﻿namespace = ep2_wedding

############################
## Wedding Events - Maintenance
## 0001-0999
## by Claudia Baldassi
############################
## Wedding Events
##
## by Claudia Baldassi, Veronica Pazos, Luke Bean
#
## Ceremony Events
# ep2_wedding.1000 - Host: The other party arrives early and criticizes your chosen options
# ep2_wedding.1010 - Host: You have an occasion to kickstart your Diplomacy/Seduce targeting efforts
# ep2_wedding.1080 - Matchmaking Intent: Lay the ground for the matchmaking
# ep2_wedding.1100 - Northern wedding: the bride goes to a bathhouse with the married women of her family: removal of clothes and kransen (golden circlet)
# ep2_wedding.1020 - Spouse: The spouses fall in love at first sight
# ep2_wedding.1030 - A good or bad omen happens: how do you react?
# ep2_wedding.1120 - Children of the spouses from a previous partner make a fuss
# ep2_wedding.1130 - A bad secret about one of the spouses comes up
# ep2_wedding.1140 - Host: A spouse has an embarrassing misstep, how do you recover?
# ep2_wedding.1150 - Seduction Intent: target scouting
# ep2_wedding.1160 - Some pesants are at the gate of the festivity - what do you do?
# ep2_wedding.1170 - A spouse has arrived with a whole parade. Interact with it
# ep2_wedding.1180 - Your spouse doesn't really like you...
# ep2_wedding.1190 - Religious guest complains about lavishness, luxury, wastes, and unchaste mingling
# ep2_wedding.1200 - Proud parent watches everything go well and brags with intent target/friend/rival/neighbor
# ep2_wedding.1210 - Political talk with a fellow ruler
# ep2_wedding.1220 - In-laws are bullies (or other close relatives)
# ep2_wedding.4000 - Non-spouse: Matchmaking Intent - What a nice wedding, maybe you should follow?
#
## Banquet Events
# ep2_wedding.1040 - You make a new friend
# ep2_wedding.1050 - Someone catches fire from the torches
# ep2_wedding.1070 - Showing off exotic animals can go very well or very wrong
# ep2_wedding.1090 - Matchmaking Intent: push a couple together
# ep2_wedding.1310 - A Friend Is Monopolizing Your Attention
# ep2_wedding.1320 - A rival seeks forgiveness
# ep2_wedding.2000-2001 - Diplomatic Intent: You find information about your target by talking to a friend of theirs
# ep2_wedding.2010-2011 - Host: Paint an animal white and pretend it's a legendary guest
#
## Wedding Night Events
# ep2_wedding.1060 - Spouse: Inspired by Matilda of Tuscany's second wedding: a younger/meeker husband is too intimidated
# ep2_wedding.1065 - Spouse: Inverted event: it's you who have problems - spouse's reaction
# ep2_wedding.1110 - Non-spouses: someone gets extremely drunk/doesn't want to leave
# ep2_wedding.1111 - Non-spouses: you get extremely drunk/don't want to leave
# ep2_wedding.1300 - Spouse: a spouse has insecurities
# ep2_wedding.1330 - Spouse: We were lovers before the wedding
# ep2_wedding.3000 - Spouse: Both spouses are shy/nervous
# ep2_wedding.3010 - Spouse: Spouse with a secret has a breakdown and confesses
# ep2_wedding.3020 - Spouse: You find out that your spouse fancies the other gender
# ep2_wedding.3030 - Spouse: Spouse gives you a memento to symbolize your love
# ep2_wedding.3040 - Spouse: The bed catches fire while you're at it
# ep2_wedding.3050 - Non-spouses: Murder Intent - try to kill your target with a chandelier
# ep2_wedding.3060 - Spouse: Murder Intent - try to kill your spouse while you're at it

# BETROTHAL INVALIDATED

# The Grand Wedding wasn't organized in the set amount of time

ep2_wedding.0001 = {
	type = character_event
	title = ep2_wedding.0001.t
	desc = {
		desc = ep2_wedding.0001.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					NOR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
				}
				desc = ep2_wedding.0001.desc_betrothed
			}
			desc = ep2_wedding.0001.desc_self
		}
	}
	theme = marriage
	left_portrait = {
		character = root
		animation = disapproval
	}
	lower_right_portrait = scope:spouse_1
	lower_center_portrait = scope:spouse_2

	trigger = {
		exists = var:promised_grand_wedding_marriage_countdown
		has_variable = promised_grand_wedding_marriage_countdown
		var:promised_grand_wedding_marriage_countdown = { is_alive = yes }
		exists = var:promised_grand_wedding_marriage_countdown.betrothed
		NOT = {
			involved_activity ?= {
				has_activity_type = activity_wedding
				activity_host = root
			}
		}
		var:promised_grand_wedding_marriage_countdown = { age >= 19 }
		var:promised_grand_wedding_marriage_countdown.betrothed = { age >= 19 }
	}

	# This event shouldn't trigger unless the spouses have been adult and marriable for at least 3 years in any case, but to prevent edge cases, we check that they are adult, and if they are not or have not been for at least 3 years, we try again one year later
	on_trigger_fail = {
        if = {
            limit = { 
                has_variable = promised_grand_wedding_marriage_countdown
            }
            if = {
                limit = { exists = var:promised_grand_wedding_marriage_countdown }
                trigger_event = {
                    id = ep2_wedding.0001
                    days = 365
                }
                set_variable = {
                    name = promised_grand_wedding_marriage_countdown
                    value = var:promised_grand_wedding_marriage_countdown
                    years = grand_wedding_timeout
                }
            }
            else = {
                remove_variable = promised_grand_wedding_marriage_countdown
            }
        }
    }

	immediate = {
		var:promised_grand_wedding_marriage_countdown = {
			save_scope_as = spouse_1
		}
		scope:spouse_1.betrothed = {
			save_scope_as = spouse_2
		}
	}

	option = {
		name = ep2_wedding.0001.a
		break_grand_wedding_betrothal_effect = yes
	}
}

# A betrothed died before organizing the activity - Host

ep2_wedding.0002 = {
	type = character_event
	title = ep2_wedding.0002.t
	desc = ep2_wedding.0002.desc
	theme = marriage
	left_portrait = {
		character = root
		animation = grief
	}
	lower_right_portrait = scope:dead_spouse
	lower_center_portrait = scope:alive_spouse

	immediate = {
		
	}

	option = {
		name = ep2_wedding.0002.a
		remove_variable = promised_grand_wedding_marriage_countdown
	}
}

# Your betrothed died before organizing the activity - Other Betrothed (also if the betrothed was the host)

ep2_wedding.0003 = {
	type = character_event
	title = ep2_wedding.0002.t
	desc = ep2_wedding.0003.desc
	theme = marriage
	left_portrait = {
		character = root
		animation = grief
	}
	lower_right_portrait = scope:dead_spouse

	option = {
		name = ep2_wedding.0003.a
		remove_variable = promised_grand_wedding_by
		if = {
			limit = {
				has_variable = promised_grand_wedding_marriage_countdown
			}
			remove_variable = promised_grand_wedding_marriage_countdown
		}
	}
}

# ON START - CEREMONY

ep2_wedding.0100 = {
	type = activity_event
	title = ep2_wedding.0100.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					root = scope:host
					NOR = { 
						root = scope:spouse_1
						root = scope:spouse_2
					}
				}
				desc = ep2_wedding.0100.desc_host
				desc = ep2_wedding.0100.desc_host_outro
			}
			triggered_desc = {
				trigger = {
					root = scope:host
					OR = { 
						root = scope:spouse_1
						root = scope:spouse_2
					}
				}
				desc = ep2_wedding.0100.desc_host_spouse
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:activity.special_guest:spouse_1
						root = scope:activity.special_guest:spouse_2
					}
				}
				desc = ep2_wedding.0100.desc_spouse
			}
			desc = ep2_wedding.0100.desc_guest
		}
		triggered_desc = {
			trigger = {
				OR = {
					root = scope:spouse_1
					root = scope:spouse_2	
				}
				is_pregnant = yes
			}
			desc = ep2_wedding.0100.desc_root_pregnant
		}
		triggered_desc = {
			trigger = {
				OR = {
					AND = {
						scope:spouse_1 = { is_pregnant = yes }
						root != scope:spouse_1
					}
					AND = {
						scope:spouse_2 = { is_pregnant = yes }
						root != scope:spouse_2
					}
				}
			}
			desc = ep2_wedding.0100.desc_spouse_pregnant
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		trigger = {
			NOR = {
				root = scope:spouse_1
				root = scope:spouse_2
			}
		}
		character = root
		animation = happiness
	}
	center_portrait = {
		character = scope:spouse_1_portrait
		camera = camera_event_left_wedding
		triggered_animation = {
			trigger = {
				NOT = { has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_2 } }
			}
			animation = wedding_bride_left
		}
		animation = disapproval
	}
	right_portrait = {
		character = scope:spouse_2_portrait
		camera = camera_event_right_wedding
		triggered_animation = {
			trigger = {
				NOT = { has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_1 } }
			}
			animation = wedding_groom_right
		}
		animation = dismissal
	}

	immediate = {
		scope:host = { save_scope_as = host }
		scope:activity.special_guest:spouse_1 = { save_scope_as = spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = spouse_2 }
		if = {
			limit = {
				root = scope:spouse_1
			}
			scope:spouse_2 = { save_scope_as = my_spouse }
		}
		else_if = {
			limit = {
				root = scope:spouse_2
			}
			scope:spouse_1 = { save_scope_as = my_spouse }
		}
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = {
					sex_opposite_of = scope:activity.special_guest:spouse_2
					is_male = yes
				}
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_2_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_1_portrait
			}
		}
		else = {
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_1_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_2_portrait
			}
		}
	}

	option = {
		name = ep2_wedding.0100.a
	}
}

# ON END - CEREMONY

# For the host (not spouse) and guests
ep2_wedding.0150 = {
	type = activity_event
	title = ep2_wedding.0150.t
	desc = ep2_wedding.0150.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:spouse_1_portrait
		animation = wedding_bride_left
		camera = camera_event_left_wedding
	}
	center_portrait = {
		character = scope:officiant
		animation = wedding_priest
	}
	right_portrait = {
		character = scope:spouse_2_portrait
		animation = wedding_groom_right
		camera = camera_event_right_wedding
	}

	trigger = {
		exists = scope:activity.special_guest:spouse_1
		exists = scope:activity.special_guest:spouse_2
		NOR = {
			scope:activity.special_guest:spouse_1 = this
			scope:activity.special_guest:spouse_2 = this
		}
	}

	immediate = {
		if = {
			limit = {
				location.culture = { has_graphical_india_culture_group_trigger = yes }
			}
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_india"
		}
		else_if = {
			limit = {
				OR = {
					location.culture = { has_graphical_mena_culture_group_trigger = yes }
					location.culture = { has_graphical_steppe_culture_group_trigger = yes }
					location.culture = { has_graphical_african_culture_group_trigger = yes }
				}
			}
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_mena"
		}
		else = {
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_west"
		}
		scope:activity.special_guest:spouse_1 = {
			save_scope_as = spouse_1
		}
		scope:activity.special_guest:spouse_2 = {
			save_scope_as = spouse_2
		}
		if = {
			limit = {
				exists = scope:activity.special_guest:officiant
			}
			scope:activity.special_guest:officiant = { save_scope_as = officiant }
		}
		scope:spouse_1 = {
			show_as_tooltip = {
				marry = scope:spouse_2
			}
		}
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = {
					sex_opposite_of = scope:activity.special_guest:spouse_2
					is_male = yes
				}
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_2_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_1_portrait
			}
		}
		else = {
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_1_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_2_portrait
			}
		}
		base_legitimacy_intent_reward = yes
	}

	option = {
		name = ep2_wedding.0150.a
	}
}

# For the spouses
ep2_wedding.0151 = {
	type = activity_event
	title = ep2_wedding.0150.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = { 
							category = special_type 
							option = wedding_type_bloody
						}
					}
					scope:host = { NOT = { has_variable = bloody_wedding_backed_down_var } }
				}
				desc = ep2_wedding.0151.desc.murder
			}
			random_valid = {
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = education_diplomacy_3
							has_trait = education_diplomacy_4
							has_trait = education_diplomacy_5
							has_trait = education_stewardship_3
							has_trait = education_stewardship_4
							has_trait = education_stewardship_5
							has_trait = diplomat
							has_trait = administrator
							has_trait = ambitious
						}
					}
					desc = ep2_wedding.0151.desc_diplo
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = education_learning_3
							has_trait = education_learning_4
							has_trait = education_learning_5
							has_trait = scholar
							has_trait = theologian
							has_trait = zealous
							has_character_modifier = bp1_superstition_modifier
						}
					}
					desc = ep2_wedding.0151.desc_religious
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = lifestyle_reveler
							has_trait = gluttonous
							has_trait = gregarious
							has_trait = drunkard
							has_trait = hashishiyah
						}
					}
					desc = ep2_wedding.0151.desc_party
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = seducer
							has_trait = lustful
							has_trait = rakish
							has_trait = deviant
							has_trait = adulterer
							has_trait = fornicator
						}
					}
					desc = ep2_wedding.0151.desc_seducer
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = chaste
							has_trait = humble
							has_trait = shy
							has_trait = reclusive
						}
					}
					desc = ep2_wedding.0151.desc_shy
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = wrathful
							has_trait = arrogant
							has_trait = callous
							has_trait = irritable
							has_trait = impatient
						}
					}
					desc = ep2_wedding.0151.desc_arrogant
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = paranoid
							has_trait = craven
						}
					}
					desc = ep2_wedding.0151.desc_paranoid
				}
				triggered_desc = {
					trigger = {
						OR = {
							has_trait = maimed
							has_trait = one_eyed
							has_trait = one_legged
							has_trait = disfigured
							has_trait = scarred
							has_trait = blind
							has_trait = beauty_bad
							has_trait = physique_bad
							has_trait = clubfooted
							has_trait = hunchbacked
							has_trait = weak
							has_trait = scaly
							has_trait = wheezing
							has_trait = bleeder
						}
					}
					desc = ep2_wedding.0151.desc_appearance
				}
				desc = ep2_wedding.0151.desc
			}
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:spouse_1_portrait
		animation = wedding_bride_left
		camera = camera_event_left_wedding
	}
	center_portrait = {
		character = scope:officiant
		animation = wedding_priest
	}
	right_portrait = {
		character = scope:spouse_2_portrait
		animation = wedding_groom_right
		camera = camera_event_right_wedding
	}

	trigger = {
		exists = scope:activity.special_guest:spouse_1
		exists = scope:activity.special_guest:spouse_2
		root = scope:activity.special_guest:spouse_1
	}

	immediate = {
		if = {
			limit = {
				location.culture = { has_graphical_india_culture_group_trigger = yes }
			}
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_india"
		}
		else_if = {
			limit = {
				OR = {
					location.culture = { has_graphical_mena_culture_group_trigger = yes }
					location.culture = { has_graphical_steppe_culture_group_trigger = yes }
					location.culture = { has_graphical_african_culture_group_trigger = yes }
				}
			}
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_mena"
		}
		else = {
			play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_west"
		}
		scope:activity.special_guest:spouse_1 = {
			save_scope_as = spouse_1
		}
		scope:activity.special_guest:spouse_2 = {
			save_scope_as = spouse_2
		}
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = {
					sex_opposite_of = scope:activity.special_guest:spouse_2
					is_male = yes
				}
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_2_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_1_portrait
			}
		}
		else = {
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_1_portrait
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_2_portrait
			}
		}
	}

	option = {
		name = ep2_wedding.0151.a
		scope:spouse_1 = {
			marry = scope:spouse_2
		}
		if = {
			limit = { scope:officiant ?= scope:spouse_1.faith.religious_head }
			scope:spouse_1 = {
				add_piety = major_piety_gain
			}
		}
		else_if = {
			limit = { scope:officiant.involved_activity ?= scope:activity }
			scope:spouse_1 = {
				add_piety = medium_piety_gain
			}
		}
		else = {
			scope:spouse_1 = {
				add_piety = minor_piety_gain
			}
		}
		if = {
			limit = { scope:officiant ?= scope:spouse_2.faith.religious_head }
			scope:spouse_2 = {
				add_piety = major_piety_gain
			}
		}
		else_if = {
			limit = { scope:officiant.involved_activity ?= scope:activity }
			scope:spouse_2 = {
				add_piety = medium_piety_gain
			}
		}
		else = {
			scope:spouse_2 = {
				add_piety = minor_piety_gain
			}
		}
		if = {
			limit = {
				root = scope:host
			}
			scope:activity.activity_location.county = {
				add_county_modifier = {
					modifier = ruler_married_here_county_modifier
					years = 10
				}
			}
		}
		scope:spouse_1.dynasty ?= { add_dynasty_prestige = medium_dynasty_prestige_gain }
		if = {
			limit = {
				NOT = { scope:spouse_2.dynasty ?= scope:spouse_1.dynasty }
			}
			scope:spouse_2.dynasty ?= { add_dynasty_prestige = medium_dynasty_prestige_gain }
		}
		if = {
			limit = {
				this = scope:spouse_1
			}
			create_character_memory = {
				type = grand_wedding_got_married
				participants = {
					spouse = scope:spouse_2
				}
			}
		}
		else = {
			create_character_memory = {
				type = grand_wedding_got_married
				participants = {
					spouse = scope:spouse_1
				}
			}
		}
		scope:spouse_1 = { remove_variable = promised_grand_wedding_by }
		scope:spouse_2 = { remove_variable = promised_grand_wedding_by }
		scope:host = {
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		# The marriage should not be consummated before the Wedding Night!
		hidden_effect = {
			scope:spouse_1 = {
				add_character_modifier = { modifier = wedding_fertility_delay_modifier }
			}
			scope:spouse_2 = {
				add_character_modifier = { modifier = wedding_fertility_delay_modifier }
			}
		}
		# Progress to next phase
		hidden_effect = {
			scope:activity = { progress_activity_phase_after = { days = 1 } }
		}
	}

	option = {
		name = ep2_wedding.0151.b
		trigger = {
			is_ai = no
		}
		custom_tooltip = ep2_wedding.0151.b.tt
		scope:activity = {
			set_variable = wedding_invalidated_said_no
		}
		add_character_flag = grand_wedding_said_no
		ai_chance = {
			base = 0
		}
	}
}

scripted_effect ep2_wedding_cleanup_jitter_modifier_effect = {
	if = {
		limit = { has_character_modifier = wedding_confident_groom }
		remove_character_modifier = wedding_confident_groom
	}
	if = {
		limit = { has_character_modifier = wedding_confident_bride }
		remove_character_modifier = wedding_confident_bride
	}
	if = {
		limit = { has_character_modifier = wedding_jitters }
		remove_character_modifier = wedding_jitters
	}
}

# I DON'T: the consequences
ep2_wedding.0152 = {
	type = character_event
	title = ep2_wedding.0152.t
	desc = ep2_wedding.0152.desc
	theme = wedding_ceremony_activity

	left_portrait = {
		character = root
		animation = wedding_objection_start
	}
	right_portrait = {
		character = scope:spouse_2
		animation = shock
	}
	lower_right_portrait = scope:scorned_matchmaker

	immediate = {
		scope:spouse_2.matchmaker = {
			if = {
				limit = {
					this != scope:spouse_2
				}
				save_scope_as = scorned_matchmaker
			}
		}
		scope:previous_host = {
			# the betrothal is broken: hand out the consequences
			break_grand_wedding_betrothal_effect = yes

			# The wedding is invalidated: get a refund
			custom_tooltip = {
				text = ep2_wedding.9000.tt
				add_gold = var:gwedding_gold_recoup_value
			}
		}
		create_character_memory = {
			type = grand_wedding_refused_to_marry
			participants = {
				spouse = scope:spouse_2
			}
		}
		ep2_wedding_cleanup_jitter_modifier_effect = yes
		scope:spouse_2 = {
			ep2_wedding_cleanup_jitter_modifier_effect = yes
		}
	}

	option = {
		name = ep2_wedding.0152.a
	}

	after = {
		remove_character_flag = grand_wedding_said_no
		scope:previous_host = { remove_variable = gwedding_gold_recoup_value }
	}
}


# ON START - BANQUET

ep2_wedding.0200 = {
	type = activity_event
	title = ep2_wedding.0200.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { #spouse and bloody wedding
					this = scope:host
					scope:activity = {
						has_activity_option = { 
							category = special_type 
							option = wedding_type_bloody
						}
					}
					root = scope:spouse_1
				}
				desc = ep2_wedding.0200.desc.murder_spouse
			}
			triggered_desc = { #bloody wedding
				trigger = {
					this = scope:host
					scope:activity = {
						has_activity_option = { 
							category = special_type 
							option = wedding_type_bloody
						}
					}
					root != scope:spouse_1
				}
				desc = ep2_wedding.0200.desc.murder
			}
			triggered_desc = { #spouses
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_2 }
				}
				desc = ep2_wedding.0200.desc_spouse_dislike
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
					has_any_good_relationship_with_character_trigger = { CHARACTER = scope:spouse_2 }
				}
				desc = ep2_wedding.0200.desc_spouse_like
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
					OR = {
						has_trait = lifestyle_reveler
						has_trait = gluttonous
						has_trait = gregarious
						has_trait = drunkard
						has_trait = hashishiyah
					}
				}
				desc = ep2_wedding.0200.desc_spouse_party
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
					OR = {
						has_trait = chaste
						has_trait = humble
						has_trait = shy
						has_trait = reclusive
					}
				}
				desc = ep2_wedding.0200.desc_spouse_shy
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
					OR = {
						has_trait = wrathful
						has_trait = arrogant
						has_trait = callous
						has_trait = irritable
						has_trait = impatient
					}
				}
				desc = ep2_wedding.0200.desc_spouse_arrogant
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
				}
				desc = ep2_wedding.0200.desc_spouse_fallback				
			}
			triggered_desc = { #host
				trigger = {
					root = scope:host
				}
				desc = ep2_wedding.0200.desc_host
			}			
			desc = ep2_wedding.0200.desc #guest
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		trigger = {
			NOR = {
				root = scope:spouse_1
				root = scope:spouse_2
			}
		}
		character = root
		animation = toast_goblet
	}
	center_portrait = {
		character = scope:spouse_1
		camera = camera_event_left_wedding
		triggered_animation = {
			trigger = {
				scope:spouse_1 = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_2 }
				}
			}
			animation = disapproval
		}
		animation = wedding_bride_left
	}
	right_portrait = {
		character = scope:spouse_2
		camera = camera_event_right_wedding
		triggered_animation = {
			trigger = {
				scope:spouse_2 = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_1 }
				}
			}
			animation = disapproval
		}
		animation = wedding_groom_right
	}
	
	trigger = {
		exists = scope:activity
	}
	
	immediate = {
		scope:activity.special_guest:spouse_1 = { save_scope_as = spouse_1 }
		scope:activity.var:spouse_2_var = { save_scope_as = spouse_2 }
		if = {
			limit = {
				root = scope:spouse_1
			}
			scope:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		else_if = {
			limit = {
				root = scope:spouse_2
			}
			scope:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
	}

	option = {
		name = {
			trigger = { 
				scope:activity = {
					has_activity_option = { 
						category = special_type 
						option = wedding_type_bloody
					}
				}
			}
			text = ep2_wedding.0200.a.murder
		}
		name = {
			trigger = {
				NOT = {
					scope:activity = {
						has_activity_option = { 
							category = special_type 
							option = wedding_type_bloody
						}
					}
				}
			}
			text = ep2_wedding.0200.a
		}
		if = {
			limit = {
				OR = {
					root = scope:host
					root = scope:spouse_1
					root = scope:spouse_2
				}
			}
			add_prestige = minor_prestige_gain
		}
	}
}

# ON START - WEDDING NIGHT

ep2_wedding.0300 = {
	type = activity_event
	title = ep2_wedding.0300.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = { 
							category = special_type 
							option = wedding_type_bloody
						}
					}
					root = scope:spouse_1
				}
				desc = ep2_wedding.0300.desc.murder_spouse
			}
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:activity.special_guest:spouse_1
						root = scope:activity.special_guest:spouse_2
					}
				}
				desc = ep2_wedding.0300.desc_spouse
			}
			triggered_desc = {
				trigger = {
					root = scope:host
				}
				desc = ep2_wedding.0300.desc
			}			
			desc = ep2_wedding.0300.desc_guest
		}
	}
	theme = wedding_night_activity
	left_portrait = {
		trigger = {
			NOR = {
				root = scope:spouse_1
				root = scope:spouse_2
			}
		}
		character = root
		animation = happiness
	}
	center_portrait = {
		character = scope:spouse_1
		triggered_animation = {
			trigger = {
				scope:spouse_1 = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_2 }
				}
			}
			animation = disapproval
		}
		animation = reception_groom_left
	}
	right_portrait = {
		character = scope:spouse_2
		triggered_animation = {
			trigger = {
				scope:spouse_2 = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:spouse_1 }
				}
			}
			animation = dismissal
		}
		animation = reception_bride_right
	}

	immediate = {
		scope:activity.special_guest:spouse_1 ?= {
			save_scope_as = spouse_1
		}
		scope:activity.special_guest:spouse_2 ?= {
			save_scope_as = spouse_2
		}
		if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			scope:activity.special_guest:spouse_2 = { save_scope_as = other_spouse }
		}
		else_if = {
			limit = {
				root = scope:activity.special_guest:spouse_2
			}
			scope:activity.special_guest:spouse_1 = { save_scope_as = other_spouse }
		}
		hidden_effect = {
			scope:spouse_1 ?= {
				if = {
					limit = {
						has_character_modifier = wedding_fertility_delay_modifier
					}
					remove_character_modifier = wedding_fertility_delay_modifier
				}
			}
			scope:spouse_2 ?= {
				if = {
					limit = {
						has_character_modifier = wedding_fertility_delay_modifier
					}
					remove_character_modifier = wedding_fertility_delay_modifier
				}
			}
		}
	}

	option = {
		name = ep2_wedding.0300.a
	}
}

# INVALIDATED

# For the host (not spouse) and the guests - one of the spouses died

ep2_wedding.0900 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0900.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = sadness
	}
	right_portrait = {
		character = scope:sad_spouse
		animation = grief
	}

	immediate = {
		if = {
			limit = {
				scope:spouse_1 ?= { is_alive = yes }
			}
			scope:spouse_1 = { save_scope_as = sad_spouse }
			scope:spouse_2 = { save_scope_as = dead_spouse }
		}
		else = {
			scope:spouse_2 = { save_scope_as = sad_spouse }
			scope:spouse_1 = { save_scope_as = dead_spouse }
		}
		if = {
			limit = {
				scope:sad_spouse = { has_character_modifier = wedding_fertility_delay_modifier }
			}
			scope:sad_spouse = { remove_character_modifier = wedding_fertility_delay_modifier }
		}
		if = {
			limit = {
				root = scope:previous_host
			}
			# The wedding is invalidated: get a refund
			custom_tooltip = {
				text = ep2_wedding.9000.tt
				add_gold = var:gwedding_gold_recoup_value
			}
		}
	}

	option = {
		name = ep2_wedding.0900.a
	}

	after = {
		if = {
			limit = {
				has_variable = gwedding_gold_recoup_value
			}
			remove_variable = gwedding_gold_recoup_value
		}
	}
}

# For the spouses - the other spouse died

ep2_wedding.0910 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0910.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = grief
	}

	immediate = {
		if = {
			limit = {
				root = scope:previous_host
			}
			# The wedding is invalidated: get a refund
			custom_tooltip = {
				text = ep2_wedding.9000.tt
				add_gold = var:gwedding_gold_recoup_value
			}
		}
		create_character_memory = {
			type = grand_wedding_death_at_wedding
			participants = {
				dead_spouse = scope:dead_spouse
			}
		}
		error_log = "Invalidating [activity.GetName] of [activity.GetOwner.GetLogName] because a spouse is dead"
	}

	option = {
		name = ep2_wedding.0910.a
	}

	after = {
		if = {
			limit = {
				has_variable = gwedding_gold_recoup_value
			}
			remove_variable = gwedding_gold_recoup_value
		}
		remove_variable = promised_grand_wedding_by
		scope:previous_host = {
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		if = {
			limit = {
				has_character_modifier = wedding_fertility_delay_modifier
			}
			remove_character_modifier = wedding_fertility_delay_modifier
		}
	}
}

# If the host who is a spouse dies, notify the heir
ep2_wedding.0915 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0915.desc
	theme = family
	left_portrait = {
		character = root
		animation = sadness
	}
	lower_center_portrait = scope:previous_host

	immediate = {
		# The wedding is invalidated: get a refund
		custom_tooltip = {
			text = ep2_wedding.9015.tt
			add_gold = scope:previous_host.var:gwedding_gold_recoup_value
		}
	}

	option = {
		name = ep2_wedding.0915.a
	}

	after = {
		if = {
			limit = {
				has_variable = gwedding_gold_recoup_value
			}
			remove_variable = gwedding_gold_recoup_value
		}
	}
}

# A spouse has been imprisoned: for the prisoner
ep2_wedding.0920 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0920.desc
	theme = prison
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { is_in_prison_type = house_arrest }
			animation = prisonhouse
		}
		triggered_animation = {
			trigger = { is_in_prison_type = dungeon }
			animation = prisondungeon
		}
	}

	immediate = {
		if = {
			limit = {
				root = scope:previous_host
			}
			# The wedding is invalidated: get a refund
			custom_tooltip = {
				text = ep2_wedding.9000.tt
				add_gold = var:gwedding_gold_recoup_value
			}
		}
		create_character_memory = {
			type = grand_wedding_missed_wedding_in_prison
			participants = {
				spouse = scope:free_spouse
			}
		}
	}

	option = {
		name = ep2_wedding.0920.a
	}

	after = {
		if = {
			limit = {
				has_variable = gwedding_gold_recoup_value
			}
			remove_variable = gwedding_gold_recoup_value
		}
		remove_variable = promised_grand_wedding_by
		scope:previous_host = {
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		if = {
			limit = {
				has_character_modifier = wedding_fertility_delay_modifier
			}
			remove_character_modifier = wedding_fertility_delay_modifier
		}
	}
}

# A spouse has been imprisoned: for everyone else
ep2_wedding.0921 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0921.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = sadness
	}
	lower_center_portrait = scope:prisoner_spouse

	immediate = {
		if = {
			limit = {
				root = scope:previous_host
			}
			# The wedding is invalidated: get a refund
			custom_tooltip = {
				text = ep2_wedding.9000.tt
				add_gold = var:gwedding_gold_recoup_value
			}
		}
		if = {
			limit = {
				root = scope:free_spouse
			}
			create_character_memory = {
				type = grand_wedding_canceled_in_prison
				participants = {
					spouse = scope:prisoner_spouse
				}
			}
		}
	}

	option = {
		name = ep2_wedding.0921.a
	}

	after = {
		if = {
			limit = {
				has_variable = gwedding_gold_recoup_value
			}
			remove_variable = gwedding_gold_recoup_value
		}
		if = {
			limit = {
				has_variable = promised_grand_wedding_by
			}
			remove_variable = promised_grand_wedding_by
		}
		if = {
			limit = {
				has_character_modifier = wedding_fertility_delay_modifier
			}
			remove_character_modifier = wedding_fertility_delay_modifier
		}
	}
}

# CONCLUSION - HOST

ep2_wedding.0950 = {
	type = activity_event
	title = ep2_wedding.0950.t
	desc = ep2_wedding.0950.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		trigger = {
			NOR = {
				root = scope:spouse_1
				root = scope:spouse_2
			}
		}
		character = root
		animation = happiness
	}
	center_portrait = {
		character = scope:spouse_1
		animation = wedding_bride_left
		camera = camera_event_left_wedding
	}
	right_portrait = {
		character = scope:spouse_2
		animation = wedding_groom_right
		camera = camera_event_right_wedding
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_end"
		play_music_cue = weddingend_cue
		show_as_tooltip = {
			scope:spouse_1 = { marry = scope:spouse_2 }
			tooltip_disburse_wedding_host_activity_rewards = yes
		}
		save_scope_as = root_scope
		# if the host is also a spouse, we disburse the special host-spouse rewards to the host, and the regular spouse rewards to the other spouse
		if = {
			limit = {
				OR = {
					root = scope:spouse_1
					root = scope:spouse_2
				}
			}		
			show_as_tooltip = { disburse_wedding_spouse_host_activity_rewards = yes }
		}
		else = {	#the spouses already had a memory created during the ceremony
			create_character_memory = {
				type = grand_wedding_completed_host
				participants = {
					spouse_1 = scope:spouse_1
					spouse_2 = scope:spouse_2
				}
			}
		}
	}

	option = {
		name = ep2_wedding.0950.a		
	}
}

# CONCLUSION - SPOUSES

ep2_wedding.0960 = {
	type = activity_event
	title = ep2_wedding.0950.t
	desc = ep2_wedding.0960.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:spouse_1
		animation = wedding_bride_left
		camera = camera_event_left_wedding
	}
	right_portrait = {
		character = scope:spouse_2
		animation = wedding_groom_right
		camera = camera_event_right_wedding
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_end"
		play_music_cue = weddingend_cue
		save_scope_as = root_scope
		show_as_tooltip = {
			scope:spouse_1 = { marry = scope:spouse_2 }
			disburse_wedding_spouse_activity_rewards = yes
		}
		if = {
			limit = {
				root = scope:spouse_1
			}
			scope:spouse_2 = { save_scope_as = other_spouse }
		}
		else_if = {
			limit = {
				root = scope:spouse_2
			}
			scope:spouse_1 = { save_scope_as = other_spouse }
		}
	}

	option = {
		name = ep2_wedding.0950.a
	}
}

# CONCLUSION - GUESTS

ep2_wedding.0970 = {
	type = activity_event
	title = ep2_wedding.0950.t
	desc = ep2_wedding.0970.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:spouse_1
		animation = wedding_bride_left
		camera = camera_event_left_wedding
	}
	right_portrait = {
		character = scope:spouse_2
		animation = wedding_groom_right
		camera = camera_event_right_wedding
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Stingers/Grand_Activities/ep2_mx_sting_wedding_end"
		play_music_cue = weddingend_cue
		save_scope_as = root_scope
		show_as_tooltip = {
			scope:spouse_1 = { marry = scope:spouse_2 }
			tooltip_disburse_wedding_guest_activity_rewards = yes
		}
		create_character_memory = {
			type = grand_wedding_completed_guest
			participants = {
				spouse_1 = scope:spouse_1
				spouse_2 = scope:spouse_2
			}
		}
	}

	option = {
		name = ep2_wedding.0970.a
	}
}

# INVALIDATION - SPOUSE DISAPPEARS
ep2_wedding.0997 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = {
		desc = ep2_wedding.0997.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:spouse_1
						root = scope:spouse_2
					}
				}
				desc = ep2_wedding.0997.desc_spouse
			}
			desc = ep2_wedding.0997.desc_generic
		}
	}

	theme = realm

	left_portrait = {
		character = root
		animation = sadness
	}

	immediate = {
		# we should never get this far. If it happens, just get a free pass out of the Grand Wedding Promise since something has gone wrong
		if = {
			limit = {
				this = scope:host
			}
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		if = {
			limit = {
				has_variable = promised_grand_wedding_by
				var:promised_grand_wedding_by = scope:host
			}
			remove_variable = promised_grand_wedding_by
		}
	}

	option = {
		name = ep2_wedding.0998.a
	}
}

# FALLBACK INVALIDATION
ep2_wedding.0998 = {
	type = character_event
	title = ep2_wedding.0900.t
	desc = ep2_wedding.0998.desc
	theme = realm

	left_portrait = {
		character = root
		animation = sadness
	}

	immediate = {
		# we should never get this far. If it happens, just get a free pass out of the Grand Wedding Promise since something has gone wrong
		if = {
			limit = {
				this = scope:host
			}
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		if = {
			limit = {
				has_variable = promised_grand_wedding_by
				var:promised_grand_wedding_by = scope:host
			}
			remove_variable = promised_grand_wedding_by
		}
		if = {
			limit = {
				exists = scope:spouse_1
				exists = scope:spouse_2
			}
			show_as_tooltip = {
				scope:spouse_1 = {
					break_betrothal = scope:spouse_2
				}
			}
		}
	}

	option = {
		name = ep2_wedding.0998.a
	}
}

# INVALIDATION - HOST TIER TOO LOW
ep2_wedding.0999 = {
	type = character_event
	title = ep2_wedding.0999.t
	desc = ep2_wedding.0999.desc
	theme = realm

	left_portrait = {
		character = scope:host
		animation = grief
	}

	immediate = {
	}

	option = {
		name = ep2_wedding.0999.a
	}
}

# CEREMONY EVENTS

##################################################
# Artistic Differences
# by Claudia Baldassi
# ep2_wedding.1000
##################################################

# The other party arrives early and criticizes your chosen options.

scripted_trigger ep2_wedding_1000_valid_relative_trigger = {
	is_alive = yes
	is_ai = yes
	is_participant_in_activity = scope:activity
	age >= 10
	location = root.location
	NOT = { has_character_flag = busy_in_wgathering_event }
}

ep2_wedding.1000 = {
	type = activity_event
	title = ep2_wedding.1000.t
	desc = {
		desc = ep2_wedding.1000.desc
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_bad
						}
					}
				}
				desc = ep2_wedding.1000.desc_servants
			}
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_good
						}
					}
				}
				desc = ep2_wedding.1000.desc_dec
			}
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_bad
						}
					}
				}
				desc = ep2_wedding.1000.desc_dec_low
			}
			triggered_desc = {
				trigger = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_entertainment
							option = wedding_entertainment_good
						}
					}
				}
				desc = ep2_wedding.1000.desc_entertainment
			}
			desc = ep2_wedding.1000.desc_fallback
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = eyeroll
	}
	right_portrait = {
		character = scope:1000_relative
		animation = disapproval
	}

	cooldown = { years = 5 }

	weight_multiplier = {
		base = 1
		modifier = {
			scope:activity.special_guest:spouse_2 = {
				any_close_family_member = {
					is_alive = yes
					is_ai = yes
					is_participant_in_activity = scope:activity
					has_trait = fickle
				}
			}
			add = 1
		}
		modifier = {
			scope:activity.special_guest:spouse_2 = {
				any_close_family_member = {
					is_alive = yes
					is_ai = yes
					is_participant_in_activity = scope:activity
					has_trait = arrogant
				}
			}
			add = 3
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 2
		}
		modifier = {
			scope:activity.special_guest:spouse_2 = {
				any_close_family_member = {
					is_alive = yes
					is_ai = yes
					is_participant_in_activity = scope:activity
					root.intent_target ?= this
				}
			}
			add = 3
		}
		modifier = {
			scope:activity.special_guest:spouse_2 ?= {
				house_has_feud_relation_with_trigger = { TARGET = scope:activity.special_guest:spouse_1 }
			}
			add = 5
		}
	}

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:host = root
		location = scope:activity.activity_location
		scope:activity.special_guest:spouse_1 = root

		scope:activity.special_guest:spouse_2 = {
			any_close_family_member = {
				ep2_wedding_1000_valid_relative_trigger = yes
			}
		}
	}

	immediate = {
		add_character_flag = busy_in_wgathering_event

		scope:activity.special_guest:spouse_1 = {
			save_scope_as = spouse_1
		}
		scope:activity.special_guest:spouse_2 = {
			save_scope_as = spouse_2
		}

		scope:spouse_2 = {
			random_close_family_member = {
				limit = {
					ep2_wedding_1000_valid_relative_trigger = yes
					root.intent_target ?= this
				}
				alternative_limit = {
					ep2_wedding_1000_valid_relative_trigger = yes
				}
				save_scope_as = 1000_relative
				add_character_flag = busy_in_wgathering_event
			}
		}
	}

	# Option A: mediate
	option = {
		name = ep2_wedding.1000.a
		duel = {
			skill = diplomacy
			target = scope:1000_relative

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1000.a.success
				send_interface_toast = {
					title = ep2_wedding.1000.a.success.tt
					left_icon = root
					right_icon = scope:1000_relative
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_artistic_mediate_log
							tags = { good }
							score = 20
							character = root
							target = scope:1000_relative

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1000_relative
									modifier = impressed_opinion
									opinion = 20
								}
								add_prestige = minor_prestige_gain
								stress_impact = {
									base = minor_stress_impact_loss
									impatient = minor_stress_impact_gain
									arrogant = minor_stress_impact_gain
								}
							}
						}
					}
				}
			}

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1000.a.failure
				send_interface_toast = {
					title = ep2_wedding.1000.a.failure.tt
					left_icon = root
					right_icon = scope:1000_relative
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_artistic_mediate_fail_log
							tags = { bad }
							score = 20
							character = root
							target = scope:1000_relative
						}
						root = {
							stress_impact = {
								base = minor_stress_impact_gain
								impatient = medium_stress_impact_gain
								arrogant = medium_stress_impact_gain
							}
						}
					}
				}
			}
		}

		ai_chance = {
			base = 100
			modifier = {
				add = -50
				has_trait = impatient
			}
			modifier = {
				add = -50
				has_trait = arrogant
			}
		}
	}

	# Option B: insult
	option = {
		name = ep2_wedding.1000.b
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_artistic_insult_log
				tags = { bad }
				score = 20
				character = root
				target = scope:1000_relative

				# Effect
				root = {
					reverse_add_opinion = {
						target = scope:1000_relative
						modifier = insult_opinion
						opinion = -20
					}
					add_dread = minor_dread_gain
				}
			}
		}

		stress_impact = {
			patient = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				add = -50
				has_trait = patient
			}
			modifier = {
				add = -50
				has_trait = humble
			}
		}
	}

	#Option C: I don't care
	option = {
		name = ep2_wedding.1000.c
		trigger = {
			has_activity_intent = reduce_stress_intent
		}
		custom_tooltip = available_because_intent_tt
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 80
			modifier = {
				has_trait = lazy
				add = 100
			}
		}
	}

	after = {
		remove_character_flag = busy_in_wgathering_event
		scope:1000_relative = { remove_character_flag = busy_in_wgathering_event }
	}
}

##################################################
# A Magnificent Welcome
# by Claudia Baldassi
# ep2_wedding.1010
##################################################

# You have an occasion to kickstart your Diplomacy/Seduce targeting efforts

ep2_wedding.1010 = {
	type = activity_event
	title = ep2_wedding.1010.t
	desc = {
		desc = ep2_wedding.1010.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					has_activity_intent = diplomatic_intent
				}
				desc = ep2_wedding.1010.diplo
			}
			triggered_desc = {
				trigger = {
					has_activity_intent = woo_attendee_intent
				}
				desc = ep2_wedding.1010.seduce
			}
			triggered_desc = {
				trigger = {
					exists = scope:1010_match
				}
				desc = ep2_wedding.1010.match
			}
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = happiness
	}
	center_portrait = {
		trigger = {
			exists = scope:1010_match
		}
		character = scope:1010_match
		animation = boredom
	}
	right_portrait = {
		character = scope:1010_target
		animation = dismissal
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		
		OR = {
			has_activity_intent = diplomatic_intent
			has_activity_intent = woo_attendee_intent
		}

		scope:host = root
		intent_target.location = root.location

		intent_target = {
			is_ai = yes
			NOT = { has_character_flag = busy_in_wgathering_event }
		}
	}

	immediate = {
		intent_target = {
			save_scope_as = 1010_target
			add_character_flag = busy_in_wgathering_event
		}
		if = {
			limit = {
				any_child = {
					is_adult = no
					is_betrothed = no
					is_participant_in_activity = scope:activity
					is_ai = yes
					NOT = { has_character_flag = busy_in_wgathering_event }
				}
			}
			random_child = {
				limit = {
					is_adult = no
					is_betrothed = no
					is_participant_in_activity = scope:activity
					is_ai = yes
					NOT = { has_character_flag = busy_in_wgathering_event }
				}
				save_scope_as = 1010_match
				add_character_flag = busy_in_wgathering_event
			}
		}
		add_character_flag = busy_in_wgathering_event
	}

	#Option A: gardens
	option = {
		name = ep2_wedding.1010.a
		random_list = {
			# target is impressed
			60 = {
				modifier = {
					scope:activity.activity_location.county = {
						development_level >= medium_development_level
					}
					add = 15
				}
				modifier = {
					has_trait = lifestyle_gardener
					add = 25
				}
				modifier = {
					has_trait = lifestyle_herbalist
					add = 25
				}
				modifier = {
					any_court_position_holder = {
						type = court_gardener_court_position
					}
					add = 40
				}
				modifier = {
					scope:activity.activity_location = {
						has_building_or_higher = orchards_01
					}
					add = 20
				}
				modifier = {
					scope:activity.activity_location = {
						has_building_or_higher = royal_garden_01
					}
					add = 50
				}
				desc = ep2_wedding.1010.a.success
				send_interface_toast = {
					title = ep2_wedding.1010.a.success.tt
					left_icon = scope:1010_target
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_welcome_garden_log
							tags = { good }
							score = 20
							character = root
							target = scope:1010_target

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1010_target
									modifier = impressed_opinion
									opinion = 20
								}
								if = {
									limit = {
										has_activity_intent = woo_attendee_intent
										can_set_relation_lover_trigger = { CHARACTER = scope:1010_target }
									}
									progress_towards_lover_effect = {
										REASON = lover_atmospheric_location
										CHARACTER = scope:1010_target
										OPINION = default_lover_opinion
									}
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						lustful = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						ambitious = medium_stress_impact_loss
					}
				}
			}
			#target is not impressed
			40 = {
				modifier = {
					diplomacy < 10
					add = 10
				}
				modifier = {
					stewardship < 10
					add = 10
				}
				modifier = {
					scope:activity.activity_location.county = {
						development_level <= bad_development_level
					}
					add = 30
				}
				desc = ep2_wedding.1010.a.failure
				send_interface_toast = {
					title = ep2_wedding.1010.a.failure.tt
					left_icon = scope:1010_target
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_welcome_garden_fail_log
							tags = { bad }
							score = 20
							character = root
							target = scope:1010_target

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1010_target
									modifier = bored_opinion
									opinion = -20
								}
								stress_impact = {
									base = minor_stress_impact_gain
									lustful = medium_stress_impact_gain
									arrogant = medium_stress_impact_gain
									ambitious = medium_stress_impact_gain							
								}
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				scope:activity.activity_location.county = {
					development_level >= medium_development_level
				}
				add = 15
			}
			modifier = {
				has_trait = lifestyle_gardener
				add = 25
			}
			modifier = {
				has_trait = lifestyle_herbalist
				add = 25
			}
			modifier = {
				any_court_position_holder = {
					type = court_gardener_court_position
				}
				add = 40
			}
			modifier = {
				scope:activity.activity_location = {
					has_building_or_higher = orchards_01
				}
				add = 20
			}
			modifier = {
				scope:activity.activity_location = {
					has_building_or_higher = royal_garden_01
				}
				add = 50
			}
		}
	}

	#Option B: venue
	option = {
		name = ep2_wedding.1010.b
		random_list = {
			# target is impressed
			60 = {
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_good
						}
					}
					add = 10
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_food
							option = wedding_food_good
						}
					}
					add = 10
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_entertainment
							option = wedding_entertainment_good
						}
					}
					add = 10
				}
				desc = ep2_wedding.1010.b.success
				send_interface_toast = {
					title = ep2_wedding.1010.a.success.tt
					left_icon = scope:1010_target
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_welcome_ceremony_log
							tags = { good }
							score = 20
							character = root
							target = scope:1010_target

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1010_target
									modifier = impressed_opinion
									opinion = 20
								}
								if = {
									limit = {
										has_activity_intent = woo_attendee_intent
										can_set_relation_lover_trigger = { CHARACTER = scope:1010_target }
									}
									progress_towards_lover_effect = {
										REASON = lover_atmospheric_location
										CHARACTER = scope:1010_target
										OPINION = default_lover_opinion
									}
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						lustful = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						ambitious = medium_stress_impact_loss
					}
				}
			}
			#target is not impressed
			40 = {
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_bad
						}
					}
					add = 10
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_food
							option = wedding_food_bad
						}
					}
					add = 10
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_entertainment
							option = wedding_entertainment_bad
						}
					}
					add = 10
				}
				desc = ep2_wedding.1010.b.failure
				send_interface_toast = {
					title = ep2_wedding.1010.a.failure.tt
					left_icon = scope:1010_target
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_welcome_ceremony_fail_log
							tags = { bad }
							score = 20
							character = root
							target = scope:1010_target

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1010_target
									modifier = bored_opinion
									opinion = -20
								}
								stress_impact = {
									base = minor_stress_impact_gain
									lustful = medium_stress_impact_gain
									arrogant = medium_stress_impact_gain
									ambitious = medium_stress_impact_gain
								}
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				scope:activity = {
					has_activity_option = {
						category = wedding_option_decoration
						option = wedding_decoration_good
					}
				}
				add = 10
			}
			modifier = {
				scope:activity = {
					has_activity_option = {
						category = wedding_option_food
						option = wedding_food_good
					}
				}
				add = 10
			}
			modifier = {
				scope:activity = {
					has_activity_option = {
						category = wedding_option_entertainment
						option = wedding_entertainment_good
					}
				}
				add = 10
			}
		}
	}

	#Option C: nevermind
	option = {
		name = ep2_wedding.1010.c
		reverse_add_opinion = {
			target = scope:1010_target
			modifier = feeling_welcome_opinion
			opinion = 5
		}
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = lazy
				add = 50
			}
		}
	}
	after = {
		remove_character_flag = busy_in_wgathering_event
		scope:1010_target = { remove_character_flag = busy_in_wgathering_event }
		if = {
			limit = {
				exists = scope:1010_match
			}
			scope:1010_match = { remove_character_flag = busy_in_wgathering_event }
		}
	}
}

##################################################
# A Proper Match
# by Claudia Baldassi
# ep2_wedding.1080
##################################################

# Lay the ground for the matchmaking

ep2_wedding.1080 = {
	type = activity_event
	title = ep2_wedding.1080.t
	desc = {
		desc = ep2_wedding.1080.desc
		triggered_desc = {
			trigger = {
				exists = scope:matchmaking_2
			}
			desc = ep2_wedding.1080.desc_2
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:1080_target
		animation = happiness
	}
	lower_left_portrait = scope:matchmaking_1
	lower_center_portrait = scope:matchmaking_2

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		
		has_activity_intent = matchmaking_intent

		intent_target.location = root.location
		location = scope:activity.activity_location

		intent_target = { 
			has_activity_state = passive
			is_ai = yes
			NOT = { has_character_flag = busy_in_wgathering_event }
		}

		scope:activity = {
			any_attending_character = {
				is_ai = yes
				location = root.location
				has_activity_state = passive
				can_marry_character_trigger = { CHARACTER = root.intent_target }
				NOR = {
					exists = betrothed
					has_character_flag = busy_in_wgathering_event
					is_close_or_extended_family_of = root.intent_target
				}
				trigger_if = {
					limit = {
						is_female = yes
					}
					age < marriage_female_fertility_cutoff_age_value
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		intent_target = { save_scope_as = 1080_target }
		scope:1080_target = { add_character_flag = busy_in_wgathering_event }
		add_character_flag = busy_in_wgathering_event
		scope:activity = {
			random_attending_character = {
				limit = {
					is_ai = yes
					location = root.location
					has_activity_state = passive
					can_marry_character_trigger = { CHARACTER = root.intent_target }
					NOR = {
						exists = betrothed
						has_character_flag = busy_in_wgathering_event
						is_close_or_extended_family_of = root.intent_target
					}
					trigger_if = {
						limit = {
							is_female = yes
						}
						age < marriage_female_fertility_cutoff_age_value
					}
				}
				save_scope_as = matchmaking_1
				add_character_flag = busy_in_wgathering_event
			}
		}
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						is_ai = yes
						location = root.location
						has_activity_state = passive
						can_marry_character_trigger = { CHARACTER = root.intent_target }
						NOR = {
							exists = betrothed
							has_character_flag = busy_in_wgathering_event
							is_close_or_extended_family_of = root.intent_target
							this = scope:matchmaking_1
						}
						trigger_if = {
							limit = {
								is_female = yes
							}
							age < marriage_female_fertility_cutoff_age_value
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						is_ai = yes
						location = root.location
						has_activity_state = passive
						can_marry_character_trigger = { CHARACTER = root.intent_target }
						NOR = {
							exists = betrothed
							has_character_flag = busy_in_wgathering_event
							is_close_or_extended_family_of = root.intent_target
							this = scope:matchmaking_1
						}
						trigger_if = {
							limit = {
								is_female = yes
							}
							age < marriage_female_fertility_cutoff_age_value
						}
					}
					save_scope_as = matchmaking_2
					add_character_flag = busy_in_wgathering_event
				}
			}
		}
	}

	#Option A: Introduce to matchmaking_1
	option = {
		name = ep2_wedding.1080.a
		scope:1080_target = {
			duel = {
				skill = diplomacy
				target = scope:matchmaking_1
				60 = {	# success - the matchmaking continues
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = ep2_wedding.1080.a.success
					root = {
						send_interface_toast = {
							title = ep2_wedding.1080.a.success.tt
							left_icon = scope:1080_target
							right_icon = scope:matchmaking_1
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_propermatch_court_log
									tags = { good }
									score = 20
									character = scope:1080_target
									target = scope:matchmaking_1

									# Effect
									scope:matchmaking_1 = {
										add_opinion = {
											target = scope:1080_target
											modifier = impressed_opinion
											opinion = 20
										}
									}
								}
							}
						}
					}
					scope:1080_target = {
						set_variable = {
							name = wedding_good_match
							value = scope:matchmaking_1
						}
					}
				}
				40 = {	# failure - you'll have to start again with someone else
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = ep2_wedding.1080.a.failure
					root = {
						send_interface_toast = {
							title = ep2_wedding.1080.a.failure.tt
							left_icon = scope:1080_target
							right_icon = scope:matchmaking_1
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_propermatch_court_fail_log
									tags = { bad }
									score = 20
									character = scope:1080_target
									target = scope:matchmaking_1
								}
							}
						}
					}
					scope:1080_target = {
						set_variable = {
							name = wedding_no_match
							value = scope:matchmaking_1
						}
					}
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	#Option B: Introduce to matchmaking_2
	option = {
		trigger = {
			exists = scope:matchmaking_2
		}
		name = ep2_wedding.1080.b
		scope:1080_target = {
			duel = {
				skill = diplomacy
				target = scope:matchmaking_2
				50 = {	# success - the matchmaking continues
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = ep2_wedding.1080.b.success
					root = {
						send_interface_toast = {
							title = ep2_wedding.1080.a.success.tt
							left_icon = scope:1080_target
							right_icon = scope:matchmaking_2
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_propermatch_court_log
									tags = { good }
									score = 20
									character = scope:1080_target
									target = scope:matchmaking_2

									# Effect
									scope:matchmaking_2 = {
										add_opinion = {
											target = scope:1080_target
											modifier = impressed_opinion
											opinion = 20
										}
									}
								}
							}
						}
					}
					scope:1080_target = {
						set_variable = {
							name = wedding_good_match
							value = scope:matchmaking_2
						}
					}
				}
				50 = {	# failure - you'll have to start again with someone else
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = ep2_wedding.1080.b.failure
					root = {
						send_interface_toast = {
							title = ep2_wedding.1080.a.failure.tt
							left_icon = scope:1080_target
							right_icon = scope:matchmaking_2
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_propermatch_court_fail_log
									tags = { bad }
									score = 20
									character = scope:1080_target
									target = scope:matchmaking_2
								}
							}
						}
					}
					scope:1080_target = {
						set_variable = {
							name = wedding_no_match
							value = scope:matchmaking_2
						}
					}
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	#Option C: let's keep looking
	option = {
		name = ep2_wedding.1080.c
		flavor = ep2_wedding.1080.c.tt
		ai_chance = {
			base = 100
			modifier = {
				has_trait = fickle
				add = 25
			}
		}
	}
	after = {
		remove_character_flag = busy_in_wgathering_event
		scope:1080_target = { remove_character_flag = busy_in_wgathering_event }
		scope:matchmaking_1 = { remove_character_flag = busy_in_wgathering_event }
		if = {
			limit = { exists = scope:matchmaking_2 }
			scope:matchmaking_2 = { remove_character_flag = busy_in_wgathering_event }
		}
	}
}

##################################################
# A Ritual Wash
# by Claudia Baldassi
# ep2_wedding.1100
##################################################

# Northern wedding: the bride goes to a bathhouse with the married women of her family: removal of clothes and kransen (golden circlet)

ep2_wedding.1100 = {
	type = activity_event
	title = ep2_wedding.1100.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:activity.special_guest:spouse_1
						root = scope:activity.special_guest:spouse_2
					}
				}
				desc = ep2_wedding.1100.desc_bride
			}
			desc = ep2_wedding.1100.desc_relative
		}
		triggered_desc = {
			trigger = {
				exists = scope:guest_3
			}
			desc = ep2_wedding.1100.desc_extra_guest
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:bride
		animation = personality_content
	}
	center_portrait = {
		character = scope:guest_2
		animation = admiration
	}
	right_portrait = {
		character = scope:guest_1
		animation = wedding_happy_cry
	}
	lower_center_portrait = scope:guest_3

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = { has_variable = has_had_event_1100 }
		}

		culture = { has_cultural_pillar = heritage_north_germanic }
		is_female = yes
		is_ai = no
		OR = {
			AND = {
				this = scope:activity.special_guest:spouse_1
				any_spouse = {
					even_if_dead = yes
					NOT = { exists = this }
				}
				any_former_spouse = {
					even_if_dead = yes
					NOT = { exists = this }
				}
			}
			AND = {
				this = scope:activity.special_guest:spouse_2
				any_spouse = {
					even_if_dead = yes
					NOT = { exists = this }
				}
				any_former_spouse = {
					even_if_dead = yes
					NOT = { exists = this }
				}
			}
			AND = {
				is_close_or_extended_family_of = scope:activity.special_guest:spouse_1
				scope:activity.special_guest:spouse_1 = { is_female = yes }
				is_married = yes
			}
			AND = {
				is_close_or_extended_family_of = scope:activity.special_guest:spouse_2
				scope:activity.special_guest:spouse_2 = { is_female = yes }
				is_married = yes
			}
		}
		trigger_if = {
			limit = {
				scope:activity.special_guest:spouse_1 = {
					is_female = yes
				}
			}
			scope:activity = {
				any_attending_character = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:activity.special_guest:spouse_1
					is_married = yes
					save_temporary_scope_as = guest_1
				}
			}
			scope:activity = {
				any_attending_character = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:activity.special_guest:spouse_1
					is_married = yes
					this != scope:guest_1
				}
			}
		}
		trigger_else = {
			scope:activity = {
				any_attending_character = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:activity.special_guest:spouse_2
					is_married = yes
					is_ai = yes
					save_temporary_scope_as = guest_1
				}
			}
			scope:activity = {
				any_attending_character = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:activity.special_guest:spouse_2
					is_married = yes
					is_ai = yes
					this != scope:guest_1
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 2
		}
		modifier = {
			is_ai = no
			factor = 2
		}
	}

	immediate = {
		scope:activity = {
			set_variable = has_had_event_1100
		}
		if = {
			limit = {
				OR = {
					root = scope:activity.special_guest:spouse_1
					root = scope:activity.special_guest:spouse_2
				}
			}
			save_scope_as = bride
		}
		else_if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { is_female = yes }
			}
			scope:activity.special_guest:spouse_1 = { save_scope_as = bride }
			root = { save_scope_as = guest_1 }
		}
		else = {
			scope:activity.special_guest:spouse_2 = { save_scope_as = bride }
			root = { save_scope_as = guest_1 }
		}
		scope:bride = {
			add_character_flag = busy_in_wgathering_event
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:bride
					is_married = yes
					is_ai = yes
					NOR = {
						has_character_flag = busy_in_wgathering_event
						this = scope:guest_1
					}
				}
				if = {
					limit = {
						exists = scope:guest_1
					}
					save_scope_as = guest_2
				}
				else = {
					save_scope_as = guest_1
				}
			}
			random_attending_character = {
				limit = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					is_female = yes
					is_close_or_extended_family_of = scope:bride
					is_married = yes
					is_ai = yes
					NOR = {
						has_character_flag = busy_in_wgathering_event
						this = scope:guest_1
						this = scope:guest_2
					}
				}
				if = {
					limit = {
						exists = scope:guest_2
					}
					save_scope_as = guest_3
				}
				else = {
					save_scope_as = guest_2
				}
			}
		}
		scope:guest_1 = { add_character_flag = busy_in_wgathering_event }
		scope:guest_2 = { add_character_flag = busy_in_wgathering_event }
		if = {
			limit = {
				exists = scope:guest_3
			}
			scope:guest_3 = { add_character_flag = busy_in_wgathering_event }
		}
	}

	#Option A: follow tradition
	option = {
		name = ep2_wedding.1100.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_cleansing_log
				tags = { good }
				score = 50
				character = scope:bride

				# Effect
				scope:bride = {
					add_character_modifier = {
						modifier = wedding_purified_modifier
						years = 5
					}
				}
			}
		}
		scope:guest_1 = {
			add_character_modifier = {
				modifier = wedding_purified_modifier
				years = 5
			}
		}
		scope:guest_2 = {
			add_character_modifier = {
				modifier = wedding_purified_modifier
				years = 5
			}
		}
		if = {
			limit = { exists = scope:guest_3 }
			scope:guest_3 = {
				add_character_modifier = {
					modifier = wedding_purified_modifier
					years = 5
				}
			}
		}
		if = {
			limit = {
				scope:bride = {
					any_vassal = { vassal_stance = courtly }
				}
			}
			scope:bride = {
				every_vassal = {
					vassal_stance = courtly
					add_opinion = {
						target = scope:bride
						modifier = wedding_traditional_ritual_opinion
					}
				}
			}
		}
		else_if = {
			limit = {
				scope:bride.betrothed = {
					any_vassal = { vassal_stance = courtly }
				}
			}
			scope:bride.betrothed = {
				every_vassal = {
					vassal_stance = courtly
					add_opinion = {
						target = scope:bride
						modifier = wedding_traditional_ritual_opinion
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Option B: try something new
	option = {
		name = ep2_wedding.1100.b
		trigger = {
			this = scope:bride
		}
		random_list = {
			25 = {}	#nothing happens
			25 = {
				show_chance = no
				trigger = {
					can_set_relation_friend_trigger = { CHARACTER = scope:guest_1 }
				}
				set_relation_friend = {
					target = scope:guest_1
					reason = friend_wedding_ritual
				}
			}
			25 = {
				show_chance = no
				trigger = {
					can_set_relation_friend_trigger = { CHARACTER = scope:guest_2 }
				}
				set_relation_friend = {
					target = scope:guest_2
					reason = friend_wedding_ritual
				}
			}
			25 = {
				show_chance = no
				trigger = {
					exists = scope:guest_3
					can_set_relation_friend_trigger = { CHARACTER = scope:guest_3 }
				}
				set_relation_friend = {
					target = scope:guest_3
					reason = friend_wedding_ritual
				}
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_cleansing_new_log
				tags = { good }
				score = 50		
				character = scope:bride

				# Effect
			}
		}
		stress_impact = {
			shy = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	#Option D: just enjoy the bath
	option = {
		name = ep2_wedding.1100.d
		trigger = {
			has_activity_intent = reduce_stress_intent
			this = scope:bride
		}
		custom_tooltip = available_because_intent_tt
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 150
			modifier = {
				has_trait = lazy
				add = 100
			}
		}
	}

	#Option C: this is dumb
	option = {
		name = ep2_wedding.1100.c
		if = {
			limit = {
				this = scope:bride
				any_vassal = { vassal_stance = courtly }
			}
			every_vassal = {
				vassal_stance = courtly
				add_opinion = {
					target = root
					modifier = wedding_no_ritual_opinion
				}
			}
		}
		else_if = {
			limit = {
				this = scope:bride
				betrothed = {
					any_vassal = {
						vassal_stance = courtly
					}
				}
			}
			betrothed = {
				every_vassal = {
					vassal_stance = courtly
					add_opinion = {
						target = scope:bride
						modifier = wedding_no_ritual_opinion
					}
				}
			}
		}
		else_if = {
			limit = {
				this != scope:bride
			}
			scope:bride = {
				add_opinion = {
					target = root
					modifier = annoyed_opinion
					opinion = -20
				}
				if = {
					limit = {
						NOT = { has_relation_rival = root }
					}
					progress_towards_rival_effect = {
						REASON = rival_despised_ritual
						CHARACTER = root
						OPINION = 0
					}
				}
			}
		}
		add_character_modifier = {
			modifier = wedding_thinking_outside_box_modifier
			years = 10
		}
		stress_impact = {
			zealous = medium_stress_impact_gain
			cynical = medium_stress_impact_loss
		}
		if = {
			limit = { root = scope:bride }
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_cleansing_dismiss_log
					tags = { good }
					score = 50
					character = scope:bride
				}
			}
		}
		else = {
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_cleansing_log
					tags = { good }
					score = 50
					character = scope:bride
				}
			}
		}
		ai_chance = {
			base = 75
			modifier = {
				has_trait = cynical
				add = 25
			}
			modifier = {
				has_trait = zealous
				add = -25
			}
		}
	}

	after = {
		scope:bride = { remove_character_flag = busy_in_wgathering_event }
		scope:guest_1 = { remove_character_flag = busy_in_wgathering_event }
		scope:guest_2 = { remove_character_flag = busy_in_wgathering_event }
		if = {
			limit = {
				exists = scope:guest_3
			}
			scope:guest_3 = { remove_character_flag = busy_in_wgathering_event }
		}
	}
}

# CEREMONY EVENTS

##################################################
# Could it Be You?
# by Claudia Baldassi
# ep2_wedding.1020
##################################################

# The spouses fall in love at first sight

ep2_wedding.1020 = {
	type = activity_event
	title = ep2_wedding.1020.t
	desc = ep2_wedding.1020.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = ecstasy
	}
	right_portrait = {
		character = scope:spouse_2
		animation = admiration
	}

	cooldown = { years = 30 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOR = {
				has_variable = has_had_event_1020
				has_variable = has_had_event_1180
			}
		}

		scope:activity.special_guest:spouse_1 = {
			num_of_relation_soulmate = 0
			NOT = { has_character_flag = busy_in_ceremony_event }
		}
		scope:activity.special_guest:spouse_2 = {
			num_of_relation_soulmate = 0
			NOT = { has_character_flag = busy_in_ceremony_event }
		}

		root = {
			OR = {
				this = scope:activity.special_guest:spouse_1
				this = scope:activity.special_guest:spouse_2
			}
		}

		scope:activity.special_guest:spouse_1 = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_2 }
		scope:activity.special_guest:spouse_2 = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_1 }
		scope:activity.special_guest:spouse_1 = {
			can_set_relation_soulmate_trigger = {
				CHARACTER = scope:activity.special_guest:spouse_2
			}
		}

		# They should not know each other, as much as we can verify
		scope:activity.special_guest:spouse_1 = {
			NOR = {
				has_relation_lover = scope:activity.special_guest:spouse_2
				has_relation_friend = scope:activity.special_guest:spouse_2
				has_relation_potential_lover = scope:activity.special_guest:spouse_2
				has_relation_crush = scope:activity.special_guest:spouse_2
				has_relation_potential_friend = scope:activity.special_guest:spouse_2
			}
		}
		NOT = {
			scope:activity.special_guest:spouse_1 = { has_any_bad_relationship_with_character_trigger = { CHARACTER =  scope:activity.special_guest:spouse_2 } }
		}

		trigger_if = {
			limit = {
				root = { is_ai = yes }
			}
			scope:activity.special_guest:spouse_1 = { is_ai = yes }
			scope:activity.special_guest:spouse_2 = { is_ai = yes }
		}
		trigger_else = {
			OR = {
				scope:activity.special_guest:spouse_1 = { is_ai = yes }
				scope:activity.special_guest:spouse_2 = { is_ai = yes }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = woo_attendee_intent
			intent_target ?= root.betrothed
			add = 1
		}
	}

	immediate = {
		scope:activity = {
			set_variable = has_had_event_1020
		}
		if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = spouse_2
			}
		}
		else = {
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = spouse_2
			}
		}
		add_character_flag = busy_in_ceremony_event
		scope:spouse_2 = { add_character_flag = busy_in_ceremony_event }
	}

	option = {
		name = ep2_wedding.1020.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_first_sight_log
				tags = { good }
				score = 50
				character = root
				target = scope:spouse_2

				# Effect
				root = {
					set_relation_soulmate = { reason = soulmate_wedding_first_sight target = scope:spouse_2 }
					reverse_add_opinion = {
						target = scope:spouse_2
						modifier = love_opinion
						opinion = 30
					}
					if = {
						limit = {
							has_activity_intent = woo_attendee_intent
							intent_target = scope:spouse_2
						}
						complete_activity_intent = yes
					}
					# Achievements
					player_succeeded_at_a_thousand_and_one_nights_achievement_effect = yes
				}
			}
		}
	}
	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:spouse_2 = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# A Good/Bad Omen
# by Claudia Baldassi
# ep2_wedding.1030
##################################################

# A good or bad omen happens: how do you react?

ep2_wedding.1030 = {
	type = activity_event
	title = ep2_wedding.1030.t
	desc = {
		desc = ep2_wedding.1030.desc
		random_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = good_thing_flag
				}
				desc = ep2_wedding.1030.desc_good1
			}
			triggered_desc = {
				trigger = {
					has_character_flag = good_thing_flag
				}
				desc = ep2_wedding.1030.desc_good2
			}
			triggered_desc = {
				trigger = {
					has_character_flag = good_thing_flag
				}
				desc = ep2_wedding.1030.desc_good3
			}
			triggered_desc = {
				trigger = {
					has_character_flag = bad_thing_flag
				}
				desc = ep2_wedding.1030.desc_bad1
			}
			triggered_desc = {
				trigger = {
					has_character_flag = bad_thing_flag
				}
				desc = ep2_wedding.1030.desc_bad2
			}
			triggered_desc = {
				trigger = {
					has_character_flag = bad_thing_flag
				}
				desc = ep2_wedding.1030.desc_bad3
			}
		}
		desc = ep2_wedding.1030.desc_outro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = bad_thing_flag
				}
				desc = ep2_wedding.1030.desc_bad
			}
			desc = ep2_wedding.1030.desc_good
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				has_character_flag = bad_thing_flag
			}
			animation = fear
		}
		animation = happiness
	}
	right_portrait = {
		character = scope:1030_chatter
		triggered_animation = {
			trigger = {
				has_character_flag = bad_thing_flag
			}
			animation = worry
		}
		animation = admiration
	}
	lower_center_portrait = {
		character = scope:spouse_2
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1030
			}
		}

		scope:activity.special_guest:spouse_2 = { is_ai = yes }
		scope:activity = {
			any_attending_character = {
				is_ai = yes
				NOR = {
					this = scope:activity.special_guest:spouse_2
					this = root
					has_character_flag = busy_in_ceremony_event
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_character_modifier = bp1_superstition_modifier
			add = 3
		}
		modifier = {
			is_ai = yes
			factor = 0.3
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 1
		}
	}

	immediate = {
		scope:activity = {
			set_variable = has_had_event_1030
		}
		hidden_effect = {
			random_list = {
				50 = {
					add_character_flag = good_thing_flag
				}
				50 = {
					add_character_flag = bad_thing_flag
				}
			}
		}
		scope:activity.special_guest:spouse_2 = {
			save_scope_as = spouse_2
			add_character_flag = busy_in_ceremony_event
		}
		scope:activity.special_guest:spouse_1 = {
			save_scope_as = spouse_1
		}

		scope:activity = {
			random_attending_character = {
				limit = {
					NOR = {
						scope:spouse_2 = this
						root = this
					}
					is_ai = yes
				}
				save_scope_as = 1030_chatter
				add_character_flag = busy_in_ceremony_event
			}
		}

		add_character_flag = busy_in_ceremony_event
		
		random = {
			chance = legend_seed_chance_low
			add_character_flag = wedding_legend_seed
		}
	}

	#Option A: good omen - excellent!
	option = {
		name = ep2_wedding.1030.a
		trigger = {
			has_character_flag = good_thing_flag
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_omen_good_log
				tags = { good }
				score = 50
				character = root
				target = scope:spouse_2
			}
		}
		if = {
			limit = {
				has_activity_intent = reduce_stress_intent
			}
			stress_impact = {
				base = medium_stress_impact_loss
			}
		}
		else = {
			stress_impact = {
				base = minor_stress_impact_loss
			}
		}
	}

	#Option B: dismiss bad omen
	option = {
		name = ep2_wedding.1030.b
		trigger = {
			has_character_flag = bad_thing_flag
			NOT = { has_character_modifier = bp1_superstition_modifier }
		}
		if = {
			limit = {
				ai_rationality >= 40
			}
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_omen_dismissed_log
					tags = { bad }
					score = 50
					character = root
					target = scope:spouse_2
				}
			}
			if = {
				limit = {
					has_activity_intent = reduce_stress_intent
				}
				stress_impact = {
					base = minor_stress_impact_loss
				}
			}
		}
		else = {
			stress_impact = {
				base = minor_stress_impact_gain
			}
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_omen_bad_log
					tags = { bad }
					score = 50
					character = root
					target = scope:spouse_2
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Option c: bad omen - panic
	option = {
		name = ep2_wedding.1030.c
		trigger = {
			has_character_flag = bad_thing_flag
			has_character_modifier = bp1_superstition_modifier
		}
		stress_impact = {
			base = medium_stress_impact_gain
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_omen_bad_log
				tags = { bad }
				score = 50
				character = root
				target = scope:spouse_2
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Option D: good omen - you get a legend seed!
	option = {
		name = ep2_wedding.1030.d
		trigger = {
			has_character_flag = good_thing_flag
			NOR = {
				has_personal_legend_seed = heroic
				has_personal_legend_seed = holy
				has_personal_legend_seed = legitimizing
			}
			has_character_flag = wedding_legend_seed
			OR = {
				scope:spouse_2.dynasty = root.dynasty
				scope:spouse_1.dynasty = root.dynasty
			} 
		}

		scope:activity = {
			add_activity_log_entry = {
				key = wedding_omen_good_log
				tags = { good }
				score = 50
				character = root
				target = scope:spouse_2
			}
		}

		legend_seed_great_deed_dynasty_effect = yes

		ai_chance = { #AI can into legend seeds
			base = 200
		}
	}

	after = {
		if = {
			limit = {
				has_character_flag = good_thing_flag
			}
			remove_character_flag = good_thing_flag
		}
		else = {
			remove_character_flag = bad_thing_flag
		}
		remove_character_flag = busy_in_ceremony_event
		scope:spouse_2 = { remove_character_flag = busy_in_ceremony_event }
		scope:1030_chatter = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# New Family
# by Claudia Baldassi
# ep2_wedding.1120
##################################################

# Spouse: your child from a previous partner makes a fuss

scripted_trigger ep2_wedding_1120_valid_child_trigger = {
	NOT = {
		any_parent = { this = root.betrothed }
	}
	any_parent = {
		even_if_dead = yes
		this != root
		save_temporary_scope_as = other_parent
	}
	age >= 6
	involved_activity ?= { this = scope:activity }
	save_temporary_scope_as = trouble_child
}

ep2_wedding.1120 = {
	type = activity_event
	title = ep2_wedding.1120.t
	desc = {
		desc = ep2_wedding.1120.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:trouble_child = {
						is_adult = no
					}
				}
				desc = ep2_wedding.1120.desc_child
			}
			desc = ep2_wedding.1120.desc_adult
		}
		triggered_desc = {
			trigger = {
				scope:other_parent = {
					involved_activity ?= { this = scope:activity }
				}
			}
			desc = ep2_wedding.1120.desc_parent
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = shock
	}
	center_portrait = {
		character = scope:other_spouse
		animation = worry
	}
	right_portrait = {
		character = scope:trouble_child
		animation = wedding_objection_start
	}
	lower_right_portrait = scope:other_parent

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1120
			}
		}

		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		betrothed ?= {
			is_ai = yes
		}
		any_child ?= {
			ep2_wedding_1120_valid_child_trigger = yes
		}
		# if the child's real parent is a secret, make sure that the child knows about it before denouncing it, and they don't like you enough
		trigger_if = {
			limit = {
				any_secret = {
					type = secret_unmarried_illegitimate_child
					secret_target = { this = scope:trouble_child }
				}
			}
			any_secret = {
				type = secret_unmarried_illegitimate_child
				secret_target = { this = scope:trouble_child }
				is_known_by = scope:trouble_child
			}
			scope:trouble_child = {
				opinion = { target = root value < 0 }
			}
		}
		trigger_if = {
			limit = {
				any_secret = {
					type = secret_disputed_heritage
					secret_target = { this = scope:trouble_child }
				}
			}
			any_secret = {
				type = secret_disputed_heritage
				secret_target = { this = scope:trouble_child }
				is_known_by = scope:trouble_child
			}
			scope:trouble_child = {
				opinion = { target = root value < 0 }
			}
		}
	}

	weight_multiplier = {
		base = 1
		# More drama if the other parent is there too
		modifier = {
			any_child = {
				ep2_wedding_1120_valid_child_trigger = yes
			}
			scope:other_parent = {
				is_alive = yes
				involved_activity ?= { this = scope:activity }
			}
			add = 4
		}
		# more likely if the child is an actual child
		modifier = {
			any_child = {
				ep2_wedding_1120_valid_child_trigger = yes
				is_adult = no
			}
			add = 2
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = -0.5
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1120
		}
		betrothed = { save_scope_as = other_spouse }
		scope:other_spouse = {
			add_character_flag = busy_in_ceremony_event
		}
		random_child = {
			limit = {
				ep2_wedding_1120_valid_child_trigger = yes
			}
			save_scope_as = trouble_child
		}
		scope:trouble_child = {
			random_parent = {
				even_if_dead = yes
				limit = {
					this != root
				}
				save_scope_as = other_parent
			}
			add_character_flag = busy_in_ceremony_event
		}
		if = {
			limit = {
				scope:other_parent = {
					is_alive = yes
					involved_activity ?= { this = scope:activity }
				}
			}
			scope:other_parent = { add_character_flag = busy_in_ceremony_event }
		}
		if = {
			limit = {
				any_secret = {
					type = secret_unmarried_illegitimate_child
					secret_target = { this = scope:trouble_child }
				}
			}
			random_secret = {
				type = secret_unmarried_illegitimate_child
				limit = {
					secret_target = { this = scope:trouble_child }
				}
				expose_secret = scope:trouble_child
			}
			add_character_flag = wedding_secret_child_revealed
		}
		else_if = {
			limit = {
				any_secret = {
					type = secret_disputed_heritage
					secret_target = { this = scope:trouble_child }
				}	
			}
			random_secret = {
				type = secret_disputed_heritage
				limit = {
					secret_target = { this = scope:trouble_child }
				}
				expose_secret = scope:trouble_child
			}
			add_character_flag = wedding_secret_child_revealed
		}
		if = {
			limit = {
				has_character_flag = wedding_secret_child_revealed
			}
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_child_fuss_secret_log
					show_in_conclusion = yes
					character = scope:trouble_child
					target = root
				}
			}
		}
		else = {
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_child_fuss_log
					character = scope:trouble_child
					target = root
				}
			}
		}
	}

	# Option A: be strict
	option = {
		name = ep2_wedding.1120.a
		trigger = {
			NOT = {
				has_character_flag = wedding_secret_child_revealed
			}
		}
		add_prestige = major_prestige_gain
		scope:trouble_child = {
			add_opinion = {
				target = root
				modifier = hate_opinion
				opinion = -60
			}
		}
		scope:other_spouse = {
			add_opinion = {
				target = scope:trouble_child
				modifier = angry_opinion
				opinion = -30
			}
			if = {
				limit = {
					OR = {
						has_trait = compassionate
						has_trait = humble
						has_trait = content
						ai_compassion >= medium_positive_ai_value
					}
				}
				add_opinion = {
					target = root
					modifier = awkward_opinion
					opinion = -20
				}
			}
			else = {
				add_opinion = {
					target = root
					modifier = amused_opinion
					opinion = 30
				}
				root = {
					add_character_modifier = {
						modifier = ep2_wedding_shared_values_modifier
						years = 5
					}
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			patient = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			calm = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			arrogant = medium_stress_impact_loss
			callous = medium_stress_impact_loss
			impatient = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}

	# Option B: be accepting
	option = {
		name = ep2_wedding.1120.b
		trigger = {
			NOT = {
				has_character_flag = wedding_secret_child_revealed
			}
		}
		dynasty ?= {
			add_dynasty_prestige = medium_dynasty_prestige_gain
		}
		scope:trouble_child = {
			add_opinion = {
				target = root
				modifier = love_opinion
				opinion = 60
			}
		}
		scope:other_spouse = {
			add_opinion = {
				target = scope:trouble_child
				modifier = angry_opinion
				opinion = -30
			}
			if = {
				limit = {
					OR = {
						ai_compassion <= low_positive_ai_value
						has_trait = callous
						has_trait = wrathful
						has_trait = vengeful
					}
				}
				add_opinion = {
					target = root
					modifier = awkward_opinion
					opinion = -20
				}
			}
			else = {
				add_opinion = {
					target = root
					modifier = respect_opinion
					opinion = 30
				}
				root = {
					add_character_modifier = {
						modifier = ep2_wedding_shared_values_modifier
						years = 5
					}
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_loss
			patient = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			calm = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			arrogant = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			impatient = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	# Option C: it was a secret!!
	option = {
		name = ep2_wedding.1120.c
		trigger = {
			has_character_flag = wedding_secret_child_revealed
		}
		if = {
			limit = {
				scope:trouble_child = {
					is_adult = yes
				}
			}
			set_variable = {
				days = 100
				name = ep2_confrontational_child
				value = scope:trouble_child
			}
		}
		stress_impact = {
			deceitful = major_stress_impact_gain
			honest = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:trouble_child = { remove_character_flag = busy_in_ceremony_event }
		scope:other_spouse = { remove_character_flag = busy_in_ceremony_event }
		scope:other_parent = {
			if = {
				limit = { has_character_flag = busy_in_ceremony_event }
				remove_character_flag = busy_in_ceremony_event
			}
		}
		if = {
			limit = {
				has_character_flag = wedding_secret_child_revealed
			}
			remove_character_flag = wedding_secret_child_revealed
		}
	}
}

# Opposite event: it is your spouse who has a complaining child

scripted_trigger ep2_wedding_1121_valid_child_trigger = {
	NOT = {
		any_parent = { this = root }
	}
	any_parent = {
		even_if_dead = yes
		this != root.betrothed
		save_temporary_scope_as = other_parent
	}
	age >= 6
	involved_activity ?= { this = scope:activity }
	save_temporary_scope_as = trouble_child
}

ep2_wedding.1121 = {
	type = activity_event
	title = ep2_wedding.1120.t
	desc = {
		desc = ep2_wedding.1120.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:trouble_child = {
						is_adult = no
					}
				}
				desc = ep2_wedding.1121.desc_child
			}
			desc = ep2_wedding.1121.desc_adult
		}
		triggered_desc = {
			trigger = {
				scope:other_parent = {
					involved_activity ?= { this = scope:activity }
				}
			}
			desc = ep2_wedding.1120.desc_parent
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = scope:other_spouse
		animation = worry
	}
	center_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:trouble_child
		animation = wedding_objection_start
	}
	lower_right_portrait = scope:other_parent

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1120
			}
		}

		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		root.betrothed ?= {
			OR = {
				this = scope:activity.special_guest:spouse_1
				this = scope:activity.special_guest:spouse_2
			}
			is_ai = yes
			save_temporary_scope_as = other_spouse
			any_child = {
				ep2_wedding_1121_valid_child_trigger = yes
			}
		}
		# if the child's real parent is a secret, make sure that the child knows about it before denouncing it, and they don't like their parent enough
		trigger_if = {
			limit = {
				scope:other_spouse = {
					any_secret = {
						type = secret_unmarried_illegitimate_child
						secret_target = { this = scope:trouble_child }
					}
				}
			}
			scope:other_spouse = {
				any_secret = {
					type = secret_unmarried_illegitimate_child
					secret_target = { this = scope:trouble_child }
					is_known_by = scope:trouble_child
				}
			}
			scope:trouble_child = {
				opinion = { target = scope:other_spouse value < 0 }
			}
		}
		trigger_if = {
			limit = {
				scope:other_spouse = {
					any_secret = {
						type = secret_disputed_heritage
						secret_target = { this = scope:trouble_child }
					}
				}
			}
			scope:other_spouse = {
				any_secret = {
					type = secret_disputed_heritage
					secret_target = { this = scope:trouble_child }
					is_known_by = scope:trouble_child
				}
			}
			scope:trouble_child = {
				opinion = { target = scope:other_spouse value < 0 }
			}
		}
	}

	weight_multiplier = {
		base = 1
		# More drama if the other parent is there too
		modifier = {
			root.betrothed = {
				any_child = {
					ep2_wedding_1121_valid_child_trigger = yes
				}
				scope:other_parent = {
					is_alive = yes
					involved_activity ?= { this = scope:activity }
				}
			}
			add = 4
		}
		# more likely if the child is an actual child
		modifier = {
			root.betrothed = {
				any_child = {
					ep2_wedding_1121_valid_child_trigger = yes
					is_adult = no
				}
			}
			add = 2
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = -0.5
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1120
		}
		root.betrothed = { save_scope_as = other_spouse }
		scope:other_spouse = {
			add_character_flag = busy_in_ceremony_event
		}
		scope:other_spouse = {
			random_child = {
				limit = {
					ep2_wedding_1121_valid_child_trigger = yes
				}
				save_scope_as = trouble_child
			}
		}
		scope:trouble_child = {
			random_parent = {
				even_if_dead = yes
				limit = {
					this != root.betrothed
				}
				save_scope_as = other_parent
			}
			add_character_flag = busy_in_ceremony_event
		}
		if = {
			limit = {
				scope:other_parent = {
					involved_activity ?= { this = scope:activity }
				}
			}
			scope:other_parent = { add_character_flag = busy_in_ceremony_event }
		}
		if = {
			limit = {
				scope:other_spouse = {
					any_secret = {
						type = secret_unmarried_illegitimate_child
						secret_target = { this = scope:trouble_child }
					}
				}
			}
			scope:other_spouse = {
				random_secret = {
					type = secret_unmarried_illegitimate_child
					limit = {
						secret_target = { this = scope:trouble_child }
					}
					expose_secret = scope:trouble_child
				}
				add_character_flag = wedding_secret_child_revealed
			}
		}
		else_if = {
			limit = {
				scope:other_spouse = {
					any_secret = {
						type = secret_unmarried_illegitimate_child
						secret_target = { this = scope:trouble_child }
					}
				}
			}
			scope:other_spouse = {
				random_secret = {
					type = secret_disputed_heritage
					limit = {
						secret_target = { this = scope:trouble_child }
					}
					expose_secret = scope:trouble_child
				}
				add_character_flag = wedding_secret_child_revealed
			}
		}
		scope:other_spouse = {
			if = {
				limit = {
					has_character_flag = wedding_secret_child_revealed	
				}
				add_opinion = {
					target = scope:trouble_child
					modifier = angry_opinion
					opinion = -30
				}
			}
		}
		if = {
			limit = {
				scope:other_spouse = { has_character_flag = wedding_secret_child_revealed }
			}
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_child_fuss_secret_log
					show_in_conclusion = yes
					character = scope:trouble_child
					target = scope:other_spouse
				}
			}
		}
		else = {
			scope:activity = {
				add_activity_log_entry = {
					key = wedding_child_fuss_log
					character = scope:trouble_child
					target = scope:other_spouse
				}
			}
		}
	}

	# Option A: Shut up!
	option = {
		name = ep2_wedding.1121.a
		add_dread = medium_dread_gain
		scope:trouble_child = {
			add_opinion = {
				target = root
				modifier = hate_opinion
				opinion = -50
			}
		}
		scope:other_spouse = {
			if = {
				limit = {
					save_temporary_opinion_value_as = { name = opinion_of_you target = root }
					opinion = { target = scope:trouble_child value >= scope:opinion_of_you }
					NOT = {
						has_dread_level_towards = {
							target = root
							level >= 1
						}
					}
				}
				add_opinion = {
					target = root
					modifier = berated_child_opinion
				}
			}
		}
		add_character_modifier = {
			modifier = ep2_wedding_authoritarian_modifier
			years = 10
		}
		stress_impact = {
			compassionate = major_stress_impact_gain
			arrogant = major_stress_impact_gain
			patient = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 0.5
			}
		}
	}

	# Option B: I'll be a better parent!
	option = {
		name = ep2_wedding.1121.b
		scope:trouble_child = {
			add_opinion = {
				target = root
				modifier = give_a_chance_opinion
			}
		}
		scope:other_spouse = {
			add_opinion = {
				target = root
				modifier = give_a_chance_opinion
			}
		}
		add_character_modifier = {
			modifier = ep2_wedding_family_focus_modifier
			years = 10
		}
		stress_impact = {
			callous = major_stress_impact_gain
			arrogant = major_stress_impact_gain
			wrathful = major_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_vengefulness = -0.5
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:trouble_child = { remove_character_flag = busy_in_ceremony_event }
		scope:other_spouse = {
			remove_character_flag = busy_in_ceremony_event
			if = {
				limit = {
					has_character_flag = wedding_secret_child_revealed
				}
				remove_character_flag = wedding_secret_child_revealed
			}
		}
		scope:other_parent = {
			if = {
				limit = { has_character_flag = busy_in_ceremony_event }
				remove_character_flag = busy_in_ceremony_event
			}
		}
	}
}

# Follow-up to 1120. NB this is a Banquet Event.
# You talk with the child who revealed your secret.

ep2_wedding.1122 = {
	type = activity_event
	title = ep2_wedding.1120.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:trouble_child = {
						has_character_flag = 1122_repentant
					}
				}
				desc = ep2_wedding.1122.desc_repentant
			}
			desc = ep2_wedding.1122.desc_unrepentant
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:trouble_child
		triggered_animation = {
			trigger = {
				scope:trouble_child = {
					has_character_flag = 1122_repentant
				}
			}
			animation = shame
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:trouble_child = {
						has_character_flag = 1122_repentant
					}
				}
			}
			animation = personality_callous
		}
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		has_variable = ep2_confrontational_child
		scope:activity = {
			NOT = {
				has_variable = has_had_event_1122
			}
		}
	}

	immediate = {
		var:ep2_confrontational_child = {
			save_scope_as = trouble_child
		}
		scope:activity = {
			set_variable = has_had_event_1122
		}
		add_character_flag = busy_in_banquet_event
		scope:trouble_child = {
			add_character_flag = busy_in_banquet_event
		}
		scope:trouble_child = {
			random_list = {
				# child regrets it
				50 = {
					modifier = {
						has_trait = humble
						add = 50
					}
					modifier = {
						has_trait = family_first
						add = 100
					}
					modifier = {
						has_trait = compassionate
						add = 100
					}
					modifier = {
						has_trait = patient
						add = 20
					}
					modifier = {
						has_trait = craven
						add = 20
					}
					modifier = {
						has_trait = shy
						add = 20
					}
					modifier = {
						has_trait = trusting
						add = 20
					}
					modifier = {
						has_trait = fickle
						add = 50
					}
					modifier = {
						has_trait = forgiving
						add = 20
					}
					modifier = {
						has_trait = contrite
						add = 100
					}
					add_character_flag = 1122_repentant
				}
				# child is unrepentant
				50 = {
					modifier = {
						has_trait = arrogant
						add = 50
					}
					modifier = {
						has_trait = arbitrary
						add = 50
					}
					modifier = {
						has_trait = paranoid
						add = 100
					}
					modifier = {
						has_trait = wrathful
						add = 20
					}
					modifier = {
						has_trait = impatient
						add = 20
					}
					modifier = {
						has_trait = brave
						add = 20
					}
					modifier = {
						has_trait = ambitious
						add = 20
					}
					modifier = {
						has_trait = vengeful
						add = 20
					}
					modifier = {
						has_trait = callous
						add = 50
					}
					modifier = {
						has_trait = stubborn
						add = 100
					}
				}
			}
		}
	}

	# Option A: You forgive
	option = {
		name = ep2_wedding.1122.a
		trigger = {
			scope:trouble_child = {
				has_character_flag = 1122_repentant
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = 1122_child_pacified_log
				tags = { good }
				score = 10
				character = root
				target = scope:trouble_child
				# Effect
				scope:trouble_child = {
					add_opinion = {
						target = root
						modifier = forgiven_opinion
						opinion = 20
					}
				}
			}
		}
		stress_impact = {
			vengeful = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	# Option B: You don't forgive
	option = {
		name = ep2_wedding.1122.b
		trigger = {
			scope:trouble_child = {
				has_character_flag = 1122_repentant
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = 1122_child_not_pacified_log
				tags = { bad }
				score = 10
				character = root
				target = scope:trouble_child
				# Effect
				scope:trouble_child = {
					add_opinion = {
						target = root
						modifier = unforgiven_opinion
						opinion = -30
					}
				}
				root = {
					if = {
						limit = {
							can_add_hook = {
								target = scope:trouble_child
								type = indebted_hook
							}
						}
						add_hook = {
							target = scope:trouble_child
							type = indebted_hook
						}
					}
				}
			}
		}
		stress_impact = {
			forgiving = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	# Option C: You accept the critique
	option = {
		name = ep2_wedding.1122.c
		trigger = {
			scope:trouble_child = {
				NOT = { has_character_flag = 1122_repentant }
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = 1122_child_pacified_log
				tags = { good }
				score = 10
				character = root
				target = scope:trouble_child
				# Effect
				scope:trouble_child = {
					add_opinion = {
						target = root
						modifier = respect_opinion
						opinion = 30
					}
				}
			}
		}
		stress_impact = {
			vengeful = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	# Option D: You remain angry
	option = {
		name = ep2_wedding.1122.d
		trigger = {
			scope:trouble_child = {
				NOT = { has_character_flag = 1122_repentant }
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = 1122_child_not_pacified_log
				tags = { bad }
				score = 10
				character = root
				target = scope:trouble_child
				# Effect
				root = {
					if = {
						limit = {
							can_add_hook = {
								target = scope:trouble_child
								type = indebted_hook
							}
						}
						add_hook = {
							target = scope:trouble_child
							type = indebted_hook
						}
					}
				}
			}
		}
		stress_impact = {
			forgiving = massive_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}

	after = {
		remove_character_flag = busy_in_banquet_event
		scope:trouble_child = {
			remove_character_flag = busy_in_banquet_event
			if = {
				limit = {
					has_character_flag = 1122_repentant
				}
				remove_character_flag = 1122_repentant
			}
		}
		remove_variable = ep2_confrontational_child
	}
}

##################################################
# Secret Whispers
# by Claudia Baldassi
# ep2_wedding.1130
##################################################

# A bad secret comes up and compromises the union: someone who knows spills the beans
#The secret is yours.

ep2_wedding.1130 = {
	type = activity_event
	title = ep2_wedding.1130.t
	desc = {
		desc = ep2_wedding.1130.desc
		desc = ep2_wedding.1130.desc_continue
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:1130_knows
		animation = wedding_objection_start
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1130
			}
		}
		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		has_any_secrets = yes
		scope:activity = {
			any_attending_character = {
				any_known_secret = {
					secret_owner = root
					NOT = { secret_target ?= prev }
				}
				opinion = { target = root value <= 0 }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			scope:activity = {
				any_attending_character = {
					any_known_secret = {
						secret_owner = root
						NOT = { secret_target ?= prev }

					}
					has_trait = contrite
				}
			}
			add = 4
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					any_known_secret = {
						secret_owner = root
						NOT = { secret_target ?= prev }
					}
					has_relation_rival = root
				}
			}
			add = 5
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = -0.5
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1130
		}
		betrothed = {
			save_scope_as = other_spouse
			add_character_flag = busy_in_ceremony_event
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					any_known_secret = {
						secret_owner = root
						NOT = { secret_target ?= prev }
					}
				}
				save_scope_as = 1130_knows
				add_character_flag = busy_in_ceremony_event
			}
		}
		scope:1130_knows = {
			random_known_secret = {
				limit = {
					secret_owner = root
					NOT = { secret_target ?= scope:1130_knows }
				}
				save_scope_as = 1130_secret
			}
		}
	}

	#Option A: let them expose the secret
	option = {
		name = ep2_wedding.1130.a
		add_character_modifier = {
			modifier = wedding_clean_slate_modifier
			years = 10
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_secret_revealed_log
				show_in_conclusion = yes
				character = scope:1130_knows
				target = root

				#Effect
				scope:1130_secret = { expose_secret = scope:1130_knows }
				root = {
					if = {
						limit = {
							can_set_relation_nemesis_trigger = { CHARACTER = scope:1130_knows }
						}
						set_relation_nemesis = {
							target = scope:1130_knows
							reason = nemesis_wedding_spread_voices_secret
						}
					}
				}
			}
		}
		scope:1130_knows = {
			if = {
				limit = {
					has_activity_intent = banquet_mischief_intent
				}
				complete_activity_intent = yes
			}
		}
		stress_impact = {
			deceitful = major_stress_impact_gain
			contrite = massive_stress_impact_loss
			honest = major_stress_impact_loss
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_honor = 0.5
			}
			modifier = {
				has_trait = contrite
				add = 200
			}
			modifier = {
				has_trait = honest
				add = 100
			}
		}
	}

	#Option B: kick them out
	option = {
		name = ep2_wedding.1130.b
		add_character_modifier = {
			modifier = wedding_web_of_secrets_modifier
			years = 10
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_secret_not_revealed_log
				show_in_conclusion = yes
				character = scope:1130_knows
				target = root

				#Effect
				root = {
					if = {
						limit = {
							can_set_relation_rival_trigger = { CHARACTER = scope:1130_knows }
						}
						set_relation_rival = {
							target = scope:1130_knows
							reason = rival_wedding_spread_voices
						}
					}
					add_dread = major_dread_gain
				}
				scope:1130_knows = {
					remove_from_activity = scope:activity
				}
			}
		}
		stress_impact = {
			contrite = massive_stress_impact_gain
			honest = major_stress_impact_gain
		}
		ai_chance = {
			base = 125
			ai_value_modifier = {
				ai_honor = -0.5
			}
			modifier = {
				has_trait = deceitful
				add = 200
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:other_spouse = {
			remove_character_flag = busy_in_ceremony_event
		}
		scope:1130_knows = {
			remove_character_flag = busy_in_ceremony_event
		}
	}
}

# The secret is your partner's.

ep2_wedding.1131 = {
	type = activity_event
	title = ep2_wedding.1130.t
	desc = {
		desc = ep2_wedding.1130.desc
		desc = ep2_wedding.1131.desc
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = shock
	}
	center_portrait = {
		character = scope:other_spouse
		animation = shame
	}
	right_portrait = {
		character = scope:1130_knows
		animation = wedding_objection_start
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1130
			}
		}
		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		betrothed ?= {
			has_any_secrets = yes
		}
		scope:activity = {
			any_attending_character = {
				any_known_secret = {
					secret_owner = root.betrothed
					NOT = { is_known_by = root }
					NOT = { secret_target ?= prev }
				}
				opinion = { target = root.betrothed value <= 0 }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			scope:activity = {
				any_attending_character = {
					any_known_secret = {
						secret_owner = root.betrothed
						NOT = { is_known_by = root }
						NOT = { secret_target ?= prev }
					}
					has_trait = contrite
				}
			}
			add = 4
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					any_known_secret = {
						secret_owner = root.betrothed
						NOT = { is_known_by = root }
						NOT = { secret_target ?= prev }
					}
					has_relation_rival = root
				}
			}
			add = 4
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					any_known_secret = {
						secret_owner = root.betrothed
						NOT = { is_known_by = root }
						NOT = { secret_target ?= prev }
					}
					has_relation_rival = root.betrothed
				}
			}
			add = 4
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = -0.5
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1130
		}
		betrothed = {
			save_scope_as = other_spouse
			add_character_flag = busy_in_ceremony_event
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					any_known_secret = {
						secret_owner = root.betrothed
						NOT = { is_known_by = root }
						NOT = { secret_target ?= prev }
					}
				}
				save_scope_as = 1130_knows
				add_character_flag = busy_in_ceremony_event
			}
		}
		scope:1130_knows = {
			random_known_secret = {
				limit = {
					secret_owner = scope:other_spouse
					NOT = { is_known_by = root }
					NOT = { secret_target ?= scope:1130_knows }
				}
				save_scope_as = 1130_secret
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_secret_revealed_log
				show_in_conclusion = yes
				character = scope:1130_knows
				target = scope:other_spouse

				#Effect
				scope:1130_secret = { expose_secret = scope:1130_knows }
			}
		}
		scope:1130_knows = {
			if = {
				limit = {
					has_activity_intent = banquet_mischief_intent
				}
				complete_activity_intent = yes
			}
		}
	}

	#Option A: be understanding
	option = {
		name = ep2_wedding.1131.a
		scope:other_spouse = {
			add_opinion = {
				target = root
				modifier = wedding_understanding_spouse_opinion
			}
		}
		if = {
			limit = {
				can_add_hook = {
					target = scope:other_spouse
					type = favor_hook
				}
			}
			add_hook = {
				target = scope:other_spouse
				type = favor_hook
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			callous = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = major_stress_impact_gain
			paranoid = major_stress_impact_gain
			honest = medium_stress_impact_loss
			forgiving = medium_stress_impact_loss
			compassionate = medium_stress_impact_loss
			trusting = major_stress_impact_loss
		}
		ai_chance = {
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	#Option B: this is unacceptable!
	option = {
		name = ep2_wedding.1131.b
		add_dread = major_dread_gain
		add_character_modifier = {
			modifier = wedding_trust_compromised_modifier
			years = 10
		}
		stress_impact = {
			impatient = minor_stress_impact_loss
			callous = medium_stress_impact_loss
			wrathful = medium_stress_impact_loss
			vengeful = major_stress_impact_loss
			paranoid = major_stress_impact_loss
			honest = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			trusting = major_stress_impact_gain
		}
		ai_chance = {
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:other_spouse = {
			remove_character_flag = busy_in_ceremony_event
		}
		scope:1130_knows = {
			remove_character_flag = busy_in_ceremony_event
		}
	}
}

# You know a secret about a spouse.

ep2_wedding.1132 = {
	type = activity_event
	title = ep2_wedding.1130.t
	desc = ep2_wedding.1132.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = wedding_objection_start
	}
	center_portrait = {
		character = scope:other_spouse
		animation = shock
	}
	right_portrait = {
		character = scope:spouse_with_secret
		animation = shame
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1130
			}
		}
		NOR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		any_known_secret = {
			secret_owner = {
				OR = {
					this = scope:activity.special_guest:spouse_1
					this = scope:activity.special_guest:spouse_2
				}
			}
			NOT = { secret_target ?= root }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_trait = contrite
			add = 4
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = -0.5
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1130
		}
		random_known_secret = {
			limit = {
				secret_owner = {
					OR = {
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
					}
				}
				NOT = { secret_target ?= root }
			}
			save_scope_as = 1130_secret
		}
		scope:1130_secret = {
			secret_owner = {
				save_scope_as = spouse_with_secret
				add_character_flag = busy_in_ceremony_event
			}
		}
		scope:spouse_with_secret.betrothed = {
			save_scope_as = other_spouse
			add_character_flag = busy_in_ceremony_event
		}
	}

	#Option A: reveal it
	option = {
		name = ep2_wedding.1132.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_secret_revealed_log
				show_in_conclusion = yes
				character = root
				target = scope:spouse_with_secret

				#Effect
				scope:1130_secret = { expose_secret = root }
			}
		}
		scope:other_spouse = {
			add_opinion = {
				target = root
				modifier = opened_my_eyes_opinion
			}
		}
		if = {
			limit = {
				can_add_hook = {
					target = scope:other_spouse
					type = favor_hook
				}
			}
			add_hook = {
				target = scope:other_spouse
				type = favor_hook
			}
		}
		if = {
			limit = {
				has_activity_intent = banquet_mischief_intent
			}
			complete_activity_intent = yes
		}
		stress_impact = {
			honest = major_stress_impact_loss
			contrite = massive_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = honest
				add = 100
			}
			modifier = {
				has_trait = contrite
				add = 100
			}
		}
	}

	#Option B: keep it
	option = {
		name = ep2_wedding.1132.b
		scope:spouse_with_secret = {
			add_opinion = {
				target = root
				modifier = kept_my_secret_opinion
			}
		}
		if = {
			limit = {
				can_add_hook = {
					target = scope:spouse_with_secret
					type = favor_hook
				}
			}
			add_hook = {
				target = scope:spouse_with_secret
				type = favor_hook
			}
		}
		stress_impact = {
			deceitful = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = deceitful
				add = 100
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:spouse_with_secret = {
			remove_character_flag = busy_in_ceremony_event
		}
		scope:other_spouse = {
			remove_character_flag = busy_in_ceremony_event
		}
	}
}

##################################################
# A Misstep
# by Claudia Baldassi
# ep2_wedding.1140
##################################################

# A spouse has an embarrassing misstep: stuttering, missing cues, forgetting vows… How do you recover?

ep2_wedding.1140 = {
	type = activity_event
	title = ep2_wedding.1140.t
	desc = {
		desc = ep2_wedding.1140.desc
		random_valid = {
			desc = ep2_wedding.1140.desc_1
			desc = ep2_wedding.1140.desc_2
			desc = ep2_wedding.1140.desc_3
		}
		triggered_desc = {
			trigger = {
				OR = {
					has_activity_intent = diplomatic_intent
					has_activity_intent = woo_attendee_intent
				}
				intent_target = {
					NOR = {
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
					}
				}
			}
			desc = ep2_wedding.1140.desc_target
		}
		triggered_desc = {
			trigger = {
				OR = {
					has_activity_intent = diplomatic_intent
					has_activity_intent = woo_attendee_intent
				}
				intent_target = {
					OR = {
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
					}
				}
			}
			desc = ep2_wedding.1140.desc_target_spouse
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = wedding_objection_start
	}
	right_portrait = {
		character = scope:fumbling_spouse
		animation = shame
	}

	lower_right_portrait = scope:intent_target

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		root = scope:host
		NOR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		scope:activity.special_guest:spouse_1 = { is_ai = yes }
		scope:activity.special_guest:spouse_2 = { is_ai = yes }
		trigger_if = {
			limit = {
				OR = {
					has_activity_intent = diplomatic_intent
					has_activity_intent = woo_attendee_intent
				}
			}
			intent_target = { is_ai = yes }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			OR = {
				has_activity_intent = diplomatic_intent
				has_activity_intent = woo_attendee_intent
				has_activity_intent = reduce_stress_intent
			}
			add = 2
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity.special_guest:spouse_1 = { save_scope_as = spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = spouse_2 }
		random_list = {
			50 = {
				modifier = {
					scope:spouse_1 = {
						has_trait = shy
					}
					add = 10
				}
				modifier = {
					scope:spouse_1 = {
						has_trait = gregarious
					}
					add = -10
				}
				modifier = {
					scope:spouse_1 = {
						has_trait = calm
					}
					add = -10
				}
				modifier = {
					scope:spouse_1 = {
						has_trait = impatient
					}
					add = 10
				}
				modifier = {
					scope:spouse_1 = {
						has_trait = arrogant
					}
					add = 10
				}
				scope:spouse_1 = { save_scope_as = fumbling_spouse }
			}
			50 = {
				modifier = {
					scope:spouse_2 = {
						has_trait = shy
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = gregarious
					}
					add = -10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = calm
					}
					add = -10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = impatient
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = arrogant
					}
					add = 10
				}
				scope:spouse_2 = { save_scope_as = fumbling_spouse }
			}
		}
		if = {
			limit = {
				OR = {
					has_activity_intent = diplomatic_intent
					has_activity_intent = woo_attendee_intent
				}
			}
			intent_target = { save_scope_as = intent_target }
		}
	}

	# Option A: Try to salvage the situation
	option = {
		name = ep2_wedding.1140.a
		duel = {
			skill = diplomacy
			value = average_skill_rating
			# Success: you recover smoothly
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1140.a.success
				send_interface_toast = {
					title = ep2_wedding.1140.a.success.tt
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = recovered_from_misstep_log
							tags = { good }
							score = 50
							character = root
							target = scope:spouse_1

							root = {
								if = {
									limit = {
										has_lifestyle = diplomacy_lifestyle
									}
									add_diplomacy_lifestyle_xp = major_lifestyle_experience
								}
							}
							if = {
								limit = {
									root = { has_activity_intent = diplomatic_intent }				
								}
								custom_tooltip = ep2_wedding.1140.a.success.tt2
								root.intent_target = {
									add_opinion = {
										target = root
										modifier = impressed_opinion
										opinion = 30
									}
								}
							}
							else_if = {
								limit = {
									root = { has_activity_intent = woo_attendee_intent }
								}
								custom_tooltip = ep2_wedding.1140.a.success.tt2
								root = {
									progress_towards_lover_effect = {
										REASON = lover_impressed_by_smooth_save
										CHARACTER = root.intent_target
										OPINION = 15
									}
								}
							}
							scope:fumbling_spouse = {
								add_opinion = {
									target = root
									modifier = grateful_opinion
									opinion = 20
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						arrogant = medium_stress_impact_loss
						ambitious = medium_stress_impact_loss
						brave = medium_stress_impact_loss
					}
				}
			}
			# Failure: you are publicly embarassed
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1140.a.failure
				send_interface_toast = {
					title = ep2_wedding.1140.a.failure.tt
					left_icon = root
					right_icon = scope:fumbling_spouse
					scope:activity = {
						add_activity_log_entry = {
							key = made_a_misstep_log
							tags = { bad }
							score = 50
							character = scope:spouse_1

							scope:fumbling_spouse = {
								add_opinion = {
									target = root
									modifier = disappointed_opinion
									opinion = -15
								}
							}
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						shy = medium_stress_impact_gain
						ambitious = medium_stress_impact_gain
						paranoid = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				OR = {
					has_activity_intent = diplomatic_intent
					has_activity_intent = woo_attendee_intent
				}
				add = 50
			}
		}
	}

	# Option B: ignore it
	option = {
		name = ep2_wedding.1140.b
		scope:fumbling_spouse = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -15
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
			shy = medium_stress_impact_loss
			callous = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			lazy = medium_stress_impact_loss
		}
		scope:activity = {
			add_activity_log_entry = {
				key = made_a_misstep_log
				tags = { bad }
				score = 50
				character = scope:spouse_1
			}
		}
		ai_chance = {
			base = 100
		}
	}

	# Option C: relax!
	option = {
		name = ep2_wedding.1140.c
		trigger = {
			has_activity_intent = reduce_stress_intent
		}
		custom_tooltip = available_because_intent_tt
		scope:fumbling_spouse = {
			add_opinion = {
				target = root
				modifier = relieved_opinion
				opinion = 20
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		scope:activity = {
			add_activity_log_entry = {
				key = recovered_from_misstep_log
				tags = { good }
				score = 50
				character = root
				target = scope:spouse_1
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_activity_intent = reduce_stress_intent
				add = 100
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
	}
}

##################################################
# Romantic Scouting
# by Claudia Baldassi
# ep2_wedding.1150
##################################################

# Seduction Intent: target scouting

ep2_wedding.1150 = {
	type = activity_event
	title = ep2_wedding.1150.t
	desc = {
		desc = ep2_wedding.1150.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:intent_target = {
						OR = {
							has_trait = shy
							has_trait = compassionate
						}
					}
				}
				desc = ep2_wedding.1150.desc_1
			}
			triggered_desc = {
				trigger = {
					scope:intent_target = {
						OR = {
							has_trait = gluttonous
							has_trait = drunkard
						}
					}
				}
				desc = ep2_wedding.1150.desc_2
			}
			triggered_desc = {
				trigger = {
					scope:intent_target = {
						OR = {
							has_trait = callous
							has_trait = cynical
						}
					}
				}
				desc = ep2_wedding.1150.desc_3
			}
			triggered_desc = {
				trigger = {
					scope:intent_target = {
						has_trait = zealous
					}
				}
				desc = ep2_wedding.1150.desc_4
			}
			desc = ep2_wedding.1150.desc_fallback
		}
		desc = ep2_wedding.1150.desc_conclusion
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = flirtation_left
	}
	right_portrait = {
		character = scope:intent_target
		animation = personality_content
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		has_activity_intent = woo_attendee_intent
		NOR = {
			this = scope:activity.special_guest:spouse_1
			this = scope:activity.special_guest:spouse_2
		}
		NOR = {
			intent_target = scope:activity.special_guest:spouse_1
			intent_target = scope:activity.special_guest:spouse_2
		}
		intent_target = { is_ai = yes }
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		intent_target = {
			save_scope_as = intent_target
			add_character_flag = busy_in_ceremony_event
		}
	}

	# Option A: approach with diplo
	option = {
		name = ep2_wedding.1150.a
		duel = {
			skill = diplomacy
			target = scope:intent_target
			# Success: you make a good impression
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.success
				send_interface_toast = {
					title = ep2_wedding.1150.a.success.tt
					left_icon = root
					right_icon = scope:intent_target
					progress_towards_lover_effect = {
						REASON = lover_impressed_by_talk
						CHARACTER = scope:intent_target
						OPINION = 15
					}
					if = {
						limit = {
							has_lifestyle = diplomacy_lifestyle
						}
						add_diplomacy_lifestyle_xp = major_lifestyle_experience
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						lustful = major_stress_impact_loss					
					}
				}
				scope:activity = {
					add_activity_log_entry = {
						key = seduction_good_impression_log
						tags = { good }
						score = 50
						character = root
						target = scope:intent_target
					}
				}
			}
			# Failure: target is not impress
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.failure
				send_interface_toast = {
					title = ep2_wedding.1150.a.failure.tt
					left_icon = root
					right_icon = scope:intent_target
					scope:intent_target = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -15
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						shy = medium_stress_impact_gain
						lustful = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				diplomacy >= average_skill_level
				add = 50
			}
		}
	}

	# Option B: approach with intrigue
	option = {
		name = ep2_wedding.1150.b
		duel = {
			skill = intrigue
			target = scope:intent_target
			# Success: you make a good impression
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.success
				send_interface_toast = {
					title = ep2_wedding.1150.a.success.tt
					left_icon = root
					right_icon = scope:intent_target
					progress_towards_lover_effect = {
						REASON = lover_impressed_by_talk
						CHARACTER = scope:intent_target
						OPINION = 15
					}
					if = {
						limit = {
							has_lifestyle = intrigue_lifestyle
						}
						add_intrigue_lifestyle_xp = major_lifestyle_experience
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						lustful = major_stress_impact_loss
					}
				}
				scope:activity = {
					add_activity_log_entry = {
						key = seduction_good_impression_log
						tags = { good }
						score = 50
						character = root
						target = scope:intent_target
					}
				}
			}
			# Failure: target is not impress
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.failure
				send_interface_toast = {
					title = ep2_wedding.1150.a.failure.tt
					left_icon = root
					right_icon = scope:intent_target
					scope:intent_target = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -15
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						shy = medium_stress_impact_gain
						lustful = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				intrigue >= average_skill_level
				add = 50
			}
		}
	}

	# Option C: approach with learning
	option = {
		name = ep2_wedding.1150.c
		duel = {
			skill = learning
			target = scope:intent_target
			# Success: you make a good impression
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.success
				send_interface_toast = {
					title = ep2_wedding.1150.a.success.tt
					left_icon = root
					right_icon = scope:intent_target
					progress_towards_lover_effect = {
						REASON = lover_impressed_by_talk
						CHARACTER = scope:intent_target
						OPINION = 15
					}
					if = {
						limit = {
							has_lifestyle = learning_lifestyle
						}
						add_learning_lifestyle_xp = major_lifestyle_experience
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						lustful = major_stress_impact_loss
					}
				}
				scope:activity = {
					add_activity_log_entry = {
						key = seduction_good_impression_log
						tags = { good }
						score = 50
						character = root
						target = scope:intent_target
					}
				}
			}
			# Failure: target is not impress
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1150.a.failure
				send_interface_toast = {
					title = ep2_wedding.1150.a.failure.tt
					left_icon = root
					right_icon = scope:intent_target
					scope:intent_target = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -15
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						shy = medium_stress_impact_gain
						lustful = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				learning >= average_skill_level
				add = 50
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:intent_target = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# Gatecrashers
# by Claudia Baldassi
# ep2_wedding.1160
##################################################

# Some pesants are at the gate of the festivity - what do you do?

ep2_wedding.1160 = {
	type = activity_event
	title = ep2_wedding.1160.t
	desc = ep2_wedding.1160.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = schadenfreude
	}

	lower_right_portrait = scope:host

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		has_activity_intent = banquet_mischief_intent
		NOR = {
			this = scope:activity.special_guest:spouse_1
			this = scope:activity.special_guest:spouse_2
		}
		scope:activity = {
			NOT = {
				has_variable = has_had_1160_event
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_1160_event
		}
	}

	# Option A: let the peasants in
	option = {
		name = ep2_wedding.1160.a
		flavor = ep2_wedding.1160.a.tt
		# for the follow-up event
		root = {
			save_scope_as = mischief_maker
		}
		scope:host = { trigger_event = ep2_wedding.1161 }
		stress_impact = {
			base = minor_stress_impact_loss
			wrathful = medium_stress_impact_loss
			impatient = medium_stress_impact_loss
			arrogant = medium_stress_impact_loss
			deceitful = major_stress_impact_loss
			arbitrary = major_stress_impact_loss
			callous = major_stress_impact_loss
			fickle = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = deceitful
				add = 50
			}
			modifier = {
				has_trait = arbitrary
				add = 50
			}
			modifier = {
				has_trait = callous
				add = 50
			}
			modifier = {
				has_trait = fickle
				add = 50
			}
		}
	}

	# Option B: smuggle food to the pesants
	option = {
		name = ep2_wedding.1160.b
		flavor = ep2_wedding.1160.b.tt
		stress_impact = {
			base = minor_stress_impact_loss
			gluttonous = medium_stress_impact_loss
			diligent = medium_stress_impact_loss
			generous = major_stress_impact_loss
			humble = major_stress_impact_loss
			gregarious = major_stress_impact_loss
			compassionate = massive_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = generous
				add = 50
			}
			modifier = {
				has_trait = humble
				add = 50
			}
			modifier = {
				has_trait = gregarious
				add = 50
			}
			modifier = {
				has_trait = compassionate
				add = 50
			}
		}
	}

	# Option C: this is below me
	option = {
		name = ep2_wedding.1160.c	
		stress_impact = {
			greedy = minor_stress_impact_loss
			temperate = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
			honest = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = lazy
				add = 50
			}
			modifier = {
				has_trait = honest
				add = 50
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
	}
}

# Follow-up for the host

ep2_wedding.1161 = {
	type = activity_event
	title = ep2_wedding.1160.t
	desc = ep2_wedding.1161.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = anger
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
	}

	# Option A: kick them out!
	option = {
		name = ep2_wedding.1161.a
		duel = {
			skill = martial
			value = average_skill_rating
			50 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1161.success
				send_interface_toast = {
					title = ep2_wedding.1161.success.tt
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_peasant_invasion_managed_log
							tags = { good }
							score = 20
							character = root

							root = {
								add_character_modifier = {
									modifier = wedding_enforced_security_modifier
									years = 10
								}
							}
						}
					}

					stress_impact = {
						base = minor_stress_impact_loss
						wrathful = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						callous = major_stress_impact_loss
						paranoid = massive_stress_impact_loss
					}
				}
				scope:mischief_maker = {
					send_interface_toast = {
						title = ep2_wedding.1161.success.tt2
						left_icon = root
					}
				}
			}
			50 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1161.failure
				send_interface_toast = {
					title = ep2_wedding.1161.failure.tt
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_peasant_invasion_not_managed_log
							tags = { bad }
							score = 20
							character = root

							root = {
								add_character_modifier = {
									modifier = wedding_peasants_overrun_modifier
									years = 10
								}
							}
						}
					}
					stress_impact = {
						wrathful = medium_stress_impact_gain
						arrogant = medium_stress_impact_gain
						callous = medium_stress_impact_gain
						paranoid = major_stress_impact_gain
					}
				}
				scope:mischief_maker = {
					send_interface_toast = {
						title = ep2_wedding.1161.failure.tt2
						left_icon = root
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	# Option B: let them stay
	option = {
		name = ep2_wedding.1161.b
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_peasant_invasion_stay_log
				tags = { bad }
				score = 20
				character = root

				root.location.county = {
					add_county_modifier = {
						modifier = wedding_peasants_connections_county_modifier
						years = 10
					}
				}
			}
		}
		if = {
			limit = {
				has_activity_intent = reduce_stress_intent
			}
			stress_impact = {
				base = medium_stress_impact_loss
			}
		}
		else = {
			stress_impact = {
				generous = medium_stress_impact_loss
				humble = medium_stress_impact_loss
				gregarious = medium_stress_impact_loss
				compassionate = medium_stress_impact_loss
				paranoid = medium_stress_impact_gain
				greedy = medium_stress_impact_gain
			}
		}
		scope:mischief_maker = {
			send_interface_toast = {
				title = ep2_wedding.1161.b.tt
				left_icon = root
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				add = 50
			}
			modifier = {
				has_trait = gregarious
				add = 50
			}
			modifier = {
				has_trait = humble
				add = 50
			}
			modifier = {
				has_trait = generous
				add = 50
			}
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
	}
}

##################################################
# The Parade
# by Claudia Baldassi
# ep2_wedding.1170
##################################################

# A spouse has arrived with a whole parade. Interact with it

ep2_wedding.1170 = {
	type = activity_event
	title = ep2_wedding.1170.t
	desc = {
		desc = ep2_wedding.1170.desc
		triggered_desc = {
			trigger = {
				has_activity_intent = reduce_stress_intent
			}
			desc = ep2_wedding.1170.desc_relax
		}
		triggered_desc = {
			trigger = {
				has_activity_intent = banquet_mischief_intent
			}
			desc = ep2_wedding.1170.desc_mischief
		}
		triggered_desc = {
			trigger = {
				has_activity_intent = murder_attendee_intent
			}
			desc = ep2_wedding.1170.desc_murder
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = ecstasy
	}
	lower_center_portrait = scope:rich_spouse
	lower_right_portrait = scope:murderee

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		scope:activity = {
			has_activity_option = {
				category = wedding_option_decoration
				option = wedding_decoration_good
			}
		}
		NOR = {
			this = scope:activity.special_guest:spouse_1
			this = scope:activity.special_guest:spouse_2
		}
		OR = {
			scope:activity.special_guest:spouse_1 = {
				NOT = { is_close_or_extended_family_of = root }
				is_lowborn = no
				is_ai = yes
				location = scope:activity.activity_location
			}
			scope:activity.special_guest:spouse_2 = {
				NOT = { is_close_or_extended_family_of = root }
				is_lowborn = no
				is_ai = yes
				location = scope:activity.activity_location
			}
		}
		NOT = {
			scope:activity = {
				has_variable = has_had_event_1170
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			OR = {
				has_activity_intent = reduce_stress_intent
				has_activity_intent = banquet_mischief_intent
			}
			add = 2
		}
		modifier = {
			has_activity_intent = murder_attendee_intent
			add = 1
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_event_1170
		}
		random_list = {
			50 = {
				trigger = {
					scope:activity.special_guest:spouse_1 = {
						NOT = { is_close_or_extended_family_of = root }
						is_lowborn = no
						is_ai = yes
					}
				}
				scope:activity.special_guest:spouse_1 = { save_scope_as = rich_spouse }
			}
			50 = {
				trigger = {
					scope:activity.special_guest:spouse_2 = {
						NOT = { is_close_or_extended_family_of = root }
						is_lowborn = no
						is_ai = yes
					}
				}
				scope:activity.special_guest:spouse_2 = { save_scope_as = rich_spouse }
			}
		}
		if = {
			limit = {
				has_activity_intent = murder_attendee_intent
			}
			intent_target = {
				save_scope_as = murderee
				add_character_flag = busy_in_ceremony_event
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_parade_arrival_log
				tags = { good }
				score = 20
				character = scope:rich_spouse
			}
		}
	}

	# Option A: Pocket some horseshoes
	option = {
		name = ep2_wedding.1170.a
		flavor = ep2_wedding.1170.a.tt
		add_gold = minor_gold_value
		stress_impact = {
			greedy = medium_stress_impact_loss
			generous = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	# Option B: What a show
	option = {
		name = ep2_wedding.1170.b
		trigger = {
			NOT = {
				has_activity_intent = reduce_stress_intent
			}
		}
		flavor = ep2_wedding.1170.b.tt
		stress_impact = {
			base = minor_stress_impact_loss
			generous = medium_stress_impact_loss
			compassionate = medium_stress_impact_loss
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	# Option C: Enjoy the show
	option = {
		name = ep2_wedding.1170.c
		trigger = {
			has_activity_intent = reduce_stress_intent
		}
		custom_tooltip = available_because_intent_tt
		stress_impact = {
			base = medium_stress_impact_loss
			humble = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			gregarious = major_stress_impact_loss
			trusting = major_stress_impact_loss
			generous = major_stress_impact_loss
		}
		ai_chance = {
			base = 200
		}
	}

	# Option D: mayhem
	option = {
		name = ep2_wedding.1170.d
		trigger = {
			has_activity_intent = banquet_mischief_intent
		}
		custom_tooltip = available_because_intent_tt
		add_character_modifier = {
			modifier = wedding_parade_mayhem_modifier
			years = 5
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 200
		}
	}

	# Option E: try to kill
	option = {
		name = ep2_wedding.1170.e
		trigger = {
			has_activity_intent = murder_attendee_intent
		}
		flavor = ep2_wedding.1170.e.tt
		custom_tooltip = available_because_intent_tt
		duel = {
			skills = { intrigue prowess }
			target = scope:murderee
			40 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1170.success
				send_interface_toast = {
					title = ep2_wedding.1170.success.tt
					left_icon = root
					right_icon = scope:murderee
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_parade_death_log
							tags = { good }
							score = 20
							character = scope:rich_spouse
							target = scope:murderee
						}
					}		
					scope:murderee = {
						death = {
							killer = root
							death_reason = death_plotting
						}
					}
					complete_activity_intent = yes
					stress_impact = {
						base = minor_stress_impact_loss
						vengeful = medium_stress_impact_loss
						paranoid = medium_stress_impact_loss
						deceitful = medium_stress_impact_loss
					}
				}
			}
			60 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1170.failure
				send_interface_toast = {
					title = ep2_wedding.1170.failure.tt
					left_icon = root
					right_icon = scope:murderee
					stress_impact = {
						base = minor_stress_impact_gain
						vengeful = medium_stress_impact_gain
						paranoid = medium_stress_impact_gain
						deceitful = medium_stress_impact_gain
					}
				}
			}
		}
		
		ai_chance = {
			base = 200
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		if = {
			limit = {
				intent_target ?= { has_character_flag = busy_in_ceremony_event }
			}
			intent_target = { remove_character_flag = busy_in_ceremony_event }
		}
	}
}

##################################################
# A Bad Match
# by Claudia Baldassi
# ep2_wedding.1180
##################################################

# Your spouse doesn't really like you...

ep2_wedding.1180 = {
	type = activity_event
	title = ep2_wedding.1180.t
	desc = ep2_wedding.1180.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:other_spouse
		animation = disgust
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		OR = {
			root.betrothed ?= {
				trait_compatibility = {
					target = root
					value <= low_negative_trait_compatibility
				}
			}
			root.betrothed ?= {
				save_temporary_opinion_value_as = {
					name = target_opinion
					target = root
				}
				scope:target_opinion < 0
			}
		}
		root.betrothed ?= {
			has_any_good_relationship_with_root_trigger = no
			is_ai = yes
		}
	}


	weight_multiplier = {
		base = 1
		modifier = {
			betrothed = { has_any_bad_relationship_with_root_trigger = yes }
			add = 1
		}
		modifier = {
			betrothed = { has_trait = fickle }
			add = 1
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		betrothed = {
			save_scope_as = other_spouse
			add_character_flag = busy_in_ceremony_event
		}
		scope:activity = { set_variable = has_had_event_1180 }
	}

	# Option A: it doesn't matter
	option = {
		name = ep2_wedding.1180.a
		add_character_modifier = {
			modifier = wedding_political_mentality_modifier
			years = 10
		}
		scope:other_spouse = {
			add_opinion = {
				target = root
				modifier = hurt_opinion
				opinion = -20
			}
		}
		stress_impact = {
			humble = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			callous = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 50
			}
			modifier = {
				has_trait = callous
				add = 50
			}
		}
	}

	# Option B: I'll make you like me!
	option = {
		name = ep2_wedding.1180.b
		if = {
			limit = {
				has_activity_intent = woo_attendee_intent
				intent_target = scope:other_spouse
			}
			progress_towards_lover_effect = {
				CHARACTER = scope:other_spouse
				REASON = lover_wedding_trying_hard
				OPINION = default_lover_opinion
			}
		}
		else_if = {
			limit = {
				can_start_scheme = {
					type = seduce
					target_character = scope:other_spouse
				}
			}
			start_scheme = {
				type = seduce
				target_character = scope:other_spouse
			}
		}
		else_if = {		
			limit = {
				any_scheme = {
					type = seduce
					scheme_target_character = scope:other_spouse
				}
			}
			random_scheme = {
				type = seduce
				limit = {
					scheme_target_character = scope:other_spouse
				}
				add_scheme_progress = scheme_progress_gain
			}
		}
		else = {
			scope:other_spouse = {
				add_opinion = {
					target = root
					modifier = making_an_effort_opinion
				}
			}
		}
		if = {
			limit = {
				scope:other_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:other_spouse
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
			lustful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = lustful
				add = 50
			}
		}
	}

	# Option C: don't care!
	option = {
		name = ep2_wedding.1180.c
		trigger = {
			has_activity_intent = reduce_stress_intent
		}
		custom_tooltip = available_because_intent_tt
		scope:other_spouse = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		stress_impact = {
			base = major_stress_impact_loss
		}
		ai_chance = {
			base = 150
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:other_spouse = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# Religious Complaints
# by Claudia Baldassi
# ep2_wedding.1190
##################################################

# Religious guest complains about lavishness, luxury, wastes, and unchaste mingling

ep2_wedding.1190 = {
	type = activity_event
	title = ep2_wedding.1190.t
	desc = ep2_wedding.1190.desc
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = dismissal
	}
	right_portrait = {
		character = scope:grumbler
		animation = personality_zealous
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = {
			root = scope:host
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		scope:activity = {
			any_attending_character = {
				NOR = {
					this = root
					this = scope:host
				}
				OR = {
					this = root.faith.religious_head
					has_trait = devoted
					has_trait = theologian
					has_trait = zealous
				}
				faith = {
					NOR = {
						trait_is_virtue = lustful
						trait_is_virtue = gluttonous
					}
				}
			}
			NOT = {
				has_variable = has_had_1190
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		scope:activity = {
			set_variable = has_had_1190
			random_attending_character = {
				limit = {
					NOR = {
						this = root
						this = scope:host
					}
					this = root.faith.religious_head
					faith = {
						NOR = {
							trait_is_virtue = lustful
							trait_is_virtue = gluttonous
						}
					}
				}
				alternative_limit = {
					NOR = {
						this = root
						this = scope:host
					}
					has_trait = devoted
					faith = {
						NOR = {
							trait_is_virtue = lustful
							trait_is_virtue = gluttonous
						}
					}
				}
				alternative_limit = {
					NOR = {
						this = root
						this = scope:host
					}
					has_trait = theologian
					faith = {
						NOR = {
							trait_is_virtue = lustful
							trait_is_virtue = gluttonous
						}
					}
				}
				alternative_limit = {
					NOR = {
						this = root
						this = scope:host
					}
					has_trait = zealous
					faith = {
						NOR = {
							trait_is_virtue = lustful
							trait_is_virtue = gluttonous
						}
					}
				}
				save_scope_as = grumbler
				add_character_flag = busy_in_ceremony_event
			}
			add_activity_log_entry = {
				key = wedding_religious_complaints_log
				tags = { bad }
				score = 20
				character = scope:grumbler
			}
		}
	}

	# Option A: repent
	option = {
		name = ep2_wedding.1190.a
		scope:grumbler = {
			add_opinion = {
				target = root
				modifier = pious_opinion
				opinion = 20
			}
		}
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						has_trait = zealous
					}
				}
			}
			scope:activity = {
				every_attending_character = {
					limit = {
						has_trait = zealous
						this != scope:grumbler
						this != root
					}
					custom = every_zealous_attending_character
					add_opinion = {
						target = root
						modifier = pious_opinion
						opinion = 5
					}
				}
			}
		}
		if = {
			limit = {
				has_lifestyle = learning_lifestyle
			}
			add_learning_lifestyle_xp = medium_lifestyle_experience
		}
		stress_impact = {
			zealous = medium_stress_impact_loss
			humble = minor_stress_impact_loss
			temperate = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			cynical = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			gluttonous = medium_stress_impact_gain
			lustful = medium_stress_impact_gain
			drunkard = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1.5
			}
		}
	}

	# Option B: kick them out
	option = {
		name = ep2_wedding.1190.b
		trigger = {
			root = scope:host
		}
		scope:grumbler = {
			remove_from_activity = scope:activity
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:grumbler
			REASON = rival_kicked_out_priest
			OPINION = default_rival_opinion
		}
		stress_impact = {
			zealous = major_stress_impact_gain
			cynical = medium_stress_impact_loss
			arrogant = medium_stress_impact_loss
			gluttonous = medium_stress_impact_loss
			lustful = medium_stress_impact_loss
			drunkard = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = gluttonous
				add = 25
			}
			modifier = {
				has_trait = lustful
				add = 50
			}
			modifier = {
				has_trait = cynical
				add = 50
			}
			modifier = {
				has_trait = drunkard
				add = 50
			}
		}
	}

	# Option C: ignore
	option = {
		name = ep2_wedding.1190.c
		scope:grumbler = {
			add_opinion = {
				target = root
				modifier = ignored_opinion
				opinion = -5
			}
		}
		stress_impact = {
			zealous = medium_stress_impact_gain
			cynical = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			gluttonous = minor_stress_impact_loss
			lustful = minor_stress_impact_loss
			drunkard = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	# Option D: yes, and I will enjoy it too!
	option = {
		name = ep2_wedding.1190.d
		trigger = {
			OR = {
				has_activity_intent = reduce_stress_intent
				has_activity_intent = woo_attendee_intent
				has_activity_intent = banquet_mischief_intent
			}
		}
		custom_tooltip = available_because_intent_tt
		scope:grumbler = {
			add_opinion = {
				target = root
				modifier = annoyed_opinion
				opinion = -20
			}
		}
		if = {
			limit = {
				has_activity_intent = woo_attendee_intent
				intent_target = {
					NOR = {
						this = scope:grumbler
						has_trait = zealous
					}
				}
			}
			root = {
				progress_towards_lover_effect = {
					CHARACTER = root.intent_target
					REASON = lover_daring_move
					OPINION = default_lover_opinion
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 200
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:grumbler = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# A Parent's Heart
# by Claudia Baldassi
# ep2_wedding.1200
##################################################

# Proud parent watches everything go well and brags with intent target/friend/rival/neighbor

ep2_wedding.1200 = {
	type = activity_event
	title = ep2_wedding.1200.t
	desc = {
		desc = ep2_wedding.1200.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_activity_intent = woo_attendee_intent
						has_activity_intent = diplomatic_intent
						has_activity_intent = matchmaking_intent
						scope:listener = { has_relation_rival = root }
						scope:listener = { has_relation_potential_rival = root}
					}
				}
				desc = ep2_wedding.1200.desc_interest
			}
			desc = ep2_wedding.1200.desc_generic
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = wedding_happy_cry
	}
	center_portrait = {
		character = scope:my_child
		animation = wrestling_victory
	}
	right_portrait = {
		character = scope:listener
		animation = boredom
	}
	lower_left_portrait = scope:my_child
	lower_center_portrait = scope:intent_target

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		OR = {
			scope:activity.special_guest:spouse_1 = { is_child_of = root }
			scope:activity.special_guest:spouse_2 = { is_child_of = root }
		}
		# Incest alert
		NOR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		scope:activity = {
			any_attending_character = {
				NOR = {
					this = root
					this = scope:activity.special_guest:spouse_1
					this = scope:activity.special_guest:spouse_2
				}
			}
		}
		trigger_if = {
			limit = {
				has_activity_intent = matchmaking_intent
			}
			OR = {
				root.intent_target = { has_variable = wedding_good_match }
				scope:activity = {
					any_attending_character = {
						is_ai = yes
						location = root.location
						can_marry_character_trigger = { CHARACTER = root.intent_target }
						NOR = {
							exists = betrothed
							has_character_flag = busy_in_wgathering_event
							is_close_or_extended_family_of = root.intent_target
							root.intent_target.var:wedding_no_match ?= this
						}
						trigger_if = {
							limit = {
								is_female = yes
							}
							age < marriage_female_fertility_cutoff_age_value
						}
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = woo_attendee_intent
			add = 1
		}
		modifier = {
			has_activity_intent = diplomatic_intent
			add = 1
		}
		modifier = {
			has_activity_intent = matchmaking_intent
			add = 1
		}
		modifier = {
			root = scope:host
			add = 2
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { is_child_of = root }
			}
			scope:activity.special_guest:spouse_1 = { save_scope_as = my_child }
		}
		else = {
			scope:activity.special_guest:spouse_2 = { save_scope_as = my_child }
		}
		if = {
			limit = {
				OR = {
					has_activity_intent = woo_attendee_intent
					has_activity_intent = diplomatic_intent
				}
			}
			intent_target = { save_scope_as = listener }
		}
		else_if = {
			limit = {
				has_activity_intent = matchmaking_intent
				intent_target = { has_variable = wedding_good_match }
			}
			intent_target.var:wedding_good_match = { save_scope_as = listener }
		}
		else_if = {
			limit = {
				has_activity_intent = matchmaking_intent
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						is_ai = yes
						location = root.location
						can_marry_character_trigger = { CHARACTER = root.intent_target }
						NOR = {
							exists = betrothed
							has_character_flag = busy_in_wgathering_event
							is_close_or_extended_family_of = root.intent_target
							root.intent_target.var:wedding_no_match ?= this
						}
						trigger_if = {
							limit = {
								is_female = yes
							}
							age < marriage_female_fertility_cutoff_age_value
						}
					}
					save_scope_as = listener
				}
			}
		}
		else_if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						OR = {
							has_relation_friend = root
							has_relation_rival = root
							has_relation_lover = root
							has_relation_potential_friend = root
							has_relation_potential_rival = root
							has_relation_potential_lover = root
						}
						NOR = {
							this = scope:my_child
							this = scope:my_child.betrothed
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						OR = {
							has_relation_friend = root
							has_relation_rival = root
							has_relation_lover = root
							has_relation_potential_friend = root
							has_relation_potential_rival = root
							has_relation_potential_lover = root
						}
						NOR = {
							this = scope:my_child
							this = scope:my_child.betrothed
						}
					}
					save_scope_as = listener
				}
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							this = root
							this = scope:my_child
							this = scope:my_child.betrothed
						}
					}
					save_scope_as = listener
				}
			}
		}
		scope:listener = { add_character_flag = busy_in_ceremony_event }
		if = {
			limit = {
				has_activity_intent = matchmaking_intent
			}
			intent_target = { save_scope_as = intent_target }
		}
	}

	# Option A: So proud
	option = {
		name = ep2_wedding.1200.a
		add_prestige = minor_prestige_gain
		dynasty ?= { add_dynasty_prestige = minor_dynasty_prestige_gain }
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_any_good_relationship_with_character_trigger = { CHARACTER = scope:listener }
				add = 50
			}
		}
	}

	# Option B: Aren't you jealous
	option = {
		name = ep2_wedding.1200.b
		if = {
			limit = {
				can_set_relation_rival_trigger = { CHARACTER = scope:listener }
			}
			progress_towards_rival_effect = {
				CHARACTER = scope:listener
				REASON = rival_rubbed_it_in
				OPINION = default_rival_opinion
			}
		}
		else_if = {
			limit = {
				has_relation_rival = scope:listener
				num_of_relation_nemesis = 0
			}
			set_relation_nemesis = {
				target = scope:listener
				reason = rival_rubbed_it_in
			}
		}
		else = {
			reverse_add_opinion = {
				target = scope:listener
				modifier = annoyed_opinion
				opinion = -15
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_gloating_log
				tags = { bad }
				score = 20
				character = root
				target = scope:listener
			}
		}
		stress_impact = {
			vengeful = medium_stress_impact_loss
			callous = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
			deceitful = medium_stress_impact_loss
			paranoid = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:listener }
				add = 50
			}
			modifier = {
				has_trait = vengeful
				add = 25
			}
			modifier = {
				has_trait = callous
				add = 25
			}
		}
	}

	# Option C: Woo - what about *us*
	option = {
		name = ep2_wedding.1200.c
		trigger = {
			has_activity_intent = woo_attendee_intent
		}
		custom_tooltip = available_because_intent_tt
		duel = {
			skill = intrigue
			target = scope:listener
			50 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					scope:listener = { has_trait = lustful }
					add = 15
				}
				desc = ep2_wedding.1200.success
				send_interface_toast = {
					title = ep2_wedding.1200.success.tt
					left_icon = root
					right_icon = scope:listener
					progress_towards_lover_effect = {
						CHARACTER = scope:listener
						REASON = lover_love_is_in_the_air
						OPINION = default_lover_opinion
					}
					stress_impact = {
						base = minor_stress_impact_loss
						lustful = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
					}
				}
			}
			50 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					scope:listener = { has_trait = chaste }
					add = 15
				}
				desc = ep2_wedding.1200.failure
				send_interface_toast = {
					title = ep2_wedding.1200.failure.tt
					left_icon = root
					right_icon = scope:listener
					scope:listener = {
						add_opinion = {
							target = root
							modifier = awkward_opinion
							opinion = -10
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						lustful = medium_stress_impact_gain
						arrogant = medium_stress_impact_gain
					}
				}
			}
		}

		ai_chance = {
			base = 200
		}
	}

	# Option D: Diplo: impressive show of power
	option = {
		name = ep2_wedding.1200.d
		flavor = ep2_wedding.1200.d.tt
		trigger = {
			has_activity_intent = diplomatic_intent
		}
		custom_tooltip = available_because_intent_tt
		duel = {
			skill = diplomacy
			target = scope:listener
			40 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					root = scope:host
					add = 10
				}
				modifier = {
					scope:listener = { has_trait = trusting }
					add = 10
				}
				desc = ep2_wedding.1200.success
				send_interface_toast = {
					title = ep2_wedding.1200.success.tt
					left_icon = root
					right_icon = scope:listener
					complete_activity_intent = yes
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_alliance_log
							tags = { good }
							score = 20
							character = root
							target = scope:listener

							root = {
								create_alliance = {
									target = scope:listener
									allied_through_owner = root
									allied_through_target = scope:listener
								}
							}
							scope:listener = {
								add_opinion = {
									target = root
									modifier = event_negotiated_alliance_opinion
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_loss
					}
				}
			}
			60 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					scope:listener = { has_trait = paranoid }
					add = 20
				}
				desc = ep2_wedding.1200.failure
				send_interface_toast = {
					title = ep2_wedding.1200.failure.tt
					left_icon = root
					right_icon = scope:listener
					stress_impact = {
						base = minor_stress_impact_gain
						ambitious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	# Option E: Matchmaking: if only I could do the same for X
	option = {
		name = ep2_wedding.1200.e
		trigger = {
			has_activity_intent = matchmaking_intent
		}
		custom_tooltip = available_because_intent_tt
		duel = {
			skills = { diplomacy intrigue }
			target = scope:listener
			50 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1200.e.success
				send_interface_toast = {
					title = ep2_wedding.1200.e.success
					left_icon = root
					right_icon = scope:listener
					custom_tooltip = ep2_wedding.1200.e.success.tt
					if = {
						limit = {
							intent_target = {
								NOT = {
									has_variable = wedding_good_match
								}
							}
						}
						intent_target = {
							set_variable = {
								name = wedding_good_match
								value = scope:listener
							}
						}
					}
					else = {
						intent_target = {
							create_betrothal = scope:listener
						}
					}
					scope:listener = {
						add_opinion = {
							target = root
							modifier = flattered_opinion
							opinion = 15
						}
					}
					scope:listener = {
						add_opinion = {
							target = scope:intent_target
							modifier = flattered_opinion
							opinion = 15
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						family_first = medium_stress_impact_loss
						arrogant = medium_stress_impact_loss
						gregarious = medium_stress_impact_loss
					}
				}
			}
			50 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1200.e.failure
				send_interface_toast = {
					title = ep2_wedding.1200.e.failure
					left_icon = root
					right_icon = scope:listener
					intent_target = {
						set_variable = {
							name = wedding_no_match
							value = scope:listener
						}
					}
					scope:listener = {
						add_opinion = {
							target = root
							modifier = insult_opinion
							opinion = -10
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						family_first = medium_stress_impact_gain
						arrogant = medium_stress_impact_gain
						gregarious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:listener = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# Political Talk
# by Claudia Baldassi
# ep2_wedding.1210
##################################################

# Political talk with a fellow ruler

ep2_wedding.1210 = {
	type = activity_event
	title = ep2_wedding.1210.t
	desc = {
		desc = ep2_wedding.1210.desc
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:talk_to.gold < 0
				}
				desc = ep2_wedding.1210.desc_gold
			}
			triggered_desc = {
				trigger = {
					scope:talk_to = {
						OR = {
							has_trait = shy
							has_trait = craven
						}
					}
				}
				desc = ep2_wedding.1210.desc_fear
			}
			triggered_desc = {
				trigger = {
					scope:talk_to = {
						any_sub_realm_county = {
							any_county_province = {
								has_province_modifier = recently_looted_modifier
							}
						}
					}
				}
				desc = ep2_wedding.1210.desc_raids
			}
			triggered_desc = {
				trigger = {
					scope:talk_to = {
						OR = {
							any_relation = {
								type = rival
							}
							has_trait = paranoid
						}
					}
				}
				desc = ep2_wedding.1210.desc_rivals
			}
			triggered_desc = {
				trigger = {
					scope:talk_to = {
						age > 65
					}
				}
				desc = ep2_wedding.1210.desc_age
			}
			desc = ep2_wedding.1210.desc_bad_harvest
			desc = ep2_wedding.1210.desc_rain
			desc = ep2_wedding.1210.desc_enemies
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:talk_to
		animation = thinking
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		is_landed = yes
		has_activity_intent = diplomatic_intent
		intent_target = {
			is_landed = yes
			NOT = { is_vassal_of = root }
			is_ai = yes
			NOR = {
				this = scope:activity.special_guest:spouse_1
				this = scope:activity.special_guest:spouse_2
			}
		}
		NOR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		intent_target = {
			save_scope_as = talk_to
			add_character_flag = busy_in_ceremony_event
		}
	}

	# Option A: gain hook
	option = {
		name = ep2_wedding.1210.a
		trigger = {
			can_add_hook = {
				target = scope:talk_to
				type = threat_hook
			}
		}
		duel = {
			skill = intrigue
			target = scope:talk_to
			50 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					has_trait = schemer
					add = 10
				}
				modifier = {
					has_trait = torturer
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = lazy }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = craven }
					add = 20
				}
				desc = ep2_wedding.1210.a.success
				send_interface_toast = {
					title = ep2_wedding.1210.a.success
					left_icon = root
					right_icon = scope:talk_to
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_intimidation_log
							tags = { good }
							score = 20
							character = root
							target = scope:talk_to

							root = {
								add_hook = {
									target = scope:talk_to
									type = threat_hook
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						deceitful = medium_stress_impact_loss
						sadistic = medium_stress_impact_loss
						ambitious = medium_stress_impact_loss
					}
				}
			}
			50 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					scope:talk_to = { has_trait = torturer }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = brave }
					add = 20
				}
				desc = ep2_wedding.1210.a.failure
				send_interface_toast = {
					title = ep2_wedding.1210.a.failure
					left_icon = root
					right_icon = scope:talk_to
					reverse_add_opinion = {
						target = scope:talk_to
						modifier = threatened_opinion
						opinion = -20
					}
					stress_impact = {
						base = minor_stress_impact_gain
						deceitful = medium_stress_impact_gain
						sadistic = medium_stress_impact_gain
						ambitious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	# Option B: gain alliance
	option = {
		name = ep2_wedding.1210.b
		duel = {
			skill = diplomacy
			target = scope:talk_to
			40 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					has_trait = diplomat
					add = 20
				}
				modifier = {
					has_trait = august
					add = 10
				}
				modifier = {
					scope:talk_to = { has_trait = lazy }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = trusting }
					add = 20
				}
				desc = ep2_wedding.1210.b.success
				send_interface_toast = {
					title = ep2_wedding.1210.b.success
					left_icon = root
					right_icon = scope:talk_to
					complete_activity_intent = yes
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_alliance_log
							tags = { good }
							score = 20
							character = root
							target = scope:talk_to

							root = {
								create_alliance = {
									target = scope:talk_to
									allied_through_owner = root
									allied_through_target = scope:talk_to
								}
							}
							scope:talk_to = {
								add_opinion = {
									target = root
									modifier = event_negotiated_alliance_opinion
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_loss
						gregarious = medium_stress_impact_loss
					}
				}
			}
			60 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					scope:talk_to = { has_trait = diplomat }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = august }
					add = 10
				}
				modifier = {
					scope:talk_to = { has_trait = paranoid }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = shy }
					add = 20
				}
				desc = ep2_wedding.1210.b.failure
				send_interface_toast = {
					title = ep2_wedding.1210.b.failure
					left_icon = root
					right_icon = scope:talk_to
					scope:talk_to = {
						add_opinion = {
							target = root
							modifier = suspicion_opinion
							opinion = -10
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						ambitious = medium_stress_impact_gain
						gregarious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	# Option C: subjugate
	option = {
		name = ep2_wedding.1210.c
		trigger = {
			scope:talk_to = { activity_wedding_diplomatic_intent_impressible_target = yes }
		}
		duel = {
			skills = { diplomacy intrigue }
			target = scope:talk_to
			30 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					has_trait = diplomat
					add = 20
				}
				modifier = {
					has_trait = august
					add = 10
				}
				modifier = {
					scope:talk_to = { has_trait = trusting }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = craven }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = shy }
					add = 20
				}
				desc = ep2_wedding.1210.c.success
				send_interface_toast = {
					title = ep2_wedding.1210.c.success
					left_icon = root
					right_icon = scope:talk_to
					complete_activity_intent = yes
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_fealty_log
							tags = { good }
							score = 20
							character = root
							target = scope:talk_to

							root = {
								create_title_and_vassal_change = {
									type = swear_fealty
									save_scope_as = title_change
									add_claim_on_loss = no
								}
								scope:talk_to = {
									change_liege = {
										liege = root
										change = scope:title_change
									}
								}
								resolve_title_and_vassal_change = scope:title_change
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = major_stress_impact_loss
					}
				}
			}
			70 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					scope:talk_to = { has_trait = diplomat }
					add = 20
				}
				modifier = {
					scope:talk_to = { has_trait = august }
					add = 10
				}
				modifier = {
					scope:talk_to = { has_trait = paranoid }
					add = 20
				}
				desc = ep2_wedding.1210.c.failure
				send_interface_toast = {
					title = ep2_wedding.1210.c.failure
					left_icon = root
					right_icon = scope:talk_to
					scope:talk_to = {
						add_opinion = {
							target = root
							modifier = suspicion_opinion
							opinion = -20
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						ambitious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:talk_to = { remove_character_flag = busy_in_ceremony_event }
	}
}

##################################################
# Poisonous Relations
# by Claudia Baldassi
# ep2_wedding.1220
##################################################

# In-laws are bullies (or other close relatives)

scripted_trigger wedding_1220_valid_relative_trigger = {
	is_ai = yes
	is_adult = yes
	is_close_family_of = $RELATIVE_SPOUSE$
	NOT = { is_close_family_of = $NON_RELATIVE_SPOUSE$ }
	NOR = {
		this = $RELATIVE_SPOUSE$
		this = $NON_RELATIVE_SPOUSE$
	}
	OR = {
		# They enjoy making people feel inadequate
		has_trait = deceitful
		has_trait = vengeful
		has_trait = callous
		has_trait = torturer
		has_trait = greedy
		has_trait = sadistic
		# Their family is marrying down
		highest_held_title_tier > $NON_RELATIVE_SPOUSE$.highest_held_title_tier
		$RELATIVE_SPOUSE$.highest_held_title_tier > $NON_RELATIVE_SPOUSE$.highest_held_title_tier
		# They are feuding
		house_has_feud_relation_with_trigger = { TARGET = $NON_RELATIVE_SPOUSE$ }
		# They already didn't like you
		has_any_bad_relationship_with_character_trigger = { CHARACTER = $NON_RELATIVE_SPOUSE$ }
		opinion = {
			target = $NON_RELATIVE_SPOUSE$
			value <= -25
		}
		# They think you are a criminal
		has_imprisonment_reason = $NON_RELATIVE_SPOUSE$
		# Or a miscreant
		faith = {
			NOR = {
				this = $NON_RELATIVE_SPOUSE$.faith
				faith_hostility_level = {
					target = $NON_RELATIVE_SPOUSE$.faith
					value = 0 # Accepted
				}
			}
		}
	}
}

ep2_wedding.1220 = {
	type = activity_event
	title = ep2_wedding.1220.t
	desc = {
		desc = ep2_wedding.1220.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						scope:relative.highest_held_title_tier > root.highest_held_title_tier
						scope:other_spouse.highest_held_title_tier > root.highest_held_title_tier
					}
				}
				desc = ep2_wedding.1220.desc_marry_down
			}
			triggered_desc = {
				trigger = {
					scope:relative ?= {
						house_has_feud_relation_with_trigger = { TARGET = root }
					}
				}
				desc = ep2_wedding.1220.desc_feud
			}
			triggered_desc = {
				trigger = {
					scope:relative = {
						OR = {
							has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
							opinion = {
								target = root
								value <= -25
							}
							has_imprisonment_reason = root
						}
					}
				}
				desc = ep2_wedding.1220.desc_despicable
			}
			triggered_desc = {
				trigger = {
					scope:relative.faith = {
						NOR = {
							this = root.faith
							faith_hostility_level = {
								target = root.faith
								value = 0
							}
						}
					}
				}
				desc = ep2_wedding.1220.desc_miscreant
			}
			desc = ep2_wedding.1220.desc_fallback
		}
		triggered_desc = {
			trigger = {
				has_activity_intent = diplomatic_intent
				scope:relative != scope:diplo_target
			}
			desc = ep2_wedding.1220.desc_target
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = shame
	}
	center_portrait = {
		trigger = {
			scope:diplo_target ?= { this != scope:relative }
		}
		character = scope:diplo_target
		animation = thinking
	}
	right_portrait = {
		character = scope:relative
		animation = anger
	}

	lower_right_portrait = scope:other_spouse

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		trigger_if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			scope:activity = {
				any_attending_character = {
					wedding_1220_valid_relative_trigger = {
						RELATIVE_SPOUSE = scope:activity.special_guest:spouse_2
						NON_RELATIVE_SPOUSE = scope:activity.special_guest:spouse_1
					}
				}
			}
		}
		trigger_else = {
			scope:activity = {
				any_attending_character = {
					wedding_1220_valid_relative_trigger = {
						RELATIVE_SPOUSE = scope:activity.special_guest:spouse_1
						NON_RELATIVE_SPOUSE = scope:activity.special_guest:spouse_2
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_activity_intent = diplomatic_intent
			add = 2
		}
		modifier = {
			has_activity_intent = banquet_mischief_intent
			add = 1
		}
	}

	immediate = {
		add_character_flag = busy_in_ceremony_event
		if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			scope:activity.special_guest:spouse_2 = { save_scope_as = other_spouse }
		}
		else = {
			scope:activity.special_guest:spouse_1 = { save_scope_as = other_spouse }
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					wedding_1220_valid_relative_trigger = {
						RELATIVE_SPOUSE = scope:other_spouse
						NON_RELATIVE_SPOUSE = root
					}
				}
				save_scope_as = relative
				add_character_flag = busy_in_ceremony_event
			}
		}
		if = {
			limit = {
				has_activity_intent = diplomatic_intent
			}
			intent_target = { save_scope_as = diplo_target }
		}
	}

	# Option A: ignore
	option = {
		name = ep2_wedding.1220.a
		add_prestige = minor_prestige_loss
		scope:relative = {
			add_opinion = {
				target = root
				modifier = weak_opinion
				opinion = 15
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_loss
			calm = medium_stress_impact_loss
			patient = medium_stress_impact_loss
			humble = medium_stress_impact_loss
			content = medium_stress_impact_loss
			forgiving = major_stress_impact_loss
			wrathful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			trusting = medium_stress_impact_gain		
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -1
			}
		}
	}

	# Option B: react aggressively
	option = {
		name = ep2_wedding.1220.b
		add_prestige = medium_prestige_gain
		scope:relative = {
			add_opinion = {
				target = root
				modifier = threatened_opinion
				opinion = -15
			}
		}
		if = {
			limit = {
				can_set_relation_rival_trigger = { CHARACTER = scope:relative }
			}
			progress_towards_rival_effect = {
				REASON = rival_wedding_challenged_prejudices
				CHARACTER = scope:relative
				OPINION = 0
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			calm = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			paranoid = minor_stress_impact_loss
			wrathful = medium_stress_impact_loss
			brave = medium_stress_impact_loss
			ambitious = medium_stress_impact_loss
			stubborn = medium_stress_impact_loss
			vengeful = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	# Option C: diplomatic intent: if you handle them well, you can also impress your target (especially if they are the target)
	option = {
		name = ep2_wedding.1220.c
		trigger = {
			has_activity_intent = diplomatic_intent
		}
		flavor = ep2_wedding.1220.c.tt
		custom_tooltip = available_because_intent_tt
		duel = {
			skill = diplomacy
			target = scope:relative
			50 = {
				# Success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1220.c.success
				send_interface_toast = {
					title = ep2_wedding.1220.c.success.tt
					left_icon = root
					right_icon = scope:relative
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_proved_wrong_log
							tags = { good }
							score = 50
							character = root
							target = scope:relative

							root = {
								add_prestige = medium_prestige_gain
								if = {
									limit = {
										can_set_relation_friend_trigger = { CHARACTER = scope:relative }
									}
									progress_towards_friend_effect = {
										REASON = friend_wedding_not_so_bad
										CHARACTER = scope:relative
										OPINION = default_friend_opinion
									}
								}
							}
							scope:diplo_target ?= {
								add_opinion = {
									target = root
									modifier = impressed_opinion
									opinion = 20
								}
								if = {
									limit = {
										this = scope:relative
										root = {
											can_add_hook = {
												target = scope:relative
												type = favor_hook
											}
										}
									}
									root = {
										add_hook = {
											target = scope:relative
											type = favor_hook
										}
									}
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						calm = medium_stress_impact_loss
						patient = medium_stress_impact_loss
						forgiving = major_stress_impact_loss
					}
				}
			}
			50 = {
				# Failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1220.c.failure
				send_interface_toast = {
					title = ep2_wedding.1220.c.failure.tt
					left_icon = root
					right_icon = scope:relative
					add_prestige = minor_prestige_loss
					if = {
						limit = {
							can_set_relation_rival_trigger = { CHARACTER = scope:relative }
						}
						progress_towards_rival_effect = {
							REASON = rival_wedding_confirmed_prejudices
							CHARACTER = scope:relative
							OPINION = default_rival_opinion
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						paranoid = minor_stress_impact_gain
						wrathful = medium_stress_impact_gain
						ambitious = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	# Option D: mischief intent: mess with them
	option = {
		name = ep2_wedding.1220.d
		trigger = {
			has_activity_intent = banquet_mischief_intent
		}
		custom_tooltip = available_because_intent_tt
		if = {
			limit = {
				has_lifestyle = intrigue_lifestyle
			}
			add_intrigue_lifestyle_xp = medium_lifestyle_xp
		}
		add_dread = minor_dread_gain
		stress_impact = {
			base = medium_stress_impact_loss
			arrogant = major_stress_impact_loss
			stubborn = major_stress_impact_loss
			vengeful = major_stress_impact_loss
		}
		ai_chance = {
			base = 200
		}
	}

	after = {
		remove_character_flag = busy_in_ceremony_event
		scope:relative = { remove_character_flag = busy_in_ceremony_event }
	}
}



# BANQUET EVENTS

##################################################
# A Kindred Spirit
# by Claudia Baldassi
# ep2_wedding.1040
##################################################

# You make a new friend

ep2_wedding.1040 = {
	type = activity_event
	title = ep2_wedding.1040.t
	desc = ep2_wedding.1040.desc
	theme = wedding_banquet_activity
	center_portrait = {
		character = root
		animation = laugh
	}
	right_portrait = {
		character = scope:new_friend
		animation = personality_content
	}

	cooldown = { years = 1 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		scope:activity = {
			any_attending_character = {
				OR = {
					has_relation_potential_friend = root
					AND = {
						has_any_good_relationship_with_root_trigger = no
						has_any_bad_relationship_with_root_trigger = no
					}
				}
				is_ai = yes
				is_adult = yes
				NOT = { has_character_flag = busy_in_banquet_event }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			is_ai = yes
			factor = 0.1
		}
	}

	immediate = {
		add_character_flag = busy_in_banquet_event
		scope:activity = {
			random_attending_character = {
				limit = {
					OR = {
						has_relation_potential_friend = root
						AND = {
							has_any_good_relationship_with_root_trigger = no
							has_any_bad_relationship_with_root_trigger = no
						}
					}
					is_ai = yes
					is_adult = yes
					NOT = { has_character_flag = busy_in_banquet_event }
				}
				save_scope_as = new_friend
			}
		}
		scope:new_friend = { add_character_flag = busy_in_banquet_event }
	}

	#Option A:
	option = {
		name = ep2_wedding.1040.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_kindred_log
				tags = { good }
				score = 50
				character = root
				target = scope:new_friend

				# Effect
				root = {
					set_relation_friend = { reason = friend_wedding_enjoyable_chat target = scope:new_friend }
					reverse_add_opinion = {
						target = scope:new_friend
						modifier = friendliness_opinion
						opinion = 20
					}
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			reclusive = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			trusting = medium_stress_impact_loss
			gregarious = major_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				has_trait = shy
				add = -50
			}
			modifier = {
				has_trait = reclusive
				add = -75
			}
			modifier = {
				has_trait = paranoid
				add = -75
			}
		}
	}

	#Option B:
	option = {
		name = ep2_wedding.1040.b
		reverse_add_opinion = {
			target = scope:new_friend
			modifier = unfriendly_opinion
			opinion = -15
		}
		stress_impact = {
			gregarious = medium_stress_impact_gain
			reclusive = major_stress_impact_loss
			paranoid = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = gregarious
				add = -75
			}
		}
	}
	after = {
		remove_character_flag = busy_in_banquet_event
		scope:new_friend = { remove_character_flag = busy_in_banquet_event }
	}
}

##################################################
# A Fiery Dance
# by Claudia Baldassi
# ep2_wedding.1050
##################################################

# Someone catches fire from the torches

scripted_trigger ep2_wedding_extra_victim_valid_trigger = {
	is_ai = yes
	is_adult = yes
	NOR = {
		this = root
		this = scope:1050_victim
	}
	NOT = { has_character_flag = busy_in_banquet_event }
}

ep2_wedding.1050 = {
	type = activity_event
	title = ep2_wedding.1050.t
	desc = ep2_wedding.1050.desc
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = fear
	}
	center_portrait = {
		trigger = {
			exists = scope:extra_victim_1
		}
		character = scope:extra_victim_1
		animation = shock
	}
	right_portrait = {
		character = scope:victim
		animation = pain
	}
	lower_center_portrait = scope:other_victim
	lower_right_portrait = scope:extra_victim_2

	cooldown = { years = 15 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			NOT = {
				has_variable = has_had_event_1050
			}
		}

		scope:activity = {
			has_activity_option = {
				category = wedding_option_entertainment
				option = wedding_entertainment_good
			}
		}
		scope:activity = {
			any_attending_character = {
				is_adult = yes
				this != root
				is_ai = yes
				NOT = { has_character_flag = busy_in_banquet_event }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			is_ai = yes
			factor = 0.1
		}
	}

	immediate = {
		scope:activity = {
			set_variable = has_had_event_1050
		}
		scope:activity = {
			random_attending_character = {
				limit = {
					is_adult = yes
					this != root
					is_ai = yes
					NOT = { has_character_flag = busy_in_banquet_event }
				}
				save_scope_as = 1050_victim
				increase_wounds_effect = { REASON = burned }
				add_character_flag = busy_in_banquet_event
			}
		}
		add_character_flag = busy_in_banquet_event
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						ep2_wedding_extra_victim_valid_trigger = yes
						save_temporary_scope_as = extra_victim_1
					}
				}
				scope:activity = {
					any_attending_character = {
						ep2_wedding_extra_victim_valid_trigger = yes
						this != scope:extra_victim_1
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						ep2_wedding_extra_victim_valid_trigger = yes
					}
					save_scope_as = extra_victim_1
					add_character_flag = busy_in_banquet_event
				}
				random_attending_character = {
					limit = {
						ep2_wedding_extra_victim_valid_trigger = yes
						this != scope:extra_victim_1
					}
					save_scope_as = extra_victim_2
					add_character_flag = busy_in_banquet_event
				}
			}
		}
		if = {
			limit = {
				scope:activity = {
					any_attending_character = {
						ep2_wedding_extra_victim_valid_trigger = yes
						NOR = {
							this = scope:extra_victim_1
							this = scope:extra_victim_2
						}
					}
				}
			}
			scope:activity = {
				random_attending_character = {
					limit = {
						ep2_wedding_extra_victim_valid_trigger = yes
						NOR = {
							this = scope:extra_victim_1
							this = scope:extra_victim_2
						}
					}
					save_scope_as = other_victim
					add_character_flag = busy_in_banquet_event
				}
			}
		}
	}

	#Option A: try to save them
	option = {
		name = ep2_wedding.1050.a
		duel = {
			skill = prowess
			value = decent_skill_rating
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1050.a.success
				send_interface_toast = {
					title = ep2_wedding.1050.a.success.tt
					left_icon = scope:1050_victim
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_dance_rescue_log
							tags = { good }
							score = 25
							character = root
							target = scope:1050_victim

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:1050_victim
									modifier = grateful_opinion
									opinion = 30
								}
								if = {
									limit = {
										can_add_hook = {
											type = indebted_hook
											target = scope:1050_victim
										}
									}
									add_hook = {
										type = indebted_hook
										target = scope:1050_victim
									}
								}
								if = {
									limit = {
										has_activity_intent = woo_attendee_intent
										intent_target = scope:1050_victim
									}
									progress_towards_lover_effect = {
										REASON = lover_wedding_saved_from_flames
										CHARACTER = scope:1050_victim
										OPINION = default_lover_opinion
									}
								}
								else_if = {
									limit = {
										has_activity_intent = diplomatic_intent
										intent_target = scope:1050_victim
									}
									create_alliance = {
										target = scope:1050_victim
										allied_through_owner = root
										allied_through_target = scope:1050_victim
									}
									scope:1050_victim = {
										add_opinion = {
											target = root
											modifier = event_negotiated_alliance_opinion
										}
									}
								}
							}
						}
					}
				}				
			}
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1050.a.failure
				send_interface_toast = {
					title = ep2_wedding.1050.a.failure.tt
					left_icon = scope:1050_victim
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_dance_rescue_fail_log
							tags = { bad }
							score = 25
							character = root
							target = scope:1050_victim

							# Effect
							root = {
								increase_wounds_effect = { REASON = burned }
								scope:1050_victim = {
									increase_wounds_effect = { REASON = burned }
								}
							}
						}
					}
				}
			}
		}
		stress_impact = {
			craven = massive_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				has_trait = brave
				add = 100
			}
			modifier = {
				has_trait = craven
				add = -100
			}
		}
	}

	#Option B: call for help
	option = {
		name = ep2_wedding.1050.b
		random_list = {
			50 = {
				#Saved!
				desc = ep2_wedding.1050.b.1
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_bad
						}
					}
					add = -25
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_good
						}
					}
					add = 25
				}
				send_interface_toast = {
					title = ep2_wedding.1050.b.1.tt
					left_icon = scope:1050_victim
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_dance_saved_log
							tags = { good }
							score = 25
							character = scope:1050_victim
						}

						root = {
							reverse_add_opinion = {
								target = scope:1050_victim
								modifier = grateful_opinion
								opinion = 15
							}
							if = {
								limit = {
									can_add_hook = {
										type = indebted_hook
										target = scope:1050_victim
									}
								}
								add_hook = {
									type = indebted_hook
									target = scope:1050_victim
								}
							}
						}
					}
				}
			}
			50 = {
				#Keeps burning!
				desc = ep2_wedding.1050.b.2
				send_interface_toast = {
					title = ep2_wedding.1050.b.2.tt
					left_icon = scope:1050_victim
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_dance_saved_fail_log
							tags = { bad }
							score = 25
							character = scope:1050_victim

							# Effect
							scope:1050_victim = {
								increase_wounds_effect = { REASON = burned }
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 50
		}
	}

	#Option C: FIRE! 
	option = {
		name = ep2_wedding.1050.c
		trigger = {
			exists = scope:extra_victim_1
			exists = scope:extra_victim_2
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_dance_disaster_log
				tags = { bad }
				score = 25
				character = scope:1050_victim

				# Effect
				scope:extra_victim_1 = {
					increase_wounds_effect = { REASON = burned }
				}
				scope:extra_victim_2 = {
					increase_wounds_effect = { REASON = burned }
				}

				root = { add_dread = medium_dread_gain }
			}
		}
		stress_impact = {
			compassionate = major_stress_impact_gain
			callous = medium_stress_impact_loss
			vengeful = major_stress_impact_loss
			sadistic = massive_stress_impact_loss
			torturer = massive_stress_impact_loss
		}
		ai_chance = {
			base = 30
			modifier = {
				has_trait = sadistic
				add = 70
			}
			modifier = {
				has_trait = callous
				add = 20
			}
			modifier = {
				has_trait = compassionate
				add = -70
			}
		}
	}

	#Option D: panic
	option = {
		name = ep2_wedding.1050.d
		trigger = { exists = scope:other_victim }
		random = {
			chance = 30			
			send_interface_toast = {
				title = ep2_wedding.1050.d.tt.2
				left_icon = scope:other_victim
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_dance_knocked_log
						tags = { bad }
						score = 25
						character = root
						target = scope:other_victim

						# Effect
						root = { custom_tooltip = ep2_wedding.1050.d.tt }
						scope:other_victim = {
							increase_wounds_effect = { REASON = burned }
						}
					}
				}
			}
			
		}
		stress_impact = {
			brave = massive_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				has_trait = craven
				add = 100
			}
			modifier = {
				has_trait = brave
				add = -100
			}
		}
	}
	after = {
		remove_character_flag = busy_in_banquet_event
		scope:1050_victim = { remove_character_flag = busy_in_banquet_event }
		if = {
			limit = { exists = scope:other_victim }
			scope:other_victim = { remove_character_flag = busy_in_banquet_event }
		}
		if = {
			limit = { exists = scope:extra_victim_1 }
			scope:extra_victim_1 = { remove_character_flag = busy_in_banquet_event }
		}
		if = {
			limit = { exists = scope:extra_victim_2 }
			scope:extra_victim_2 = { remove_character_flag = busy_in_banquet_event }
		}
	}
}

##################################################
# An Exotic Show
# by Claudia Baldassi
# ep2_wedding.1070
##################################################

# Showing off exotic animals can go very well or very wrong

ep2_wedding.1070 = {
	type = activity_event
	title = ep2_wedding.1070.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						root = scope:host
						root = scope:activity.special_guest:spouse_1
						root = scope:activity.special_guest:spouse_2
					}
				}
				desc = ep2_wedding.1070.desc_host
			}
			desc = ep2_wedding.1070.desc_guest
		}
		desc = ep2_wedding.1070.desc_mid
		first_valid = {
			triggered_desc = {	#Everyone is impressed
				trigger = {
					has_character_flag = 1070_exotic_fiends_good
				}
				desc = ep2_wedding.1070.desc_good
			}
			desc = ep2_wedding.1070.desc_bad #The animals are out of control!
		}
		triggered_desc = {
			trigger = {
				exists = scope:1070_target
				has_character_flag = 1070_exotic_fiends_bad
			}
			desc = ep2_wedding.1070.desc_bad_target
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				has_character_flag = 1070_exotic_fiends_bad
			}
			animation = shock
		}
		triggered_animation = {
			trigger = {
				has_character_flag = 1070_exotic_fiends_good
			}
			animation = personality_bold
		}
	}
	right_portrait = {
		trigger = {
			exists = scope:1070_target
			has_character_flag = 1070_exotic_fiends_bad
		}
		character = scope:1070_target
		animation = fear
	}

	lower_right_portrait = scope:m_hunt

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity = {
			has_activity_option = {
				category = wedding_option_entertainment
				option = wedding_entertainment_good
			}
		}
		scope:activity = {
			NOT = { has_variable = has_had_event_1070 }
		}
		scope:host = {
			has_character_modifier = hunt_captive_beast_modifier
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			scope:host = { has_trait = arrogant }
			add = 1
		}
		modifier = {
			scope:host = { has_trait = humble }
			add = -1
		}
		modifier = {
			is_ai = no
			factor = 2
		}
	}

	immediate = {
		add_character_flag = busy_in_banquet_event
		scope:activity = { set_variable = has_had_event_1070 }
		scope:host = {
			if = {
				limit = {
					employs_court_position = master_of_hunt_court_position
					any_court_position_holder = {
						type = master_of_hunt_court_position
						is_ai = yes
						is_adult = yes
						involved_activity = root.involved_activity
						NOT = { has_character_flag = busy_in_banquet_event }
					}
				}
				random_court_position_holder = {
					type = master_of_hunt_court_position
					limit = {
						is_ai = yes
						is_adult = yes
						involved_activity = root.involved_activity
						NOT = { has_character_flag = busy_in_banquet_event }
					}
					save_scope_as = m_hunt
					add_character_flag = busy_in_banquet_event
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_activity_intent = murder_attendee_intent
					has_activity_intent = woo_attendee_intent
					has_activity_intent = diplomatic_intent
				}
			}
			intent_target = { save_scope_as = 1070_target }
		}
		random_list = {
			50 = {	# all goes well
				modifier = {
					scope:host = {
						employs_court_position = master_of_hunt_court_position
					}
					add = 15
				}
				modifier = {
					exists = scope:m_hunt
					add = 15
				}
				modifier = {
					scope:host = {
						has_trait = lifestyle_hunter
					}
					add = 25
				}
				modifier = {
					scope:host = {
						has_trait = diligent
					}
					add = 20
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_good
						}
					}
					add = 20
				}
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_normal
						}
					}
					add = 5
				}
				add_character_flag = 1070_exotic_fiends_good
			}
			50 = {	# a beast escapes!
				modifier = {
					scope:activity = {
						has_activity_option = {
							category = wedding_option_decoration
							option = wedding_decoration_bad
						}
					}
					add = 30
				}
				modifier = {
					scope:host = {
						has_trait = arrogant
					}
					add = 20
				}
				modifier = {
					scope:host = {
						has_trait = lazy
					}
					add = 15
				}
				add_character_flag = 1070_exotic_fiends_bad
				if = {
					limit = {
						this = scope:host
					}
					stress_impact = {
						arrogant = major_stress_impact_gain
						ambitious = major_stress_impact_gain
						diligent = medium_stress_impact_gain
						paranoid = medium_stress_impact_gain
					}
				}
			}
		}
	}

	#Option A: a worthy show
	option = {
		name = ep2_wedding.1070.a
		trigger = { has_character_flag = 1070_exotic_fiends_good }
		scope:activity = {
			every_attending_character = {
				custom = custom.every_attending_character
				limit = {
					this != scope:host
				}
				add_opinion = {
					target = scope:host
					modifier = wedding_good_entertainment_opinion
				}
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_beasts_entertain_log
				tags = { good }
				score = 20
				character = scope:host

				# Effect
				scope:host = { add_prestige = medium_prestige_gain }
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	#Option E: I can do better
	option = {
		name = ep2_wedding.1070.e
		flavor = ep2_wedding.1070.e.tt
		trigger = {
			has_character_flag = 1070_exotic_fiends_good
		}
		scope:activity = {
			every_attending_character = {
				custom = custom.every_attending_character
				limit = {
					this != scope:host
				}
				add_opinion = {
					target = scope:host
					modifier = wedding_good_entertainment_opinion
				}
			}
		}
		duel = {
			skill = prowess
			value = high_skill_rating
			# Success: you make the beasts do your bid!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1070.e.success
				send_interface_toast = {
					title = ep2_wedding.1070.e.tt.success
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_charm_success_log
							tags = { good }
							score = 20
							character = root

							# Effect
							root = {
								add_character_modifier = {
									modifier = ep2_beastmaster_modifier
									years = 20
								}
								add_prestige = medium_prestige_gain
							}
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != root
							}
							add_opinion = {
								target = root
								modifier = impressed_opinion
								opinion = 25
							}
						}
					}
					root = {
						stress_impact = {
							base = minor_stress_impact_loss
							brave = medium_stress_impact_loss
							gregarious = medium_stress_impact_loss
							arrogant = major_stress_impact_loss
							ambitious = major_stress_impact_loss
						}
					}
				}
			}
			# Failure: the beasts disagree with you
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1070.e.failure
				send_interface_toast = {
					title = ep2_wedding.1070.e.tt.failure
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_charm_failure_log
							tags = { bad }
							score = 20
							character = root

							# Effect
							root = {
								random_list = {
									20 = {
										custom_tooltip = ep2_wedding.1070.e.tt.failure_1		
										scope:activity = {
											every_attending_character = {
												custom = custom.every_attending_character
												limit = {
													this != root
												}
												add_opinion = {
													target = root
													modifier = laughingstock_opinion
												}
											}
										}
									}
									50 = {
										increase_wounds_effect = { REASON = wild_animal }
									}
									30 = {
										trigger = {
											NOT = { has_trait = maimed }
										}
										apply_maimed_trait_and_modifier_effect = yes
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_eyed }
										}
										add_trait = one_eyed
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_legged }
										}
										add_trait = one_legged
									}
								}
							}
						}
					}
				}
				stress_impact = {
					arrogant = medium_stress_impact_gain
					ambitious = medium_stress_impact_gain
					stubborn = medium_stress_impact_gain
					lazy = major_stress_impact_gain
					content = major_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 75
			}
			modifier = {
				has_trait = ambitious
				add = 50
			}
			modifier = {
				has_trait = stubborn
				add = 50
			}
			modifier = {
				has_trait = lazy
				add = -75
			}
			modifier = {
				has_trait = content
				add = -50
			}
		}
	}

	#Option B: jump in to save the day!
	option = {
		name = ep2_wedding.1070.b
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			NOT = { exists = scope:1070_target }
		}
		duel = {
			skill = prowess
			value = high_skill_rating
			# Success: you calm down the beasts
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1070.b.success
				send_interface_toast = {
					title = ep2_wedding.1070.b.tt.success
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_calmed_success_log
							tags = { good }
							score = 20
							character = root

							# Effect
							root = {
								add_character_modifier = {
									modifier = ep2_beastmaster_modifier
									years = 20
								}
							}
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != root
							}
							add_opinion = {
								target = root
								modifier = impressed_opinion
								opinion = 25
							}
						}
					}
					root = {
						stress_impact = {
							base = minor_stress_impact_loss
							ambitious = medium_stress_impact_loss
							lifestyle_hunter = medium_stress_impact_loss
							brave = major_stress_impact_loss
							gregarious = major_stress_impact_loss
							arrogant = major_stress_impact_loss
						}
					}
				}
			}
			# Failure: the beasts disagree with you
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1070.b.failure
				send_interface_toast = {
					title = ep2_wedding.1070.e.tt.failure
					left_icon = root
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_calmed_failure_log
							tags = { good }
							score = 20
							character = root

							# Effect
							root = {
								random_list = {
									50 = {
										increase_wounds_effect = { REASON = wild_animal }
									}
									30 = {
										trigger = {
											NOT = { has_trait = maimed }
										}
										apply_maimed_trait_and_modifier_effect = yes
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_eyed }
										}
										add_trait = one_eyed
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_legged }
										}
										add_trait = one_legged
									}
								}
							}
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != scope:host
							}
							add_opinion = {
								target = scope:host
								modifier = wedding_scary_entertainment_opinion
							}
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						ambitious = medium_stress_impact_gain
						lifestyle_hunter = medium_stress_impact_gain
						lazy = medium_stress_impact_gain
						craven = major_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 50
			}
			modifier = {
				has_trait = brave
				add = 75
			}
			modifier = {
				has_trait = compassionate
				add = 25
			}
			modifier = {
				has_trait = lifestyle_hunter
				add = 25
			}
			modifier = {
				hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 50 }
				add = 25
			}
			modifier = {
				hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 100 }
				add = 25
			}
			modifier = {
				has_trait = lazy
				add = -75
			}
			modifier = {
				has_trait = craven
				add = -100
			}
		}
	}

	#Option G: jump in to save the intent target!
	option = {
		name = ep2_wedding.1070.g
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			exists = scope:1070_target
			NOT = { has_activity_intent = murder_attendee_intent }
		}
		duel = {
			skill = prowess
			value = high_skill_rating
			# Success: you calm down the beasts
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1070.g.success
				send_interface_toast = {
					title = ep2_wedding.1070.g.tt.success
					left_icon = scope:1070_target
					set_relation_friend = { reason = friend_wedding_saved_from_beasts target = scope:1070_target }
					if = {
						limit = { has_activity_intent = woo_attendee_intent }
						progress_towards_lover_effect = {
							REASON = friend_wedding_saved_from_beasts
							CHARACTER = scope:1070_target 
							OPINION = default_lover_opinion
						}
					}
					else_if = {
						limit = {
							has_activity_intent = diplomatic_intent
							intent_target = scope:1070_target
						}
						add_hook = {
							type = indebted_hook
							target = scope:1070_target
						}
						create_alliance = {
							target = scope:1070_target
							allied_through_owner = root
							allied_through_target = scope:1070_target
						}
						scope:1070_target = {
							add_opinion = {
								target = root
								modifier = event_negotiated_alliance_opinion
							}
						}
						complete_activity_intent = yes
					}
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_rescue_success_log
							tags = { good }
							score = 20		
							character = root
							target = scope:1070_target

							# Effect
							root = {
								add_character_modifier = {
									modifier = ep2_beastmaster_modifier
									years = 20
								}
							}
							scope:1070_target = {
								add_opinion = {
									target = root
									modifier = grateful_opinion
									opinion = 40
								}
							}
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								NOR = {
									this = root
									this = scope:1070_target
								}
							}
							add_opinion = {
								target = root
								modifier = impressed_opinion
								opinion = 25
							}
						}
					}
					root = {
						stress_impact = {
							base = minor_stress_impact_loss
							ambitious = medium_stress_impact_loss
							lifestyle_hunter = medium_stress_impact_loss
							brave = major_stress_impact_loss
							gregarious = major_stress_impact_loss
							arrogant = major_stress_impact_loss
						}
					}
				}				
			}
			# Failure: the beasts disagree with you
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1070.g.failure
				send_interface_toast = {
					title = ep2_wedding.1070.g.tt.failure
					left_icon = root
					right_icon = scope:1070_target
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_rescue_failure_log
							tags = { bad }
							score = 20
							character = root
							target = scope:1070_target

							# Effect
							root = {
								random_list = {
									50 = {
										increase_wounds_effect = { REASON = wild_animal }
									}
									30 = {
										trigger = {
											NOT = { has_trait = maimed }
										}
										apply_maimed_trait_and_modifier_effect = yes
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_eyed }
										}
										add_trait = one_eyed
									}
									30 = {
										trigger = {
											NOT = { has_trait = one_legged }
										}
										add_trait = one_legged
										
									}
								}
							}
							scope:1070_target = { increase_wounds_effect = { REASON = wild_animal } }
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != scope:host
							}
							add_opinion = {
								target = scope:host
								modifier = wedding_scary_entertainment_opinion
							}
						}
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						ambitious = medium_stress_impact_gain
						lifestyle_hunter = medium_stress_impact_gain
						lazy = medium_stress_impact_gain
						craven = major_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 50
			}
			modifier = {
				has_trait = brave
				add = 75
			}
			modifier = {
				has_trait = compassionate
				add = 25
			}
			modifier = {
				has_trait = lifestyle_hunter
				add = 25
			}
			modifier = {
				hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 50 }
				add = 25
			}
			modifier = {
				hunt_lifestyle_track_greater_equal_trigger = { TRACK = hunter GREATER_EQUAL = 100 }
				add = 25
			}
			modifier = {
				has_trait = lazy
				add = -75
			}
			modifier = {
				has_trait = craven
				add = -100
			}
		}
	}

	#Option H: let the beasts kill your target
	option = {
		name = ep2_wedding.1070.h
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			exists = scope:1070_target
			has_activity_intent = murder_attendee_intent
		}
		custom_tooltip = available_because_intent_tt
		scope:1070_target = {
			duel = {
				skill = prowess
				value = high_skill_rating
				# Success: they survive
				40 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = ep2_wedding.1070.h.survive
					root = {
						send_interface_toast = {
							title = ep2_wedding.1070.h.tt.survive
							left_icon = scope:1070_target
							stress_impact = {
								ambitious = minor_stress_impact_gain
								callous = minor_stress_impact_gain
								deceitful = medium_stress_impact_gain
								arrogant = medium_stress_impact_gain
								vengeful = medium_stress_impact_gain
								sadistic = major_stress_impact_gain 
							}
						}
					}
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_murder_survive_log
							tags = { intent murder }
							score = 50
							character = scope:1070_target
						}
					}
				}
				# Failure: the beasts kill them
				60 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = ep2_wedding.1070.h.kill
					root = {
						complete_activity_intent = yes
						send_interface_toast = {
							title = ep2_wedding.1070.h.tt.kill
							left_icon = scope:1070_target
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_beasts_murder_kill_log
									tags = { intent murder }
									score = 50
									character = scope:1070_target

									# Effect
									scope:1070_target = {
										 death = { death_reason = death_wild_animal }
									}
								}
								every_attending_character = {
									custom = custom.every_attending_character
									limit = {
										this != scope:host
									}
									add_opinion = {
										target = scope:host
										modifier = wedding_scary_entertainment_opinion
									}
								}
							}
							stress_impact = {
								compassionate = major_stress_impact_gain
								ambitious = minor_stress_impact_loss
								callous = minor_stress_impact_loss
								deceitful = medium_stress_impact_loss
								arrogant = medium_stress_impact_loss
								vengeful = medium_stress_impact_loss
								sadistic = major_stress_impact_loss
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				add = -75
			}
			modifier = {
				has_trait = lazy
				add = 25
			}
			modifier = {
				has_trait = craven
				add = 100
			}
			modifier = {
				has_trait = deceitful
				add = 100
			}
		}
	}

	#Option C: call master of hunt
	option = {
		name = ep2_wedding.1070.c
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			exists = scope:m_hunt
			this = scope:host
		}
		duel = {
			skill = prowess
			value = average_skill_rating
			50 = {
				#Master of hunt knows what they are doing
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.1070.c.success
				send_interface_toast = {
					title = ep2_wedding.1070.c.tt.success
					left_icon = scope:m_hunt
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_calmed_success_log
							tags = { good }
							score = 20
							character = scope:m_hunt

							# Effect
							scope:m_hunt = {
								add_character_modifier = {
									modifier = ep2_beastmaster_modifier
									years = 20
								}
							}
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != scope:host
							}
							add_opinion = {
								target = scope:host
								modifier = wedding_good_entertainment_opinion
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
					}
				}
			}
			50 = {
				#Why are you paying this guy again??
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.1070.c.failure
				send_interface_toast = {
					title = ep2_wedding.1070.c.tt.failure
					left_icon = scope:m_hunt
					scope:host = {
						remove_character_modifier = hunt_captive_beast_modifier
					}
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_beasts_master_failure_log
							tags = { bad }
							score = 20
							character = scope:m_hunt

							# Effect
							scope:m_hunt = { increase_wounds_effect = { REASON = wild_animal } }
						}
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != scope:host
							}
							add_opinion = {
								target = scope:host
								modifier = wedding_scary_entertainment_opinion
							}
						}
					}
					stress_impact = {
						greedy = medium_stress_impact_gain
						arrogant = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Option F: GUARDS!!
	option = {
		name = ep2_wedding.1070.f
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			this = scope:host
			NOT = { exists = scope:m_hunt }
		}
		scope:host = {
			remove_character_modifier = hunt_captive_beast_modifier
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_beasts_guards_log
				tags = { bad }
				score = 10
				character = scope:host
			}
			every_attending_character = {
				custom = custom.every_attending_character
				limit = {
					this != scope:host
				}
				add_opinion = {
					target = scope:host
					modifier = wedding_scary_entertainment_opinion
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Option D: run and hide!
	option = {
		name = ep2_wedding.1070.d
		flavor = ep2_wedding.1070.d.tt
		trigger = {
			has_character_flag = 1070_exotic_fiends_bad
			this != scope:host
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_beasts_fled_log
				tags = { bad }
				score = 10
				character = scope:host
			}
			every_attending_character = {
				custom = custom.every_attending_character
				limit = {
					this != scope:host
				}
				add_opinion = {
					target = scope:host
					modifier = wedding_scary_entertainment_opinion
				}
			}
			every_attending_character = {
				custom = custom.every_attending_character
				limit = {
					this != root
				}
				add_opinion = {
					target = root
					modifier = coward_opinion
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			brave = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = callous
				add = 50
			}
			modifier = {
				has_trait = shy
				add = 75
			}
			modifier = {
				has_trait = reclusive
				add = 150
			}
		}
	}

	after = {
		remove_character_flag = busy_in_banquet_event
		if = {
			limit = {
				exists = scope:m_hunt
			}
			scope:m_hunt = { remove_character_flag = busy_in_banquet_event }
		}
	}
}

##################################################
# A Match Made In... ?
# by Claudia Baldassi
# ep2_wedding.1090
##################################################

# Matchmaking Intent: push a couple together

scripted_trigger ep2_wedding_1090_good_match_trigger = {
	is_ai = yes
	location = root.location
	can_marry_character_trigger = { CHARACTER = root.intent_target }
	NOR = {
		exists = betrothed
		AND = {
			exists = root.intent_target.var:wedding_no_match
			this = root.intent_target.var:wedding_no_match
		}
		has_character_flag = busy_in_banquet_event
		is_close_or_extended_family_of = root.intent_target
	}
	trigger_if = {
		limit = {
			is_female = yes
		}
		age < marriage_female_fertility_cutoff_age_value
	}
}

ep2_wedding.1090 = {
	type = activity_event
	title = ep2_wedding.1090.t
	desc = {
		desc = ep2_wedding.1090.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					intent_target = { has_variable = wedding_good_match }
				}
				desc = ep2_wedding.1090.desc_already_matched
			}
			desc = ep2_wedding.1090.desc_new_match
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = schadenfreude
	}
	center_portrait = {
		character = scope:1090_target
		animation = flirtation_left
	}
	right_portrait = {
		character = scope:1090_match
		animation = flirtation
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		has_activity_intent = matchmaking_intent

		intent_target.location = root.location
		location = scope:activity.activity_location

		intent_target = { NOT = { has_character_flag = busy_in_banquet_event } }

		OR = {
			intent_target = { has_variable = wedding_good_match }
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1090_good_match_trigger = yes
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			intent_target = { has_variable = wedding_good_match }
			add = 4
		}
	}

	immediate = {
		add_character_flag = busy_in_banquet_event
		intent_target = {
			save_scope_as = 1090_target
			add_character_flag = busy_in_banquet_event
		}
		if = {
			limit = {
				scope:1090_target = { has_variable = wedding_good_match }
			}
			scope:1090_target.var:wedding_good_match = {
				save_scope_as = 1090_match
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						ep2_wedding_1090_good_match_trigger = yes
					}
					save_scope_as = 1090_match
				}
			}
		}
		scope:1090_match = { add_character_flag = busy_in_banquet_event }
	}

	#Option A: push them together
	option = {
		name = ep2_wedding.1090.a
		scope:1090_target = {
			duel = {
				skill = diplomacy
				target = scope:1090_match
				50 = {	# success - get a betrothal
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					desc = ep2_wedding.1090.a.success
					root = {
						send_interface_toast = {
							title = ep2_wedding.1080.a.success.tt
							left_icon = scope:1090_target
							right_icon = scope:1090_match
							scope:activity = {
								add_activity_log_entry = {
									key = wedding_matchmade_success_log
									tags = { betrothal }
									score = 50
									character = scope:1090_target
									target = scope:1090_match

									# Effect
									scope:1090_target = { create_betrothal = scope:1090_match }
									scope:1090_match = {
										add_opinion = {
											target = scope:1090_target
											modifier = impressed_opinion
											opinion = 20
										}
										if = {
											limit = {
												scope:1090_match = { can_set_relation_lover_trigger = { CHARACTER = scope:1090_target } }
											}
											random = {
												chance = 10
												scope:1090_match = {
													set_relation_lover = { reason = lover_wedding_matchmaking target = scope:1090_target }
												}
											}
										}
									}
									root = { add_prestige = minor_prestige_gain }
								}
							}
						}
						if = {
							limit = { has_activity_intent = matchmaking_intent }
							complete_activity_intent = yes
						}
					}
				}
				50 = {	# failure - you'll have to start again with someone else
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					desc = ep2_wedding.1090.a.failure
					send_interface_toast = {
						title = ep2_wedding.1080.a.failure.tt
						left_icon = scope:1090_target
						right_icon = scope:1090_match
						scope:activity = {
							add_activity_log_entry = {
								key = wedding_matchmade_failure_log
								tags = { betrothal }
								score = 50
								character = scope:1090_target
								target = scope:1090_match
							}
						}
						stress_impact = {
							base = minor_stress_impact_gain
						}
					}
					scope:1090_target = {
						set_variable = {
							name = wedding_no_match
							value = scope:1090_match
						}
					}				
				}
			}
		}
		ai_chance = {
			base = 200
		}
	}

	#Option B: no deal
	option = {
		name = ep2_wedding.1090.b
		scope:1090_target = {
			set_variable = {
				name = wedding_no_match
				value = scope:1090_match
			}
		}
		scope:1090_target = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -15
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = fickle
				add = 25
			}
		}
	}

	after = {
		remove_character_flag = busy_in_banquet_event
		scope:1090_match = { remove_character_flag = busy_in_banquet_event }
		scope:1090_target = { remove_character_flag = busy_in_banquet_event }
	}
}

# WEDDING NIGHT EVENTS

##################################################
# That Cursed Table
# by Claudia Baldassi
# ep2_wedding.1060
##################################################

# Inspired by Matilda of Tuscany's second wedding: a younger/meeker husband is too intimidated

ep2_wedding.1060 = {
	type = activity_event
	title = ep2_wedding.1060.t
	desc = ep2_wedding.1060.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = disgust
	}
	right_portrait = {
		character = scope:spouse_2
		animation = shame
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity.special_guest:spouse_2 = {
			is_ai = yes
			is_male = yes
			NOT = { has_character_flag = busy_in_wnight_event }
		}
		scope:activity.special_guest:spouse_1 = root
		scope:activity.special_guest:spouse_1 = {
			NOT = { has_relation_lover = scope:activity.special_guest:spouse_2 }
		}
		
		OR = {
			# is weaker
			scope:activity.special_guest:spouse_1 = {
				tier_difference = {
					target = scope:activity.special_guest:spouse_2
					value >= 2
				}
			}
			# is younger
			scope:activity.special_guest:spouse_2.age <= scope:activity.special_guest:spouse_1.age_minus_10
			# has "difficulties"
			scope:activity.special_guest:spouse_2 = {
				OR = {
					fertility <= low_fertility
					has_trait = infertile
					NOT = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_1 }
				}
			}
		}
	}

	weight_multiplier = {
		base = 1

		modifier = {
			scope:activity.special_guest:spouse_1 = {
				tier_difference = {
					target = scope:activity.special_guest:spouse_2
					value > 2
				}
			}
			add = 2
		}
		modifier = {
			scope:activity.special_guest:spouse_2.age <= scope:activity.special_guest:spouse_1.age_minus_25
			add = 3
		}
		modifier = {
			scope:activity.special_guest:spouse_2 = {
				NOT = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_1 }
			}
			add = 3
		}
	}

	immediate = {
		scope:activity.special_guest:spouse_1 = {
			save_scope_as = spouse_1
			add_character_flag = busy_in_wnight_event
		}
		scope:activity.special_guest:spouse_2 = {
			save_scope_as = spouse_2
			add_character_flag = busy_in_wnight_event
		}
	}

	#Option A: *Fine* - triggers follow up
	option = {
		name = ep2_wedding.1060.a
		flavor = ep2_wedding.1060.a.tt
		trigger_event = {
			id = ep2_wedding.1061
			days = 3
		}
		stress_impact = {
			base = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = impatient
				add = 75
			}
			modifier = {
				has_trait = lustful
				add = 75
			}
			modifier = {
				has_trait = arrogant
				add = 75
			}
		}
	}

	#Option B: be accepting
	option = {
		name = ep2_wedding.1060.b
		scope:spouse_2 = {
			add_opinion = {
				target = root
				modifier = wedding_understanding_spouse_opinion
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:spouse_2
				modifier = wedding_understanding_spouse_opinion
			}
		}
		if = {
			limit = {
				scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:spouse_2
		}
		if = {
			limit = {
				can_set_relation_soulmate_trigger = { CHARACTER = scope:spouse_2 } 
			}
			random = {
				chance = 5
				set_relation_soulmate = { reason = soulmate_wedding_accepting_partner target = scope:spouse_2 }
				# Achievements
				player_succeeded_at_a_thousand_and_one_nights_achievement_effect = yes
			}
		}
		scope:spouse_1 = { remove_character_flag = busy_in_wnight_event }
		scope:spouse_2 = { remove_character_flag = busy_in_wnight_event }
		stress_impact = {
			impatient = medium_stress_impact_gain
			lustful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			compassionate = medium_stress_impact_loss
			patient = medium_stress_impact_loss
			humble = medium_stress_impact_loss
			chaste = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = compassionate
				add = 75
			}
			modifier = {
				has_trait = patient
				add = 75
			}
			modifier = {
				has_trait = chaste
				add = 75
			}
		}
	}
}

# Follow up event: you have emptied the room except for a bare table - spouse reaction

ep2_wedding.1061 = {
	type = activity_event
	title = ep2_wedding.1060.t
	desc = {
		desc = ep2_wedding.1061.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:spouse_2 = { has_character_flag = 1061_success }
				}
				desc = ep2_wedding.1061.desc_1 #It goes well
			}
			desc = ep2_wedding.1061.desc_2 #Still nothing
		}
	}
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:spouse_2
		animation = shame
	}

	trigger = {
		exists = scope:activity
	}

	immediate = {
		random_list = {
			30 = {
				# he gets over it
				modifier = {
					scope:spouse_2 = {
						NOT = { has_trait = impotent }
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						NOT = { fertility <= low_fertility }
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = arrogant
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = lustful
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = brave
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = gregarious
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						NOT = { is_attracted_to_gender_of = scope:spouse_1 }
					}
					factor = 0
				}
				scope:spouse_2 = { add_character_flag = 1061_success }
			}
			70 = {
				#he really doesn't get over it
				modifier = {
					scope:spouse_2 = {
						has_trait = impotent
					}
					add = 30
				}
				modifier = {
					scope:spouse_2 = {
						fertility <= low_fertility
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = shy
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = chaste
					}
					add = 20
				}
				scope:spouse_2 = { add_character_flag = 1061_not_success }
			}
		}
		add_character_flag = is_naked
	}

	#Option A: All good then!
	option = {
		name = ep2_wedding.1061.a
		trigger = {
			scope:spouse_2 = { has_character_flag = 1061_success }
		}
		scope:spouse_2 = {
			add_opinion = {
				target = root
				modifier = wedding_challenging_spouse_opinion
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:spouse_2
				modifier = wedding_challenging_spouse_opinion
			}
		}
		scope:spouse_2 = {
			add_character_modifier = {
				modifier = wedding_nagging_spouse_modifier
				years = 10
			}
		}
		if = {
			limit = {
				scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:spouse_2
		}
		stress_impact = {
			base = minor_stress_impact_loss
			lustful = medium_stress_impact_loss
		}
	}

	#Option B: kick them out and denounce them!
	option = {
		name = ep2_wedding.1061.b
		trigger = {
			scope:spouse_2 = { has_character_flag = 1061_not_success }
		}
		scope:spouse_2 = {
			add_opinion = {
				target = root
				modifier = wedding_cruel_spouse_opinion
			}
			add_character_modifier = {
				modifier = wedding_accused_impotency_modifier
				years = 10
			}
		}
		if = {
			limit = {
				scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_very_bad_fertility = scope:spouse_1
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:spouse_2
				modifier = wedding_useless_spouse_opinion
			}
		}
		stress_impact = {
			calm = minor_stress_impact_gain
			patient = medium_stress_impact_gain
			chaste = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
			vengeful = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 30
			}
			modifier = {
				has_trait = callous
				add = 50
			}
			modifier = {
				has_trait = sadistic
				add = 30
			}
			modifier = {
				has_trait = lustful
				add = 50
			}
			modifier = {
				has_trait = wrathful
				add = 50
			}
			modifier = {
				has_trait = impatient
				add = 50
			}
		}
	}

	#Option C: be patient
	option = {
		name = ep2_wedding.1061.c
		trigger = {
			scope:spouse_2 = { has_character_flag = 1061_not_success }
		}
		scope:spouse_2 = {
			add_opinion = {
				target = root
				modifier = wedding_understanding_spouse_opinion
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:spouse_2
				modifier = wedding_understanding_spouse_opinion
			}
		}
		if = {
			limit = {
				scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:spouse_2
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			lustful = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = calm
				add = 30
			}
			modifier = {
				has_trait = patient
				add = 50
			}
			modifier = {
				has_trait = compassionate
				add = 75
			}
		}
		
	}

	after = {
		if = {
			limit = {
				scope:spouse_2 = { has_character_flag = 1061_success }
			}
			scope:spouse_2 = { remove_character_flag = 1061_success }
		}
		else_if = {
			limit = {
				scope:spouse_2 = { has_character_flag = 1061_not_success }
			}
			scope:spouse_2 = { remove_character_flag = 1061_not_success }
		}
		scope:spouse_1 = { remove_character_flag = busy_in_wnight_event }
		scope:spouse_2 = { remove_character_flag = busy_in_wnight_event }
		remove_character_flag = is_naked
	}
}

# Inverted event: it's you who have problems - spouse's reaction

ep2_wedding.1065 = {
	type = activity_event
	title = ep2_wedding.1060.t
	desc = ep2_wedding.1065.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:spouse_2
		animation = disgust
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		scope:activity.special_guest:spouse_1 = { is_male = yes }
		scope:activity.special_guest:spouse_1 = root
		scope:activity.special_guest:spouse_1 = {
			NOT = { has_relation_lover = scope:activity.special_guest:spouse_2 }
		}
		scope:activity.special_guest:spouse_2 = {
			is_ai = yes
			NOT = { has_character_flag = busy_in_wnight_event }
		}
		
		OR = {
			# is weaker
			scope:activity.special_guest:spouse_2 = {
				tier_difference = {
					target = root
					value >= 2
				}
			}
			# is younger
			age <= scope:activity.special_guest:spouse_2.age_minus_10
			# has difficulties
			fertility <= low_fertility
			has_trait = infertile
			NOT = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_2 }
		}
	}

	weight_multiplier = {
		base = 1

		modifier = {
			scope:activity.special_guest:spouse_2 = {
				tier_difference = {
					target = root
					value > 2
				}
			}
			add = 2
		}
		modifier = {
			age <= scope:activity.special_guest:spouse_2.age_minus_25
			add = 3
		}
		modifier = {
			NOT = { is_attracted_to_gender_of = scope:activity.special_guest:spouse_2 }
			add = 3
		}
	}

	immediate = {
		scope:activity.special_guest:spouse_1 = { save_scope_as = spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = spouse_2 }
		scope:spouse_1 = { add_character_flag = busy_in_wnight_event }
		scope:spouse_2 = { add_character_flag = busy_in_wnight_event }
	}

	#Option A: It's a curse!
	option = {
		name = ep2_wedding.1065.a
		flavor = ep2_wedding.1065.a.tt
		trigger_event = {
			id = ep2_wedding.1066
			days = 3
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			lustful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			deceitful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = deceitful
				add = 50
			}
			modifier = {
				has_trait = arrogant
				add = 50
			}
			modifier = {
				has_trait = lustful
				add = 50
			}
			modifier = {
				has_character_modifier = bp1_superstition_modifier
				add = 50
			}
		}
	}

	#Option B: Sorry...
	option = {
		name = ep2_wedding.1065.b
		random_list = {
			50 = {	#they are understanding
				modifier = {
					scope:spouse_2 = {
						has_trait = compassionate
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = calm
					}
					add = 10
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = patient
					}
					add = 20
				}
				send_interface_toast = {
					title = ep2_wedding.1065.b1
					scope:spouse_2 = {
						add_opinion = {
							target = root
							modifier = wedding_understanding_spouse_opinion
						}
					}
					if = {
						limit = {
							is_ai = yes
						}
						add_opinion = {
							target = scope:spouse_2
							modifier = wedding_understanding_spouse_opinion
						}
					}
					if = {
						limit = {
							scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:spouse_2
					}
				}
			}
			50 = {	#they are not
				modifier = {
					scope:spouse_2 = {
						has_trait = callous
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = lustful
					}
					add = 30
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = impatient
					}
					add = 20
				}
				modifier = {
					scope:spouse_2 = {
						has_trait = wrathful
					}
					add = 10
				}
				send_interface_toast = {
					title = ep2_wedding.1065.b2
					scope:spouse_2 = {
						add_opinion = {
							target = root
							modifier = wedding_useless_spouse_opinion
						}
					}
					if = {
						limit = {
							is_ai = yes
						}
						add_opinion = {
							target = scope:spouse_2
							modifier = wedding_cruel_spouse_opinion
						}
					}
					add_character_modifier = {
						modifier = wedding_accused_impotency_modifier
						years = 10
					}
					if = {
						limit = {
							scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_very_bad_fertility = scope:spouse_2
					}
				}
			}
		}
		scope:spouse_1 = { remove_character_flag = busy_in_wnight_event }
		scope:spouse_2 = { remove_character_flag = busy_in_wnight_event }
		stress_impact = {
			deceitful = medium_stress_impact_gain
			honest = medium_stress_impact_loss
			humble = minor_stress_impact_loss			
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = humble
				add = 50
			}
			modifier = {
				has_trait = honest
				add = 50
			}
		}
	}
}

# Follow up event: your spouse has emptied the room except for a bare table

ep2_wedding.1066 = {
	type = activity_event
	title = ep2_wedding.1060.t
	desc = {
		desc = ep2_wedding.1066.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = 1066_success
				}
				desc = ep2_wedding.1066.desc_1 #It goes well
			}
			desc = ep2_wedding.1066.desc_2 #Still nothing
		}
	}
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:spouse_2
		animation = anger
	}

	trigger = {
		exists = scope:activity
	}

	immediate = {
		random_list = {
			30 = {
				# you get over it
				modifier = {
					NOT = { has_trait = impotent }
					add = 10
				}
				modifier = {
					NOT = { fertility <= low_fertility }
					add = 10
				}
				modifier = {
					has_trait = arrogant
					add = 10
				}
				modifier = {
					has_trait = lustful
					add = 20
				}
				modifier = {
					has_trait = brave
					add = 10
				}
				modifier = {
					has_trait = gregarious
					add = 10
				}
				modifier = {
					NOT = { is_attracted_to_gender_of = scope:spouse_2 }
					factor = 0
				}
				add_character_flag = 1066_success
			}
			70 = {
				#you really don't get over it
				modifier = {
					has_trait = impotent
					add = 30
				}
				modifier = {
					fertility <= low_fertility
					add = 20
				}
				modifier = {
					has_trait = shy
					add = 20
				}
				modifier = {
					has_trait = chaste
					add = 20
				}
				add_character_flag = 1066_not_success
			}
		}
		scope:spouse_2 = {
			add_character_flag = is_naked
		}
	}

	#Option A: I feel better
	option = {
		name = ep2_wedding.1066.a
		trigger = {
			has_character_flag = 1066_success
		}
		scope:spouse_2 = {
			add_opinion = {
				target = root
				modifier = wedding_challenging_spouse_opinion
			}
		}
		if = {
			limit = {
				scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:spouse_2
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:spouse_2
				modifier = wedding_challenging_spouse_opinion
			}
		}
		add_character_modifier = {
			modifier = wedding_nagging_spouse_modifier
			years = 10
		}
		stress_impact = {
			base = minor_stress_impact_loss
			lustful = medium_stress_impact_loss
		}
	}

	#Option B: ...Still nothing
	option = {
		name = ep2_wedding.1066.b
		trigger = {
			has_character_flag = 1066_not_success
		}
		random_list = {
			50 = {	#hey don't take it well
				modifier = {
					scope:spouse_2 = { has_trait = arrogant }
					add = 10
				}
				modifier = {
					scope:spouse_2 = { has_trait = callous }
					add = 20
				}
				modifier = {
					scope:spouse_2 = { has_trait = sadistic }
					add = 25
				}
				modifier = {
					scope:spouse_2 = { has_trait = lustful }
					add = 25
				}
				modifier = {
					scope:spouse_2 = { has_trait = wrathful }
					add = 25
				}
				modifier = {
					scope:spouse_2 = { has_trait = impatient }
					add = 25
				}
				send_interface_toast = {
					title = ep2_wedding.1066.b_1
					left_icon = scope:spouse_2
					scope:spouse_2 = {
						add_opinion = {
							target = root
							modifier = wedding_useless_spouse_opinion
						}
					}
					if = {
						limit = {
							is_ai = yes
						}
						add_opinion = {
							target = scope:spouse_2
							modifier = wedding_cruel_spouse_opinion
						}
					}
					add_character_modifier = {
						modifier = wedding_accused_impotency_modifier
						years = 10
					}
					if = {
						limit = {
							scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_very_bad_fertility = scope:spouse_2
					}
					stress_impact = {
						base = minor_stress_impact_gain
					}
				}
			}
			50 = {	#they take it well
				modifier = {
					scope:spouse_2 = { has_trait = calm }
					add = 10
				}
				modifier = {
					scope:spouse_2 = { has_trait = patient }
					add = 25
				}
				modifier = {
					scope:spouse_2 = { has_trait = compassionate }
					add = 40
				}
				send_interface_toast = {
					title = ep2_wedding.1066.b_2
					left_icon = scope:spouse_2
					scope:spouse_2 = {
						add_opinion = {
							target = root
							modifier = wedding_understanding_spouse_opinion
						}
					}
					if = {
						limit = {
							is_ai = yes
						}
						add_opinion = {
							target = scope:spouse_2
							modifier = wedding_understanding_spouse_opinion
						}
					}
					if = {
						limit = {
							scope:spouse_2 = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:spouse_2
					}
					stress_impact = {
						base = minor_stress_impact_loss
					}
				}
			}
		}
	}
	after = {
		if = {
			limit = {
				has_character_flag = 1066_success
			}
			remove_character_flag = 1066_success
		}
		else_if = {
			limit = {
				has_character_flag = 1066_not_success
			}
			remove_character_flag = 1066_not_success
		}
		scope:spouse_1 = { remove_character_flag = busy_in_wnight_event }
		scope:spouse_2 = { 
			remove_character_flag = busy_in_wnight_event
			remove_character_flag = is_naked
		}
	}
}

##################################################
# One More Goblet
# by Claudia Baldassi
# ep2_wedding.1110
##################################################

# Non-spouses: someone gets extremely drunk/doesn't want to leave

scripted_trigger ep2_wedding_1110_valid_drunk_trigger = {
	is_adult = yes
	is_ai = yes
	NOR = {
		this = scope:activity.special_guest:spouse_1
		this = scope:activity.special_guest:spouse_2
		this = scope:host
		has_character_flag = busy_in_wnight_event
	}
	drinks_alcohol_trigger = yes
}

ep2_wedding.1110 = {
	type = activity_event
	title = ep2_wedding.1110.t
	desc = {
		desc = ep2_wedding.1110.desc_intro
		desc = ep2_wedding.1110.desc
		triggered_desc = {
			trigger = {
				root = scope:host
			}
			desc = ep2_wedding.1110.desc_host
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = disgust
	}
	right_portrait = {
		character = scope:1110_drunk
		animation = wedding_drunk
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		NOR = {
			scope:activity.special_guest:spouse_1 ?= root
			scope:activity.special_guest:spouse_2 ?= root
		}
		scope:host ?= {	#There must be alcohol at the party!
			drinks_alcohol_trigger = yes
		}
		scope:activity ?= {
			any_attending_character = {
				ep2_wedding_1110_valid_drunk_trigger = yes
			}
			NOT = { has_variable = has_had_1110_event }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					has_trait = drunkard
				}
			}
			add = 10
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					OR = {
						has_activity_intent = reduce_stress_intent
						has_activity_intent = banquet_mischief_intent
					}
				}
			}
			add = 3
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					has_trait = gregarious
				}
			}
			add = 2
		}
		modifier = {
			is_ai = yes
			factor = 0.1
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					has_trait = drunkard
				}
				alternative_limit = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					has_trait = gregarious
				}
				alternative_limit = {
					ep2_wedding_1110_valid_drunk_trigger = yes
					OR = {
						has_activity_intent = reduce_stress_intent
						has_activity_intent = banquet_mischief_intent
					}
				}
				alternative_limit = {
					ep2_wedding_1110_valid_drunk_trigger = yes
				}
				save_scope_as = 1110_drunk
				add_character_flag = busy_in_wnight_event
			}
			set_variable = has_had_1110_event
		}
		add_character_flag = busy_in_wnight_event
	}

	#Option B: Kick them out (host only)
	option = {
		name = ep2_wedding.1110.b
		trigger = { root = scope:host }
		flavor = ep2_wedding.1110.b.tt
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_goblet_eject_log
				tags = { bad }
				score = 25
				character = root
				target = scope:1110_drunk

				# Effect
				root = {
					progress_towards_rival_effect = {
						REASON = rival_kicked_out
						CHARACTER = scope:1110_drunk
						OPINION = -30
					}
					add_prestige = minor_prestige_gain
					add_character_modifier = {
						modifier = wedding_severe_host_modifier
						years = 20
					}
					scope:1110_drunk = { remove_from_activity = scope:activity }
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			patient = medium_stress_impact_gain
			drunkard = major_stress_impact_gain
			just = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			temperate = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
			}
			modifier = {
				has_trait = compassionate
				add = -25
			}
			modifier = {
				has_trait = patient
				add = -50
			}
			modifier = {
				has_trait = gregarious
				add = -50
			}
			modifier = {
				has_trait = temperate
				add = 100
			}
		}
	}

	#Option C: If you can't fight them, join them!
	option = {
		name = ep2_wedding.1110.c
		trigger = { drinks_alcohol_trigger = yes }
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_goblet_fool_log
				tags = { bad }
				score = 25
				character = root
				target = scope:1110_drunk

				# Effect
				root = {
					progress_towards_friend_effect = {
						REASON = friend_drinking_buddies
						CHARACTER = scope:1110_drunk
						OPINION = 10
					}
					if = {
						limit = {
							NOT = {
								has_trait = drunkard
							}
						}
						random = {
							chance = 5
							add_trait = drunkard
						}
					}
					add_character_modifier = {
						modifier = wedding_social_drinker_modifier
						years = 20
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			gregarious = medium_stress_impact_loss
			drunkard = major_stress_impact_loss
			temperate = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 50
			modifier = {
				has_trait = drunkard
				add = 200
			}
			modifier = {
				has_trait = gregarious
				add = 75
			}
			modifier = {
				has_trait = temperate
				add = -75
			}
		}
	}

	#Option A: Judge them hard
	option = {
		name = ep2_wedding.1110.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_goblet_refusal_log
				tags = { bad }
				score = 25
				character = scope:1110_drunk

				# Effect
				root = {
					reverse_add_opinion = {
						target = scope:1110_drunk
						modifier = annoyed_opinion
						opinion = -15
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = temperate
				add = 50
			}
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}

	after = {
		remove_character_flag = busy_in_wnight_event
		scope:1110_drunk = { remove_character_flag = busy_in_wnight_event }
	}
}

##################################################
# One More Goblet
# by Claudia Baldassi
# ep2_wedding.1111
##################################################

# Non-spouses: you get extremely drunk/don't want to leave

scripted_trigger ep2_wedding_1111_valid_drunk_trigger = {
	is_adult = yes
	NOR = {
		this = scope:activity.special_guest:spouse_1
		this = scope:activity.special_guest:spouse_2
		has_character_flag = busy_in_wnight_event
	}
	drinks_alcohol_trigger = yes
}

ep2_wedding.1111 = {
	type = activity_event
	title = ep2_wedding.1110.t
	desc = {
		desc = ep2_wedding.1110.desc_intro
		desc = ep2_wedding.1111.desc
		triggered_desc = {
			trigger = {
				root = scope:host
			}
			desc = ep2_wedding.1111.desc_host
		}
		desc = ep2_wedding.1111.desc_conclusion
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = wedding_drunk
	}
	right_portrait = {
		character = scope:1111_other
		animation = disgust
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes

		ep2_wedding_1111_valid_drunk_trigger = yes

		scope:host = {	#There must be alcohol at the party!
			drinks_alcohol_trigger = yes 
		}
		scope:activity = {	
			NOT = { has_variable = has_had_1110_event }
		}
		NOR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		trigger_if = {
			limit = {
				OR = {
					this = scope:host
					scope:host = scope:activity.special_guest:spouse_1
					scope:host = scope:activity.special_guest:spouse_2
				}
			}
			scope:activity = {
				any_attending_character = {
					NOR = {
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
					}
					is_adult = yes
					is_ai = yes
					NOT = { has_character_flag = busy_in_wnight_event }
				}
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = {
			has_trait = drunkard
			add = 10
		}
		modifier = {
			has_trait = gregarious
			add = 2
		}
		modifier = {
			is_ai = yes
			factor = 0.1
		}
		modifier = {
			OR = {
				has_activity_intent = reduce_stress_intent
				has_activity_intent = banquet_mischief_intent
			}
			add = 5
		}
	}

	immediate = {
		add_character_flag = busy_in_wnight_event
		scope:activity = {
			set_variable = has_had_1110_event
		}
		if = {
			limit = {
				NOR = {
					this = scope:host
					scope:host = {
						OR = {
							this = scope:activity.special_guest:spouse_1
							this = scope:activity.special_guest:spouse_2
						}
					}
				}
			}
			scope:host = {
				add_character_flag = busy_in_wnight_event
				save_scope_as = 1111_other
			}
		}
		else = {
			scope:activity = {
				random_attending_character = {
					limit = {
						NOR = {
							this = scope:activity.special_guest:spouse_1
							this = scope:activity.special_guest:spouse_2
						}
						is_adult = yes
						is_ai = yes
						NOT = { has_character_flag = busy_in_wnight_event }
					}
					save_scope_as = 1111_other
					add_character_flag = busy_in_wnight_event
				}
			}
		}
	}

	#Option B: not sorry
	option = {
		name = ep2_wedding.1111.b
		add_character_modifier = {
			modifier = wedding_social_drinker_modifier
			years = 20
		}
		random_list = {
			30 = {	#join me!
				trigger = {
					scope:1111_other = { drinks_alcohol_trigger = yes }
				}
				modifier = {
					scope:1111_other = { has_trait = drunkard }
					add = 200
				}
				modifier = {
					scope:1111_other = { has_trait = gregarious }
					add = 70
				}
				modifier = {
					scope:1111_other = { has_trait = wrathful }
					add = -50
				}
				desc = ep2_wedding.1111.b.1
				send_interface_toast = {
					title = ep2_wedding.1111.b.1.tt
					left_icon = scope:1111_other
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_goblet_fool_log
							tags = { bad }
							score = 25
							character = root
							target = scope:1111_other

							# Effect
							root = {
								progress_towards_friend_effect = {
									REASON = friend_drinking_buddies
									CHARACTER = scope:1111_other
									OPINION = 10
								}
							}
						}
					}
				}
			}
			70 = {	#you get kicked out!
				trigger = {
					scope:1111_other = scope:host
				}
				modifier = {
					scope:1111_other = { has_trait = patient }
					add = -30
				}
				modifier = {
					scope:1111_other = { has_trait = compassionate }
					add = -25
				}
				modifier = {
					scope:1111_other = { has_trait = forgiving }
					add = -30
				}
				modifier = {
					scope:1111_other = { has_trait = wrathful }
					add = 50
				}
				desc = ep2_wedding.1111.b.2
				send_interface_toast = {
					title = ep2_wedding.1111.b.2.tt
					left_icon = scope:1111_other
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_goblet_eject_log
							tags = { bad }
							score = 10
					
							character = scope:1111_other
							target = root

							#Effect
							root = { remove_from_activity = scope:activity }
							scope:1111_other  ={
								progress_towards_rival_effect = {
									REASON = rival_kicked_out
									CHARACTER = root
									OPINION = -30
								}
							}
						}
					}
				}
			}
			50 = {	#you get judged - harshly
				trigger = {
					scope:1111_other != scope:host
				}
				desc = ep2_wedding.1111.b.3
				send_interface_toast = {
					title = ep2_wedding.1111.b.3.tt
					left_icon = scope:1111_other
					reverse_add_opinion = {
						target = scope:1111_other
						modifier = annoyed_opinion
						opinion = -20
					}
				}
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_goblet_reprimand_log
						tags = { bad }
						score = 10
				
						character = root
					}
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_activity_intent = reduce_stress_intent
					has_activity_intent = banquet_mischief_intent
				}
			}
			stress_impact = {
				base = minor_stress_impact_loss
			}
		}
		else = {
			stress_impact = {
				humble = medium_stress_impact_gain
				temperate = major_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				has_trait = arrogant
				add = 75
			}
			modifier = {
				has_trait = drunkard
				add = 75
			}
			modifier = {
				has_trait = humble
				add = -50
			}
			modifier = {
				has_trait = temperate
				add = -75
			}
			modifier = {
				OR = {
					has_activity_intent = reduce_stress_intent
					has_activity_intent = banquet_mischief_intent
				}
				opinion = {
					target = scope:host
					value < neutral_opinion
				}
				add = 100
			}
		}
	}

	#Option A: sorry
	option = {
		name = ep2_wedding.1111.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_goblet_reprimand_log
				tags = { bad }
				score = 25
				character = root

				# Effect
				root = {
					reverse_add_opinion = {
						target = scope:1111_other
						modifier = respect_opinion
						opinion = 15
					}
					stress_impact = {
						arrogant = medium_stress_impact_gain
						drunkard = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 200
			modifier = {
				opinion = {
					target = scope:host
					value > low_positive_opinion
				}
				add = 100
			}
			modifier = {
				has_trait = arrogant
				add = -75
			}
			modifier = {
				has_trait = drunkard
				add = -75
			}
		}
	}

	after = {
		remove_character_flag = busy_in_wnight_event
		scope:1111_other = { remove_character_flag = busy_in_wnight_event }
	}
}


##################################################
# Why Would You Marry Someone Like Me?
# by Luke Bean
# ep2_wedding.1300
##################################################

scripted_trigger ep2_wedding_1300_appearance_insecurity_trigger = {
	OR = {
		AND = {
			is_female = yes
			has_trait = giant
		}
		has_trait = one_eyed
		has_trait = scarred
		has_trait = one_legged
		has_trait = disfigured
		has_trait = scaly
		has_trait = albino
		has_trait = dwarf
		has_trait = hunchbacked
		has_trait = maimed
		has_trait = spindly
		has_trait = beauty_bad_1
		has_trait = beauty_bad_2
		has_trait = beauty_bad_3
	}
}

scripted_trigger ep2_wedding_1300_voice_insecurity_trigger = {
	OR = {
		has_trait = lisping
		has_trait = stuttering
		has_trait = wheezing
	}
}

ep2_wedding.1300 = {
	type = activity_event
	title = ep2_wedding.1300.t
	desc = {
		desc = ep2_wedding.1300.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {	scope:insecurity = flag:appearance }
				desc = ep2_wedding.1300.desc_appearance
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:dark_past }
				desc = ep2_wedding.1300.desc_dark_past
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:voice }
				desc = ep2_wedding.1300.desc_voice
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:lowborn }
				desc = ep2_wedding.1300.desc_lowborn
			}
		}
		desc = ep2_wedding.1300.desc_outro
	}
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:spouse_2
		animation = worry
	}

	cooldown = { years = 10 }

	trigger = {
		has_ep2_dlc_trigger = yes
		root = scope:activity.special_guest:spouse_1
		scope:activity.special_guest:spouse_2 = {
			is_alive = yes
			NOR = {
				has_trait = arrogant
				any_relation = { type = lover this = root }
				any_relation = { type = best_friend this = root }
			}
			OR = {
				ep2_wedding_1300_appearance_insecurity_trigger = yes
				has_any_shunned_or_criminal_trait_in_faith_trigger = {
					CHARACTER = scope:activity.special_guest:spouse_2
					FAITH = scope:activity.special_guest:spouse_2.faith
				}
				ep2_wedding_1300_voice_insecurity_trigger = yes
				is_lowborn = yes
			}
		}
	}

	weight_multiplier = {
		base = 2
		modifier = {
			has_activity_intent = woo_attendee_intent
			intent_target = scope:activity.special_guest:spouse_2
			add = 3
		}
	}

	immediate = {
		root = { save_scope_as = spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = spouse_2 }
		add_character_flag = busy_in_wnight_event
		scope:spouse_2 = { 
			add_character_flag = busy_in_wnight_event
			add_character_flag = is_naked
		}
		if = {
			limit = {
				scope:spouse_2 = {
					ep2_wedding_1300_appearance_insecurity_trigger = yes
				}
			}
			save_scope_value_as = {
				name = insecurity
				value = flag:appearance
			}
		}
		else_if = {
			limit = {
				has_any_shunned_or_criminal_trait_in_faith_trigger = {
					CHARACTER = scope:spouse_2
					FAITH = scope:spouse_2.faith
				}
			}
			save_scope_value_as = {
				name = insecurity
				value = flag:dark_past
			}
		}
		else_if = {
			limit = {
				scope:spouse_2 = {
					ep2_wedding_1300_voice_insecurity_trigger = yes
				}
			}
			save_scope_value_as = {
				name = insecurity
				value = flag:voice
			}
		}
		else_if = {
			limit = {
				scope:spouse_2 = {
					is_lowborn = yes
				}
			}
			save_scope_value_as = {
				name = insecurity
				value = flag:lowborn
			}
		}
		if = {
			limit = {
				scope:spouse_2 = {
					OR = {
						has_trait = intellect_good_1
						has_trait = intellect_good_2
						has_trait = intellect_good_3
						has_trait = ambitious
						has_trait = shrewd
						intrigue >= high_skill_rating
						diplomacy >= high_skill_rating
						stewardship >= high_skill_rating
						martial >= high_skill_rating
						learning >= high_skill_rating
					}
				}
			}
			save_scope_value_as = {
				name = mind_of_a_ruler
				value = yes
			}
		}
		add_character_flag = is_naked	
	}

	# I chose you for your virtue
	option = {
		name = ep2_wedding.1300.virtue
		custom_tooltip = ep2_wedding.1300.virtue.tt #This option is available because SPOUSE is a virtuous PERSON
		custom_tooltip = ep2_wedding.1300.followup.tt
		trigger = {
			scope:spouse_2 = { num_virtuous_traits >= 1 }
			NOR = {
				scope:spouse_2 = { num_sinful_traits >= 1 }
				has_any_shunned_or_criminal_trait_in_faith_trigger = {
					CHARACTER = scope:spouse_2
					FAITH = scope:spouse_2.faith
				}
			}
		}

		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.a
					show_chance = no
					scope:spouse_1 = {
						progress_towards_lover_effect = {
							CHARACTER = scope:spouse_2
							REASON = lover_shared_insecurity
							OPINION = default_lover_opinion
						}
					}
				}
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			just = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			zealous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_zeal = 0.5
			}
			modifier = {
				has_trait = impatient
				add = -30
			}
			modifier = {
				has_trait = wrathful
				add = -30
			}
			modifier = {
				has_trait = sadistic
				add = -30
			}
			modifier = {
				has_trait = cynical
				add = -80
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:virtue
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

	# I need someone like you to rule by my side
	option = {
		name = ep2_wedding.1300.rule_together
		custom_tooltip = ep2_wedding.1300.rule_together.tt #This option is available because SPOUSE has the mind of a ruler
		custom_tooltip = ep2_wedding.1300.followup.tt

		trigger = {
			exists = scope:mind_of_a_ruler
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.a
					show_chance = no
					scope:spouse_1 = {
						progress_towards_lover_effect = {
							CHARACTER = scope:spouse_2
							REASON = lover_shared_insecurity
							OPINION = default_lover_opinion
						}
					}
				}
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
			content = minor_stress_impact_gain
			fickle = medium_stress_impact_gain
			just = medium_stress_impact_loss
			diligent = medium_stress_impact_loss
			ambitious = medium_stress_impact_loss
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
			}
			modifier = {
				has_trait = content
				add = -30
			}
			modifier = {
				has_trait = lazy
				add = -80
			}
			modifier = {
				has_trait = arrogant
				add = -80
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:rule_together
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

# This marriage is practical for both of us
	option = {
		name = ep2_wedding.1300.practical
		custom_tooltip = ep2_wedding.1300.followup.tt
		trigger = {
			NOR = { #This is purely so that you don't get a seven-option event if you marry a beautiful fertile genius with a lisp
				has_trait = beauty_good_1
				has_trait = beauty_good_2
				has_trait = beauty_good_3
			}
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.a
					show_chance = no
					scope:spouse_1 = {
						progress_towards_lover_effect = {
							CHARACTER = scope:spouse_2
							REASON = lover_shared_insecurity
							OPINION = default_lover_opinion
						}
					}
				}
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			arbitrary = minor_stress_impact_gain
			zealous = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
			callous = medium_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			modifier = {
				has_trait = arbitrary
				add = -30
			}
			modifier = {
				has_trait = zealous
				add = -30
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:practical
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

	# Stop whining, I'm making you a TITLE
	option = {
		name = ep2_wedding.1300.stop_whining
		custom_tooltip = ep2_wedding.1300.followup.tt

		trigger = {
			OR = {
				has_trait = sadistic
				has_trait = callous
				has_trait = wrathful
				has_trait = impatient
				has_trait = arrogant
			}
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			calm = minor_stress_impact_gain
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
			modifier = {
				has_trait = compassionate
				add = -80
			}
			modifier = {
				has_trait = calm
				add = -50
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:stop_whining
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

	# I understand how you feel
	option = {
		name = ep2_wedding.1300.understanding
		custom_tooltip = ep2_wedding.1300.followup.tt

		trigger = {
			OR = {
				has_trait = reclusive
				has_trait = shy
				has_trait = depressed_1
				has_trait = depressed_genetic
				ep2_wedding_1300_appearance_insecurity_trigger = yes
				ep2_wedding_1300_voice_insecurity_trigger = yes
			}
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.a
					show_chance = no
					scope:spouse_1 = {
						progress_towards_lover_effect = {
							CHARACTER = scope:spouse_2
							REASON = lover_shared_insecurity
							OPINION = default_lover_opinion
						}
					}
				}
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_loss
			calm = minor_stress_impact_loss
			sadistic = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
			modifier = {
				has_trait = compassionate
				add = -80
			}
			modifier = {
				has_trait = calm
				add = -50
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:understanding
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

	# You're the most beautiful PERSON in the world
	option = {
		name = ep2_wedding.1300.beauty
		custom_tooltip = ep2_wedding.1300.beauty.tt #This option is available because SPOUSE is renowned for THEIR looks
		custom_tooltip = ep2_wedding.1300.followup.tt

		trigger = {
			scope:spouse_2 = {
				OR = {
					has_trait = beauty_good_1
					has_trait = beauty_good_2
					has_trait = beauty_good_3
				}
			}
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.a
					show_chance = no
					scope:spouse_1 = {
						progress_towards_lover_effect = {
							CHARACTER = scope:spouse_2
							REASON = lover_shared_insecurity
							OPINION = default_lover_opinion
						}
					}
				}
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			chaste = minor_stress_impact_gain
			lustful = minor_stress_impact_loss
			honest = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.25
			}
			modifier = {
				has_trait = chaste
				add = -50
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:beauty
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}

	# You will give me many strong heirs
	option = {
		name = ep2_wedding.1300.fertility
		custom_tooltip = ep2_wedding.1300.fertility.tt #This option is available because SPOUSE has the right qualities to be a prolific PARENT
		custom_tooltip = ep2_wedding.1300.followup.tt

		trigger = {
			scope:spouse_2 = {
				OR = {
					has_trait = physique_good_1
					has_trait = physique_good_2
					has_trait = physique_good_3
					has_trait = fecund
					has_trait = lustful
				}
			}
		}
		show_as_tooltip = {
			random_list = {
				10 = {
					desc = ep2_wedding.1300.followup.b
					show_chance = no			
				}
				10 = {
					desc = ep2_wedding.1300.followup.c
					show_chance = no
					scope:spouse_1 = {
						progress_towards_rival_effect = {
							REASON = rival_shared_insecurity
							CHARACTER = scope:spouse_2
							OPINION = -20
						}
					}				
				}
			}
		}
		stress_impact = {
			chaste = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			lustful = medium_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_rationality = 0.5
			}
			modifier = {
				has_trait = chaste
				add = -50
			}
			modifier = {
				has_trait = compassionate
				add = -50
			}
		}
		save_scope_value_as = {
			name = reassurance
			value = flag:fertility
		}
		scope:spouse_2 = {
			trigger_event = {
				id = ep2_wedding.1301
			}
		}
	}
	after = {
		remove_character_flag = is_naked
		scope:spouse_2 = {
			remove_character_flag = is_naked
		}
	}
}

ep2_wedding.1301 = { #Spouse response
	type = activity_event
	title = ep2_wedding.1301.t
	desc = {
		desc = ep2_wedding.1301.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {	scope:insecurity = flag:appearance }
				desc = ep2_wedding.1301.desc_appearance
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:dark_past }
				desc = ep2_wedding.1301.desc_dark_past
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:voice }
				desc = ep2_wedding.1301.desc_voice
			}
			triggered_desc = {
				trigger = {	scope:insecurity = flag:lowborn }
				desc = ep2_wedding.1301.desc_lowborn
			}
		}
		desc = ep2_wedding.1301.desc_midtro
		first_valid = {
			triggered_desc = {
				trigger = {	scope:reassurance = flag:virtue }
				desc = ep2_wedding.1301.desc_virtue
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:rule_together }
				desc = ep2_wedding.1301.desc_rule_together
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:practical }
				desc = ep2_wedding.1301.desc_practical
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:stop_whining }
				desc = ep2_wedding.1301.desc_stop_whining
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:understanding }
				desc = ep2_wedding.1301.desc_understanding
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:beauty }
				desc = ep2_wedding.1301.desc_beauty
			}
			triggered_desc = {
				trigger = {	scope:reassurance = flag:fertility }
				desc = ep2_wedding.1301.desc_fertility
			}
		}
		desc = ep2_wedding.1301.desc_outro
	}
	theme = wedding_night_activity
	left_portrait = {
		character = scope:spouse_1
		animation = thinking
	}
	right_portrait = {
		character = root
		animation = worry
	}

	immediate = {
		add_character_flag = is_naked
		scope:spouse_1 = {
			add_character_flag = is_naked
		}
	}

	option = { #I want to be worthy of your love...
		name = ep2_wedding.1301.love
		trigger = {
			is_attracted_to_gender_of = scope:spouse_1
			NOR = {
				scope:reassurance = flag:fertility
				scope:reassurance = flag:stop_whining
				scope:reassurance = flag:practical
			}
		}
		scope:spouse_1 = {
			send_interface_toast = {
				title = ep2_wedding.1301.outcome.love
				left_icon = scope:spouse_2
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_whyme_love_log
						tags = { good }
						score = 25
						character = scope:spouse_1
						target = scope:spouse_2

						# Effect
						scope:spouse_1 = {
							if = {
								limit = {
									has_activity_intent = woo_attendee_intent
									intent_target = scope:spouse_2
									can_set_relation_lover_trigger = { CHARACTER = scope:spouse_2 }
								}
								set_relation_lover = {
									reason = lover_shared_insecurity
									target = scope:spouse_2
								}
								complete_activity_intent = yes
							}
							else = {
								progress_towards_lover_effect = {
									CHARACTER = scope:spouse_2
									REASON = lover_shared_insecurity
									OPINION = default_lover_opinion
								}
							}
						}
						scope:spouse_2 = {
							add_character_modifier = {
								modifier = wedding_soothed_insecurity_modifier
								years = 15
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -0.25
			}
			modifier = {
				scope:reassurance = flag:understanding
				add = 30
			}
			modifier = {
				scope:reassurance = flag:beauty
				add = 15
			}
			modifier = {
				scope:spouse_1 = { has_trait = compassionate }
				add = 20
			}
			modifier = {
				scope:spouse_1 = { attraction >= low_positive_attraction }
				add = 20
			}
			modifier = {
				scope:spouse_1 = { attraction >= medium_positive_attraction }
				add = 30
			}
			modifier = {
				scope:spouse_1 = { attraction >= high_positive_attraction }
				add = 50
			}
			modifier = {
				scope:spouse_1 = { attraction <= low_negative_attraction }
				add = -20
			}
			modifier = {
				scope:spouse_1 = { attraction <= medium_negative_attraction }
				add = -30
			}
			modifier = {
				scope:spouse_1 = { attraction <= high_negative_attraction }
				add = -50
			}
		}	
	}

	option = { #I want to trust you...
		name = ep2_wedding.1301.trust
		trigger = {
			NOR = {
				scope:reassurance = flag:fertility
				scope:reassurance = flag:stop_whining
			}
		}
		scope:spouse_1 = {
			send_interface_toast = {
				title = ep2_wedding.1301.outcome.trust
				left_icon = scope:spouse_2
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_whyme_trust_log
						tags = { good }
						score = 25
						character = scope:spouse_1
						target = scope:spouse_2

						# Effect
						scope:spouse_1 = {
							if = {
								limit = {
									has_activity_intent = woo_attendee_intent
									intent_target = scope:spouse_2
									can_set_relation_lover_trigger = { CHARACTER = scope:spouse_2 }
								}
								set_relation_lover = {
									reason = lover_shared_insecurity
									target = scope:spouse_2
								}
								complete_activity_intent = yes
							}
							else = {
								progress_towards_lover_effect = {
									CHARACTER = scope:spouse_2
									REASON = lover_shared_insecurity
									OPINION = default_lover_opinion
								}
							}
						}
						scope:spouse_2 = {
							add_character_modifier = {
								modifier = wedding_soothed_insecurity_modifier
								years = 15
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.25
			}
			modifier = {
				scope:reassurance = flag:rule_together
				add = 30
			}
			modifier = {
				scope:reassurance = flag:virtue
				add = 30
			}
			modifier = {
				scope:spouse_1 = { has_trait = honest }
				add = 30
			}
			modifier = {
				scope:spouse_1 = { num_virtuous_traits >= 1 }
				add = 20
			}
		}
	}

	option = { #I'm being silly
		name = ep2_wedding.1301.silly

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			modifier = {
				scope:reassurance = flag:practical
				add = 30
			}
			modifier = {
				scope:reassurance = flag:fertility
				add = 30
			}
			modifier = {
				scope:reassurance = flag:rule_together
				add = 10
			}
		}
		scope:spouse_1 = {
			send_interface_toast = {
				title = ep2_wedding.1301.outcome.silly
				left_icon = scope:spouse_2
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_whyme_silly_log
						tags = { bad }
						score = 25
						character = scope:spouse_1
						target = scope:spouse_2

						# Effect
						scope:spouse_2 = {
							add_character_modifier = {
								modifier = wedding_practical_marriage_modifier
								years = 15
							}
						}
					}
				}
			}
		}
	}

	option = { #Misunderstood
		name = ep2_wedding.1301.misunderstood

		ai_chance = {
			base = 120
			ai_value_modifier = {
				ai_energy = -0.25
			}
			modifier = {
				scope:reassurance = flag:practical
				add = 5
			}
			modifier = {
				scope:reassurance = flag:fertility
				add = 10
			}
			modifier = {
				scope:reassurance = flag:stop_whining
				add = 20
			}
		}
		scope:spouse_1 = {
			send_interface_toast = {
				title = ep2_wedding.1301.outcome.misunderstood
				left_icon = scope:spouse_2
				scope:activity = {
					add_activity_log_entry = {
						key = wedding_whyme_misunderstood_log
						tags = { bad }
						score = 25
						character = scope:spouse_1
						target = scope:spouse_2

						# Effect
						scope:spouse_1 = {
							progress_towards_rival_effect = {
								REASON = rival_shared_insecurity
								CHARACTER = scope:spouse_2
								OPINION = -20
							}
						}
						scope:spouse_2 = {
							add_character_modifier = {
								modifier = wedding_insecure_marriage_modifier
								years = 15
							}
						}
					}
				}
			}
		}
	}

	after = {
		remove_character_flag = busy_in_wnight_event
		remove_character_flag = is_naked
		scope:spouse_1 = { 
			remove_character_flag = busy_in_wnight_event 
			remove_character_flag = is_naked
		}
	}
}



##################################################
# A Friend Is Monopolizing Your Attention
# by Luke Bean
# ep2_wedding.1310
##################################################

scripted_trigger ep2_wedding_1310_wedding_friend_trigger = {
	any_relation = { type = friend this = root }
	is_adult = yes
	is_ai = yes
	NOR ={
		AND = {
			this = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		} # If the spouses are friends, that's adorable but incompatible with this event
		AND = {
			this = scope:activity.special_guest:spouse_2
			root = scope:activity.special_guest:spouse_1
		}
	}
}

ep2_wedding.1310 = {
	type = activity_event
	title = ep2_wedding.1310.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						this = scope:spouse_1
						this = scope:spouse_2
					}
				}
				desc = ep2_wedding.1310.desc_spouse
			}
			triggered_desc = {
				trigger = {
					this = scope:host
				}
				desc = ep2_wedding.1310.desc_host
			}
			desc = ep2_wedding.1310.desc_guest
		}
	}

	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = laugh
	}
	center_portrait = {
		character = scope:other_guest
		animation = disapproval
	}
	right_portrait = {
		character = scope:friend
		animation = wedding_drunk
	}

	lower_right_portrait = scope:other_spouse

	cooldown = { years = 10 }

	trigger = {
		has_ep2_dlc_trigger = yes
		scope:activity = {
			any_attending_character = {
				ep2_wedding_1310_wedding_friend_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			has_trait = shy
			add = 1
		}
		modifier = {
			has_trait = lifestyle_reveler
			add = 1
		}
		modifier = {
			scope:activity = { exists = var:lovers_wedding }
			add = -1
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 1
		}
		modifier = {
			is_ai = yes
			factor = 0.1
		}
	}

	immediate = {
		scope:activity.special_guest:spouse_1 = { save_scope_as = spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = spouse_2 }
		scope:activity = {
			random_attending_character = {
				limit = {
					ep2_wedding_1310_wedding_friend_trigger = yes
				}
				save_scope_as = friend
			}
		}
		if = {
			limit = {
				#If you're one of the spouses
				OR = {
					this = scope:spouse_1
					this = scope:spouse_2
				}
			}
			if = {
				limit = { this = scope:spouse_1 }
				 #The person judging you will probably be a close relative of your new spouse, but could also be the spouse themselves
				scope:spouse_2 = { save_scope_as = other_spouse }
				random_list = {
					100 = {
						trigger = {
							scope:activity = {
								any_attending_character = {
									NOT = {
										any_relation = { type = friend this = root }
										any_relation = { type = friend this = scope:friend }
										this = root
										this = scope:friend
									}
									is_adult = yes
									is_ai = yes
									is_close_family_of = scope:spouse_2
								}
							}	
						}
						scope:activity = {
							random_attending_character = {
								limit = {
									NOT = {
										any_relation = { type = friend this = root }
										any_relation = { type = friend this = scope:friend }
										this = root
										this = scope:friend
									}
									is_adult = yes
									is_ai = yes
									is_close_family_of = scope:spouse_2
								}
								save_scope_as = other_guest
							}
						}
					}
					50 = {
						scope:spouse_2 = { save_scope_as = other_guest }
					}
				}
			}
			else = {
				scope:spouse_1 = { save_scope_as = other_spouse }
				random_list = {
					100 = {
						trigger = {
							scope:activity = {
								any_attending_character = {
									NOT = {
										any_relation = { type = friend this = root }
										any_relation = { type = friend this = scope:friend }
										this = root
										this = scope:friend
									}
									is_adult = yes
									is_ai = yes
									is_close_family_of = scope:spouse_1
								}
							}
						}
						scope:activity = {
							random_attending_character = {
								limit = {
									NOT = {
										any_relation = { type = friend this = root }
										any_relation = { type = friend this = scope:friend }
										this = root
										this = scope:friend
									}
									is_adult = yes
									is_ai = yes
									is_close_family_of = scope:spouse_1
								}
								save_scope_as = other_guest
							}
						}
					}
					50 = {
						scope:spouse_1 = { save_scope_as = other_guest }
					}
				}
			}
		}
		else_if = {
			limit = { this = scope:host }  # If you are the host, the judgy guest can be either spouse or any of their close family
			random_list = {
				100 = {
					trigger = {
						NOT = {
							scope:spouse_1 = {
								any_relation = {
									type = friend
									this = root
								}
							}
						}
					}
					scope:spouse_1 = { save_scope_as = other_guest }
				}
				100 = {
					trigger = { NOT = { scope:spouse_2 = { any_relation = { type = friend this = root } } } }
					scope:spouse_2 = { save_scope_as = other_guest }
				}
				100 = {
					trigger = {
						scope:activity = {
							any_attending_character = {
								NOT = {
									any_relation = { type = friend this = root }
									any_relation = { type = friend this = scope:friend }
									this = root
									this = scope:friend
								}
								is_adult = yes
								is_ai = yes
								OR = {
									is_close_family_of = scope:spouse_1
									is_close_family_of = scope:spouse_2
								}
							}
						}
					}
					scope:activity = {
						random_attending_character = {
							limit = {
								NOT = {
									any_relation = { type = friend this = root }
									any_relation = { type = friend this = scope:friend }
									this = root
									this = scope:friend
								}
								is_adult = yes
								is_ai = yes
								OR = {
									is_close_family_of = scope:spouse_1
									is_close_family_of = scope:spouse_2
								}
							}
							save_scope_as = other_guest
						}
					}
				}
				1 = {
					scope:activity = { random_attending_character = { save_scope_as = other_guest } } #In case you're friends with both spouses and their entire families, I guess.
				}
			}
		}
		else = {
			random_list = {
				10 = {
					trigger = { NOT = { scope:spouse_1 = { any_relation = { type = friend this = root } } } } #Same options as if you're the host, but much less likely to grab the spouses
					scope:spouse_1 = { save_scope_as = other_guest }
				}
				10 = {
					trigger = { NOT = { scope:spouse_2 = { any_relation = { type = friend this = root } } } }
					scope:spouse_2 = { save_scope_as = other_guest }
				}
				100 = {
					trigger = {
						scope:activity = {
							any_attending_character = {
								NOT = {
									any_relation = { type = friend this = root }
									any_relation = { type = friend this = scope:friend }
									this = root
									this = scope:friend
								}
								is_adult = yes
								is_ai = yes
								OR = {
									is_close_family_of = scope:spouse_1
									is_close_family_of = scope:spouse_2
								}
							}
						}
					}
					scope:activity = {
						random_attending_character = {
							limit = {
								NOT = {
									any_relation = { type = friend this = root }
									any_relation = { type = friend this = scope:friend }
									this = root
									this = scope:friend
								}
								is_adult = yes
								is_ai = yes
								OR = {
									is_close_family_of = scope:spouse_1
									is_close_family_of = scope:spouse_2
								}
							}
							save_scope_as = other_guest
						}
					}
				}
				1 = {
					scope:activity = { random_attending_character = { save_scope_as = other_guest } }
				}
			}
		}
	}

	# What a joy to have FRIEND here with me!
	option = {
		name = ep2_wedding.1310.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_banquet_bond_log
				tags = { good }
				score = 25
				character = root
				target = scope:friend

				# Effect
				root = {
					if = {
						limit = {
							can_set_relation_best_friend_trigger = { CHARACTER = scope:friend }
						}
						set_relation_best_friend = { reason = best_friend_great_time_at_wedding copy_reason = friend target = scope:friend }
					}
					if = {
						limit = {
							OR = {
								this = scope:spouse_1
								this = scope:spouse_2
								this = scope:host
							}
						}
						reverse_add_opinion = {
							target = scope:other_guest
							modifier = insult_opinion
							opinion = -30
						}
					}
					stress_impact = {
						base = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.1
			}
			modifier = {
				has_trait = lustful
				add = -15
			}
			modifier = {
				has_trait = gregarious
				add = -25
			}
		}
	}

	# OTHER GUEST, come join us!
	option = {
		name = ep2_wedding.1310.b
		random_list = {
			50 = { #Third person befriends you both
				desc = ep2_wedding.1310.b.newfriends
				compatibility_modifier = {
					who = scope:friend
					compatibility_target = scope:other_guest
					multiplier = 3
					max = 50
					min = -30
				}
				send_interface_toast = {
					title = ep2_wedding.1310.b.newfriends
					left_icon = scope:other_guest
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_cannot_escape_friends_log
							tags = { good }
							score = 25
							character = root
							target = scope:other_guest

							# Effect
							root = {
								if = {
									limit = {
										can_set_relation_friend_trigger = { CHARACTER = scope:other_guest }
									}
									set_relation_friend = {
										reason = friend_great_time_at_wedding
										target = scope:other_guest
										province = root.location
									}
								}
								stress_impact = {
									gregarious = medium_stress_impact_loss
								}
							}
							scope:friend = {
								if = {
									limit = {
										can_set_relation_friend_trigger = { CHARACTER = scope:other_guest }
									}
									set_relation_friend = {
										reason = friend_great_time_at_wedding
										target = scope:other_guest
										province = root.location
									}
								}
							}
						}
					}
				}
			}
			50 = { #Everyone has a good time
				desc = ep2_wedding.1310.b.goodtime
				compatibility_modifier = {
					who = scope:friend
					compatibility_target = scope:other_guest
					multiplier = 2
					max = 35
					min = -35
				}
				send_interface_toast = {
					title = ep2_wedding.1310.b.goodtime
					left_icon = scope:other_guest
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_cannot_escape_goodtime_log
							tags = { betrothal }
							score = 25
							character = root
							target = scope:other_guest

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:other_guest
									modifier = friendliness_opinion
									opinion = 30
								}
								reverse_add_opinion = {
									target = scope:friend
									modifier = friendliness_opinion
									opinion = 30
								}
								stress_impact = {
									gregarious = minor_stress_impact_loss
								}
							}
						}
					}
				}
			}
			40 = { #Everyone has a bad time
				desc = ep2_wedding.1310.b.badtime
				compatibility_modifier = {
					who = scope:friend
					compatibility_target = scope:other_guest
					multiplier = -3
					max = 60
					min = -9
				}
				send_interface_toast = {
					title = ep2_wedding.1310.b.badtime
					left_icon = scope:other_guest
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_cannot_escape_badtime_log
							tags = { betrothal }
							score = 25
							character = root
							target = scope:other_guest

							#Effect
							if = {
								limit = {
									scope:friend = { can_set_relation_rival_trigger = { CHARACTER = scope:other_guest } }
								}
								scope:friend = {
									set_relation_rival = {
										target = scope:other_guest
										reason = rival_bad_time_at_wedding
									}
								}
							}
							root = {
								stress_impact = {
									base = minor_stress_impact_gain
								}
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 0.5
			}
			modifier = {
				has_trait = gregarious
				add = 20
			}
			modifier = {
				has_trait = shy
				add = -75
			}
		}
	}

	# Let's sneak out so we can talk properly!
	option = {
		name = ep2_wedding.1310.c		
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_cannot_escape_sneak_log
				tags = { betrothal }
				score = 25
				character = root
				target = scope:friend

				# Effect
				root = {
					if = {
						limit = { NOT = { has_trait = confider } }
						add_trait = confider
					}
					else = {
						add_stress = major_stress_impact_loss
					}
				}
				scope:other_guest = {
					if = {
						limit = {
							OR = {
								this = scope:spouse_1
								this = scope:spouse_2
							}
						}
						progress_towards_rival_effect = {
							REASON = rival_dishonored_wedding_banquet
							CHARACTER = root
							OPINION = 0
						}
					}
					else = {
						add_opinion = {
							target = root
							modifier = insult_opinion
							opinion = -30
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
			}
			modifier = {
				has_trait = shy
				add = 20
			}
			modifier = {
				has_trait = gregarious
				add = -50
			}
		}
	}

	option = { # You must excuse me, my friend.
		name = ep2_wedding.1310.d
		flavor = ep2_wedding.1310.d.tt
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_cannot_escape_excuse_log
				tags = { betrothal }
				score = 25
				character = root
				target = scope:other_guest

				# Effect
				scope:other_guest = {
					progress_towards_friend_effect = {
						REASON = friend_great_time_at_wedding
						CHARACTER = root
						OPINION = 0
					}
				}
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
			}
			modifier = {
				has_trait = gregarious
				add = -20
			}
		}
	}
}

######################################
# A Rival Seeks Forgiveness 
# by Luke Bean
# ep2_wedding.1320
######################################

scripted_trigger ep2_wedding_1320_forgiving_rival_trigger = {
	is_adult = yes
	is_ai = yes
	any_relation = { type = rival this = root }
	NOR = {
		has_character_flag = busy_in_wnight_event
		has_trait = vengeful
		has_trait = arrogant
		any_relation = { type = nemesis this = root }
	}
	OR = {
		has_trait = forgiving
		has_trait = humble
		has_trait = compassionate
		AND = {
			has_trait = zealous
			this.faith = { trait_is_virtue = forgiving }
		}
		trait_compatibility = {
			target = root
			value >= medium_positive_trait_compatibility # We're not so different, you and I...
		}
	}
	NOR = {
		AND = {
			root = scope:activity.special_guest:spouse_1 # Never triggers for rival spouses
			this = scope:activity.special_guest:spouse_2
		}
		AND = {
			root = scope:activity.special_guest:spouse_2
			this = scope:activity.special_guest:spouse_1
		}
	}
}

ep2_wedding.1320 = {
	type = activity_event
	title = ep2_wedding.1320.t
	desc = {
		desc = ep2_wedding.1320.desc_intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:role = flag:host
					scope:rival_role = flag:spouse
				}
				desc = ep2_wedding.1320.desc_host_vs_spouse
			}
			triggered_desc = {
				trigger = {
					scope:role = flag:host
					scope:rival_role = flag:guest
				}
				desc = ep2_wedding.1320.desc_host_vs_guest
			}
			triggered_desc = {
				trigger = {
					scope:role = flag:spouse
					scope:rival_role = flag:guest
				}
				desc = ep2_wedding.1320.desc_spouse_vs_guest
			}
			triggered_desc = {
				trigger = {
					scope:role = flag:guest
					scope:rival_role = flag:host
				}
				desc = ep2_wedding.1320.desc_guest_vs_host
			}
			triggered_desc = {
				trigger = {
					scope:role = flag:guest
					scope:rival_role = flag:spouse
				}
				desc = ep2_wedding.1320.desc_guest_vs_spouse
			}
			triggered_desc = {
				trigger = {
					scope:role = flag:spouse
					scope:rival_role = flag:host
				}
				desc = ep2_wedding.1320.desc_spouse_vs_host
			}
			desc = ep2_wedding.1320.desc_guest_vs_guest
		}
		desc = ep2_wedding.1320.desc_outro
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	right_portrait = {
		character = scope:rival
		animation = shame
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		scope:activity = {
			any_attending_character = {
				ep2_wedding_1320_forgiving_rival_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			OR = {
				root = scope:host
				scope:host = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
				}
			}
			add = 5 # Very, very likely to happen if one rival invited and the other accepted
		}
		modifier = {
			OR = {
				root = scope:activity.special_guest:spouse_1
				scope:activity.special_guest:spouse_2 = { ep2_wedding_1320_forgiving_rival_trigger = yes }
			}
			add = 3 # Much more likely to happen on the occasion of one of the rivals' weddings
		}
		modifier = {
			has_trait = forgiving ### More likely to happen if the rival thinks root is the sort of person who might forgive them
			add = 1
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
					has_trait = forgiving
				}
			}
			add = 1
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
					has_trait = humble
				}
			}
			add = 1
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
					has_trait = compassionate
				}
			}
			add = 1
		}
		modifier = {
			scope:activity = {
				any_attending_character = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
					has_trait = zealous
					faith = { trait_is_virtue = forgiving }
				}
			}
			add = 1
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
					OR = {
						has_trait = forgiving
						has_trait = humble
						has_trait = compassionate
						AND = {
							has_trait = zealous
							faith = { trait_is_virtue = forgiving }
						}
					}
				}
				alternative_limit = {
					ep2_wedding_1320_forgiving_rival_trigger = yes
				}
				save_scope_as = rival
			}
		}
		if = {
			limit = {
				root = scope:host
			}
			save_scope_value_as = {
				name = role
				value = flag:host
			}
		}
		else_if = {
			limit = {
				OR = {
					root = scope:activity.special_guest:spouse_1
					root = scope:activity.special_guest:spouse_2
				}
			}
			save_scope_value_as = {
				name = role
				value = flag:spouse
			}
		}
		else = {
			save_scope_value_as = {
				name = role
				value = flag:guest
			}
		}
		if = {
			limit = {
				scope:rival = scope:host
			}
			save_scope_value_as = {
				name = rival_role
				value = flag:host
			}
		}
		else_if = {
			limit = {
				OR = {
					scope:rival = scope:activity.special_guest:spouse_1
					scope:rival = scope:activity.special_guest:spouse_2
				}
			}
			save_scope_value_as = {
				name = rival_role
				value = flag:spouse
			}
		}
		else = {
			save_scope_value_as = {
				name = rival_role
				value = flag:guest
			}
		}
	}

	# Embrace RIVAL and let bygones be bygones!
	option = {
		name = ep2_wedding.1320.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_embraced_rival_log
				tags = { rival }
				score = 25
				character = root
				target = scope:rival

				#Effect
				root = {
					remove_relation_rival = scope:rival
					random_list = {
						80 = {
							send_interface_toast = {
								title = ep2_wedding.1320.a.friendliness
								left_icon = scope:rival
								reverse_add_opinion = {
									target = scope:rival
									modifier = friendliness_opinion
									opinion = 30
								}
							}
						}
						20 = {
							compatibility_modifier = {
								who = root
								compatibility_target = scope:rival
								multiplier = 3
								max = 50
								min = -30
							}
							send_interface_toast = {
								title = ep2_wedding.1320.a.friend
								left_icon = scope:rival
								set_relation_friend = { reason = friend_reconciled_at_wedding target = scope:rival }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			vengeful = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			forgiving = massive_stress_impact_loss
			compassionate = major_stress_impact_loss
			gregarious = minor_stress_impact_loss
			humble = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.2
				ai_compassion = 0.5
				ai_sociability = 0.2
			}
			modifier = {
				has_trait = vengeful
				add = -100
			}
			modifier = {
				has_trait = arrogant
				add = -50
			}
			modifier = {
				has_trait = forgiving
				add = 100
			}
		}
	}

	# Hurl a DISH in RIVAL's face.
	option = {
		name = ep2_wedding.1320.b
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_dished_rival_log
				tags = { rival }
				score = 25
				character = root
				target = scope:rival

				# Effect
				root = {
					add_dread = minor_dread_gain
				}
			}
		}
		random_list = {
			100 = {
				desc = ep2_wedding.1310.b.nowound
				send_interface_toast = {
					title = ep2_wedding.1310.b.nowound
					left_icon = scope:rival
					reverse_add_opinion = {
						target = scope:rival
						modifier = angry_opinion
						opinion = -50
					}
				}
			}
			30 = {
				desc = ep2_wedding.1310.b.wound
				trigger = {
					can_set_relation_nemesis_trigger = { CHARACTER = scope:rival }
				}
				send_interface_toast = {
					title = ep2_wedding.1310.b.wound
					left_icon = scope:rival
					scope:rival = { increase_wounds_effect = { REASON = fight } }
					set_relation_nemesis = { reason = nemesis_spurned_reconciliation_at_wedding target = scope:rival }
				}
			}
			30 = {
				desc = ep2_wedding.1310.b.wound
				trigger = {
					NOT = { can_set_relation_nemesis_trigger = { CHARACTER = scope:rival } }
				}
				send_interface_toast = {
					title = ep2_wedding.1310.b.wound
					left_icon = scope:rival
					scope:rival = { increase_wounds_effect = { REASON = fight } }
				}
			}
		}
		if = {
			limit = {
				has_activity_intent = banquet_mischief_intent
			}
			stress_impact = {
				base = minor_stress_impact_loss
				vengeful = major_stress_impact_loss
			}
		}
		else = {
			stress_impact = {
				vengeful = medium_stress_impact_loss
				arrogant = medium_stress_impact_loss
				forgiving = massive_stress_impact_gain
				compassionate = major_stress_impact_gain
				gregarious = minor_stress_impact_gain
				humble = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_compassion = -0.5
			}
			modifier = {
				has_trait = wrathful
				add = 30
			}
			modifier = {
				has_trait = impatient
				add = 30
			}
		}
	}

	# What's forgiveness worth to you?
	option = {
		name = ep2_wedding.1320.c

		duel = {
			target = scope:rival
			skill = diplomacy
			25 = {
				desc = ep2_wedding.1310.c.hook
				trigger = {
					can_add_hook = {
						target = scope:rival
						type = favor_hook
					}
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = ep2_wedding.1310.c.hook
					left_icon = scope:rival
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_hooked_rival_log
							tags = { rival }
							score = 25
							character = root
							target = scope:rival

							# Effect
							root = {
								remove_relation_rival = scope:rival
								add_hook = {
									target = scope:rival
									type = favor_hook
								}
							}
						}
					}
				}
			}
			30 = {
				desc = ep2_wedding.1310.c.apology
				compare_modifier = {
					value = scope:duel_value
					multiplier = 2
				}
				send_interface_toast = {
					title = ep2_wedding.1310.c.apology
					left_icon = scope:rival
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_apology_rival_log
							tags = { rival }
							score = 25
							character = root
							target = scope:rival

							# Effect
							root = {
								remove_relation_rival = scope:rival
								add_prestige = medium_prestige_value
							}
						}
					}
				}
			}
			35 = {
				desc = ep2_wedding.1310.c.refusal
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = ep2_wedding.1310.c.refusal
					left_icon = scope:rival
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_refusal_rival_log
							tags = { rival }
							score = 25
							character = root
							target = scope:rival

							# Effect
							root = {
								reverse_add_opinion = {
									target = scope:rival
									modifier = angry_opinion
									opinion = -50
								}
							}
						}
					}
				}
			}
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
			modifier = {
				has_trait = ambitious
				add = 10
			}
		}
	}

	#Ignore RIVAL until they leave.
	option = {
		name = ep2_wedding.1320.d
		add_prestige = minor_prestige_gain
		scope:rival = { add_prestige = minor_prestige_loss }
		reverse_add_opinion = {
			target = scope:rival
			modifier = angry_opinion
			opinion = -20
		}
		if = {
			limit = {
				has_activity_intent = reduce_stress_intent
			}
			stress_impact = {
				base = minor_stress_impact_loss
			}
		}
		ai_chance = {
			base = 80
			modifier = {
				has_activity_intent = reduce_stress_intent
				add = 50
			}
			ai_value_modifier = {
				ai_energy = -0.5
			}
		}
	}
}

##############################################
# We Were Lovers Before The Wedding 
# by Luke Bean
# ep2_wedding.1330
##############################################

scripted_trigger ep2_wedding_1330_doubts_own_fidelity_trigger = {
	OR = {
		has_trait = lustful
		has_trait = seducer
		has_trait = rakish
		any_relation = {
			type = lover
			this != scope:spouse
		}
	}
}

ep2_wedding.1330 = {
	type = activity_event
	title = ep2_wedding.1330.t
	desc = ep2_wedding.1330.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:spouse
		animation = flirtation
	}

	cooldown = { years = 10 }

	trigger = {
		has_ep2_dlc_trigger = yes
		scope:activity = { exists = var:lovers_wedding }
		OR = {
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
	}

	weight_multiplier = {
		base = 100
	}

	immediate = {
		if = {
			limit = { root = scope:activity.special_guest:spouse_1 }
			scope:activity.special_guest:spouse_2 = { save_scope_as = spouse }
		}
		else_if = {
			limit = { root = scope:activity.special_guest:spouse_2 }
			scope:activity.special_guest:spouse_1 = { save_scope_as = spouse }
		}
		if = {
			limit = {
				any_relation = { type = soulmate this != scope:spouse }
			}
			random_relation = {
				type = soulmate
				limit = { this != scope:spouse }
				save_scope_as = soulmate
			}
		}
	}

	# I love this MAN beyond words
	option = {
		name = ep2_wedding.1330.a
		trigger = {
			can_set_relation_soulmate_trigger = { CHARACTER = scope:spouse }
		}

		set_relation_soulmate = {
			reason = soulmate_married_my_lover
			copy_reason = lover
			target = scope:spouse
		}
		# Achievements
		player_succeeded_at_a_thousand_and_one_nights_achievement_effect = yes

		stress_impact = {
			seducer = medium_stress_impact_gain
			rakish = medium_stress_impact_gain
			deceitful = minor_stress_impact_gain
			chaste = medium_stress_impact_loss
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -0.25
			}
			modifier = {
				has_trait = callous
				add = -20
			}
		}
	}

	# I will never need anyone else but HIM
	option = {
		name = ep2_wedding.1330.b
		trigger = {
			ep2_wedding_1330_doubts_own_fidelity_trigger = no
		}
		
		add_character_modifier = {
			modifier = wedding_wants_to_be_faithful_modifier
			years = 20
		}

		stress_impact = {
			fickle = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.25
			}
			modifier = {
				has_trait = chaste
				add = 20
			}
		}
	}

	# I will be faithful. I will change my ways!
	option = {
		name = ep2_wedding.1330.c
		trigger = {
			OR = {
				has_trait = rakish
				any_relation = {
					type = lover
					this != scope:spouse
				}
			}
		}
		
		add_character_modifier = {
			modifier = wedding_wants_to_be_faithful_modifier
			years = 20
		}
		if = {
			limit = { has_trait = rakish }
			random_list = {
				50 = {
					send_interface_toast = {
						title = ep2_wedding.1330.c.rakish.success
						remove_trait = rakish
						add_stress = major_stress_impact_gain
					}
				}
				50 = {
					send_interface_toast = {
						title = ep2_wedding.1330.c.rakish.failure
						add_stress = minor_stress_impact_gain
					}
				}
			}
		}
		every_relation ?= {
			type = lover
			limit = { this != scope:spouse }
			save_temporary_scope_as = lover
			if = {
				limit = { scope:lover = { is_ai = no } }
				scope:lover = {
					send_interface_toast = {
						title = ep2_wedding.1330.c.breakup
						left_icon = root
						root = { remove_relation_lover = scope:lover }
					}
				}
			}
			else = { root = { remove_relation_lover = scope:lover } }
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -0.25
				ai_honor = 0.25
			}
			modifier = {
				has_trait = lustful # lustful will avoid this option UNLESS...
				add = -30
			}
			modifier = {
				has_trait = lustful
				has_trait = compassionate # ...they have a reason to feel bad about it.
				add = 80
			}
			modifier = {
				has_trait = lustful
				has_trait = just
				add = 60
			}
			modifier = {
				has_trait = lustful
				has_trait = honest
				add = 60
			}
			modifier = {
				has_trait = lustful
				has_trait = zealous
				root.faith = { trait_is_virtue = chaste }
				add = 80
			}
		}
	}

	# I wonder if HE's into... that one thing?
	option = {
		name = ep2_wedding.1330.d
		trigger = {
			OR = {
				has_trait = deviant
				any_secret = { type = secret_deviant }
			}
			NOR = {
				faith = { has_doctrine = doctrine_deviancy_accepted }
				scope:spouse = { has_trait = deviant }
				scope:spouse = { any_secret = { type = secret_deviant NOT = { is_known_by = root } } }
			}
		}
		
		if = {
			limit = { any_secret = { type = secret_deviant NOT = { is_known_by = scope:spouse } } }
			every_secret = { type = secret_deviant reveal_to = scope:spouse }
		}

		hidden_effect = {
			if = {
				limit = { scope:spouse = { NOT = { any_secret = { type = secret_deviant } } } }
				random_list = {
					70 = {
						send_interface_toast = {
							title = ep2_wedding.1330.d.yuck
							left_icon = scope:spouse
							reverse_add_opinion = {
								target = scope:spouse
								modifier = disgusted_opinion
								opinion = -15
							}
						}
					}
					30 = {
						compatibility_modifier = {
							who = root
							compatibility_target = scope:spouse
							multiplier = 3
							max = 50
							min = -30
						}
						modifier = {
							scope:spouse = { has_trait = lustful }
							add = 50
						}
						modifier = {
							scope:spouse = { has_trait = chaste }
							add = -50
						}
						send_interface_toast = {
							title = ep2_wedding.1330.d.yum
							left_icon = scope:spouse
							scope:spouse = { add_secret = { type = secret_deviant } }
							reverse_add_opinion = {
								target = scope:spouse
								modifier = love_opinion
								opinion = 15
							}
						}
					}
				}
			}
			if = {
				limit = { scope:spouse = { any_secret = { type = secret_deviant NOT = { is_known_by = root } } } }
				send_interface_toast = {
					title = ep2_wedding.1330.d.yeahmetoo
					left_icon = scope:spouse
					scope:spouse = { every_secret = { type = secret_deviant reveal_to = root } }
					reverse_add_opinion = {
						target = scope:spouse
						modifier = love_opinion
						opinion = 15
					}
				}
			}
		}

		show_as_tooltip = {
			random_list = {
				1 = {
					desc = ep2_wedding.1330.d.yuck.tt
					show_chance = no
					reverse_add_opinion = {
						target = scope:spouse
						modifier = disgusted_opinion
						opinion = -15
					}
				}
				1 = {
					desc = ep2_wedding.1330.d.yum.tt
					show_chance = no
					scope:spouse = { add_secret = { type = secret_deviant } }
					reverse_add_opinion = {
						target = scope:spouse
						modifier = love_opinion
						opinion = 15
					}
				}
				1 = {
					desc = ep2_wedding.1330.d.yeahmetoo.tt
					show_chance = no
					custom_tooltip = ep2_wedding.1330.d.confession.tt
				}
			}
		}
		
		ai_chance = {
			base = 120
			ai_value_modifier = {
				ai_boldness = 0.25
			}
			modifier = {
				has_trait = lustful
				add = 20
			}
		}
	}

	# How could I have done this to SOULMATE?
	option = {
		name = ep2_wedding.1330.e
		trigger = {
			exists = scope:soulmate
		}
		
		remove_relation_lover = scope:spouse
		reverse_add_opinion = {
			target = scope:soulmate
			modifier = love_opinion
			opinion = 100
		}

		stress_impact = {
			base = major_stress_impact_loss
			stubborn = medium_stress_impact_gain
			chaste = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 90
			ai_value_modifier = {
				ai_honor = 0.25
				ai_boldness = -0.25
				ai_rationality = -0.5
			}
			modifier = {
				has_trait = fickle
				add = 30
			}
			modifier = {
				has_trait = arbitrary
				add = 10
			}
		}
	}

	# Am I really HIS only love?
	option = {
		name = ep2_wedding.1330.f
		hidden_effect = {
			random_list = {
				100 = { # Mind at ease
					send_interface_toast = {
						title = ep2_wedding.1330.f.mindatease
						left_icon = scope:spouse
						add_character_modifier = {
							modifier = wedding_mind_at_ease_modifier
							days = 3650
						}
					}
				}
				100 = { # Lingering doubts
					modifier = {
						scope:spouse = { has_trait = deceitful }
						add = 30
					}
					modifier = {
						scope:spouse = { has_trait = lustful }
						add = 20
					}
					modifier = {
						scope:spouse = { has_trait = honest }
						add = -30
					}
					modifier = {
						scope:spouse = { has_trait = chaste }
						add = -50
					}
					modifier = {
						has_trait = paranoid
						add = 50
					}
					modifier = {
						has_trait = trusting
						add = -60
					}

					send_interface_toast = {
						title = ep2_wedding.1330.f.lingeringdoubts
						left_icon = scope:spouse
						add_character_modifier = {
							modifier = wedding_lingering_doubts_modifier
							days = 3650
						}
					}
				}
				100 = { # Confess all
					trigger = { scope:spouse = { any_secret = { type = secret_lover NOT = { is_known_by = root } } } }
					modifier = {
						scope:spouse = { has_trait = honest }
						add = 200
					}
					modifier = {
						scope:spouse = { has_trait = compassionate }
						add = 20
					}
					modifier = {
						scope:spouse = { has_trait = just }
						add = 40
					}
					modifier = {
						scope:spouse = { has_trait = deceitful }
						add = -100
					}
					modifier = {
						scope:spouse = { has_trait = callous }
						add = -20
					}
					modifier = {
						scope:spouse = { has_trait = sadistic } # "The LOOK on your face!"
						add = 20
					}
					send_interface_toast = {
						title = ep2_wedding.1330.f.confession
						left_icon = scope:spouse
						scope:spouse = { every_secret = { type = secret_lover limit = { NOT = { is_known_by = root } } reveal_to = root } }
					}
				}
			}
		}
		show_as_tooltip = {
			random_list = {
				1 = {
					desc = ep2_wedding.1330.f.lingeringdoubts.tt
					show_chance = no
					add_character_modifier = {
						modifier = wedding_lingering_doubts_modifier
						days = 3650
					}
				}
				1 = {
					desc = ep2_wedding.1330.f.mindatease.tt
					show_chance = no
					add_character_modifier = {
						modifier = wedding_mind_at_ease_modifier
						days = 3650
					}
				}
				1 = {
					desc = ep2_wedding.1330.f.confession.desc
					show_chance = no
					custom_tooltip = ep2_wedding.1330.f.confession.tt
				}
			}
		}
		stress_impact = {
			trusting = minor_stress_impact_gain
		}
		
		ai_chance = {
			base = 90
			modifier = {
				has_trait = paranoid
				add = 50
			}
		}
	}

	# Finally, we have no need to hide our love!
	option = {
		name = ep2_wedding.1330.g

		stress_impact = {
			base = medium_stress_impact_loss
			honest = major_stress_impact_loss
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -0.5
			}
			modifier = {
				has_trait = honest
				add = 50
			}
		}
	}
}

##################################################
# Condolences On Your Wedding
# by Luke Bean
# ep2_wedding.1340
##################################################

scripted_trigger ep2_wedding_1340_marriage_cynic_trigger = {
	is_ai = yes 
	OR = {
		any_spouse = { # dislikes a spouse
			OR = {
				reverse_opinion = {
					target = prev
					value <= low_negative_opinion
				}
				has_relation_rival = prev
			}
		}
		any_memory = { memory_type = spouse_committed_adultery } # has been cheated on
		AND = { # has been divorced
			any_former_spouse = { }
			NOT = {
				any_memory = { memory_type = spouse_died }
			}
		}
	}
}

scripted_trigger ep2_wedding_1340_unusual_hobbies_trigger = {
	OR = {
		AND = {
			has_trait = lustful
			any_relation = {
				type = lover
				this != scope:intended
			}
		}
		has_trait = seducer
		has_trait = torturer
		has_trait = rakish
		has_trait = cannibal
		any_secret = { type = secret_cannibal }
		has_trait = witch
		any_secret = { type = secret_witch }
	}
}

scripted_effect ep2_wedding_1340_add_confidence = {
	if = {
		limit = {
			this = { is_female = yes }
		}
		add_character_modifier = wedding_confident_bride
	}
	else = { add_character_modifier = wedding_confident_groom }
}

ep2_wedding.1340 = {
	type = activity_event
	title = ep2_wedding.1340.t
	desc = {
		desc = ep2_wedding.1340.desc.intro
		random_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:disliked_spouse
					scope:cynic = {
						NOR = {
							has_trait = lustful
							has_trait = seducer
							has_trait = rakish
						}
					}
				}
				desc = ep2_wedding.1340.desc.dislikes_spouse
			}
			triggered_desc = {
				trigger = {
					exists = scope:disliked_spouse
					scope:cynic = {
						OR = { # dislikes a spouse and has a lust-related trait
							has_trait = lustful
							has_trait = seducer
							has_trait = rakish
						}
					}
				}
				desc = ep2_wedding.1340.desc.dislikes_spouse_lustful
			}
			triggered_desc = {
				trigger = {
					scope:cynic = {
						AND = { # has been divorced
							any_former_spouse = { }
							NOT = {
								any_memory = {
									memory_type = spouse_died
								}
							}
						}
					}
					exists = scope:divorced_spouse
				}
				desc = ep2_wedding.1340.desc.divorced
			}
			triggered_desc = {
				trigger = { # has been cheated on
					NOT = { exists = scope:adulterous_spouse } # separate loc if they can name them
					scope:cynic = {
						any_memory = {
							memory_type = spouse_committed_adultery
						}
					}
				}
				desc = ep2_wedding.1340.desc.cheated_on
			}
			triggered_desc = {
				trigger = {
					exists = scope:adulterous_spouse
				}
				desc = ep2_wedding.1340.desc.cheated_on_alt
			}
		}
		desc = ep2_wedding.1340.desc.outro
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:cynic
		animation = eyeroll
	}
	lower_center_portrait = scope:intended

	cooldown = { years = 15 }

	weight_multiplier = {
		base = 1
		modifier = { # more likely to happen if close family member is cynical about marriage
			root = {
				any_close_family_member = {
					is_alive = yes
					is_ai = yes
					is_participant_in_activity = scope:activity
					ep2_wedding_1340_marriage_cynic_trigger = yes
				}
			}
			add = 3
		}
		modifier = { # also more likely to happen with a friend
			root = {
				any_relation = {
					type = friend
					is_alive = yes
					is_ai = yes
					is_participant_in_activity = scope:activity
					ep2_wedding_1340_marriage_cynic_trigger = yes
				}
			}
			add = 3
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 2
		}
	}

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		location = scope:activity.activity_location
		OR = {
			scope:activity.special_guest:spouse_1 = root
			scope:activity.special_guest:spouse_2 = root
		}
		scope:activity = {
			any_attending_character = {
				ep2_wedding_1340_marriage_cynic_trigger = yes
			}
		}
	}

	immediate = {
		add_character_flag = busy_in_wgathering_event
		root = { save_scope_as = nervous_spouse }
		if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = intended
			}
		}
		else = {
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = intended
			}
		}
		scope:activity = {
			random_attending_character = {
				limit = { ep2_wedding_1340_marriage_cynic_trigger = yes }
				weight = {
					base = 1
					modifier = { # much more likely to be cynical friend or family
						factor = 100
						has_relation_friend = root
					}
					modifier = {
						factor = 100
						is_close_family_of = root
					}
					modifier = { # helps if their personality disposes them to be cynical about marriage
						factor = 3
						OR = {
							has_trait = cynical
							has_trait = lustful
						}
					}
				}
				save_scope_as = cynic
				add_character_flag = busy_in_wgathering_event
				if = { # if cynic dislikes a current spouse, mention them by name
					limit = {
						any_spouse = {
							OR = {
								reverse_opinion = {
									target = prev
									value <= 0
								}
								has_relation_rival = prev
							}
						}
					}
					random_spouse = {
						limit = {
							OR = {
								reverse_opinion = {
									target = prev
									value <= 0
								}
								has_relation_rival = prev
							}
						}
						save_scope_as = disliked_spouse
					}
				}
				if = { # if cynic has a memory of adultery about a living spouse, mention them
					limit = {
						any_memory = {
							memory_type = spouse_committed_adultery
						}
					}
					every_spouse = {
						save_temporary_scope_as = temp_spouse
						prev = {
							every_memory = {
								memory_type = spouse_committed_adultery
								if = {
									limit = { has_memory_participant = scope:temp_spouse }
									scope:temp_spouse = { save_scope_as = adulterous_spouse }
								}
							}
						}
					}
					every_former_spouse = {
						save_temporary_scope_as = temp_spouse
						prev = {
							every_memory = {
								memory_type = spouse_committed_adultery
								if = {
									limit = { has_memory_participant = scope:temp_spouse }
									scope:temp_spouse = { save_scope_as = adulterous_spouse }
								}
							}
						}
					}	
				}
				if = {
					limit = {
						AND = {
							any_former_spouse = { }
							NOT = {
								any_memory = {
									memory_type = spouse_died
								}
							}
						}
					}
					random_former_spouse = { save_scope_as = divorced_spouse }
				}		
			}
		}
	}

	option = { # SPOUSE is perfect for me.
		name = ep2_wedding.1340.a
		flavor = ep2_wedding.1340.a.tt
		random_list = {
			40 = {
				compatibility_modifier = {
					who = root
					compatibility_target = scope:intended
					multiplier = 3
					max = 100
					min = -20
				}
				modifier = {
					scope:intended = {
						attraction >= low_positive_attraction
					}
					factor = 1.2
				}
				modifier = {
					attraction <= low_negative_attraction
					factor = 0.8
				}
				send_interface_toast = {
					title = ep2_wedding.1340.a.success
					ep2_wedding_1340_add_confidence = yes
					add_stress = medium_stress_impact_loss
				}
			}
			20 = {
				send_interface_toast = {
					title = ep2_wedding.1340.a.failure
					add_character_modifier = wedding_jitters
					add_stress = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Don't worry, I'll have my hobbies!
		name = ep2_wedding.1340.b
		flavor = ep2_wedding.1340.b.tt
		trigger = { ep2_wedding_1340_unusual_hobbies_trigger = no }
		random_list = {
			15 = {
				modifier = {
					has_trait = lifestyle_gardener
					add = 70
				}
				modifier = {
					has_trait = lifestyle_reveler
					add = 70
				}
				modifier = {
					has_trait = lifestyle_hunter
					add = 70
				}
				modifier = {
					has_trait = lifestyle_poet
					add = 70
				}
				modifier = {
					has_trait = lifestyle_blademaster
					add = 40
				}
				modifier = {
					has_trait = lifestyle_herbalist
					add = 40
				}
				modifier = {
					has_trait = lifestyle_mystic
					add = 40
				}
				modifier = {
					has_trait = lifestyle_physician
					add = 40
				}
				modifier = {
					has_trait = athletic
					add = 40
				}
				modifier = {
					has_trait = journaller
					add = 40
				}
				send_interface_toast = {
					title = ep2_wedding.1340.b.success
					ep2_wedding_1340_add_confidence = yes
					add_stress = medium_stress_impact_loss
				}
			}
			30 = {
				send_interface_toast = {
					title = ep2_wedding.1340.b.failure
					add_character_modifier = wedding_jitters
					add_stress = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 100
			base = 1
			modifier = {
					has_trait = lifestyle_gardener
					add = 70
				}
				modifier = {
					has_trait = lifestyle_reveler
					add = 70
				}
				modifier = {
					has_trait = lifestyle_hunter
					add = 70
				}
				modifier = {
					has_trait = lifestyle_poet
					add = 70
				}
				modifier = {
					has_trait = lifestyle_blademaster
					add = 40
				}
				modifier = {
					has_trait = lifestyle_herbalist
					add = 40
				}
				modifier = {
					has_trait = lifestyle_mystic
					add = 40
				}
				modifier = {
					has_trait = lifestyle_physician
					add = 40
				}
				modifier = {
					has_trait = athletic
					add = 40
				}
				modifier = {
					has_trait = journaller
					add = 40
				}
		}
	}

	option = { # Don't worry, I'll have my... hobbies.
		name = ep2_wedding.1340.c
		flavor = ep2_wedding.1340.c.tt
		trigger = { ep2_wedding_1340_unusual_hobbies_trigger = yes }
		random_list = {
			0 = {
				modifier = {
					has_trait = lustful
					any_relation = {
						type = lover
						this != scope:intended
					}
					add = 20
				}
				modifier = {
					has_trait = seducer
					add = 20
				}
				modifier = {
					has_trait = torturer
					add = 20
				}
				modifier = {
					has_trait = rakish
					add = 20
				}
				modifier = {
					OR = {
						any_secret = { type = secret_cannibal }
						has_trait = cannibal
					}
					add = 20
				}
				modifier = {
					OR = {
						any_secret = { type = secret_witch }
						has_trait = witch
					}
					add = 20
				}
				send_interface_toast = {
					title = ep2_wedding.1340.c.success
					ep2_wedding_1340_add_confidence = yes
					add_stress = medium_stress_impact_loss
				}
			}
			10 = {
				send_interface_toast = {
					title = ep2_wedding.1340.c.failure
					add_character_modifier = wedding_jitters
					add_stress = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 150
			modifier = {
				has_trait = seducer
				add = 20
			}
			modifier = {
				has_trait = torturer
				add = 20
			}
			modifier = {
				has_trait = rakish
				add = 20
			}
			modifier = {
				OR = {
					any_secret = { type = secret_cannibal }
					has_trait = cannibal
				}
				add = 20
			}
			modifier = {
				OR = {
					any_secret = { type = secret_witch }
					has_trait = witch
				}
				add = 20
			}
		}
	}
	
	option = { # Please, I know all about marriage!
		name = ep2_wedding.1340.d
		flavor = {
			first_valid = {
				triggered_desc = {
					trigger = {
						number_of_current_and_former_spouses > 1
					}
					desc = ep2_wedding.1340.d.tt.more
				}
				triggered_desc = {
					trigger = {
						number_of_current_and_former_spouses > 0
					}
					desc = ep2_wedding.1340.d.tt.once
				}
				desc = ep2_wedding.1340.d.tt.never
			}
		}
		random_list = {
			10 = {
				modifier = {
					number_of_current_and_former_spouses > 0
					add = 10
				}
				modifier = {
					number_of_current_and_former_spouses > 1
					add = 20
				}
				modifier = {
					number_of_current_and_former_spouses > 2
					add = 30
				}
				send_interface_toast = {
					title = ep2_wedding.1340.d.success
					ep2_wedding_1340_add_confidence = yes
					add_stress = medium_stress_impact_loss
				}
			}
			20 = {
				send_interface_toast = {
					title = ep2_wedding.1340.d.failure
					add_character_modifier = wedding_jitters
					add_stress = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Get out of my face, you bitter wretch.
		name = ep2_wedding.1340.e
		trigger = { has_trait = wrathful }
		stress_impact = {
			base = medium_stress_impact_loss
		}
		reverse_add_opinion = {
			target = scope:cynic
			modifier = insulted_opinion
			opinion = -30
		}
		ai_chance = {
			base = 300
		}
	}

	option = { # ...will it really be that bad?
		name = ep2_wedding.1340.f
		trigger = {
			NOT = { has_trait = wrathful }
		}
		add_character_modifier = wedding_jitters
		ai_chance = {
			base = 50
		}
	}

	after = {
		remove_character_flag = busy_in_wgathering_event
		scope:cynic = { remove_character_flag = busy_in_wgathering_event }
	}
}

##################################################
# Lost For Words
# by Luke Bean
# ep2_wedding.1350
##################################################

scripted_trigger ep2_wedding_1350_caring_relative_trigger = {
	is_ai = yes
	is_close_family_of = root
	NOR = {
		is_child_of = root
		is_grandchild_of = root
		has_trait = callous
		has_trait = sadistic
		this = root
	}
	opinion = {
		target = root
		value >= 40
	}
}

ep2_wedding.1350 = {
	type = activity_event
	title = ep2_wedding.1350.t
	desc = ep2_wedding.1350.desc.intro
	theme = wedding_ceremony_activity
	center_portrait = {
		character = root
		animation = personality_compassionate 
	}
	right_portrait = {
		character = scope:caring_relative
		animation = admiration
	}

	cooldown = { years = 15 }

	weight_multiplier = {
		base = 1
		modifier = { # much more likely to happen if root has wedding jitters
			root = {
				has_character_modifier = wedding_jitters
			}
			add = 5
		}
		modifier = {
			has_activity_intent = reduce_stress_intent
			add = 2
		}
	}

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		location = scope:activity.activity_location
		OR = {
			scope:activity.special_guest:spouse_1 = root
			scope:activity.special_guest:spouse_2 = root
		}
		scope:activity = {
			any_attending_character = {
				ep2_wedding_1350_caring_relative_trigger = yes 
			}
		}
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = { ep2_wedding_1350_caring_relative_trigger = yes }
				weight = {
					base = 10
					modifier = {
						add = 10
						is_parent_of = root
					}
					modifier = {
						add = 5
						is_sibling_of = root
					}
					modifier = { 
						factor = 2
						has_trait = compassionate
					}
				}
				save_scope_as = caring_relative
			}
		}
	}

	option = { # Enjoy a quiet moment together.
		name = ep2_wedding.1350.a
		stress_impact = {
			base = medium_stress_impact_loss
		}
		reverse_add_opinion = {
			target = scope:caring_relative
			modifier = love_opinion
			opinion = 15
		}
		if = {
			limit = { has_character_modifier = wedding_jitters }
			remove_character_modifier = wedding_jitters
			ep2_wedding_1340_add_confidence = yes # replace wedding_jitters with confidence
		}
		ai_chance = {
			base = 100
			modifier = {
				has_character_modifier = wedding_jitters
				add = 50
			}
		}
	}

	option = { # Tell RELATIVE how much it means to have them here.
		name = ep2_wedding.1350.b
		progress_towards_friend_effect = {
			CHARACTER = scope:caring_relative
			OPINION = 20
			REASON = friend_supportive_at_wedding
		}
		ai_chance = {
			base = 100
		}
	}
}

############################
## Wedding Banquet Events
## 2000-2999
## by Veronica Pazos
############################

# Diplomatic Intent: You ask a friend of your target's for info about them

scripted_trigger ep2_wedding_2000_valid_friend = {
	feast_default_adult_participant_trigger = yes
	drinks_alcohol_trigger = yes
	OR = { #they know the person
		is_close_family_or_spouse_of_root_trigger = yes
		has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = root.intent_target }
	}
	NOT = { is_spouse_of = root }
	NOT = { is_close_family_of = root }
}

scripted_trigger ep2_wedding_2000_is_valiant = {
	OR = {
		has_lifestyle = martial_lifestyle
		prowess >= high_skill_rating
		martial >= high_skill_rating
		has_trait = brave
		has_trait = reckless
		has_trait = gallant
		has_trait = wrathful
		has_trait = overseer
		has_trait = strategist
		has_trait = lifestyle_hunter
		has_trait = lifestyle_blademaster
	}
}

scripted_trigger ep2_wedding_2000_is_nerd = {
	OR = {
		has_lifestyle = learning_lifestyle
		learning >= high_skill_rating
		has_trait = theologian
		has_trait = scholar
		has_trait = diligent
		has_trait = shrewd
	}
}

scripted_trigger ep2_wedding_2000_is_social = {
	OR = {
		has_lifestyle = diplomacy_lifestyle
		diplomacy >= high_skill_rating
		has_trait = lifestyle_reveler
		has_trait = gregarious
		has_trait = august
		has_trait = diplomat
		has_trait = drunkard
		has_trait = trusting
		has_trait = compassionate
	}
}

scripted_trigger ep2_wedding_2000_is_fishy = {
	OR = {
		has_lifestyle = intrigue_lifestyle
		intrigue >= high_skill_rating
		has_trait = callous
		has_trait = cynical
		has_trait = arbitrary
		has_trait = deceitful
		has_trait = schemer
		has_trait = torturer
		has_trait = greedy
		has_trait = vengeful
		has_trait = ambitious
		has_trait = disloyal
	}
}

scripted_trigger ep2_wedding_2000_is_lustful = {
	OR = {
		has_trait = lustful
		has_trait = seducer
		has_trait = rakish
		has_trait = fornicator
		has_trait = adulterer
		has_trait = sodomite
		has_trait = deviant
	}
}

ep2_wedding.2000 = {
	type = activity_event
	title = ep2_wedding.2000.t
	desc = {
		desc = ep2_wedding.2000.desc.intro
		random_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						intent_target = {
							ep2_wedding_2000_is_lustful = yes
						}
						AND = {
							intent_target = {
								ep2_wedding_2000_is_lustful = no
							}
							scope:target_friend = {
								ep2_wedding_2000_is_fishy = yes
							}
						}
					}
				}
				desc = ep2_wedding.2000.desc.lustful
			}
			triggered_desc = {
				trigger = {
					OR = {
						intent_target = {
							ep2_wedding_2000_is_nerd = yes
						}
						AND = {
							intent_target = {
								ep2_wedding_2000_is_nerd = no
							}
							scope:target_friend = {
								ep2_wedding_2000_is_fishy = yes
							}
						}
					}
				}
				desc = ep2_wedding.2000.desc.nerd
			}
			triggered_desc = {
				trigger = {
					OR = {
						intent_target = {
							ep2_wedding_2000_is_valiant = yes
						}
						AND = {
							intent_target = {
								ep2_wedding_2000_is_valiant = no
							}
							scope:target_friend = {
								ep2_wedding_2000_is_fishy = yes
							}
						}
					}
				}
				desc = ep2_wedding.2000.desc.valiant
			}
			triggered_desc = {
				trigger = {
					OR = {
						intent_target = {
							ep2_wedding_2000_is_social = yes
						}
						AND = {
							intent_target = {
								ep2_wedding_2000_is_social = no
							}
							scope:target_friend = {
								ep2_wedding_2000_is_fishy = yes
							}
						}
					}
				}
				desc = ep2_wedding.2000.desc.social
			}
			triggered_desc = {
				trigger = {
					OR = {
						intent_target = {
							ep2_wedding_2000_is_fishy = yes
						}
						AND = {
							intent_target = {
								ep2_wedding_2000_is_fishy = no
							}
							scope:target_friend = {
								ep2_wedding_2000_is_fishy = yes
							}
						}
					}
				}
				desc = ep2_wedding.2000.desc.fishy
			}
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				ep2_wedding_2000_is_fishy = yes
			}
			animation = scheme
		}
		animation = admiration
	}
	right_portrait = {
		character = scope:target_friend
		animation = drink_goblet
	}
	lower_center_portrait = scope:diplo_target

	cooldown = { years = 5 }

	trigger = {
		has_ep2_dlc_trigger = yes
		has_activity_intent = diplomatic_intent
		intent_target = { #there's something we can say of them
			is_alive = yes
			OR = {
				ep2_wedding_2000_is_valiant = yes
				ep2_wedding_2000_is_nerd = yes
				ep2_wedding_2000_is_social = yes
				ep2_wedding_2000_is_fishy = yes
				ep2_wedding_2000_is_lustful = yes
			}
		}
		scope:activity = { #there's someone that knows the person
			any_attending_character = {
				ep2_wedding_2000_valid_friend = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:activity = { #there's a guy that's best friends with target
				any_attending_character = {
					has_relation_best_friend = root.intent_target
				}
			}
		}
		modifier = {
			factor = 1.5
			scope:activity = { #their soulmate is around
				any_attending_character = {
					has_relation_soulmate = root.intent_target
				}
			}
		}
	}

	immediate = {
		scope:activity = { #there's someone that knows the person
			random_attending_character = {
				limit = {
					ep2_wedding_2000_valid_friend = yes
				}
				save_scope_as = target_friend
			}
		}
		intent_target = { save_scope_as = diplo_target }
	}

	#Awesome, let's go!
	option = {
		name = ep2_wedding.2000.a
		custom_tooltip = ep2_wedding.2000.a.tt
		trigger_event = ep2_wedding.2001
		stress_impact = {
			lazy = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = lazy
					has_trait = patient
					has_trait = shy
				}
			}
		}
	}
	
	#Are they... lying?
	option = {
		name = ep2_wedding.2000.b
		duel = {
			skill = intrigue
			target = scope:target_friend
			50 = { #they were lying, you catch them
				desc = ep2_wedding.2000.b.success
				show_chance = no
				modifier = {
					add = 20
					scope:target_friend = {
						ep2_wedding_2000_is_fishy = yes
					}
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = 5
				}
				send_interface_toast = {
					title = ep2_wedding.2000.b.success
					left_icon = root
					custom_tooltip = ep2_wedding.2000.b.success.tt
					set_variable = {
						name = wbanquet_friend_insight_var
						value = scope:diplo_target
					}
					add_intrigue_skill = 1
					if = {
						limit = { has_lifestyle = intrigue_lifestyle }
						add_intrigue_lifestyle_xp = minor_lifestyle_experience
					}
				}
			}
			50 = { #they weren't lying
				desc = ep2_wedding.2000.b.failure
				show_chance = no
				modifier = {
					add = 50
					scope:target_friend = {
						has_trait = honest
					}
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = 5
				}
				send_interface_toast = {
					title = ep2_wedding.2000.b.failure
					left_icon = scope:target_friend
					scope:target_friend = {
						add_opinion = {
							target = root
							modifier = insult_opinion
							opinion = -5
						}
					}
				}
			}
		}
		stress_impact = {
			reclusive = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				has_trait = reclusive
			}
		}
	}		
}

ep2_wedding.2001 = {
	type = activity_event
	title = ep2_wedding.2001.t
	desc = ep2_wedding.2001.desc
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				ep2_wedding_2000_is_fishy = yes
			}
			animation = scheme
		}
		animation = admiration
	}
	right_portrait = {
		character = scope:diplo_target
		triggered_animation = {
			trigger = {
				drinks_alcohol_trigger = yes
			}
			animation = drink_goblet
		}
		animation = happiness
	}

	lower_center_portrait = scope:target_friend

	#Lustful
	option = {
		name = ep2_wedding.2001.a
		set_local_variable = ep2_wedding_lustful_var
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				ep2_wedding_2000_is_lustful = yes
			}					
		}
	}
	
	#Nerd
	option = {
		name = {
			trigger = {
				NOT = { has_trait = dull }
				capital_province = {
					geographical_region = world_europe
				}
			}
			text = ep2_wedding.2001.b
		}
		name = ep2_wedding.2001.b.dull
		flavor = {
			triggered_desc = {
				trigger = {
					NOT = { has_trait = dull }
				}
				desc = ep2_wedding.2001.b.flavor
			}
		}
		set_local_variable = ep2_wedding_nerd_var
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				ep2_wedding_2000_is_nerd = yes
			}
		}
	}
	
	#Valiant
	option = {
		name = ep2_wedding.2001.c
		set_local_variable = ep2_wedding_valiant_var
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				ep2_wedding_2000_is_valiant = yes
			}
		}
	}
	
	#Social
	option = {
		name = ep2_wedding.2001.d
		set_local_variable = ep2_wedding_social_var
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				ep2_wedding_2000_is_social = yes
			}
		}
	}
	
	#Fishy
	option = {
		name = ep2_wedding.2001.e
		set_local_variable = ep2_wedding_fishy_var
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				ep2_wedding_2000_is_fishy = yes
			}
		}
	}
	
	after = {
		scope:diplo_target = {
			hidden_effect = {
				if = {
					limit = {
						OR = {
							AND = {
								ep2_wedding_2000_is_lustful = yes
								has_local_variable = ep2_wedding_lustful_var
							}
							AND = {
								ep2_wedding_2000_is_nerd = yes
								has_local_variable = ep2_wedding_nerd_var
							}
							AND = {
								ep2_wedding_2000_is_valiant = yes
								has_local_variable = ep2_wedding_valiant_var
							}
							AND = {
								ep2_wedding_2000_is_social = yes
								has_local_variable = ep2_wedding_social_var
							}
							AND = {
								ep2_wedding_2000_is_fishy = yes
								has_local_variable = ep2_wedding_fishy_var
							}
						}
					}
					set_local_variable = ep2_wedding_2000_got_it_right
				}
			}
		}
		random_list = {
			5 = {
				trigger = {
					scope:diplo_target = { activity_wedding_diplomatic_intent_impressible_target = yes }
				}
				desc = ep2_wedding.2000.after.subjugate
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.2000.after.subjugate
					left_icon = scope:diplo_target
					custom_tooltip = {
						text = ep2_wedding.2000.after.subjugate.tt
						complete_activity_intent = yes
						create_title_and_vassal_change = {
							type = swear_fealty
							save_scope_as = title_change
							add_claim_on_loss = no
						}
						scope:diplo_target = {
							change_liege = {
								liege = root
								change = scope:title_change
							}
						}
						resolve_title_and_vassal_change = scope:title_change
					}
				}
			}
			10 = {
				desc = ep2_wedding.2000.after.alliance
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.2000.after.alliance
					left_icon = scope:diplo_target
					custom_tooltip = {
						text = ep2_wedding.2000.after.alliance.tt
						complete_activity_intent = yes
						create_alliance = {
							target = scope:diplo_target
							allied_through_owner = root
							allied_through_target = scope:diplo_target
						}
						scope:diplo_target = {
							add_opinion = {
								target = root
								modifier = event_negotiated_alliance_opinion
							}
						}
					}
				}
			}
			10 = {
				desc = ep2_wedding.2000.after.friends
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.2000.after.friends
					left_icon = scope:diplo_target
					progress_towards_friend_effect = {
						CHARACTER = scope:diplo_target
						OPINION = 15
						REASON = friend_wedding
					}
				}
			}
			20 = { #only possible if you messed up
				trigger = {
					NOT = { has_local_variable = ep2_wedding_2000_got_it_right }
				}
				desc = ep2_wedding.2000.after.insult
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.2000.after.insult.short
					left_icon = scope:diplo_target
					reverse_add_opinion = {
						target = scope:diplo_target
						modifier = insult_opinion
						opinion = -10
					}
				}
			}
		}
	}
}

############################
## Wedding Night Events
## 3000-3999
## by Veronica Pazos and Joe Parkin
############################

# Both spouses are shy/nervous and bond over something else

scripted_trigger ep2_wedding.is_valid_shy = {
	OR = {
		AND = {
			age <= 19 #they're young
			NOT = { has_trait = lustful }
		}
		has_trait = shy
		has_trait = craven
		has_trait = depressed_1
		has_trait = depressed_genetic
		has_trait = reclusive
		has_trait = chaste
	}
}

ep2_wedding.3000 = {
	type = activity_event
	title = ep2_wedding.3000.t
	desc = ep2_wedding.3000.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:my_spouse
		animation = shame
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are a spouse and shy
			AND = {
				root = scope:activity.special_guest:spouse_1
				ep2_wedding.is_valid_shy = yes
			}
			AND = {
				root = scope:activity.special_guest:spouse_2
				ep2_wedding.is_valid_shy = yes
			}
		}
		OR = { #and they are a spouse and shy; you also don't have a lover relationship already
			scope:activity.special_guest:spouse_1 = {
				this != root
				NOT = { has_relation_lover = root }
				ep2_wedding.is_valid_shy = yes
			}
			scope:activity.special_guest:spouse_2 = {
				this != root
				NOT = { has_relation_lover = root }
				ep2_wedding.is_valid_shy = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = shy
		}
	}

	immediate = {
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { this != root }
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
		else = {
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		add_character_flag = { #doesn't make sense for you to have sexy times after this
			flag = busy_in_wnight_event
			days = 90
		}
	}

	#Let's go for a walk
	option = {
		name = ep2_wedding.3000.a
		custom_tooltip = ep2_wedding.3000.tt
		random_list = {
			50 = { #they like it
				desc = ep2_wedding.3000.a.success
				show_chance = no
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = lifestyle_herbalist
							has_trait = lifestyle_gardener
						}
					}
				}
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = impatient
							has_trait = diligent
						}
					}
				}
				send_interface_toast = {
					title = ep2_wedding.3000.a.success
					left_icon = scope:my_spouse
					scope:activity = {
						add_activity_log_entry = {
							key = ep2_wedding_3000_log_a
							tags = { good }
							score = 20
							character = root
							target = scope:my_spouse

							# Effect
							root = {
								if = {
									limit = {
										NOT = { has_relation_friend = scope:my_spouse }
									}
									set_relation_friend = {
										target = scope:my_spouse
										reason = lover_wnight_walk
									}
								}
								else_if = {
									limit = {
										NOT = { has_relation_lover = scope:my_spouse }
									}
									progress_towards_lover_effect = {
										CHARACTER = scope:my_spouse
										REASON = lover_wnight_walk
										OPINION = default_lover_opinion
									}
								}
								else = {
									scope:my_spouse = {
										add_opinion = {
											target = root
											modifier = romance_opinion
											opinion = 15
										}
									}
								}
								add_opinion = {
									target = scope:my_spouse
									modifier = wnight_common_things_opinion
								}
							}
						}
					}
				}
			}
			50 = { #they dont
				desc = ep2_wedding.3000.a.failure
				show_chance = no
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = lazy
							has_trait = patient
						}
					}
				}
				send_interface_toast = {
					title = ep2_wedding.3000.a.failure
					left_icon = scope:my_spouse
					scope:my_spouse = {
						add_opinion = {
							target = root
							modifier = bored_opinion
							opinion = -10
						}
					}
					add_opinion = {
						target = scope:my_spouse
						modifier = wnight_nothing_in_common_opinion
					}
				}
			}
		}
		stress_impact = {
			lazy = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = lazy
					has_trait = patient
				}
			}
		}
	}
	
	#Do you like... things? Talk about something else
	option = {
		name = ep2_wedding.3000.b
		custom_tooltip = ep2_wedding.3000.tt
		random_list = {
			50 = { #they like it
				desc = ep2_wedding.3000.b.success
				show_chance = no
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = patient
							has_trait = calm
						}
					}
				}
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = gregarious
							has_trait = trusting
						}
					}
				}
				send_interface_toast = {
					title = ep2_wedding.3000.b.success
					left_icon = scope:my_spouse
					scope:activity = {
						add_activity_log_entry = {
							key = ep2_wedding_3000_log_b
							tags = { good }
							score = 20
							character = root
							target = scope:my_spouse

							# Effect
							root = {
								if = {
									limit = {
										NOT = { has_relation_friend = scope:my_spouse }
									}
									set_relation_friend = {
										target = scope:my_spouse
										reason = lover_wnight_talk
									}
								}
								else_if = {
									limit = { NOT = { has_relation_lover = scope:my_spouse } }
									progress_towards_lover_effect = {
										CHARACTER = scope:my_spouse
										REASON = lover_wnight_talk
										OPINION = default_lover_opinion
									}
								}
								else = {
									scope:my_spouse = {
										add_opinion = {
											target = root
											modifier = romance_opinion
											opinion = 5
										}
									}
								}
								add_opinion = {
									target = scope:my_spouse
									modifier = wnight_common_things_opinion
								}
							}
						}
					}
				}
			}
			50 = { #they dont
				desc = ep2_wedding.3000.b.failure
				show_chance = no
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = shy
							has_trait = reclusive
						}
					}
				}
				modifier = {
					add = 50
					scope:my_spouse = {
						OR = {
							has_trait = lisping
							has_trait = stuttering							
						}
					}
				}
				send_interface_toast = {
					title = ep2_wedding.3000.b.failure
					left_icon = scope:my_spouse
					scope:my_spouse = {
						add_opinion = {
							target = root
							modifier = bored_opinion
							opinion = -10
						}
					}
					add_opinion = {
						target = scope:my_spouse
						modifier = wnight_nothing_in_common_opinion
					}
				}
			}
		}
		stress_impact = {
			reclusive = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				has_trait = reclusive
			}
		}
	}
	
	#Let's just sleep
	option = {
		name = ep2_wedding.3000.c
		scope:my_spouse = {
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = 5
			}
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = gregarious
				}
			}
		}
	}
}

# Spouse with a secret has a breakdown and confesses their secret

ep2_wedding.3010 = {
	type = activity_event
	title = ep2_wedding.3010.t
	desc = {
		desc = ep2_wedding.3010.desc.intro
		first_valid = { #some vague flavour in case you choose the option to not hear about it (you still know the secret in the tooltip
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_murder
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.murder
			}
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_murder_attempt
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.murder_attempt
			}
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_cannibal
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.cannibal
			}
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_deviant
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.deviant
			}
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_witch
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.witch
			}
			triggered_desc = {
				trigger = {
					scope:my_spouse = {
						any_secret = {
							type = secret_non_believer
							NOT = { is_known_by = root }
						}
					}
				}
				desc = ep2_wedding.3010.desc.non_believer
			}
			desc = ep2_wedding.3010.desc.fallback
		}
	}
	theme = wedding_night_activity
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:my_spouse
		animation = grief
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		OR = { #the other spouse has a secret
			scope:activity.special_guest:spouse_1 = {
				this != root
				any_secret = {
					NOT = { is_known_by = root }
				}
			}
			scope:activity.special_guest:spouse_2 = {
				this != root
				any_secret = {
					NOT = { is_known_by = root }
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = shy
		}
	}

	immediate = {
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { this != root }
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
		else = {
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		scope:my_spouse = {
			random_secret = {
				limit = { NOT = { is_known_by = root } }
				save_scope_as = secret_to_reveal
			}
		}
	}

	#You can trust me
	option = {
		name = ep2_wedding.3010.a
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_confession_log
				tags = { good }
				score = 25
				character = root
				target = scope:my_spouse

				# Effect
				root = {
					scope:secret_to_reveal = { reveal_to = root }
					if = {
						limit = { NOT = { has_relation_lover = scope:my_spouse } }
						progress_towards_lover_effect = {
							CHARACTER = scope:my_spouse
							REASON = lover_wnight_secret_accepted
							OPINION = default_lover_opinion
						}
					}
					else = {
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = grateful_opinion
							opinion = 5
						}
					}
					scope:my_spouse = {
						if = {
							limit = {
								NOT = { has_character_modifier = wnight_confider_modifier }
							}
							add_character_modifier = {
								modifier = wnight_confider_modifier
								years = 10
							}
						}
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_good_fertility = scope:my_spouse
					}
					else = {
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = grateful_opinion
							opinion = 15
						}
					}
				}
			}
			root = {
				stress_impact = { #intended to be a very stressful moment
					calm = medium_stress_impact_gain
					content = medium_stress_impact_gain
					diligent = medium_stress_impact_gain
					temperate = medium_stress_impact_gain
					paranoid = major_stress_impact_gain #they can hurt you
					just = major_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = calm
					has_trait = content
					has_trait = diligent
					has_trait = temperate
					has_trait = paranoid
					has_trait = just
				}
			}
		}
	}
	
	#I don't wanna hear the rest
	option = {
		name = ep2_wedding.3010.b
		add_character_modifier = {
			modifier = wnight_clear_conscience_modifier
			years = 10
		}
		stress_impact = {
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				has_trait = deceitful
			}
		}
	}
	
	#confess YOUR secret
	option = {
		name = ep2_wedding.3010.c
		trigger = {
			any_secret = {
				NOT = { is_known_by = scope:my_spouse }
			}
		}
		if = {
			limit = { NOT = { has_relation_lover = scope:my_spouse } }
			progress_towards_lover_effect = {
				CHARACTER = scope:my_spouse
				REASON = lover_wnight_secret_shared
				OPINION = 20
			}
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = grateful_opinion
					opinion = 20
				}
			}
		}
		if = {
			limit = {
				scope:my_spouse = {
					NOT = { has_character_modifier = wnight_confider_modifier }
				}
			}
			scope:my_spouse = {
				add_character_modifier = {
					modifier = wnight_confider_modifier
					years = 10
				}
			}
		}
		stress_impact = {
			deceitful = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_confession_joint_log
				tags = { good }
				score = 25
				character = root
				target = scope:my_spouse

				# Effect
				root = {
					scope:secret_to_reveal = { reveal_to = root }
					random_secret = {
						limit = { NOT = { is_known_by = scope:my_spouse } }
						reveal_to = scope:my_spouse
					}
					if = {
						limit = { NOT = { has_relation_soulmate = scope:my_spouse } }
						progress_towards_lover_effect = {
							CHARACTER = scope:my_spouse
							REASON = lover_wnight_secret_shared
							OPINION = 20
						}
					}
					else = {
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = grateful_opinion
							opinion = 20
						}
					}
					if = {
						limit = {
							scope:my_spouse = {
								NOT = { has_character_modifier = wnight_confider_modifier }
							}
						}
						scope:my_spouse = {
							add_character_modifier = {
								modifier = wnight_confider_modifier
								years = 10
							}
						}
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_good_fertility = scope:my_spouse
					}
					else = {
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = grateful_opinion
							opinion = 20
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = deceitful
					has_trait = paranoid
				}
			}
		}
	}
}

# You find out that your spouse fancies the other gender

scripted_effect ep2_wedding.3020.reveal_secret_effect = {
	if = {
		limit = {
			scope:my_spouse = {
				any_secret = {
					type = secret_homosexual
					NOT = { is_known_by = root }
				}
			}
		}
		scope:my_spouse = {
			random_secret = {
				type = secret_homosexual
				limit = {
					NOT = { is_known_by = root }
				}
				reveal_to = root
			}
		}
	}
}

ep2_wedding.3020 = {
	type = activity_event
	title = ep2_wedding.3020.t
	desc = ep2_wedding.3020.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { NOT = { is_attracted_to_gender_of = scope:my_spouse } }
			animation = disbelief
		}
		animation = stress
	}
	right_portrait = {
		character = scope:my_spouse
		animation = worry
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		OR = { #the other spouse doesn't fancy you
			scope:activity.special_guest:spouse_1 = {
				this != root
				NOT = { is_attracted_to_gender_of = root }
			}
			scope:activity.special_guest:spouse_2 = {
				this != root
				NOT = { is_attracted_to_gender_of = root }
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { this != root }
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
		else = {
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		add_character_flag = { #doesn't make sense for you to have sexy times after this revelation
			flag = busy_in_wnight_event
			days = 90
		}
	}

	#Well... not my problem
	option = {
		name = ep2_wedding.3020.a
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = lazy
					has_trait = patient
				}
			}
		}
	}
	
	#I get it - comfort them
	option = {
		name = ep2_wedding.3020.b
		ep2_wedding.3020.reveal_secret_effect = yes
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:my_spouse }
			}
			set_relation_friend = {
				reason = friend_wnight_homosexual
				target = scope:my_spouse
			}
		}
		if = {
			limit = {
				scope:my_spouse = {
					NOT = { has_character_modifier = wnight_confider_modifier }
				}
			}
			scope:my_spouse = {
				add_character_modifier = {
					modifier = wnight_confider_modifier
					years = 10
				}
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:my_spouse
		}
		stress_impact = {
			lustful = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = lustful
					has_trait = callous
				}
			}
		}
	}
	
	#You're also NOT attracted to them
	option = {
		name = ep2_wedding.3020.c
		trigger = {
			NOT = { is_attracted_to_gender_of = scope:my_spouse }
		}
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:my_spouse }
			}
			set_relation_friend = {
				reason = friend_wnight_homosexual_both
				target = scope:my_spouse
			}
		}
		if = {
			limit = {
				scope:my_spouse = {
					NOT = { has_character_modifier = wnight_confider_modifier }
				}
			}
			scope:my_spouse = {
				add_character_modifier = {
					modifier = wnight_confider_modifier
					years = 10
				}
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:my_spouse
		}
		ep2_wedding.3020.reveal_secret_effect = yes
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				NOT = { is_attracted_to_gender_of = scope:my_spouse }
			}
		}
	}
}

# Spouse gives you a cute memento to remember this night

ep2_wedding.3030 = {
	type = activity_event
	title = ep2_wedding.3030.t
	desc = ep2_wedding.3030.desc
	theme = wedding_night_activity
	center_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = seducer
					has_trait = lustful
					has_trait = rakish
				}
			}
			animation = flirtation_left
		}
		animation = love
	}
	right_portrait = {
		character = scope:my_spouse
		animation = flirtation
	}
	artifact = {
		target = scope:love_memento
		position = lower_center_portrait
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		OR = { #the other spouse likes you in any way
			scope:activity.special_guest:spouse_1 = {
				this != root
				OR = {
					has_any_good_relationship_with_root_trigger = yes
					opinion = {
						target = root
						value >= default_friend_opinion #15
					}
				}
			}
			scope:activity.special_guest:spouse_2 = {
				this != root
				OR = {
					has_any_good_relationship_with_root_trigger = yes
					opinion = {
						target = root
						value >= default_friend_opinion #15
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 1.5
			OR = {
				scope:activity.special_guest:spouse_1 = {
					this != root
					has_relation_lover = root
				}
				scope:activity.special_guest:spouse_2 = {
					this != root
					has_relation_lover = root
				}
			}
		}
		modifier = {
			factor = 2
			OR = {
				scope:activity.special_guest:spouse_1 = {
					this != root
					has_relation_soulmate = root
				}
				scope:activity.special_guest:spouse_2 = {
					this != root
					has_relation_soulmate = root
				}
			}
		}
	}

	immediate = {
		save_scope_as = itsa_me_scope #used in the artifact description
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { this != root }
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
		else = {
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		hidden_effect_new_object = {
			generate_romantic_trinket_effect = { OWNER = scope:my_spouse }
			if = {
				# Checks required for error suppression
				limit = { exists = scope:romantic_trinket }
				scope:romantic_trinket = {
					save_scope_as = love_memento
					set_artifact_description = love_memento_desc
				}
			}
		}
		create_character_memory = {
			type = wedding_night_trinket
			participants = {
				spouse_1 = root
				spouse_2 = scope:my_spouse
			}
		}
		if = {
			limit = {
				any_character_artifact = {
					artifact_slot_type = miscellaneous
					this != scope:love_memento
				}
			}
			random_character_artifact = {
				limit = {
					artifact_slot_type = miscellaneous
					this != scope:love_memento
				}
				save_scope_as = my_love_memento
			}
		}
		add_character_flag = is_naked
		scope:my_spouse = {
			add_character_flag = is_naked
		}
	}

	#I shall cherish this
	option = {
		name = ep2_wedding.3030.a
		#get a bonus to court schemes targetting them
		custom_tooltip = ep2_wedding.3030.a.tt
		set_variable = {
			name = wnight_court_memento_var
			value = scope:my_spouse
		}
		custom_tooltip = ep2_wedding.3030.artifact_tt
		scope:love_memento = {
			add_artifact_history = {
				type = given
				actor = scope:my_spouse
				recipient = root
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:my_spouse
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = romance_opinion
					opinion = 10
				}
			}
		}
		if = {
			limit = {
				has_activity_intent = reduce_stress_intent
			}
			stress_impact = {
				base = minor_stress_impact_loss
				paranoid = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				paranoid = medium_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = lustful
					has_trait = paranoid
				}
			}
		}
	}
	
	#I shall cherish /you/
	option = {
		name = ep2_wedding.3030.b
		#get a bonus to seduce schemes targetting them
		custom_tooltip = ep2_wedding.3030.b.tt
		set_variable = {
			name = wnight_seduce_memento_var
			value = scope:my_spouse
		}
		custom_tooltip = ep2_wedding.3030.artifact_tt
		scope:love_memento = {
			add_artifact_history = {
				type = given
				actor = scope:my_spouse
				recipient = root
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:my_spouse
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = romance_opinion
					opinion = 10
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = compassionate
					has_trait = paranoid
				}
			}
		}
	}
	
	#I have something for you too!
	option = {
		name = ep2_wedding.3030.c
		trigger = {
			exists = scope:my_love_memento
		}
		scope:love_memento = { set_owner = root }
		scope:my_love_memento = { set_owner = scope:my_spouse }
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_very_good_fertility = scope:my_spouse
		}
		else_if = {
			limit = {
				NOT = { has_relation_lover = scope:my_spouse }
			}
			progress_towards_lover_effect = {
				CHARACTER = scope:my_spouse
				REASON = lover_wnight_gifts
				OPINION = default_lover_opinion
			}
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = romance_opinion
					opinion = 15
				}
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			lustful = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = lustful
					has_trait = paranoid
				}
			}
		}
	}
	
	#Reject it
	option = {
		name = ep2_wedding.3030.d
		trigger = {
			has_trait = paranoid
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:my_spouse
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = insult_opinion
					opinion = -10
				}
			}
		}
		stress_impact = {
			base = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
	after = {
		remove_character_flag = is_naked
		scope:my_spouse = {
			remove_character_flag = is_naked
		}
	}
}

# Your spouse and you are having a nice time when the bed catches fire

ep2_wedding.3040 = {
	type = activity_event
	title = ep2_wedding.3040.t
	desc = ep2_wedding.3040.desc
	theme = wedding_night_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = brave
					has_trait = reckless
				}
			}
			animation = anger
		}
		animation = fear
	}
	right_portrait = {
		character = scope:my_spouse
		animation = shock
	}

	cooldown = { years = 10 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		scope:activity = {
			has_activity_option = {
				category = wedding_option_decoration
				option = wedding_decoration_bad
			}
		}
		#This is to check if you've been cheap in general
		OR = {
			scope:activity = {
				has_activity_option = {
					category = wedding_option_entertainment
					option = wedding_entertainment_bad
				}
			}
			scope:activity = {
				has_activity_option = {
					category = wedding_option_food
					option = wedding_food_bad
				}
			}
		}
		trigger_if = {
			limit = {
				root = scope:activity.special_guest:spouse_1
			}
			#the other spouse likes you at least a tiny bit so you were having fun before the fire
			scope:activity.special_guest:spouse_2 = {
				OR = {
					has_any_good_relationship_with_root_trigger = yes
					opinion = {
						target = root
						value >= 0
					}
				}
				is_attracted_to_gender_of = root
			}
			# And you like them too
			root = {
				is_attracted_to_gender_of = scope:activity.special_guest:spouse_2
			}
		}
		trigger_else = {
			#the other spouse likes you at least a tiny bit so you were having fun before the fire
			scope:activity.special_guest:spouse_1 = {
				OR = {
					has_any_good_relationship_with_root_trigger = yes
					opinion = {
						target = root
						value >= 0
					}
				}
				is_attracted_to_gender_of = root
			}
			# And you like them too
			root = {
				is_attracted_to_gender_of = scope:activity.special_guest:spouse_1
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = reckless #you wouldn't pay attention to the candles
		}
		modifier = {
			scope:activity.special_guest:spouse_1 = {
				has_relation_lover = scope:activity.special_guest:spouse_2
			}
			add = 1
		}
	}

	immediate = {
		if = {
			limit = {
				scope:activity.special_guest:spouse_1 = { this != root }
			}
			scope:activity.special_guest:spouse_1 = {
				save_scope_as = my_spouse
			}
		}
		else = {
			scope:activity.special_guest:spouse_2 = {
				save_scope_as = my_spouse
			}
		}
		add_character_flag = is_naked
		scope:my_spouse = {
			add_character_flag = is_naked
		}
	}

	#Save them!
	option = {
		name = ep2_wedding.3040.a
		duel = {
			skill = prowess
			value = average_skill_rating
			50 = { #you save them
				desc = ep2_wedding.3040.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = ep2_wedding.3040.a.success
					left_icon = root
					right_icon = scope:my_spouse
				}
			}
			50 = { #you get injured
				desc = ep2_wedding.3040.a.failure
				send_interface_toast = {
					title = ep2_wedding.3040.a.failure
					left_icon = root
					right_icon = scope:my_spouse
					increase_wounds_no_death_effect = { REASON = fire }
				}
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:my_spouse
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = grateful_opinion
					opinion = 5
				}
			}
		}
		stress_impact = {
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = callous
					has_trait = sadistic
					has_trait = craven
				}
			}
		}
	}
	
	#Save yourself
	option = {
		name = ep2_wedding.3040.b
		random_list = {
			50 = { #spouse saves themselves
				desc = ep2_wedding.3040.b.success
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.3040.b.success
					left_icon = scope:my_spouse
				}
			}
			50 = { #spouse gets injured
				desc = ep2_wedding.3040.b.failure
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.3040.b.failure
					left_icon = scope:my_spouse
					scope:my_spouse = {
						increase_wounds_no_death_effect = { REASON = fire }
					}
				}
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_bad_fertility = scope:my_spouse
		}
		else = {
			scope:my_spouse = {
				add_opinion = {
					target = root
					modifier = disappointed_opinion
					opinion = -10
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			just = minor_stress_impact_gain
			brave = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = compassionate
					has_trait = just
					has_trait = brave
				}
			}
		}
	}
	
	#MY BODY IS MY WEAPON
	option = {
		name = ep2_wedding.3040.c
		trigger = { has_lifestyle = martial_lifestyle }
		duel = {
			skill = prowess
			value = average_skill_rating
			70 = { #you save them
				desc = ep2_wedding.3040.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = ep2_wedding.3040.c.success
					left_icon = root
					add_prowess_skill = 1
				}
			}
			30 = { #you get injured
				desc = ep2_wedding.3040.a.failure
				send_interface_toast = {
					title = ep2_wedding.3040.a.failure
					left_icon = root
					increase_wounds_no_death_effect = { REASON = fire }
					add_prestige = minor_prestige_loss
				}
			}
		}
		if = {
			limit = {
				has_trait = tourney_participant
				has_trait_xp = {
					trait = tourney_participant
					track = foot
					value < 100
				}
			}
			add_trait_xp = {
				trait = tourney_participant
				track = foot
				value = tournament_hastiludes_xp_gain_medium_value
			}
		}
		else = {
			add_martial_lifestyle_xp = medium_lifestyle_xp
		}
		#no fertility gain because you're doing for yourself
		stress_impact = {
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				OR = {
					has_trait = brave
					has_trait = reckless
				}
			}
			modifier = {
				factor = 1.5
				has_lifestyle = martial_lifestyle
			}
			modifier = {
				factor = 0 
				OR = {
					has_trait = craven
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}
	
	#Are you trying to kill your spouse?
	option = {
		name = ep2_wedding.3040.d
		flavor = ep2_wedding.3040.d.flavor
		trigger = {
			has_activity_intent = murder_attendee_intent
			scope:my_spouse = { is_ai = yes }
			intent_target = scope:my_spouse
		}
		custom_tooltip = available_because_intent_tt
		random_list = {
			50 = { #spouse saves themselves
				desc = ep2_wedding.3040.d.success
				show_chance = no
				send_interface_toast = { #but they know
					title = ep2_wedding.3040.d.success
					left_icon = scope:my_spouse
					attempted_murder_opinion_effect = {
						VICTIM = scope:my_spouse
						MURDERER = root
					}
					add_secret = {
						type = secret_murder_attempt
						target = scope:my_spouse
					}
				}
			}
			50 = { #spouse dies
				desc = ep2_wedding.3040.d.failure
				show_chance = no
				send_interface_toast = {
					title = ep2_wedding.3040.d.failure
					left_icon = scope:my_spouse
					custom_tooltip = ep2_wedding.wedding_intent.success.tt
					unknown_murder_effect = {
						VICTIM = scope:my_spouse
						MURDERER = root
						REASON = death_burned
					}
					set_variable = just_widowed_var
					complete_activity_intent = yes
				}
				give_nickname = nick_the_just_widowed
			}
		}
	}
	after = {
		remove_character_flag = is_naked
		scope:my_spouse = {
			remove_character_flag = is_naked
		}
	}
}

# Non-spouse: Use the Wedding Night phase where almost no one is around to kill your target 
# episode 1: CHANDELIER EXTRAVAGANZA

ep2_wedding.3050 = {
	type = activity_event
	title = ep2_wedding.3050.t
	desc = ep2_wedding.3050.desc
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:intent_victim
		animation = drink_goblet
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		NOR = { #you are not one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		has_activity_intent = murder_attendee_intent #you're trying to kill someone
		intent_target = { is_alive = yes } #they're not dead yet
		intent_target = { #you're not trying to kill the spouses
			NOR = {
				this = scope:activity.special_guest:spouse_1
				this = scope:activity.special_guest:spouse_2
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			OR = {
				has_trait = callous
				has_trait = deceitful
				has_trait = sadistic
			}
		}
		modifier = { #more likely for them to stay behind
			factor = 1.5
			intent_target ?= {
				OR = {
					has_trait = drunkard
					has_trait = gregarious
					has_trait = lifestyle_reveler
				}
			}
		}
	}

	immediate = {
		intent_target = { save_scope_as = intent_victim }
	}

	#Kill them immediately
	option = {
		name = ep2_wedding.3050.a
		duel = {
			skill = prowess
			value = average_skill_rating
			70 = { #you kill them
				desc = ep2_wedding.3050.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = ep2_wedding.3050.a.success
					left_icon = scope:intent_victim
					custom_tooltip = ep2_wedding.wedding_intent.success.tt
					unknown_murder_effect = {
						VICTIM = scope:intent_victim
						MURDERER = root
						REASON = death_accident
					}
				}
				complete_activity_intent = yes
			}
			30 = { #they catch you
				desc = ep2_wedding.3050.a.failure
				send_interface_toast = {
					title = ep2_wedding.3050.a.failure
					left_icon = root
					right_icon = scope:intent_victim
					attempted_murder_opinion_effect = {
						VICTIM = scope:intent_victim
						MURDERER = root
					}
					add_secret = {
						type = secret_murder_attempt
						target = scope:intent_victim
					}
					random_secret = {
						type = secret_murder_attempt
						limit = {
							secret_target = scope:intent_victim
						}
						expose_secret = scope:intent_victim
					}
				}
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
			calm = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = craven
					has_trait = patient
					has_trait = compassionate
					has_trait = deceitful
					has_trait = calm
				}
			}
		}
	}
	
	#Use the chandelier
	option = {
		name = ep2_wedding.3050.b
		duel = {
			skill = intrigue
			value = average_skill_rating
			40 = { #you kill them
				desc = ep2_wedding.3050.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = ep2_wedding.3050.b.success
					left_icon = scope:intent_victim
					custom_tooltip = ep2_wedding.wedding_intent.success.tt
					unknown_murder_effect = {
						VICTIM = scope:intent_victim
						MURDERER = root
						REASON = death_accident
					}
				}
				complete_activity_intent = yes
			}
			60 = { #they suspect
				desc = ep2_wedding.3050.b.failure
				send_interface_toast = {
					title = ep2_wedding.3050.b.failure
					left_icon = root
					right_icon = scope:intent_victim
					scope:intent_victim = {
						add_opinion = {
							target = root
							modifier = suspicion_opinion
							opinion = -5
						}
					}
					add_secret = {
						type = secret_murder_attempt
						target = scope:intent_victim
					}
				}
			}
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = wrathful
					has_trait = vengeful
					has_trait = craven
					has_trait = compassionate
					has_trait = impatient
				}
			}
		}
	}
	
	#Not now, not now...
	option = {
		name = ep2_wedding.3050.c
		custom_tooltip = ep2_wedding.3050.c.tt
		set_variable = {
			name = wnight_chandelier_murder_var
			value = scope:intent_victim
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = wrathful
					has_trait = impatient
				}
			}
		}
	}	
}

# Either you or spouse doesn't want to take part in bedding ceremony

scripted_trigger ep2_wedding_3200_is_shy_trigger = {
	OR = {
		has_trait = shy
		has_trait = reclusive
		has_trait = craven
		has_trait = paranoid
	}
	NOT = { has_trait = gregarious }
}

scripted_trigger ep2_wedding_bedding_ceremony_witness_trigger = {
	is_adult = yes
	NOR = {
		this = root
		this = scope:my_spouse
		scope:bedding_witness_1 ?= this
		scope:bedding_witness_2 ?= this
	}
	OR = {
		scope:host.cp:councillor_court_chaplain ?= this
		is_close_family_of = root
		is_close_family_of = scope:my_spouse
		has_relation_friend = root
		has_relation_friend = scope:my_spouse
		any_court_position_employer = { this = root }
		any_court_position_employer = { this = scope:my_spouse }
	}
}

scripted_effect ep2_wedding_bedding_ceremony_witness_effect = {
	hidden_effect = {
		while = {
			count = 3
			scope:activity = {
				if = {
					limit = {
						any_attending_character = { ep2_wedding_bedding_ceremony_witness_trigger = yes }
					}
					random_attending_character = {
						limit = { ep2_wedding_bedding_ceremony_witness_trigger = yes }
						weight = {
							base = 1
							modifier = {
								scope:host.cp:councillor_court_chaplain ?= this
								add = 1000
							}
							modifier = {
								has_trait = lifestyle_reveler
								add = 25
							}
							modifier = {
								has_trait = gregarious
								add = 25
							}
							is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root }
							is_of_minor_interest_to_weight_up_modifier = { CHARACTER = scope:my_spouse }
							is_of_major_interest_to_weight_up_modifier = { CHARACTER = root }
							is_of_major_interest_to_weight_up_modifier = { CHARACTER = scope:my_spouse }
						}
						if = {
							limit = { exists = scope:bedding_witness_2 }
							save_scope_as = bedding_witness_3
						}
						else_if = {
							limit = { exists = scope:bedding_witness_1 }
							save_scope_as = bedding_witness_2
						}
						else = { save_scope_as = bedding_witness_1 }
						add_to_list = bedding_witnesses
					}
				}
			}
		}
	}
}

ep2_wedding.3200 = {
	type = activity_event
	title = ep2_wedding.3200.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:shy_both ?= this }
				desc = ep2_wedding.3200.both
			}
			triggered_desc = {
				trigger = { scope:shy_spouse ?= this }
				desc = ep2_wedding.3200.self
			}
			desc = ep2_wedding.3200.other
		}
	}	
	theme = wedding_night_activity
	left_portrait = {
		character = root
		outfit_tags = { nightgown }
		triggered_animation = {
			trigger = {
				OR = {
					scope:shy_spouse ?= this
					exists = scope:shy_both
				}
			}
			animation = worry
		}
		animation = disapproval
	}
	right_portrait = {
		character = scope:my_spouse
		outfit_tags = { nightgown }
		triggered_animation = {
			trigger = { scope:shy_spouse ?= this }
			animation = worry
		}
		triggered_animation = {
			trigger = { exists = scope:shy_both }
			animation = stress
		}
		animation = disapproval
	}
	lower_left_portrait = scope:bedding_witness_1
	lower_center_portrait = scope:bedding_witness_2
	lower_right_portrait = scope:bedding_witness_3
	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			scope:activity.special_guest:spouse_1 ?= this
			scope:activity.special_guest:spouse_2 ?= this
		}
		OR = {
			scope:activity.special_guest:spouse_1 ?= {
				NOT = { has_trait = gregarious }
			}
			scope:activity.special_guest:spouse_2 ?= {
				NOT = { has_trait = gregarious }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:activity.special_guest:spouse_1 = { ep2_wedding_3200_is_shy_trigger = yes }
		}
		modifier = {
			factor = 2
			scope:activity.special_guest:spouse_2 = { ep2_wedding_3200_is_shy_trigger = yes }
		}
	}

	immediate = {
		# Identify root
		if = {
			limit = { root = scope:activity.special_guest:spouse_1 }
			scope:activity.special_guest:spouse_2 = { save_scope_as = my_spouse }
		}
		else = {
			scope:activity.special_guest:spouse_1 = { save_scope_as = my_spouse }
		}
		# Determine shy beddiness
		if = {
			limit = {
				ep2_wedding_3200_is_shy_trigger = yes
				scope:my_spouse = { ep2_wedding_3200_is_shy_trigger = yes }
			}
			save_scope_as = shy_both
		}
		else_if = {
			limit = { ep2_wedding_3200_is_shy_trigger = yes }
			save_scope_as = shy_spouse
		}
		else = {
			scope:my_spouse = { save_scope_as = shy_spouse }
		}
		# Save witnesses
		ep2_wedding_bedding_ceremony_witness_effect = yes
	}

	#Bar the doors
	option = {
		name = ep2_wedding.3200.a
		flavor = ep2_wedding.3200.a.flavor
		trigger = {
			# Has door privileges
			OR = {
				location.county.holder = root
				highest_held_title_tier > scope:my_spouse.highest_held_title_tier
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = wedding_barred_bedding_log
				character = root
				target = scope:my_spouse

				# Effect
				root = {
					add_character_modifier = {
						modifier = wedding_barred_doors_modifier
						years = 5
					}
					if = {
						limit = { scope:shy_spouse ?= this }
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = wedding_barred_bedding_doors_opinion
							opinion = -20
						}
						had_sex_with_effect = {
							CHARACTER = scope:my_spouse
							PREGNANCY_CHANCE = 5
						}
					}
					else = {
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = wedding_barred_bedding_doors_opinion
							opinion = 20
						}
						had_sex_with_effect = {
							CHARACTER = scope:my_spouse
							PREGNANCY_CHANCE = 75
						}
					}
				}  
			}
		}
		every_in_list = {
			list = bedding_witnesses
			custom = ep2_wedding_witnesses_tt
			add_opinion = {
				target = root
				modifier = wedding_barred_bedding_doors_opinion
				opinion = -10
			}
			if = {
				limit = { exists = scope:shy_both }
				add_opinion = {
					target = scope:my_spouse
					modifier = wedding_barred_bedding_doors_opinion
					opinion = -10
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_loss
			reclusive = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
			craven = minor_stress_impact_loss
			compassionate = minor_stress_impact_loss
			gregarious = miniscule_stress_impact_gain
			trusting = miniscule_stress_impact_gain
			brave = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_boldness = 1
				ai_sociability = -1
			}
		}
	}

	#Convince to bar
	option = {
		name = ep2_wedding.3200.c
		trigger = {
			OR = {
				scope:shy_spouse ?= this
				exists = scope:shy_both
			}
			NOR = {
				location.county.holder = root
				highest_held_title_tier > scope:my_spouse.highest_held_title_tier
			}
		}
		duel = {
			skill = diplomacy
			target = scope:my_spouse
			40 = { #they accept
				desc = ep2_wedding.3200.c.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					factor = 2
					exists = scope:shy_both
				}
				send_interface_toast = {
					title = ep2_wedding.3200.c.success
					left_icon = scope:my_spouse
					scope:activity = {
						add_activity_log_entry = {
							key = wedding_barred_bedding_log
							character = root
							target = scope:my_spouse

							# Effect
							root = {
								add_character_modifier = {
									modifier = wedding_barred_doors_modifier
									years = 5
								}
								if = {
									limit = { scope:shy_spouse ?= this }
									reverse_add_opinion = {
										target = scope:my_spouse
										modifier = wedding_barred_bedding_doors_opinion
										opinion = 10
									}
								}
								else = {
									reverse_add_opinion = {
										target = scope:my_spouse
										modifier = wedding_barred_bedding_doors_opinion
										opinion = 20
									}
								}
								had_sex_with_effect = {
									CHARACTER = scope:my_spouse
									PREGNANCY_CHANCE = 25
								}
							} 
						}
					}
					every_in_list = {
						list = bedding_witnesses
						custom = ep2_wedding_witnesses_tt
						reverse_add_opinion = {
							target = scope:my_spouse
							modifier = wedding_barred_bedding_doors_opinion
							opinion = -10
						}
						if = {
							limit = { exists = scope:shy_both }
							add_opinion = {
								target = scope:my_spouse
								modifier = wedding_barred_bedding_doors_opinion
								opinion = -10
							}
						}
					}
					stress_impact = {
						shy = minor_stress_impact_loss
						reclusive = medium_stress_impact_loss
						paranoid = minor_stress_impact_loss
						craven = minor_stress_impact_loss
					}
				}
			}
			60 = { #they refuse
				desc = ep2_wedding.3200.c.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = ep2_wedding.3200.c.failure
					left_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = wedding_forced_bedding_ceremony_opinion
						opinion = -10
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 5
					}
					stress_impact = {
						shy = miniscule_stress_impact_gain
						reclusive = minor_stress_impact_gain
						paranoid = miniscule_stress_impact_gain
						craven = miniscule_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_boldness = 0.5
				ai_sociability = -1
			}
		}
	}

	#Convince to take part
	option = {
		name = ep2_wedding.3200.d
		trigger = {
			NOT = { scope:shy_spouse ?= root }
		}
		duel = {
			skill = diplomacy
			target = scope:my_spouse
			40 = { #
				desc = ep2_wedding.3200.d.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = ep2_wedding.3200.d.success
					left_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = wedding_caved_to_bedding_opinion
						opinion = 10
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 75
					}
				}
			}
			60 = { #
				desc = ep2_wedding.3200.d.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = ep2_wedding.3200.d.failure
					left_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = wedding_forced_bedding_ceremony_opinion
						opinion = -10
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 5
					}
				}
			}
		}
		stress_impact = {
			stubborn = miniscule_stress_impact_gain
			compassionate = minor_stress_impact_loss
			callous = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_boldness = 0.5
				ai_sociability = 1
			}
		}
	}

	#Force to take part
	option = {
		name = ep2_wedding.3200.e
		trigger = { scope:shy_spouse ?= scope:my_spouse }
		reverse_add_opinion = {
			target = scope:my_spouse
			modifier = wedding_forced_bedding_ceremony_opinion
			opinion = -10
		}
		had_sex_with_effect = {
			CHARACTER = scope:my_spouse
			PREGNANCY_CHANCE = 20
		}
		stress_impact = {
			gregarious = medium_stress_impact_loss
			zealous = medium_stress_impact_loss
			diligent = medium_stress_impact_loss
			callous = minor_stress_impact_loss
			fickle = miniscule_stress_impact_gain
			compassionate = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_boldness = 0.5
				ai_sociability = 1
			}
		}
	}

	#Do your duty
	option = {
		name = ep2_wedding.3200.b
		trigger = { scope:shy_spouse ?= this }
		if = {
			limit = {
				NOT = { exists = scope:shy_both }
			}
			reverse_add_opinion = {
				target = scope:my_spouse
				modifier = wedding_caved_to_bedding_opinion
				opinion = 20
			}
		}
		if = {
			limit = {
				scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
			}
			set_relation_wedding_good_fertility = scope:my_spouse
		}
		had_sex_with_effect = {
			CHARACTER = scope:my_spouse
			PREGNANCY_CHANCE = 20
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			reclusive = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			gregarious = medium_stress_impact_loss
			zealous = medium_stress_impact_loss
			diligent = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -1
				ai_sociability = 0.5
			}
		}
	}
}

scripted_trigger wedding_3300_flavor_character_trigger = {
	is_participant_in_activity = scope:activity
	NOR = {
		this = scope:my_spouse
		this = root
	}
}

ep2_wedding.3300 = {
	type = activity_event
	title = ep2_wedding.3300.t
	desc = {
		desc = ep2_wedding.3300.opening
		# Ceremony flavor 1
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:officiant ?= { is_clergy = yes }
				}
				desc = ep2_wedding.3300.blessing
			}
			triggered_desc = {
				trigger = { exists = scope:officiant }
				desc = ep2_wedding.3300.decorate
			}
			desc = ep2_wedding.3300.flowers
		}
		# Ceremony flavor 2
		first_valid = {
			triggered_desc = {
				trigger = {
					drinks_alcohol_trigger = yes
					scope:my_spouse = { drinks_alcohol_trigger = yes }
				}
				desc = ep2_wedding.3300.wine
			}
			desc = ep2_wedding.3300.anointing
		}
		# Spouse flavor
		first_valid = {
			triggered_desc = {
				trigger = { has_relation_lover = scope:my_spouse }
				desc = ep2_wedding.3300.lover
			}
			triggered_desc = {
				trigger = { has_relation_friend = scope:my_spouse }
				desc = ep2_wedding.3300.friend
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_rival = scope:my_spouse
						reverse_opinion = { target = scope:my_spouse value < -50 }
					}
				}
				desc = ep2_wedding.3300.hatred
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_rival = scope:my_spouse
						reverse_opinion = { target = scope:my_spouse value < -10 }
					}
				}
				desc = ep2_wedding.3300.unfriendly
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_relation_rival = scope:my_spouse
						reverse_opinion = { target = scope:my_spouse value >= 25 }
					}
				}
				desc = ep2_wedding.3300.friendly
			}
			desc = ep2_wedding.3300.polite
		}
		# Party flavor
		random_valid = {
			triggered_desc = {
				trigger = { scope:jester.employer ?= root }
				desc = ep2_wedding.3300.jester_self
			}
			triggered_desc = {
				trigger = {
					exists = scope:jester 
					scope:jester.employer != root
				}
				desc = ep2_wedding.3300.jester
			}
			triggered_desc = {
				trigger = {
					scope:friend ?= { has_relation_friend = root }
				}
				desc = ep2_wedding.3300.other_friend_self
			}
			triggered_desc = {
				trigger = {
					exists = scope:friend
					NOT = {
						scope:friend = { has_relation_friend = root }
					}
				}
				desc = ep2_wedding.3300.other_friend
			}
			triggered_desc = {
				trigger = {
					scope:other_spouse ?= { is_spouse_of = root }
				}
				desc = ep2_wedding.3300.other_spouse_self
			}
			triggered_desc = {
				trigger = {
					exists = scope:other_spouse
					NOT = {
						scope:other_spouse ?= { is_spouse_of = root  }
					}
				}
				desc = ep2_wedding.3300.other_spouse
			}
			triggered_desc = {
				trigger = {
					scope:family ?= { is_close_family_of = root }
				}
				desc = ep2_wedding.3300.family_self
			}
			triggered_desc = {
				trigger = {
					scope:family ?= { is_close_family_of = scope:my_spouse }
				}
				desc = ep2_wedding.3300.family
			}
			desc = ep2_wedding.3300.fallback
		}
	}	
	theme = wedding_night_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_relation_rival = scope:my_spouse
					opinion = { target = scope:my_spouse value < -50 }
				}
			}
			animation = dismissal
		}
		triggered_animation = {
			trigger = {
				OR = {
					has_relation_lover = scope:my_spouse
					opinion = { target = scope:my_spouse value >= 25 }
				}
			}
			animation = flirtation_left
		}
		animation = idle
	}
	right_portrait = {
		character = scope:my_spouse
		triggered_animation = {
			trigger = {
				OR = {
					has_relation_rival = root
					opinion = { target = root value < -10 }
				}
			}
			animation = disapproval
		}
		triggered_animation = {
			trigger = {
				OR = {
					has_relation_lover = root
					opinion = { target = root value >= 25 }
				}
			}
			animation = flirtation
		}
		animation = idle
	}
	lower_left_portrait = scope:bedding_witness_1
	lower_center_portrait = scope:bedding_witness_2
	lower_right_portrait = scope:bedding_witness_3

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		OR = { #you are one of the spouses
			this = scope:activity.special_guest:spouse_1
			this = scope:activity.special_guest:spouse_2
		}
	}

	immediate = {
		# Identify root
		if = {
			limit = { root = scope:activity.special_guest:spouse_1 }
			scope:activity.special_guest:spouse_2 = { save_scope_as = my_spouse }
		}
		else = {
			scope:activity.special_guest:spouse_1 = { save_scope_as = my_spouse }
		}
		# Save witnesses
		ep2_wedding_bedding_ceremony_witness_effect = yes
		# Save officiant
		if = {
			limit = {
				scope:host.cp:councillor_court_chaplain ?= { is_participant_in_activity = scope:activity }
			}
			scope:host.cp:councillor_court_chaplain = { save_scope_as = officiant }
		}
		# Save jester
		if = {
			limit = {
				employs_court_position = court_jester_court_position
				court_position:court_jester_court_position ?= { wedding_3300_flavor_character_trigger = yes }
			}
			court_position:court_jester_court_position = { save_scope_as = jester }
		}
		else_if = {
			limit = {
				scope:my_spouse = {
					employs_court_position = court_jester_court_position
					court_position:court_jester_court_position ?= { wedding_3300_flavor_character_trigger = yes }
				}
			}
			scope:my_spouse.court_position:court_jester_court_position = { save_scope_as = jester }
		}
		else_if = {
			limit = {
				scope:host = {
					employs_court_position = court_jester_court_position
					court_position:court_jester_court_position ?= { wedding_3300_flavor_character_trigger = yes }
				}
			}
			scope:host.court_position:court_jester_court_position = { save_scope_as = jester }
		}
		# Save friend
		if = {
			limit = {
				any_relation = {
					type = friend
					wedding_3300_flavor_character_trigger = yes
				}
			}
			random_relation = {
				type = friend
				limit = { wedding_3300_flavor_character_trigger = yes }
				weight = {
					base = 1
					modifier = { add = ai_sociability }
					modifier = { add = ai_boldness }
				}
				save_scope_as = other_friend
			}
		}
		else_if = {
			limit = {
				scope:my_spouse = {
					any_relation = {
						type = friend
						wedding_3300_flavor_character_trigger = yes
					}
				}
			}
			scope:my_spouse = {
				random_relation = {
					type = friend
					limit = { wedding_3300_flavor_character_trigger = yes }
					weight = {
						base = 1
						modifier = { add = ai_sociability }
						modifier = { add = ai_boldness }
					}
					save_scope_as = other_friend
				}
			}
		}
		# Save other spouse
		if = {
			limit = {
				any_spouse = { wedding_3300_flavor_character_trigger = yes }
			}
			random_spouse = {
				limit = { wedding_3300_flavor_character_trigger = yes }
				weight = {
					base = 1
					modifier = { add = ai_sociability }
					modifier = { add = ai_boldness }
				}
				save_scope_as = other_spouse
			}
		}
		else_if = {
			limit = {
				scope:my_spouse = {
					any_spouse = { wedding_3300_flavor_character_trigger = yes }
				}
			}
			scope:my_spouse = {
				random_spouse = {
					limit = { wedding_3300_flavor_character_trigger = yes }
					weight = {
						base = 1
						modifier = { add = ai_sociability }
						modifier = { add = ai_boldness }
					}
					save_scope_as = other_spouse
				}
			}
		}
		# Save family
		random_list = {
			10 = {
				trigger = {
					any_in_list = {
						list = bedding_witnesses
						is_close_family_of = root
					}
				}
				random_in_list = {
					list = bedding_witnesses
					limit = { is_close_family_of = root }
					weight = {
						base = 1
						modifier = { add = ai_sociability }
						modifier = { add = ai_boldness }
					}
					save_scope_as = family
				}
			}
			10 = {
				trigger = {
					any_in_list = {
						list = bedding_witnesses
						is_close_family_of = scope:my_spouse
					}
				}
				random_in_list = {
					list = bedding_witnesses
					limit = { is_close_family_of = scope:my_spouse }
					weight = {
						base = 1
						modifier = { add = ai_sociability }
						modifier = { add = ai_boldness }
					}
					save_scope_as = family
				}
			}
		}
		# Save scopes for portraits
		if = {
			limit = {
				exists = scope:jester
				scope:jester != scope:bedding_witness_1
			}
			scope:jester = { save_scope_as = bedding_witness_1 }
		}
		else_if = {
			limit = {
				exists = scope:other_friend
				scope:other_friend != scope:bedding_witness_1
			}
			scope:other_friend = { save_scope_as = bedding_witness_1 }
		}
		else_if = {
			limit = {
				exists = scope:other_spouse
				scope:other_spouse != scope:bedding_witness_1
			}
			scope:other_spouse = { save_scope_as = bedding_witness_1 }
		}
		else_if = {
			limit = {
				exists = scope:family
				scope:family != scope:bedding_witness_1
			}
			scope:family = { save_scope_as = bedding_witness_1 }
		}
		add_character_flag = is_naked
		scope:my_spouse = {
			add_character_flag = is_naked
		}
	}

	#Hurry up!
	option = {
		name = ep2_wedding.3300.a
		random_list = {
			1 = {
				desc = ep2_wedding.3300.a.success
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = 1
				}
				modifier = { add = attraction }
				modifier = {
					scope:my_spouse = { has_trait = trusting }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = humble }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.a.success
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = feast_had_good_time_together_opinion
						opinion = 10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_good_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 75
					}
				}
			}
			1 = {
				desc = ep2_wedding.3300.a.failure
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = -1
				}
				modifier = {
					scope:my_spouse = { has_trait = paranoid }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = arrogant }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.a.failure
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = disgusted_opinion
						opinion = -10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 5
					}
				}
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_loss
			rakish = minor_stress_impact_loss
			lustful = minor_stress_impact_loss
			chaste = miniscule_stress_impact_gain
			humble = miniscule_stress_impact_gain
			craven = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:my_spouse
				multiplier = 1
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_sociability = 1
				ai_compassion = 0.5
			}
		}
	}

	#Tired
	option = {
		name = ep2_wedding.3300.b
		random_list = {
			1 = {
				desc = ep2_wedding.3300.b.success
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = 0.5
				}
				modifier = {
					scope:my_spouse = { has_trait = compassionate }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = lustful }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.b.success
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = insulted_opinion
						opinion = -10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:my_spouse
					}
				}
			}
			1 = {
				desc = ep2_wedding.3300.b.failure
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = -0.5
				}
				modifier = {
					scope:my_spouse = { has_trait = chaste }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = callous }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.b.failure
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = relieved_opinion
						opinion = 10
					}
				}
			}
		}
		stress_impact = {
			callous = minor_stress_impact_loss
			sadistic = minor_stress_impact_loss
			compassionate = miniscule_stress_impact_gain
			lustful = miniscule_stress_impact_gain
			rakish = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:my_spouse
				multiplier = -1
			}
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_compassion = -1
				ai_sociability = -1
			}
		}
	}

	#Need more wine
	option = {
		name = ep2_wedding.3300.c
		trigger = { drinks_alcohol_trigger = yes }
		random_list = {
			1 = {
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = 0.25
				}
				modifier = {
					scope:my_spouse = { has_trait = gluttonous }
					factor = 1.25
				}
				modifier = {
					scope:my_spouse = { has_trait = shy }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.c.success
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = relieved_opinion
						opinion = 10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_good_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 75
					}
				}
			}
			1 = {
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = -0.25
				}
				modifier = {
					scope:my_spouse = { drinks_alcohol_trigger = no }
					factor = 2
				}
				modifier = {
					scope:my_spouse = { has_trait = temperate }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = gregarious }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.c.failure
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = insulted_opinion
						opinion = -10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 5
					}
				}
			}
		}
		stress_impact = {
			drunkard = minor_stress_impact_loss
			honest = minor_stress_impact_loss
			temperate = miniscule_stress_impact_gain
			compassionate = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:my_spouse
				multiplier = -0.5
			}
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_compassion = -0.5
				ai_sociability = 0.5
			}
		}
	}

	#I'll do it, but I won't like it
	option = {
		name = ep2_wedding.3300.d
		trigger = {
			OR = {
				has_relation_rival = scope:my_spouse
				opinion = {
					target = scope:my_spouse
					value < -10
				}
			}
		}
		random_list = {
			1 = {
				desc = ep2_wedding.3300.d.success
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = 0.5
				}
				modifier = { add = attraction }
				modifier = { add = scope:my_spouse.attraction }
				modifier = {
					scope:my_spouse = { has_trait = lustful }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.d.success
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = feast_had_good_time_together_opinion
						opinion = 10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_good_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 75
					}
				}
			}
			1 = {
				desc = ep2_wedding.3300.d.failure
				opinion_modifier = {
					who = scope:my_spouse
					opinion_target = root
					multiplier = -0.5
				}
				modifier = {
					scope:my_spouse = { has_trait = shy }
					factor = 1.5
				}
				modifier = {
					scope:my_spouse = { has_trait = chaste }
					factor = 1.5
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3300.d.failure
					left_icon = root
					right_icon = scope:my_spouse
					reverse_add_opinion = {
						target = scope:my_spouse
						modifier = seduce_bad_time_opinion
						opinion = -10
					}
					if = {
						limit = {
							scope:my_spouse = { has_any_fertility_relationship_with_root_trigger = no }
						}
						set_relation_wedding_bad_fertility = scope:my_spouse
					}
					had_sex_with_effect = {
						CHARACTER = scope:my_spouse
						PREGNANCY_CHANCE = 5
					}
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_loss
			stubborn = minor_stress_impact_loss
			fickle = miniscule_stress_impact_gain
			arrogant = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:my_spouse
				multiplier = 0.5
			}
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = -0.5
				ai_sociability = 0.5
			}
		}
	}
	after = {
		remove_character_flag = is_naked
		scope:my_spouse = {
			remove_character_flag = is_naked
		}
	}
}

scripted_trigger wedding_3400_shared_trigger = {
	is_adult = yes
	is_participant_in_activity = scope:activity
	NOR = {
		this = root
		has_any_scripted_relation = root
		scope:activity.special_guest:spouse_1 ?= this
		scope:activity.special_guest:spouse_2 ?= this
		is_child_of = root
		is_nibling_of = root
		is_uncle_or_aunt_of = root
		is_sibling_of = root
		is_parent_of = root
		is_grandparent_of = root
		is_great_grandparent_of = root
		is_grandchild_of = root
		is_great_grandchild_of = root
	}
}

scripted_trigger wedding_3400_suitor_trigger = {
	age < 50
	is_participant_in_activity = scope:activity
	is_attracted_to_gender_of = $SUITOR$
	age >= $SUITOR$.age_minus_25
    age < $SUITOR$.age_plus_25
	OR = {
		is_married = no
		allowed_more_spouses = yes
		trigger_if = {
			limit = { is_female = yes }
			faith = { has_doctrine = doctrine_adultery_women_accepted }
			root.faith = { has_doctrine = doctrine_adultery_women_accepted }
			$SUITOR$.faith = { has_doctrine = doctrine_adultery_women_accepted }
	        
		}
		trigger_else = {
			faith = { has_doctrine = doctrine_adultery_men_accepted }
			root.faith = { has_doctrine = doctrine_adultery_men_accepted }
			$SUITOR$.faith = { has_doctrine = doctrine_adultery_men_accepted }
		}
	}
}

scripted_effect wedding_3400_save_relative_effect = {
	save_scope_as = other_family_spouse
	random_close_or_extended_family_member = {
		limit = {
			is_close_family_of = scope:other_family_spouse
			wedding_3400_shared_trigger = yes
			save_temporary_scope_as = other_relative_temp
		}
		alternative_limit = {
			wedding_3400_shared_trigger = yes
			save_temporary_scope_as = other_relative_temp
		}
		weight = {
			base = 1
			wedding_similiar_family_member_modifier = yes
			modifier = {
				add = 50
				scope:my_family_spouse = {
					any_close_family_member = {
						wedding_3400_suitor_trigger = { SUITOR = scope:other_relative_temp }
						save_temporary_scope_as = family_suitor_temp						
					}
				}
				wedding_3400_suitor_trigger = { SUITOR = scope:family_suitor_temp }
			}
		}
		save_scope_as = other_family_relative
	}
}

scripted_effect wedding_3400_knowledge_effect = {
	random_list = {
		0 = {
			trigger = { diplomacy < $OTHER$.diplomacy }
			modifier = { add = $OTHER$.diplomacy }
			add_diplomacy_skill = 1
		}
		0 = {
			trigger = { martial < $OTHER$.martial }
			modifier = { add = $OTHER$.martial }
			add_martial_skill = 1
		}
		0 = {
			trigger = { stewardship < $OTHER$.stewardship }
			modifier = { add = $OTHER$.stewardship }
			add_stewardship_skill = 1
		}
		0 = {
			trigger = { intrigue < $OTHER$.intrigue }
			modifier = { add = $OTHER$.intrigue }
			add_intrigue_skill = 1
		}
		0 = {
			trigger = { learning < $OTHER$.learning }
			modifier = { add = $OTHER$.learning }
			add_learning_skill = 1
		}
	}
}

ep2_wedding.3400 = {
	type = activity_event
	title = ep2_wedding.3400.t
	desc = {
		desc = ep2_wedding.3400.opening
		first_valid = {
			triggered_desc = {
				trigger = { drinks_alcohol_trigger = yes }
				desc = ep2_wedding.3400.drink_self
			}
			triggered_desc = {
				trigger = { can_be_hashishiyah = yes }
				desc = ep2_wedding.3400.hashish_self
			}
			desc = ep2_wedding.3400.fallback_self
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:other_family_relative = { drinks_alcohol_trigger = yes }
				}
				desc = ep2_wedding.3400.drink
			}
			triggered_desc = {
				trigger = {
					scope:other_family_relative = { can_be_hashishiyah = yes }
				}
				desc = ep2_wedding.3400.hashish
			}
			desc = ep2_wedding.3400.fallback
		}
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:other_family_relative = {
						drinks_alcohol_trigger = yes
						NOR = {
							is_child_of = scope:my_family_spouse
							is_sibling_of = scope:my_family_spouse
							is_parent_of = scope:my_family_spouse
							is_grandparent_of = scope:my_family_spouse
						}
					}
				}
				desc = ep2_wedding.3400.drink_family
			}
			triggered_desc = {
				trigger = {
					scope:other_family_relative = {
						drinks_alcohol_trigger = no
						NOR = {
							is_child_of = scope:my_family_spouse
							is_sibling_of = scope:my_family_spouse
							is_parent_of = scope:my_family_spouse
							is_grandparent_of = scope:my_family_spouse
						}
					}
				}
				desc = ep2_wedding.3400.family
			}
			triggered_desc = {
				trigger = {
					exists = house
					exists = scope:other_family_relative.house
					house != scope:other_family_relative.house
					scope:other_family_relative = { drinks_alcohol_trigger = yes }
				}
				desc = ep2_wedding.3400.drink_house
			}
			triggered_desc = {
				trigger = {
					exists = house
					exists = scope:other_family_relative.house
					house != scope:other_family_relative.house
					scope:other_family_relative = { drinks_alcohol_trigger = no }
				}
				desc = ep2_wedding.3400.house
			}
		}
	}	
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				drinks_alcohol_trigger = yes
				NOT = { has_trait = temperate }
			}
			animation = drink_goblet
		}
		animation = happiness
	}
	right_portrait = {
		character = scope:other_family_relative
		triggered_animation = {
			trigger = {
				drinks_alcohol_trigger = yes
				NOT = { has_trait = temperate }
			}
			animation = toast_goblet
		}
		animation = laugh
	}
	lower_right_portrait = scope:activity.special_guest:spouse_1
	lower_center_portrait = scope:my_family_suitor
	lower_left_portrait = scope:activity.special_guest:spouse_2

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		is_adult = yes
		# Spouse 1 and 2 are not root
		NOR = {
			scope:activity.special_guest:spouse_1 = root
			scope:activity.special_guest:spouse_2 = root
		}
		# Spouse 1 is related to root and someone related to Spouse 2 is kicking around
		trigger_if = {
			limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_1 }
			scope:activity.special_guest:spouse_2 = {
				any_close_or_extended_family_member = { wedding_3400_shared_trigger = yes }
			}
		}
		# Spouse 2 is related to root and someone related to Spouse 1 is kicking around
		trigger_else_if = {
			limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_2 }
			scope:activity.special_guest:spouse_1 = {
				any_close_or_extended_family_member = { wedding_3400_shared_trigger = yes }
			}
		}
		# No dice
		trigger_else = { always = no }
	}

	immediate = {
		# Save someone related to Spouse 2
		save_scope_as = my_family_relative
		if = {
			limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_1 }
			scope:activity.special_guest:spouse_1 = { save_scope_as = my_family_spouse }
			scope:activity.special_guest:spouse_2 = { wedding_3400_save_relative_effect = yes }
		}
		# Save someone related to Spouse 1
		else = {
			scope:activity.special_guest:spouse_2 = { save_scope_as = my_family_spouse }
			scope:activity.special_guest:spouse_1 = { wedding_3400_save_relative_effect = yes }
		}
		# Save suitor if relevant
		if = {
			limit = {
				any_close_family_member = {
					wedding_3400_suitor_trigger = { SUITOR = scope:other_family_relative }
					save_temporary_scope_as = family_suitor_temp
				}
				scope:other_family_relative = {
					wedding_3400_suitor_trigger = { SUITOR = scope:family_suitor_temp }
				}
			}
			random_close_family_member = {
				limit = {
					wedding_3400_suitor_trigger = { SUITOR = scope:other_family_relative }
					save_temporary_scope_as = family_suitor_temp
					scope:other_family_relative = {
						wedding_3400_suitor_trigger = { SUITOR = scope:family_suitor_temp }
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 50
						age >= scope:other_family_relative.age_minus_5
						age < scope:other_family_relative.age_plus_5
					}
					modifier = {
						add = 25
						age >= scope:other_family_relative.age_minus_10
						age < scope:other_family_relative.age_plus_10
					}
					modifier = { add = attraction }
				}
				save_scope_as = my_family_suitor
			}
		}
	}

	#Oh lemme bore you
	option = {
		name = ep2_wedding.3400.a
		send_interface_toast = {
			title = ep2_wedding.3400.tt
			left_icon = root
			right_icon = scope:other_family_relative
			wedding_3400_knowledge_effect = { OTHER = scope:other_family_relative }
			scope:other_family_relative = {
				wedding_3400_knowledge_effect = { OTHER = root }
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			content = miniscule_stress_impact_gain
			lazy = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
			}
		}
	}

	#Family matchmaker
	option = {
		name = ep2_wedding.3400.b
		trigger = { exists = scope:my_family_suitor }
		random_list = {
			10 = {
				desc = ep2_wedding.3400.b.success
				opinion_modifier = {
					who = scope:my_family_suitor
					opinion_target = scope:other_family_relative
					multiplier = 0.5
				}
				send_interface_toast = {
					title = ep2_wedding.3400.b.tt
					left_icon = scope:other_family_relative
					right_icon = scope:my_family_suitor
					scope:other_family_relative = {
						progress_towards_lover_effect = {
							CHARACTER = scope:my_family_suitor
							REASON = lover_wedding_relation_suitor
							OPINION = default_lover_opinion
						}
					}
				}
			}
			10 = {
				desc = ep2_wedding.3400.b.failure
				opinion_modifier = {
					who = scope:my_family_suitor
					opinion_target = scope:other_family_relative
					multiplier = -0.5
				}
				send_interface_toast = {
					title = ep2_wedding.3400.b.failure
					left_icon = scope:other_family_relative
					right_icon = scope:my_family_suitor
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_loss
			trusting = minor_stress_impact_loss
			callous = miniscule_stress_impact_gain
			paranoid = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:my_family_suitor
				multiplier = 0.5
			}
			opinion_modifier = {
				opinion_target = scope:other_family_relative
				multiplier = 0.5
			}
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	#More wine!
	option = {
		name = {
			trigger = { drinks_alcohol_trigger = yes }
			text = ep2_wedding.3400.c.drink
		}
		name = {
			trigger = { drinks_alcohol_trigger = no }
			text = ep2_wedding.3400.c.hashish
		}
		trigger = {
			OR = {
				drinks_alcohol_trigger = yes
				can_be_hashishiyah = yes
			}
		}
		add_prestige = medium_prestige_gain
		if = {
			limit = { has_trait = lifestyle_reveler }
			add_trait_xp = {
				trait = lifestyle_reveler
				value = medium_trait_xp
			}
		}
		else = { add_trait = lifestyle_reveler }
		if = {
			limit = { drinks_alcohol_trigger = yes }
			if = {
				limit = {
					NOT = { has_trait = drunkard }
				}
				random = {
					chance = 1
					add_trait = drunkard
				}
				stress_impact = {
					base = minor_stress_impact_loss
					drunkard = minor_stress_impact_loss
					lifestyle_reveler = minor_stress_impact_loss
					lazy = minor_stress_impact_loss
					temperate = miniscule_stress_impact_gain
					diligent = miniscule_stress_impact_gain
				}
			}

		}
		else_if = {
			limit = { can_be_hashishiyah = yes }
			random = {
				chance = 1
				add_trait = hashishiyah
			}
			stress_impact = {
				base = minor_stress_impact_loss
				hashishiyah = minor_stress_impact_loss
				lifestyle_reveler = minor_stress_impact_loss
				lazy = minor_stress_impact_loss
				temperate = miniscule_stress_impact_gain
				diligent = miniscule_stress_impact_gain
			}
		}
		ai_chance = {
			base = 50
			modifier = {
				has_trait = drunkard
				add = 50
			}
			modifier = {
				has_trait = hashishiyah
				add = 50
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_rationality = -0.5
			}
		}
	}

	#Befriend
	option = {
		name = ep2_wedding.3400.d
		trigger = {
			OR = {
				NOT = { exists = scope:my_family_suitor }
				NOT = { is_attracted_to_gender_of = scope:other_family_relative }
			}
		}
		progress_towards_friend_effect = {
			REASON = friend_wedding_relation_bond
			CHARACTER = scope:other_family_relative
			OPINION = default_friend_opinion
		}
		stress_impact = {
			gregarious = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			shy = miniscule_stress_impact_gain
			arrogant = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:other_family_relative
				multiplier = 1
			}
			ai_value_modifier = {
				ai_sociability = 1
			}
			modifier = {
				num_of_relation_friend >= 2
				factor = 0
			}
		}
	}

	#Woo
	option = {
		name = ep2_wedding.3400.e
		trigger = {
			is_attracted_to_gender_of = scope:other_family_relative
			NOT = { has_trait = celibate }
		}
		duel = {
			skill = intrigue
			value = medium_skill_rating
			10 = {
				desc = ep2_wedding.3400.e.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					add = 5
					has_trait = seducer
				}
				modifier = { add = attraction }
				modifier = {
					add = 50
					scope:other_family_relative = {
						would_attempt_to_seduce_trigger = { CHARACTER = root }
					}
				}
				send_interface_toast = {
					title = ep2_wedding.3400.e.success
					progress_towards_lover_effect = {
						REASON = lover_wedding_relation_bond
						CHARACTER = scope:other_family_relative
						OPINION = default_lover_opinion
					}
					if = {
						limit = {
							might_cheat_on_every_partner_trigger = yes
							scope:other_family_relative = { might_cheat_on_every_partner_trigger = yes }
						}
						had_sex_with_effect = {
							CHARACTER = scope:other_family_relative
							PREGNANCY_CHANCE = pregnancy_chance
						}
					}
				}
				min = 5
			}
			10 = {
				desc = ep2_wedding.3400.e.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				modifier = {
					add = 50
					NOT = {
						scope:other_family_relative = {
							would_attempt_to_seduce_trigger = { CHARACTER = root }
						}
					}
				}
				min = 5
				send_interface_toast = {
					title = ep2_wedding.3400.e.failure
					reverse_add_opinion = {
						target = scope:other_family_relative
						modifier = disgusted_opinion
						opinion = -10
					}	
				}
			}
		}
		stress_impact = {
			lustful = minor_stress_impact_loss
			rakish = minor_stress_impact_loss
			chaste = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:other_family_relative
				multiplier = 1
			}
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = 0.5
			}
			modifier = {
				num_of_relation_lover >= 2
				factor = 0
			}
			modifier = {
				NOT = {
					would_attempt_to_seduce_trigger = { CHARACTER = scope:other_family_relative }
				}
				factor = 0
			}
		}
	}
}

ep2_wedding.3410 = {
	type = activity_event
	title = ep2_wedding.3410.t
	desc = {
		desc = ep2_wedding.3410.opening
		first_valid = {
			triggered_desc = { # Double trouble
				trigger = { exists = scope:double_jealousy }
				desc = ep2_wedding.3410.double
			}
			triggered_desc = { # Primary spouse
				trigger = {
					OR = {
						has_relation_lover = scope:jealousy_focus
						any_secret = {
							type = secret_lover
							secret_target = scope:jealousy_focus
						}
					}
				}
				desc = ep2_wedding.3410.lover
			}
			triggered_desc = { # Primary spouse
				trigger = { primary_spouse ?= scope:jealousy_focus }
				desc = ep2_wedding.3410.primary
			}
			desc = ep2_wedding.3410.secondary
		}
		first_valid = {
			triggered_desc = { # Double trouble
				trigger = { exists = scope:double_jealousy }
				desc = ep2_wedding.3410.double_opinion
			}
			triggered_desc = { # Primary spouse
				trigger = {
					reverse_opinion = {
						target = scope:jealousy_focus
						value >= 25
					}
				}
				desc = ep2_wedding.3410.positive_opinion
			}
			triggered_desc = { # Primary spouse
				trigger = {
					reverse_opinion = {
						target = scope:jealousy_focus
						value <= 0
					}
				}
				desc = ep2_wedding.3410.negative_opinion
			}
			desc = ep2_wedding.3410.indifferent_opinion
		}
	}	
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					exists = scope:double_jealousy
					AND = {
						NOT = { exists = scope:double_jealousy }
						reverse_opinion = {
							target = scope:jealousy_focus
							value > 0
						}
					}
				}
			}
			animation = stress
		}
		animation = war_over_win
	}
	lower_right_portrait = scope:jealousy_focus
	lower_left_portrait = scope:jealousy_usurper

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		is_adult = yes
		# Spouse 1 and 2 are not root
		NOR = {
			scope:activity.special_guest:spouse_1 = root
			scope:activity.special_guest:spouse_2 = root
		}
		# Has an intimate relationship with a spouse
		OR = {
			any_secret = {
				type = secret_lover
				secret_target = scope:activity.special_guest:spouse_1
			}
			any_secret = {
				type = secret_lover
				secret_target = scope:activity.special_guest:spouse_2
			}
			has_relation_lover = scope:activity.special_guest:spouse_1
			has_relation_lover = scope:activity.special_guest:spouse_2
			is_spouse_of = scope:activity.special_guest:spouse_1
			is_spouse_of = scope:activity.special_guest:spouse_2
		}
	}

	immediate = {
		# Check for double
		if = {
			limit = {
				OR = {
					any_secret = {
						type = secret_lover
						secret_target = scope:activity.special_guest:spouse_1
					}
					has_relation_lover = scope:activity.special_guest:spouse_1
					is_spouse_of = scope:activity.special_guest:spouse_1
				}
				OR = {
					any_secret = {
						type = secret_lover
						secret_target = scope:activity.special_guest:spouse_2
					}
					has_relation_lover = scope:activity.special_guest:spouse_2
					is_spouse_of = scope:activity.special_guest:spouse_2
				}
			}
			save_scope_as = double_jealousy
		}
		# Save jealous focus, or preferred
		hidden_effect = {
			random_list = {
				1 = {
					trigger = {
						OR = {
							any_secret = {
								type = secret_lover
								secret_target = scope:activity.special_guest:spouse_1
							}
							has_relation_lover = scope:activity.special_guest:spouse_1
							is_spouse_of = scope:activity.special_guest:spouse_1
						}
					}
					opinion_modifier = {
						opinion_target = scope:activity.special_guest:spouse_1
						multiplier = 1
					}
					scope:activity.special_guest:spouse_1 = { save_scope_as = jealousy_focus }
					scope:activity.special_guest:spouse_2 = { save_scope_as = jealousy_usurper }
				}
				1 = {
					trigger = {
						OR = {
							any_secret = {
								type = secret_lover
								secret_target = scope:activity.special_guest:spouse_2
							}
							has_relation_lover = scope:activity.special_guest:spouse_2
							is_spouse_of = scope:activity.special_guest:spouse_2
						}
					}
					opinion_modifier = {
						opinion_target = scope:activity.special_guest:spouse_2
						multiplier = 1
					}
					scope:activity.special_guest:spouse_2 = { save_scope_as = jealousy_focus }
					scope:activity.special_guest:spouse_1 = { save_scope_as = jealousy_usurper }
				}
			}
		}
	}

	#Make a scene
	option = {
		name = ep2_wedding.3410.a
		flavor = ep2_wedding.3410.a.flavor
		add_prestige = minor_prestige_gain
		reverse_add_opinion = {
			target = scope:jealousy_focus
			modifier = ruined_wedding_night_opinion
			opinion = -15
		}
		reverse_add_opinion = {
			target = scope:jealousy_usurper
			modifier = ruined_wedding_night_opinion
			opinion = -15
		}
		if = {
			limit = {
				any_secret = {
					type = secret_lover
					secret_target = scope:jealousy_focus
				}
			}
			scope:jealousy_usurper = {
				every_close_family_member = {
					custom = every_usurper_close_family_tt
					add_opinion = {
						target = scope:jealousy_focus
						modifier = revealed_lover_wedding_night_opinion
						opinion = -20
					}
					add_opinion = {
						target = root
						modifier = ruined_wedding_night_opinion
						opinion = -10
					}
				}
			}
		}
		expose_lover_secret_or_run_consequence_effect = {
			TARGET = scope:jealousy_focus
			EXPOSER = root
		}
		stress_impact = {
			base = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			calm = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_vengefulness = 0.5
				ai_boldness = 0.5
			}
			modifier = {
				any_secret = {
					type = secret_lover
					secret_target = scope:jealousy_usurper
				}
				factor = 0.5
			}
		}
	}

	#Plot murder
	option = {
		name = ep2_wedding.3410.b
		trigger = {
			NOR = {
				any_secret = {
					type = secret_lover
					secret_target = scope:jealousy_usurper
				}
				has_relation_lover = scope:jealousy_usurper
				is_scheming_against = { target = scope:jealousy_usurper }
			}
			can_start_scheme = {
				type = murder
				target_character = scope:jealousy_usurper
			}
		}
		start_scheme = {
			target_character = scope:jealousy_usurper
			type = murder
		}
		random_scheme = {
			type = murder
			limit = {
				scheme_target_character = scope:jealousy_usurper
			}
			add_scheme_modifier = { type = wedding_consorts_envy_modifier }
		}
		custom_tooltip = ep2_wedding.3410.b.tt
		stress_impact = {
			vengeful = minor_stress_impact_loss
			zealous = miniscule_stress_impact_gain
			just = miniscule_stress_impact_gain
			forgiving = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 75
			opinion_modifier = {
				opinion_target = scope:jealousy_usurper
				multiplier = -1
			}
			ai_value_modifier = {
				ai_energy = 1
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	#Fed up with focus
	option = {
		name = ep2_wedding.3410.c
		trigger = {
			OR = {
				has_relation_lover = scope:jealousy_focus
				has_relation_lover = scope:jealousy_usurper
			}
		}
		if = {
			limit = { has_relation_lover = scope:jealousy_focus }
			if = {
				limit = { is_ai = yes }
				add_opinion = {
					target = scope:jealousy_focus
					modifier = insulted_opinion
					opinion = -20
				}
			}
			lose_lover_effect = { LOVER = scope:jealousy_focus }
		}
		if = {
			limit = { has_relation_lover = scope:jealousy_usurper }
			if = {
				limit = { is_ai = yes }
				add_opinion = {
					target = scope:jealousy_focus
					modifier = insulted_opinion
					opinion = -20
				}
			}
			lose_lover_effect = { LOVER = scope:jealousy_usurper }
		}
		stress_impact = {
			fickle = minor_stress_impact_loss
			base = miniscule_stress_impact_gain
			stubborn = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_compassion = 1
				ai_boldness = 0.5
			}
		}
	}

	#Fine by me
	option = {
		name = ep2_wedding.3410.d
		add_character_modifier = {
			modifier = wedding_old_news_modifier
			years = 5
		}
		stress_impact = {
			humble = minor_stress_impact_loss
			content = minor_stress_impact_loss
			arrogant = miniscule_stress_impact_gain
			ambitious = miniscule_stress_impact_gain
		}
		ai_chance = {
			base = 50
			opinion_modifier = {
				opinion_target = scope:jealousy_focus
				multiplier = -1
			}
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

ep2_wedding.3420 = {
	type = activity_event
	title = ep2_wedding.3420.t
	desc = {
		desc = ep2_wedding.3420.opening
		random_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = gluttonous
						has_trait = comfort_eater
					}
					exists = scope:wedding_eat
				}
				desc = ep2_wedding.3420.eat
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = drunkard
						has_trait = hashishiyah
						has_trait = lifestyle_reveler
					}
					exists = scope:wedding_drink
				}
				desc = ep2_wedding.3420.drink
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = lustful
						has_trait = rakish
					}
					exists = scope:wedding_lech
				}
				desc = ep2_wedding.3420.lech
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = greedy
						has_trait = avaricious
					}
					exists = scope:wedding_steal
				}
				desc = ep2_wedding.3420.steal
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = shy
						has_trait = reclusive
					}
					exists = scope:wedding_flee
				}
				desc = ep2_wedding.3420.flee
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = generous
						has_trait = improvident
					}
					exists = scope:wedding_charity
				}
				desc = ep2_wedding.3420.charity
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = gregarious
						has_trait = trusting
					}
					exists = scope:wedding_social
				}
				desc = ep2_wedding.3420.social
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = arrogant
						has_trait = ambitious
						has_trait = august
					}
					exists = scope:wedding_posture
				}
				desc = ep2_wedding.3420.posture
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = honest
						has_trait = contrite
					}
					exists = scope:wedding_blab
					scope:blab_guest = root
				}
				desc = ep2_wedding.3420.blab_self
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = honest
						has_trait = contrite
					}
					exists = scope:wedding_blab
				}
				desc = ep2_wedding.3420.blab
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = deceitful
						has_trait = schemer
					}
					exists = scope:wedding_scheme
				}
				desc = ep2_wedding.3420.scheme
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = compassionate
						has_trait = generous
					}
					exists = scope:wedding_help
				}
				desc = ep2_wedding.3420.help
			}
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = compassionate
						has_trait = zealous
					}
					exists = scope:wedding_pray
				}
				desc = ep2_wedding.3420.pray
			}
		}
		desc = ep2_wedding.3420.closing
	}	
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:social_guest
		trigger = { exists = scope:wedding_social }
		animation = happiness
	}
	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		is_adult = yes
		exists = scope:activity
	}

	immediate = {
		scope:activity = {
			# Blab scopes
			random_attending_character = {
				limit = {
					any_targeting_secret = {
						OR = {
							is_known_by = root
							secret_owner = root
						}
					}
				}
				save_scope_as = blab_guest
				random_targeting_secret = {
					limit = { is_known_by = root }
					alternative_limit = { secret_owner = root }
					save_scope_as = blab_secret
				}
			}
			# Scheme scopes
			random_attending_character = {
				limit = {
					OR = {
						any_secret = {
							NOR = {
								is_known_by = root
								secret_owner ?= root
								secret_target ?= root
							}
						}
						any_targeting_secret = {
							NOR = {
								is_known_by = root
								secret_owner ?= root
								secret_target ?= root
							}
						}
					}
				}
				weight = {
					base = 100
					modifier = {
						factor = 0.1
						scope:blab_guest ?= this
					}
					is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root }
					is_of_major_interest_to_weight_up_modifier = { CHARACTER = root }
				}
				save_scope_as = scheme_guest
				hidden_effect = {
					random_list = {
						1 = {
							trigger = {
								any_secret = {
									NOR = {
										is_known_by = root
										secret_owner = root
										trigger_if = {
											limit = { exists = scope:scheme_target }
											secret_target = root
										}
									}
								}
							}
							random_secret = {
								limit = {
									NOR = {
										is_known_by = root
										secret_owner = root
										trigger_if = {
											limit = { exists = scope:scheme_target }
											secret_target = root
										}
									}
								}
								save_scope_as = scheme_secret
							}
						}
						1 = {
							trigger = {
								any_targeting_secret = {
									NOR = {
										is_known_by = root
										secret_owner = root
										trigger_if = {
											limit = { exists = scope:scheme_target }
											secret_target = root
										}
									}
								}
							}
							random_targeting_secret = {
								limit = {
									NOR = {
										is_known_by = root
										secret_owner = root
										trigger_if = {
											limit = { exists = scope:scheme_target }
											secret_target = root
										}
									}
								}
								save_scope_as = scheme_secret
							}
						}
					}
				}
			}
			# Social scopes
			random_attending_character = {
				limit = {
					NOR = {
						this = root
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
						has_any_scripted_relation = root
					}
					opinion = {
						target = root
						value > -25
					}
				}
				weight = {
					base = 50
					modifier = {
						scope:blab_guest ?= this
						factor = 0.1
					}
					modifier = {
						scope:scheme_guest ?= this
						factor = 0.1
					}
					modifier = {
						has_trait = gregarious
						add = 25
					}
					modifier = {
						has_trait = lifestyle_reveler
						add = 25
					}
					modifier = {
						trait_compatibility = {
							target = root
							value >= low_positive_trait_compatibility
						}
						add = 25
					}
					modifier = {
						trait_compatibility = {
							target = root
							value >= medium_positive_trait_compatibility
						}
						add = 25
					}
					modifier = {
						trait_compatibility = {
							target = root
							value >= high_positive_trait_compatibility
						}
						add = 25
					}
					modifier = {
						sex_same_as = root 
						add = 50
					}
					modifier = {
						age >= root.age_minus_10
						age < root.age_plus_10
						add = 25
					}
					modifier = {
						age >= root.age_minus_5
						age < root.age_plus_5
						add = 25
					}
				}
				save_scope_as = social_guest
			}
			# Help scopes
			random_attending_character = {
				limit = {
					NOR = {
						this = root
						this = scope:activity.special_guest:spouse_1
						this = scope:activity.special_guest:spouse_2
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
				}
				weight = {
					base = 50
					modifier = {
						scope:blab_guest ?= this
						factor = 0.1
					}
					modifier = {
						scope:scheme_guest ?= this
						factor = 0.1
					}
					modifier = {
						scope:social_guest ?= this
						factor = 0.1
					}
					modifier = {
						OR = {
							has_trait = drunkard
							has_trait = lifestyle_reveler
						}
						add = 25
					}
					modifier = {
						is_healthy = no
						add = 25
					}
					modifier = {
						age >= 50
						add = 25
					}
					modifier = {
						is_close_family_of = root
						factor = 2
					}
					modifier = {
						ai_energy <= low_negative_ai_value
						add = 25
					}
					modifier = {
						ai_energy <= medium_negative_ai_value
						add = 25
					}
					modifier = {
						ai_energy <= high_negative_ai_value
						add = 25
					}
					modifier = {
						current_weight >= overweight_value
						add = 25
					}
					modifier = {
						age > 30
						add = 25
					}
					modifier = {
						age > 60
						add = 25
					}
				}
				save_scope_as = help_guest
			}
		}
		hidden_effect = {
			while = {
				count = 4
				random_list = {
					10 = { # Eat
						trigger = {
							NOR = {
								exists = scope:wedding_eat
								has_trait = inappetetic
							}
						}
						modifier = {
							has_trait = temperate
							add = -20
						}
						modifier = {
							has_trait = gluttonous
							add = 10
						}
						modifier = {
							has_trait = comfort_eater
							add = 10
						}
						modifier = {
							has_trait = lazy
							add = 10
						}
						modifier = {
							add = {
								value = ai_energy
								multiply = -1
							}
						}
						save_scope_as = wedding_eat
					}
					10 = { # Drink
						trigger = {
							NOT = { exists = scope:wedding_drink }
						}
						modifier = {
							has_trait = temperate
							add = -20
						}
						modifier = {
							has_trait = drunkard
							add = 10
						}
						modifier = {
							has_trait = hashishiyah
							add = 10
						}
						modifier = {
							has_trait = lifestyle_reveler
							add = 10
						}
						modifier = {
							has_trait = lazy
							add = 10
						}
						modifier = {
							add = {
								value = ai_energy
								multiply = -1
							}
						}
						save_scope_as = wedding_drink
					}
					10 = { # Lech
						trigger = {
							NOT = { exists = scope:wedding_lech }
							would_attempt_to_seduce_married_trigger = yes
							is_eunuch_trigger = no
							NOR = {
								has_trait = celibate
								has_trait = devoted
							}
						}
						modifier = {
							has_trait = chaste
							add = -20
						}
						modifier = {
							has_trait = lustful
							add = 10
						}
						modifier = {
							has_trait = rakish
							add = 10
						}
						modifier = {
							add = {
								value = ai_sociability
								multiply = 0.5
							}
						}
						modifier = {
							add = {
								value = ai_honor
								multiply = -0.5
							}
						}
						save_scope_as = wedding_lech
					}
					10 = { # Steal
						trigger = {
							NOT = { exists = scope:wedding_steal }
							exists = root.capital_province
							NOT = { scope:activity.activity_location ?= root.capital_province }
							OR = {
								has_trait = greedy
								has_trait = avaricious
								gold < 0
								ai_honor < low_positive_honor
							}
						}
						modifier = {
							has_trait = generous
							add = -20
						}
						modifier = {
							has_trait = greedy
							add = 10
						}
						modifier = {
							has_trait = arbitrary
							add = 10
						}
						modifier = {
							has_trait = avaricious
							add = 10
						}
						modifier = { add = ai_greed }
						modifier = {
							add = {
								value = ai_honor
								multiply = -1
							}
						}
						save_scope_as = wedding_steal
					}
					10 = { # Flee
						trigger = {
							NOT = { exists = scope:wedding_flee }
							OR = {
								has_trait = shy
								has_trait = reclusive
								has_trait = paranoid
								has_trait = impatient
							}
						}
						modifier = {
							has_trait = gregarious
							add = -20
						}
						modifier = {
							has_trait = brave
							add = -20
						}
						modifier = {
							has_trait = trusting
							add = -20
						}
						modifier = {
							has_trait = shy
							add = 10
						}
						modifier = {
							has_trait = paranoid
							add = 10
						}
						modifier = {
							has_trait = craven
							add = 10
						}
						modifier = {
							has_trait = reclusive
							add = 10
						}
						modifier = {
							has_trait = impatient
							add = 10
						}
						modifier = {
							add = {
								value = ai_boldness
								multiply = -1
							}
						}
						save_scope_as = wedding_flee
					}
					10 = { # Charity
						trigger = {
							NOT = { exists = scope:wedding_charity }
						}
						modifier = {
							has_trait = greedy
							add = -20
						}
						modifier = {
							has_trait = avaricious
							add = -20
						}
						modifier = {
							has_trait = callous
							add = -20
						}
						modifier = {
							has_trait = sadistic
							add = -20
						}
						modifier = {
							has_trait = generous
							add = 10
						}
						modifier = {
							has_trait = improvident
							add = 10
						}
						modifier = {
							add = {
								value = ai_greed
								multiply = -1
							}
							add = {
								value = ai_zeal
								multiply = 0.5
							}
						}
						save_scope_as = wedding_charity
					}
					10 = { # Social
						trigger = {
							NOT = { exists = scope:wedding_social }
							exists = scope:social_guest
						}
						modifier = {
							has_trait = shy
							add = -20
						}
						modifier = {
							has_trait = reclusive
							add = -20
						}
						modifier = {
							has_trait = gregarious
							add = 10
						}
						modifier = {
							has_trait = confider
							add = 10
						}
						modifier = { add = ai_sociability }
						save_scope_as = wedding_social
					}
					10 = { # Posture
						trigger = {
							NOT = { exists = scope:wedding_posture }
						}
						modifier = {
							has_trait = humble
							add = -20
						}
						modifier = {
							has_trait = content
							add = -20
						}
						modifier = {
							has_trait = arrogant
							add = 10
						}
						modifier = {
							has_trait = ambitious
							add = 10
						}
						modifier = {
							has_trait = august
							add = 10
						}
						modifier = {
							add = {
								value = ai_boldness
								multiply = 0.5
							}
						}
						save_scope_as = wedding_posture
					}
					10 = { # Blab
						trigger = {
							NOT = { exists = scope:wedding_blab }
							exists = scope:blab_guest
							exists = scope:blab_secret
						}
						modifier = {
							has_trait = deceitful
							add = -20
						}
						modifier = {
							has_trait = honest
							add = 10
						}
						modifier = {
							has_trait = contrite
							add = 10
						}
						modifier = {
							add = {
								value = ai_honor
								multiply = 0.5
							}
						}
						save_scope_as = wedding_blab
					}
					10 = { # Scheme
						trigger = {
							NOT = { exists = scope:wedding_scheme }
						}
						modifier = {
							has_trait = honest
							add = -20
						}
						modifier = {
							has_trait = contrite
							add = -20
						}
						modifier = {
							has_trait = deceitful
							add = 10
						}
						modifier = {
							has_trait = schemer
							add = 10
						}
						modifier = {
							add = {
								value = ai_honor
								multiply = -1
							}
						}
						save_scope_as = wedding_scheme
					}
					10 = { # Help
						trigger = {
							NOT = { exists = scope:wedding_help }
							exists = scope:help_guest
						}
						modifier = {
							has_trait = callous
							add = -20
						}
						modifier = {
							has_trait = sadistic
							add = -20
						}
						modifier = {
							has_trait = compassionate
							add = 10
						}
						modifier = {
							has_trait = generous
							add = 10
						}
						modifier = { add = ai_compassion }
						save_scope_as = wedding_help
					}
					10 = { # Pray
						trigger = {
							NOT = { exists = scope:wedding_pray }
							OR = {
								is_close_or_extended_family_of = scope:activity.special_guest:spouse_1
								is_close_or_extended_family_of = scope:activity.special_guest:spouse_2
								has_trait = devoted
								has_trait = zealous
							}
						}
						modifier = {
							has_trait = cynical
							add = -20
						}
						modifier = {
							has_trait = callous
							add = -20
						}
						modifier = {
							has_trait = zealous
							add = 10
						}
						modifier = {
							has_trait = compassionate
							add = 10
						}
						modifier = { add = ai_zeal }
						modifier = {
							add = {
								value = ai_compassion
								multiply = 0.5
							}
						}
						save_scope_as = wedding_pray
					}
				}
			}
		}
	}

	#Eat
	option = {
		name = ep2_wedding.3420.a
		trigger = { exists = scope:wedding_eat }
		trait = gluttonous
		trait = comfort_eater
		target_weight_modifier_effect = { VALUE = 2 }
		stress_impact = {
			gluttonous = medium_stress_impact_loss
			comfort_eater = medium_stress_impact_loss
			temperate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_energy = 1
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	#Drink
	option = {
		name = ep2_wedding.3420.b
		trigger = { exists = scope:wedding_drink }
		trait = drunkard
		trait = hashishiyah
		trait = lifestyle_reveler
		if = {
			limit = {
				NOT = { has_trait = lifestyle_reveler }
			}
			add_trait = lifestyle_reveler
		}
		else = {
			add_trait_xp = {
				trait = lifestyle_reveler
				value = medium_trait_xp
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			drunkard = medium_stress_impact_loss
			hashishiyah = medium_stress_impact_loss
			lifestyle_reveler = medium_stress_impact_loss
			temperate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_compassion = 1
				ai_boldness = 0.5
			}
		}
	}

	#Lech
	option = {
		name = ep2_wedding.3420.c
		trigger = { exists = scope:wedding_lech }
		trait = lustful
		trait = rakish
		if = {
			limit = {
				NOT = { is_attracted_to_men = yes }
			}
			had_sex_with_unknown_effect = { GENDER = female }
		}
		else = {
			had_sex_with_unknown_effect = { GENDER = male }
		}
		stress_impact = {
			lustful = medium_stress_impact_loss
			rakish = medium_stress_impact_loss
			chaste = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Steal
	option = {
		name = ep2_wedding.3420.d
		trigger = { exists = scope:wedding_steal }
		trait = greedy
		trait = avaricious
		add_gold = { 10 25 }
		stress_impact = {
			greedy = medium_stress_impact_loss
			avaricious = medium_stress_impact_loss
			generous = medium_stress_impact_gain
			just = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Flee
	option = {
		name = ep2_wedding.3420.e
		trigger = { exists = scope:wedding_flee }
		trait = shy
		trait = reclusive
		add_prestige = miniscule_prestige_loss
		stress_impact = {
			impatient = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
			shy = medium_stress_impact_loss
			reclusive = medium_stress_impact_loss
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
				ai_vengefulness = 0.5
				ai_boldness = 0.5
			}
		}
	}

	#Charity
	option = {
		name = ep2_wedding.3420.f
		trigger = { exists = scope:wedding_charity }
		trait = generous
		trait = improvident
		remove_short_term_gold = { 10 25 }
		add_piety = minor_piety_gain
		stress_impact = {
			generous = medium_stress_impact_loss
			improvident = medium_stress_impact_loss
			greedy = minor_stress_impact_gain
			avaricious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Socialize
	option = {
		name = ep2_wedding.3420.g
		trigger = { exists = scope:wedding_social }
		trait = gregarious
		trait = trusting
		progress_towards_friend_effect = {
			REASON = friend_wedding_relation_bond
			CHARACTER = scope:social_guest
			OPINION = default_friend_opinion
		}
		stress_impact = {
			gregarious = medium_stress_impact_loss
			trusting = medium_stress_impact_loss
			shy = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Posture
	option = {
		name = ep2_wedding.3420.h
		trigger = { exists = scope:wedding_posture }
		trait = arrogant
		trait = ambitious
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = medium_stress_impact_loss
			ambitious = medium_stress_impact_loss
			humble = minor_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Blab
	option = {
		name = ep2_wedding.3420.i
		trigger = { exists = scope:wedding_blab }
		trait = honest
		trait = contrite
		if = {
			limit = {
				root != scope:blab_guest
			}
			reverse_add_opinion = {
				target = scope:blab_guest
				modifier = exposed_my_secret_opinion
			}	
		}
		scope:blab_secret = { expose_secret = root }
		stress_impact = {
			honest = medium_stress_impact_loss
			contrite = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Scheme
	option = {
		name = ep2_wedding.3420.j
		trigger = { exists = scope:wedding_scheme }
		trait = deceitful
		trait = schemer
		remove_short_term_gold = { 10 25 }
		random = {
			chance = 50
			custom_tooltip = ep2_wedding.3420.j.tt
			hidden_effect = {
				if = {
					limit = { exists = scope:scheme_secret }
					send_interface_toast = {
						title = secret_discovered_toast
						scope:scheme_secret = { reveal_to = root }
					}
				}
			}
		}
		stress_impact = {
			deceitful = medium_stress_impact_loss
			schemer = medium_stress_impact_loss
			honest = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Help
	option = {
		name = {
			text = ep2_wedding.3420.k.health
			trigger = {
				scope:help_guest = { is_healthy = no }
			}
		}
		name = {
			text = ep2_wedding.3420.k.drink
			trigger = {
				scope:help_guest = {
					OR = {
						has_trait = drunkard
						has_trait = lifestyle_reveler
					}
				}
			}
		}
		name = {
			text = ep2_wedding.3420.k.fallback
			trigger = {
				scope:help_guest = {
					is_healthy = yes
					NOR = {
						has_trait = drunkard
						has_trait = lifestyle_reveler
					}
				}
			}
		}
		trigger = { exists = scope:wedding_help }
		trait = compassionate
		flavor = ep2_wedding.3420.k.flavor
		progress_towards_friend_effect = {
			REASON = friend_wedding_relation_bond
			CHARACTER = scope:help_guest
			OPINION = default_friend_opinion
		}
		stress_impact = {
			compassionate = medium_stress_impact_loss
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	#Pray
	option = {
		name = ep2_wedding.3420.l
		trigger = { exists = scope:wedding_pray }
		trait = zealous
		add_piety = minor_piety_gain
		stress_impact = {
			compassionate = minor_stress_impact_loss
			zealous = medium_stress_impact_loss
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = -1
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

scripted_trigger wedding_3500_shared_trigger = {
	is_adult = yes
	is_participant_in_activity = scope:activity
	NOR = {
		this = root
		scope:my_family_relative ?= this
		scope:my_family_relative_1 ?= this
		scope:my_family_relative_2 ?= this
		this = scope:activity.special_guest:spouse_1
		this = scope:activity.special_guest:spouse_2
	}
}

scripted_trigger wedding_3500_same_relation_spouse_trigger = {
	is_$RELATION$_of = scope:my_family_spouse
	scope:my_family_relative_1 = { is_$RELATION$_of = scope:my_family_spouse }
	scope:my_family_relative_2 = { is_$RELATION$_of = scope:my_family_spouse }
}

scripted_trigger ep2_wedding_3500_relations_spouse_shared_trigger = {
	OR = {
		wedding_3500_same_relation_spouse_trigger = { RELATION = great_grandchild }
		wedding_3500_same_relation_spouse_trigger = { RELATION = grandchild }
		wedding_3500_same_relation_spouse_trigger = { RELATION = child }
		wedding_3500_same_relation_spouse_trigger = { RELATION = great_grandparent }
		wedding_3500_same_relation_spouse_trigger = { RELATION = grandparent }
		wedding_3500_same_relation_spouse_trigger = { RELATION = sibling }
		wedding_3500_same_relation_spouse_trigger = { RELATION = nibling }
		wedding_3500_same_relation_spouse_trigger = { RELATION = uncle_or_aunt }
		wedding_3500_same_relation_spouse_trigger = { RELATION = cousin }
	}
}

scripted_trigger ep2_wedding_3500_same_relation_root_trigger = {
	scope:my_family_relative_1 = { is_$RELATION$_of = root }
	scope:my_family_relative_2 = { is_$RELATION$_of = root }
}

scripted_trigger ep2_wedding_3500_relations_root_shared_trigger = {
	OR = {
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = great_grandchild }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = grandchild }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = child }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = great_grandparent }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = grandparent }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = sibling }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = nibling }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = uncle_or_aunt }
		ep2_wedding_3500_same_relation_root_trigger = { RELATION = cousin }
	}
}

scripted_effect wedding_3500_save_family_effect = {
	scope:activity.special_guest:$SPOUSE$ = { save_scope_as = my_family_spouse }
	if = {
		limit = { scope:my_family_spouse = scope:activity.special_guest:spouse_1 }
		scope:activity.special_guest:spouse_2 = { save_scope_as = other_family_spouse }
	}
	else = {
		scope:activity.special_guest:spouse_1 = { save_scope_as = other_family_spouse }
	}
	while = {
		count = 2
		random_close_or_extended_family_member = {
			limit = {
				trigger_if = {
					limit = {
						root = { is_close_family_of = scope:my_family_spouse }
					}
					is_close_family_of = scope:my_family_spouse
				}
				trigger_else = { is_extended_family_of = scope:my_family_spouse }
				wedding_3500_shared_trigger = yes
				NOR = {
					has_relation_rival = scope:other_family_spouse
					opinion = {
						target = scope:other_family_spouse
						value <= -25
					}
				}
			}
			alternative_limit = {
				wedding_3500_shared_trigger = yes
				NOR = {
					has_relation_rival = scope:other_family_spouse
					opinion = {
						target = scope:other_family_spouse
						value <= -25
					}
				}
			}
			weight = {
				base = 1
				wedding_family_member_compatibility_modifier = yes
				is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root }
				is_of_major_interest_to_weight_up_modifier = { CHARACTER = root }
			}
			if = {
				limit = { exists = scope:my_family_relative_1 }
				save_scope_as = my_family_relative_2
			}
			else = { save_scope_as = my_family_relative_1 }
		}
	}
}

scripted_trigger ep2_wedding_3500_active_bedroom_trigger = {
	scope:my_family_spouse = {
		is_eunuch_trigger = no
		NOT = { has_trait = celibate }
	}
	scope:other_family_spouse = {
		is_eunuch_trigger = no
		NOT = { has_trait = celibate }
	}
}

scripted_trigger ep2_wedding_3500_dislikes_fornicators_trigger = {
	scope:other_family_spouse = {
		OR = {
			has_trait = fornicator
			has_trait = adulterer
		}
	}
	scope:my_family_spouse = {
		OR = {
			has_trait = fornicator
			has_trait = adulterer
		}
	}
	trigger_if = {
		limit = {
			scope:other_family_spouse = { is_female = yes }
		}
		faith = {
			NOT = { has_doctrine = doctrine_adultery_women_accepted }
		}
	}
	trigger_else = {
		faith = {
			NOT = { has_doctrine = doctrine_adultery_men_accepted }
		}
	}
}

ep2_wedding.3500 = {
	type = activity_event
	title = ep2_wedding.3500.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:my_family_relative_1 = { sex_same_as = scope:my_family_relative_2 }
					ep2_wedding_3500_relations_root_shared_trigger = yes
				}
				desc = ep2_wedding.3500.intro_plural
			}
			desc = ep2_wedding.3500.intro
		}
		desc = ep2_wedding.3500.intro_connector
		first_valid = {
			# BOTH
			triggered_desc = {
				trigger = { ep2_wedding_3500_relations_spouse_shared_trigger = yes }
				desc = ep2_wedding.3500.relation_shared
			}
			desc = ep2_wedding.3500.relation
		}
		first_valid = {
			# Personal concerns
			triggered_desc = {
				trigger = {
					scope:my_family_relative_1 = {
						OR = {
							ep2_wedding_3500_dislikes_fornicators_trigger = yes
							has_imprisonment_reason = scope:other_family_spouse
							has_relation_rival = scope:other_family_spouse
							opinion = {
								target = scope:other_family_spouse
								value <= -25
							}
						}
					}
				}
				desc = {
					random_valid = {
						triggered_desc = {
							trigger = { # Fornicator or adulterer trait, and not accepted in faith
								scope:my_family_relative_1 = { ep2_wedding_3500_dislikes_fornicators_trigger = yes }
							}
							desc = ep2_wedding.3500.fornicator
						}
						triggered_desc = {
							trigger = {
								scope:my_family_relative_1 = { has_imprisonment_reason = scope:other_family_spouse }
								NOT = {
									scope:my_family_relative_1 = { has_imprisonment_reason = scope:my_family_spouse }
								}
							}
							desc = ep2_wedding.3500.criminal
						}
						triggered_desc = {
							trigger = {
								OR = {
									has_relation_rival = scope:other_family_spouse
									opinion = {
										target = scope:other_family_spouse
										value <= -25
									}
								}
							}
							desc = ep2_wedding.3500.dislike
						}
					}
				}
			}
			# Political concerns
			triggered_desc = {
				trigger = {
					exists = scope:other_family_spouse.house
					exists = scope:my_family_spouse.house
					OR = {
						scope:other_family_spouse.dynasty.dynasty_prestige_level < scope:my_family_spouse.dynasty.dynasty_prestige_level
						scope:other_family_spouse.house.house_head ?= {
							is_ruler = yes
							OR = {
								any_neighboring_top_liege_realm_owner = {scope:my_family_spouse.house.house_head.liege ?= this }
								AND = {
									exists = liege
									scope:my_family_spouse.house.house_head.liege ?= liege
								}
							}
						}
						AND = {
							NOT = {
								scope:my_family_relative_1 = { has_trait = cynical }
							}
							scope:my_family_spouse.faith = {
								NOR = {
									this = scope:other_family_spouse.faith
									faith_hostility_level = {
										target = scope:other_family_spouse.faith
										value = 0 # Accepted
									}
								}
							}
						}
					}
				}
				desc = {
					random_valid = {
						triggered_desc = {
							trigger = {
								scope:other_family_spouse.dynasty.dynasty_prestige_level < scope:my_family_spouse.dynasty.dynasty_prestige_level
							}
							desc = ep2_wedding.3500.renown
						}
						triggered_desc = {
							trigger = {
								scope:other_family_spouse.house.house_head ?= {
									is_ruler = yes
									OR = {
										any_neighboring_top_liege_realm_owner = {scope:my_family_spouse.house.house_head.liege ?= this }
										AND = {
											exists = liege
											scope:my_family_spouse.house.house_head.liege ?= liege
										}
									}
								}
							}
							desc = ep2_wedding.3500.realms
						}
						triggered_desc = {
							trigger = {
								NOT = {
									scope:my_family_relative_1 = { has_trait = cynical }
								}
								scope:my_family_spouse.faith = {
									NOR = {
										this = scope:other_family_spouse.faith
										faith_hostility_level = {
											target = scope:other_family_spouse.faith
											value = 0 # Accepted
										}
									}
								}
							}
							desc = ep2_wedding.3500.faith
						}
					}
				}
			}
			# Petty concerns
			desc = {
				first_valid = {					
					triggered_desc = {
						trigger = {
							scope:other_family_spouse = { is_healthy = no }
							scope:my_family_spouse = { is_healthy = yes }
							scope:my_family_relative_1 = { is_healthy = yes }
						}
						desc = ep2_wedding.3500.health
					}
					triggered_desc = {
						trigger = {
							scope:other_family_spouse.ai_boldness > low_positive_boldness
							scope:my_family_spouse.ai_boldness < low_negative_boldness
							scope:my_family_relative_1.ai_boldness < low_negative_boldness
						}
						desc = ep2_wedding.3500.bold
					}
					triggered_desc = {
						trigger = {
							scope:other_family_spouse.ai_boldness < low_negative_boldness
							scope:my_family_spouse.ai_boldness > low_positive_boldness
							scope:my_family_relative_1.ai_boldness > low_positive_boldness
						}
						desc = ep2_wedding.3500.shy
					}
					triggered_desc = {
						trigger = {
							scope:other_family_spouse.ai_honor < low_positive_honor
							scope:my_family_relative_1.ai_honor >= low_positive_honor
						}
						desc = ep2_wedding.3500.dishonorable
					}
					triggered_desc = {
						trigger = {
							scope:my_family_spouse.age <= scope:other_family_spouse.age_minus_10
							ep2_wedding_3500_active_bedroom_trigger = yes
						}
						desc = ep2_wedding.3500.old
					}
					triggered_desc = {
						trigger = {
							scope:my_family_spouse.age >= scope:other_family_spouse.age_plus_10
							ep2_wedding_3500_active_bedroom_trigger = yes
						}
						desc = ep2_wedding.3500.young
					}
					triggered_desc = {
						trigger = {
							ep2_wedding_3500_active_bedroom_trigger = yes
							scope:other_family_spouse = { has_trait = beauty_bad }
							NOR = {
								scope:my_family_spouse = { has_trait = beauty_bad }
								scope:my_family_relative_1 = { has_trait = beauty_bad }
							}
						}
						desc = ep2_wedding.3500.beauty
					}
					triggered_desc = {
						trigger = {
							NOR = {
								AND = {
									scope:other_family_spouse = { is_healthy = no }
									scope:my_family_spouse = { is_healthy = yes }
									scope:my_family_relative_1 = { is_healthy = yes }
								}
								AND = {
									scope:other_family_spouse.ai_boldness > low_positive_boldness
									scope:my_family_spouse.ai_boldness < low_negative_boldness
									scope:my_family_relative_1.ai_boldness < low_negative_boldness
								}
								AND = {
									scope:other_family_spouse.ai_boldness < low_negative_boldness
									scope:my_family_spouse.ai_boldness > low_positive_boldness
									scope:my_family_relative_1.ai_boldness > low_positive_boldness
								}
								AND = {
									scope:other_family_spouse.ai_honor < low_positive_honor
									scope:my_family_relative_1.ai_honor >= low_positive_honor
								}
								AND = {
									ep2_wedding_3500_active_bedroom_trigger = yes
									OR = {
										scope:my_family_spouse.age <= scope:other_family_spouse.age_plus_10
										scope:my_family_spouse.age >= scope:other_family_spouse.age_minus_10
										AND = {
											scope:other_family_spouse = { has_trait = beauty_bad }
											NOR = {
												scope:my_family_spouse = { has_trait = beauty_bad }
												scope:my_family_relative_1 = { has_trait = beauty_bad }
											}
										}
									}
								}

							}
						}
						desc = ep2_wedding.3500.fallback
					}
				}
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:my_family_relative_2 = {
						ep2_wedding_3500_dislikes_fornicators_trigger = yes
						has_imprisonment_reason = scope:other_family_spouse
						has_relation_rival = scope:other_family_spouse
						opinion = {
							target = scope:other_family_spouse
							value <= -25
						}
					}
				}
				desc = ep2_wedding.3500.agree
			}
			triggered_desc = {
				trigger = {
					exists = scope:my_family_spouse
					scope:other_family_spouse.house.house_head = { is_allied_to = scope:my_family_spouse.house.house_head }
				}
				desc = ep2_wedding.3500.alliance
			}
			triggered_desc = {
				trigger = {
					OR = {
						AND = {
							scope:other_family_spouse = { has_trait = beauty_bad }
							scope:my_family_spouse = {
								NOT = { has_trait = beauty_bad }
							}
						}
						AND = {
							scope:other_family_spouse = { is_healthy = no }
							scope:my_family_spouse = { is_healthy = yes }
						}
					}
				}
				desc = ep2_wedding.3500.compromise
			}
			desc = ep2_wedding.3500.time
		}
	}	
	theme = marriage
	override_background = { reference = feast }
	left_portrait = {
		character = scope:my_family_relative_1
		animation = worry
	}
	center_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:my_family_relative_2
		animation = thinking
	}
	lower_right_portrait = scope:activity.special_guest:spouse_1
	lower_left_portrait = scope:activity.special_guest:spouse_2

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		is_adult = yes
		# Spouse 1 and 2 are not root
		NOR = {
			scope:activity.special_guest:spouse_1 ?= root
			scope:activity.special_guest:spouse_2 ?= root
		}
		# More relatives of your family's spouse are about
		trigger_if = {
			limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_1 }
			NOR = {
				has_relation_rival = scope:activity.special_guest:spouse_1
				opinion = {
					target = scope:activity.special_guest:spouse_1
					value <= -25
				}
			}
			scope:activity.special_guest:spouse_1 = {
				any_close_or_extended_family_member = {
					count >= 2
					wedding_3500_shared_trigger = yes
					NOR = {
						has_relation_rival = scope:activity.special_guest:spouse_2
						opinion = {
							target = scope:activity.special_guest:spouse_2
							value <= -25
						}
					}
				}
			}
		}
		trigger_else_if = {
			limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_2 }
			NOR = {
				has_relation_rival = scope:activity.special_guest:spouse_2
				opinion = {
					target = scope:activity.special_guest:spouse_2
					value <= -25
				}
			}
			scope:activity.special_guest:spouse_2 = {
				any_close_or_extended_family_member = {
					count >= 2
					wedding_3500_shared_trigger = yes
					NOR = {
						has_relation_rival = scope:activity.special_guest:spouse_2
						opinion = {
							target = scope:activity.special_guest:spouse_2
							value <= -25
						}
					}
				}
			}
		}
		# No dice
		trigger_else = { always = no }
	}

	immediate = {
		save_scope_as = my_family_relative
		# Save family members related to spouse
		hidden_effect = {
			if = {
				limit = { is_close_or_extended_family_of = scope:activity.special_guest:spouse_1 }
				wedding_3500_save_family_effect = { SPOUSE = spouse_1 }
			}
			else = {
				wedding_3500_save_family_effect = { SPOUSE = spouse_2 }
			}
		}
	}

	# Agree
	option = {
		name = ep2_wedding.3500.a
		trigger = { exists = scope:my_family_relative_1 }
		progress_towards_friend_effect = {
			REASON = friend_wedding_relation_bond
			CHARACTER = scope:my_family_relative_1
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	# Rebuff
	option = {
		name = ep2_wedding.3500.b
		trigger = {
			scope:my_family_relative_2 ?= {
				NOR = {
					ep2_wedding_3500_dislikes_fornicators_trigger = yes
					has_imprisonment_reason = scope:other_family_spouse
					has_relation_rival = scope:other_family_spouse
					opinion = {
						target = scope:other_family_spouse
						value <= -25
					}
				}
			}
		}
		progress_towards_friend_effect = {
			REASON = friend_wedding_relation_bond
			CHARACTER = scope:my_family_relative_2
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}

	#It matters not
	option = {
		name = ep2_wedding.3500.d
		add_prestige = minor_prestige_gain
		stress_impact = {
			compassionate = miniscule_stress_impact_gain
			content = miniscule_stress_impact_gain
			callous = minor_stress_impact_loss
			ambitious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
			}
		}
	}

	#It is in god's hands now
	option = {
		name = ep2_wedding.3500.e
		add_piety = minor_prestige_gain
		stress_impact = {
			cynical = miniscule_stress_impact_gain
			diligent = miniscule_stress_impact_gain
			zealous = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
			}
		}
	}
}

############################
## Wedding Ceremony Events
## 4000-4999
## by Veronica Pazos
############################

scripted_trigger ep2_wedding_4000_valid_betrothed = {
	feast_default_adult_participant_trigger = yes #includes is_ai = yes
	can_marry_character_trigger = { CHARACTER = root.intent_target }
	NOR = {
		age < root.intent_target.age_minus_10
		age > root.intent_target.age_plus_10
	}
}

# Non-spouse: Matchmaking Intent - This wedding is so cool, you guys should also get married

ep2_wedding.4000 = {
	type = activity_event
	title = ep2_wedding.4000.t
	desc = {
		desc = ep2_wedding.4000.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:matchmaked_scope = {
						exists = var:wedding_good_match
						var:wedding_good_match = scope:objective_scope
					}
				}
				desc = ep2_wedding.4000.desc.good_match
			}
			triggered_desc = {
				trigger = {
					scope:matchmaked_scope = {
						exists = var:wedding_no_match
						var:wedding_no_match = scope:objective_scope
					}
				}
				desc = ep2_wedding.4000.desc.no_match
			}
		}
	}
	theme = wedding_ceremony_activity
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:matchmaked_scope
		animation = personality_rational
	}
	lower_center_portrait = scope:objective_scope

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		NOT = { has_variable = had_ep2_wedding_matchmaking_event_var }
		NOR = { #you are not one of the spouses
			root = scope:activity.special_guest:spouse_1
			root = scope:activity.special_guest:spouse_2
		}
		has_activity_intent = matchmaking_intent #you're trying to matchmake someone
		intent_target = { is_alive = yes } #they're not dead yet
		scope:activity = { #there's someone to pair them with
			any_attending_character = {
				ep2_wedding_4000_valid_betrothed = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		intent_target = { save_scope_as = matchmaked_scope }
		scope:activity = {
			random_attending_character = {
				limit = { ep2_wedding_4000_valid_betrothed = yes }
				save_scope_as = objective_scope
			}
		}
		set_variable = {
			name = had_ep2_wedding_matchmaking_event_var
			days = 90 #enough to not affect this wedding
		}
	}

	#Go for it
	option = {
		name = ep2_wedding.4000.a
		duel = {
			skill = diplomacy
			target = scope:matchmaked_scope
			50 = {	# success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					add = 20
					attraction >= medium_positive_attraction
				}
				modifier = {
					add = 30
					attraction >= high_positive_attraction
				}					
				desc = ep2_wedding.4000.a.success
				send_interface_toast = {
					title = ep2_wedding.4000.a.success
					left_icon = scope:matchmaked_scope
					right_icon = scope:objective_scope
					scope:activity = {
						add_activity_log_entry = {
							key = ep2_wedding_4000_log_success
							character = root
							target = scope:matchmaked_scope

							# Effect
							root = { custom_tooltip = ep2_wedding.wedding_intent.success.tt }
							scope:matchmaked_scope = { create_betrothal = scope:objective_scope }
						}
					}
				}
				complete_activity_intent = yes
			}
			50 = {	# fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.4000.a.failure
				send_interface_toast = {
					title = ep2_wedding.4000.a.failure
					left_icon = scope:matchmaked_scope
					add_prestige = minor_prestige_loss
					scope:matchmaked_scope = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -10
						}
					}
				}
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
			patient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = craven
					has_trait = patient				
				}
			}
		}
	}
	
	#Be subtle
	option = {
		name = ep2_wedding.4000.b
		duel = {
			skill = intrigue
			target = scope:matchmaked_scope
			30 = {	# success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.4000.b.success
				send_interface_toast = {
					title = ep2_wedding.4000.b.success
					left_icon = scope:matchmaked_scope
					right_icon = scope:objective_scope
					scope:activity = {
						add_activity_log_entry = {
							key = ep2_wedding_4000_log_success
							character = root
							target = scope:matchmaked_scope

							# Effect
							custom_tooltip = ep2_wedding.wedding_intent.success.tt
							scope:matchmaked_scope = { create_betrothal = scope:objective_scope }
						}
					}
				}
				complete_activity_intent = yes
			}
			70 = {	# fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.4000.a.failure
				send_interface_toast = {
					title = ep2_wedding.4000.a.failure
					left_icon = scope:matchmaked_scope
					scope:matchmaked_scope = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -10
						}
					}
				}
			}
		}
		stress_impact = {
			brave = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = brave
					has_trait = impatient
				}
			}
		}
	}
	
	#Nahhh
	option = {
		name = ep2_wedding.4000.c
		ai_chance = {
			base = 100
			modifier = {
				factor = 1.25
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
			modifier = {
				factor = 0
				scope:matchmaked_scope = {
					trait_compatibility = {
						target = scope:objective_scope
						value >= high_positive_trait_compatibility
					}
				}
			}
		}
	}
}

# Host: Gain Renown Intent - Bring a white animal to the Banquet to flex (it's painted)

scripted_trigger ep2_wedding_2010_impressed = {
	OR = { #what kind of people would be impressed by a legendary animal?
		has_trait = gregarious
		has_trait = brave 
		has_trait = lifestyle_reveler 
		has_trait = lifestyle_hunter
		has_trait = drunkard
		has_trait = gallant #white animals were a pretty chivalrous thing to find/hunt
	}
}
 
ep2_wedding.2010 = {
	type = activity_event
	title = ep2_wedding.2010.t
	desc = {
		desc = ep2_wedding.2010.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = { #you are one of the spouses
						root = scope:activity.special_guest:spouse_1
						root = scope:activity.special_guest:spouse_2
					}
				}
				desc = ep2_wedding.2010.desc_spouse
			}
		}
	}
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		animation = personality_rational
	}

	cooldown = { years = 5 }

	trigger = {
		this = scope:host #you're the host
		has_activity_intent = diplomatic_intent
		intent_target = { ep2_wedding_2010_impressed = yes }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = deceitful
		}
		modifier = {
			factor = 0.5
			has_trait = honest
		}
	}

	immediate = {
		select_local_animal_effect = { TYPE = big } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
		intent_target = {
			add_to_list = ep2_wedding_2010_impressed_list
			save_scope_as = diplo_target
		}
		if = {
			limit = {
				scope:activity = { #there's someone else to impress
					any_attending_character = {
						feast_default_adult_participant_trigger = yes
						NOR = {
							this = root
							this = root.intent_target
						}
						ep2_wedding_2010_impressed = yes
					}
				}
			}	
			scope:activity = {
				every_attending_character = {
					limit = {
						feast_default_adult_participant_trigger = yes
						NOR = {
							this = root
							this = root.intent_target
						}
						ep2_wedding_2010_impressed = yes
					}
					add_to_list = ep2_wedding_2010_impressed_list
				}
			}
		}
	}

	#Yeah
	option = {
		name = ep2_wedding.2010.a
		custom_tooltip = ep2_wedding.2010.a.tt
		every_in_list = {
			list = ep2_wedding_2010_impressed_list
			custom = ep2_wedding.2010.impressed_list
			add_opinion = {
				modifier = wbanquet_white_animal_opinion
				target = root
				opinion = 20
			}
		}
		#Does anyone suspect? 
		hidden_effect = {
			if = {
				limit = {
					scope:diplo_target = {
						feast_default_adult_participant_trigger = yes
						OR = {
							has_trait = cynical
							has_trait = callous
						}
						has_any_good_relationship_with_root_trigger = no
					}
				}
				random_list = {
					50 = { #they don't notice
						remove_variable = animal_type
						if = {
							limit = {
								scope:diplo_target = { activity_wedding_diplomatic_intent_impressible_target = yes }
							}
							send_interface_toast = {
								title = ep2_wedding.2000.after.subjugate
								left_icon = scope:diplo_target
								custom_tooltip = {
									text = ep2_wedding.2000.after.subjugate.tt
									complete_activity_intent = yes
									create_title_and_vassal_change = {
										type = swear_fealty
										save_scope_as = title_change
										add_claim_on_loss = no
									}
									scope:diplo_target = {
										change_liege = {
											liege = root
											change = scope:title_change
										}
									}
									resolve_title_and_vassal_change = scope:title_change
								}
							}
						}
					}
					50 = { #they do
						trigger_event = ep2_wedding.2011
					}
				}
			}
			else_if = {
				limit = {
					scope:activity = {
						any_attending_character = {
							feast_default_adult_participant_trigger = yes
							OR = {
								has_trait = cynical
								has_trait = callous
							}
							has_any_good_relationship_with_root_trigger = no
						}
					}
				}
				random_list = {
					50 = { #they don't notice
						remove_variable = animal_type
					}
					50 = { #they do
						trigger_event = ep2_wedding.2011
					}
				}
			}
		}
		remove_short_term_gold = minor_gold_value
		stress_impact = {
			greedy = medium_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				short_term_gold <= minor_gold_value
			}
			modifier = {
				factor = 0 
				OR = {
					has_trait = greedy
					has_trait = honest
				}
			}
		}
	}
	
	#Nah
	option = {
		name = ep2_wedding.2010.b
		remove_variable = animal_type
		stress_impact = {
			gallant = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
			lifestyle_reveler = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = gallant
					has_trait = gregarious
					has_trait = lifestyle_reveler
				}
			}
			modifier = {
				factor = 1.25
				has_trait = deceitful
			}
		}
	}
}

# Follow up: You get called out
 
ep2_wedding.2011 = {
	type = activity_event
	title = ep2_wedding.2011.t
	desc = ep2_wedding.2011.desc
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = arrogant
					has_trait = wrathful
					has_trait = vengeful
					has_trait = callous
					has_trait = brave
				}
			}
			animation = anger
		}
		animation = stress
	}
	right_portrait = {
		character = scope:doubting_guest
		animation = schadenfreude
	}
	
	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					feast_default_adult_participant_trigger = yes
					OR = {
						has_trait = cynical
						has_trait = callous
					}
					has_any_good_relationship_with_root_trigger = no
				}
				save_scope_as = doubting_guest
			}
		}
	}

	#Confess
	option = {
		name = ep2_wedding.2011.a
		add_prestige = minor_prestige_loss
		add_piety = minor_piety_gain
		scope:doubting_guest = {
			add_opinion = {
				target = root
				opinion = 10
				modifier = pleased_opinion
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			ambitious = medium_stress_impact_gain
			deceitful = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = greedy
					has_trait = honest
				}
			}
		}
	}
	
	#Double down
	option = {
		name = ep2_wedding.2011.b
		duel = { #they believe you
			skill = intrigue
			target = scope:doubting_guest
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				modifier = {
					factor = 2
					scope:doubting_guest = {
						OR = {
							has_trait = trusting
							has_trait = loyal
						}
					}
				}
				desc = ep2_wedding.2011.b.success
				send_interface_toast = {
					left_icon = scope:doubting_guest
					title = ep2_wedding.2011.b.success
					custom_tooltip = ep2_wedding.wedding_intent.success.tt
					complete_activity_intent = yes
				}
			}
			50 = { #they don't
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.2011.b.failure
				send_interface_toast = {
					left_icon = scope:doubting_guest
					title = ep2_wedding.2011.b.failure
					scope:doubting_guest = {
						add_opinion = {
							target = root
							opinion = -10
							modifier = annoyed_opinion
						}
					}
				}
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_gain
			just = medium_stress_impact_gain
			honest = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = honest
					has_trait = trusting
					has_trait = just
				}
			}
		}
	}
	
	after = {
		remove_variable = animal_type
	}
}

# Spouse/Non-spouse: Someone is dangerously close to a well of wine

scripted_trigger ep2_wedding_2020_would_fall_trigger = {
	is_adult = yes
	is_alive = yes
	feast_default_adult_participant_trigger = yes
	drinks_alcohol_trigger = yes
	OR = {
		has_trait = lifestyle_reveler
		has_trait = drunkard
		has_trait = gregarious
		has_trait = arbitrary
	}
}

ep2_wedding.2020 = {
	type = activity_event
	title = ep2_wedding.2020.t
	desc = ep2_wedding.2020.desc
	theme = wedding_banquet_activity
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_activity_intent = banquet_mischief_intent
					has_trait = callous
					has_trait = sadistic
					has_trait = deceitful
				}
			}
			animation = scheme
		}
		animation = worry
	}
	right_portrait = {
		character = scope:drunk_guest
		animation = drink_goblet
	}

	cooldown = { years = 5 }

	trigger = {
		#DLC check.
		has_ep2_dlc_trigger = yes
		this != scope:host
		scope:activity = {
			any_attending_character = {
				ep2_wedding_2020_would_fall_trigger = yes
			}
			has_activity_option = {
				category = wedding_option_food
				option = wedding_food_good
			}
			NOT = {
				has_variable = has_had_2020_event
			}
		}
		scope:activity = { NOT = { has_variable = ep2_wedding_2020_well_var } }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_activity_intent = banquet_mischief_intent
		}
		modifier = {
			factor = 2
			scope:activity = {
				any_attending_character = {
					has_trait = drunkard
				}
			}
		}
		modifier = {
			is_ai = yes
			factor = 0.1
		}
	}

	immediate = {
		scope:activity = {
			set_variable = ep2_wedding_2020_well_var
			random_attending_character = {
				limit = {
					ep2_wedding_2020_would_fall_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 50
						has_trait = drunkard
					}
				}
				save_scope_as = drunk_guest
			}
			set_variable = has_had_2020_event
		}
	}

	#Tell them
	option = {
		name = ep2_wedding.2020.a
		duel = {
			skill = diplomacy
			target = scope:drunk_guest
			50 = { #they listen to you
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.2020.a.success
				send_interface_toast = {
					left_icon = scope:drunk_guest
					title = ep2_wedding.2020.a.success
					progress_towards_friend_effect = {
						REASON = friend_wbanquet_saved_from_well
						CHARACTER = scope:drunk_guest
						OPINION = 20
					}
					add_piety = minor_piety_gain
				}
			}
			50 = { #they fall down
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.2020.a.failure
				send_interface_toast = {
					left_icon = scope:drunk_guest
					title = ep2_wedding.2020.a.failure
					scope:drunk_guest = {
						add_prestige = minor_prestige_loss
						increase_wounds_effect = { REASON = fall }
					}
				}
			}
		}
		stress_impact = {
			deceitful = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = deceitful
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}
	
	#Don't
	option = {
		name = ep2_wedding.2020.b
		random_list = {
			50 = { #they don't fall
				desc = ep2_wedding.2020.b.success
				send_interface_toast = {
					left_icon = scope:drunk_guest
					title = ep2_wedding.2020.b.success
					#nothing happens
				}
			}
			50 = { #they fall down
				modifier = {
					factor = 2
					scope:drunk_guest = { has_trait = drunkard }
				}
				desc = ep2_wedding.2020.a.failure
				send_interface_toast = {
					left_icon = scope:drunk_guest
					title = ep2_wedding.2020.a.failure
					add_stress = major_stress_impact_loss
					scope:drunk_guest = {
						add_prestige = minor_prestige_loss
						increase_wounds_effect = { REASON = fall }
					}
				}
			}
		}
		stress_impact = {
			compassionate = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				has_trait = compassionate
			}
		}
	}
	
	#Crash Wedding Intent - Push them
	option = {
		name = ep2_wedding.2020.c
		trigger = {
			OR = {
				has_activity_intent = banquet_mischief_intent
				AND = {
					has_activity_intent = murder_attendee_intent
					intent_target = scope:drunk_guest
				}
			}
		}
		custom_tooltip = available_because_intent_tt
		duel = {
			skill = prowess
			target = scope:drunk_guest
			50 = { #you push them
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = ep2_wedding.2020.c.success
				send_interface_toast = {
					left_icon = scope:drunk_guest
					title = ep2_wedding.2020.c.success
					custom_tooltip = ep2_wedding.wedding_intent.success.tt
					add_stress = major_stress_impact_loss
					scope:drunk_guest = {
						add_prestige = minor_prestige_loss
						increase_wounds_effect = { REASON = fall }
					}
					complete_activity_intent = yes
				}
			}
			50 = { #they kick you back
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.2020.c.failure
				send_interface_toast = {
					left_icon = root
					right_icon = scope:drunk_guest
					title = ep2_wedding.2020.c.failure
					increase_wounds_effect = { REASON = fight }
				}
			}
			10 = { #they die
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = ep2_wedding.2020.c.death
				send_interface_toast = {
					left_icon = root
					right_icon = scope:drunk_guest
					title = ep2_wedding.2020.c.death
					scope:drunk_guest = {
						death = { death_reason = death_accident }
					}
					known_murder_effect = {
						VICTIM = scope:drunk_guest
						MURDERER = root
						EXPOSER = root
					}
				}
			}
		}
		stress_impact = {
			calm = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0 
				OR = {
					has_trait = calm
					has_trait = forgiving
					has_trait = compassionate
				}
			}
		}
	}
}
