﻿zgc_determine_wedding_end_relationship_event_from_compatibility_effect = {
	
	#Sets a new scope for the "other person," so relationship setting can work if fired from
	#either activity owner (i.e. wedding owner) or wedding spouse scopes. This is so the player
	#always gets to see the event, even when they are the wedding spouse. It also avoids duplication.
	if = {
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				NOR = {
					any_relation = {
						type = soulmate
						this = scope:spouse
					}
					any_relation = {
						type = lover
						this = scope:spouse
					}
					any_relation = {
						type = friend
						this = scope:spouse
					}
					any_relation = {
						type = best_friend
						this = scope:spouse
					}
					any_relation = {
						type = rival
						this = scope:spouse
					}
					any_relation = {
						type = nemesis
						this = scope:spouse
					}
				}
			}
		}
		random_list = {
			#Lover - seduction scheme modifiers
			100 = {
				custom_tooltip = debug_rel_lover
				trigger_event = {
					id = zgc_wedding_relationship_events.103
					days = { 3 5 }
				}
			
				#Sexualtiy - Not attracted to your gender, hard stop
				trigger = {
					scope:spouse = { is_attracted_to_gender_of = root }
					root = { is_attracted_to_gender_of = scope:spouse }
					can_set_relation_lover_trigger = { CHARACTER = scope:spouse }					
					NOT = {
						guaranteed_under_20_incest_rejection_trigger = {
							TARGET = scope:spouse
							SEDUCER = root
						}
					}
				}
			

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 50
				}
			
				#Attraction - not part of vanilla seduce scheme (for some reason)
				modifier = {
					add = root.attraction
				}
			
			
				#Language
				modifier = {
					add = 5
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}
			
				modifier = { # Smooth Operator perk bonus
					desc = SEDUCE_PERK_BONUS
					root = { has_perk = smooth_operator_perk }
					always = yes
					add = smooth_operator_perk_bonus
				}
			
				modifier = { # Legacy bonus
					desc = LEGACY_PERK_BONUS
					root = {
						exists = dynasty
						dynasty = {
							has_dynasty_perk = fp1_adventure_legacy_2
						}
					}
					always = yes
					add = fp1_adventure_legacy_2_success_chance_seduction
				}

				modifier = {
					desc = "SCHEME_SCHEMER_TRAIT"
					root = { has_trait = seducer }
					add = 25
				}
			
				#Beauty good
				modifier = {
					desc = "scheme_beauty_good_1"
					root = { has_trait = beauty_good_1 }
					add = 10
				}
				modifier = {
					desc = "scheme_beauty_good_2"
					root = { has_trait = beauty_good_2 }
					add = 15
				}
				modifier = {
					desc = "scheme_beauty_good_3"
					root = { has_trait = beauty_good_3 }
					add = 20
				}

				#Physique good
				modifier = {
					desc = "scheme_physique_good_1"
					root = { has_trait = physique_good_1 }
					add = 5
				}
				modifier = {
					desc = "scheme_physique_good_2"
					root = { has_trait = physique_good_2 }
					add = 10
				}
				modifier = {
					desc = "scheme_physique_good_3"
					root = { has_trait = physique_good_3 }
					add = 15
				}

				#Beauty bad
				modifier = {
					desc = "scheme_beauty_bad_1"
					root = { has_trait = beauty_bad_1 }
					add = -10
				}
				modifier = {
					desc = "scheme_beauty_bad_2"
					root = { has_trait = beauty_bad_2 }
					add = -15
				}
				modifier = {
					desc = "scheme_beauty_bad_3"
					root = { has_trait = beauty_bad_3 }
					add = -20
				}

				#Venereal diseases
				modifier = {
					desc = "scheme_great_pox"
					root = { has_trait = great_pox }
					add = -50
				}
				modifier = {
					desc = "scheme_lovers_pox"
					root = { has_trait = lovers_pox }
					add = -25
				}
				modifier = {
					desc = "scheme_early_great_pox"
					root = { has_trait = early_great_pox }
					add = -25
				}

				#Sexuality
				modifier = {
					desc = SCHEME_SEDUCE_WRONG_GENDER
					root = {
						NOR = {
							is_attracted_to_gender_of = scope:spouse
							has_perk = unshackled_lust_perk # Removed by the Unshackled Lust Perk
						}
					}
					add = -25
				}


				#TARGET#

				#Lustful/hedonist
				modifier = {
					desc = "SCHEME_REVELER"
					scope:spouse = { has_trait = lifestyle_reveler }
					add = 5
				}
				modifier = {
					desc = "SCHEME_LUSTFUL_TRAIT"
					scope:spouse = { has_trait = lustful }
					add = 10
				}

				#Chaste/shy
				modifier = {
					desc = "SCHEME_CHASTE_TRAIT"
					scope:spouse = { has_trait = chaste }
					add = -15
				}
				modifier = {
					desc = "SCHEME_SHY_TRAIT"
					scope:spouse = { has_trait = shy }
					add = -10
				}

				#Opinion of owner
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = 1.5
					step = 5
				}
			
				#Trait similitarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -100
					max = 80
					multiplier = 2
				}
			
				#Extra rank bonus/penalty if target is arrogant/ambitious
				modifier = {
					trigger = { root = { NOT = { is_consort_of = scope:spouse } } } # No 'social climbing' if you're already their spouse!
					desc = SCHEME_SOCIAL_CLIMBER_RANK_BONUS
					add = 10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
						NOT = {
							is_theocratic_lessee = yes
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier > scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier > scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = {
					trigger = { root = { NOT = { is_consort_of = scope:spouse } } } # No 'social climbing' if you're already their spouse!
					desc = SCHEME_SOCIAL_CLIMBER_RANK_PENALTY
					add = -10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier < scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier < scope:spouse.highest_held_title_tier
						}
					}
				}

				#Taboo
				modifier = { #Incest is taboo (norms & consequences)
					add = -25
					desc = SCHEME_SEDUCE_TABOO_INCEST
					scope:spouse = {
						relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = root }
					}
					root = { # The Subtle Desire Perk nullifies this
						NOT = { has_perk = subtle_desire_perk }
					}
				}
				modifier = { #Character is not willing to engage in incest with root
					add = {
						if = {
							limit = { scope:spouse = { is_close_family_of = root } }
							value = -40
						}
						else_if = {
							limit = { scope:spouse = { is_extended_family_of = root } }
							value = -15
						}
						if = {
							limit = { scope:spouse = { is_deviant_trigger = yes } }
							add = 15
						}
					}
					desc = SCHEME_SEDUCE_UNWILLING_INCEST
					scope:spouse = {
						NOT = { is_consort_of = root }
							is_close_or_extended_family_of = root
						NOR = {
							accepts_incest_with_trigger = { CHARACTER = root } #100% fine with incest with owner
							root = { has_perk = subtle_desire_perk }  # The Subtle Desire Perk nullifies this
							guaranteed_under_20_incest_rejection_trigger = { # handled by hard block modifier
								TARGET = scope:spouse
								SEDUCER = root
							}
						}
					}	
				}
			}
	
			#Soulmate - romance scheme modifiers
			75 = { #was 100
				custom_tooltip = debug_rel_soulmate
				trigger_event = {
					id = zgc_wedding_relationship_events.104
					days = { 3 5 }
				}
			
				#Sexualtiy - Not attracted to your gender, hard stop
				trigger = {
					can_set_relation_soulmate_trigger = { CHARACTER = scope:spouse }					
					scope:spouse = { is_attracted_to_gender_of = root }
					root = { is_attracted_to_gender_of = scope:spouse }
				}
		
				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 50
				}

				#Attraction - not part of vanilla seduce scheme (for some reason)
				modifier = {
					add = root.attraction
				}
			
				#Language
				modifier = {
					add = 5
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}

				#Gallant
				modifier = {
					desc = "SCHEME_GALLANT_TRAIT"
				root = { has_trait = gallant }
					add = 30
				}

				#Beauty good
				modifier = {
					desc = "scheme_beauty_good_1"
					root = { has_trait = beauty_good_1 }
					add = 10
				}
				modifier = {
					desc = "scheme_beauty_good_2"
					root = { has_trait = beauty_good_2 }
					add = 15
				}
				modifier = {
					desc = "scheme_beauty_good_3"
					root = { has_trait = beauty_good_3 }
					add = 20
				}

				#Physique good
				modifier = {
					desc = "scheme_physique_good_1"
					root = { has_trait = physique_good_1 }
					add = 5
				}
				modifier = {
					desc = "scheme_physique_good_2"
					root = { has_trait = physique_good_2 }
					add = 10
				}
				modifier = {
					desc = "scheme_physique_good_3"
					root = { has_trait = physique_good_3 }
					add = 15
				}

				#Beauty bad
				modifier = {
					desc = "scheme_beauty_bad_1"
					root = { has_trait = beauty_bad_1 }
					add = -10
				}
				modifier = {
					desc = "scheme_beauty_bad_2"
					root = { has_trait = beauty_bad_2 }
					add = -15
				}
				modifier = {
					desc = "scheme_beauty_bad_3"
					root = { has_trait = beauty_bad_3 }
					add = -20
				}

				#TARGET

				#Opinion of owner
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = 1.5
					step = 5
				}

				#Trait similitarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -100
					max = 80
					multiplier = 3
				}
			
				#Taboo
				modifier = { #Incest is taboo (norms & consequences)
					add = -25
					desc = SCHEME_SEDUCE_TABOO_INCEST
					scope:spouse = {
						relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = root }
					}
					root = { # The Subtle Desire Perk nullifies this
						NOT = { has_perk = subtle_desire_perk }
					}
				}
				modifier = { #Character is not willing to engage in incest with root
					add = {
						if = {
							limit = { scope:spouse = { is_close_family_of = root } }
							value = -40
						}
						else_if = {
							limit = { scope:spouse = { is_extended_family_of = root } }
							value = -15
						}
						if = {
							limit = { scope:spouse = { is_deviant_trigger = yes } }
							add = 15
						}
					}
					desc = SCHEME_SEDUCE_UNWILLING_INCEST
					scope:spouse = {
						NOT = {
							is_consort_of = root
						}
						is_close_or_extended_family_of = root
						NOR = {
							accepts_incest_with_trigger = { CHARACTER = root } #100% fine with incest with owner
							root = { has_perk = subtle_desire_perk }  # The Subtle Desire Perk nullifies this
							guaranteed_under_20_incest_rejection_trigger = { # handled by hard block modifier
								TARGET = scope:spouse
								SEDUCER = root
							}
						}
					}
				}

				modifier = { # Tradition
					add = 40
					desc = SCHEME_TRAIT_POET
					root = {
						has_trait = lifestyle_poet
						culture = {
							has_cultural_parameter = poet_trait_romance_bonuses
						}
					}
				}

				# Courtship Perk
				modifier = {
					add = courtship_court_success_chance_bonus_value
					desc = SCHEME_COURTSHIP_PERK
					root = {
						has_perk = courtship_perk
					}
				}				
		
			}
		
			#Friend - befriend scheme modifiers
			100 = {
				custom_tooltip = debug_rel_friend
				trigger_event = {
					id = zgc_wedding_relationship_events.105
					days = { 3 5 }
				}
			
				trigger = {
					can_set_relation_friend_trigger = { CHARACTER = scope:spouse }					
				}

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 25
				}	

				#SCHEME OWNER#
				opinion_modifier = {
					desc = SCHEME_BEFRIEND_THEIR_OPINION
					who = scope:spouse
					opinion_target = root
					max = 30
					min = -30
					multiplier = 0.75
				}
				#Language
				modifier = {
					add = 4
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}
				#Owner Traits
				modifier = {
					add = 2
					root = { has_trait = education_diplomacy_1 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 4
					root = { has_trait = education_diplomacy_2 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 6
					root = { has_trait = education_diplomacy_3 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}	
				modifier = {
					add = 8
					root = { has_trait = education_diplomacy_4 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 10
					root = { has_trait = education_diplomacy_5 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					root = {
						OR = {
							has_trait = diplomat
							has_trait = family_first
							has_trait = august
						}
					}
					add = {
						value = 0
						if = {
							limit = {
								root = { has_trait = diplomat }
							}
							add = 4
						}
						if = {
							limit = {
								root = { has_trait = family_first }
							}
							add = 8
						}
						if = {
							limit = {
								root = { has_trait = august }
							}
							add = 12
						}
					}
					desc = "SCHEME_BEFRIEND_MY_LIFESTYLE"
				}
				modifier = {
					add = 6
					root = { has_trait = lifestyle_reveler }
					desc = "SCHEME_BEFRIEND_MY_REVELRY"
				}
				modifier = {
					add = -5
					root = { has_trait = shy }
					desc = "SCHEME_BEFRIEND_MY_SHYNESS"
				}
				modifier = {
					add = 5
					root = { has_trait = gregarious }
					desc = "SCHEME_BEFRIEND_MY_GREGARIOUSNESS"
				}
				modifier = {
					add = -4
					root = { has_trait = callous }
					desc = "SCHEME_BEFRIEND_MY_CALLOUSNESS"
				}
				#Target Traits
				modifier = {
					add = -5
					scope:spouse = { has_trait = shy }
					desc = "SCHEME_BEFRIEND_THEIR_SHYNESS"
				}
				modifier = {
					add = 5
					scope:spouse = { has_trait = gregarious }
					desc = "SCHEME_BEFRIEND_THEIR_GREGARIOUSNESS"
				}
				modifier = {
					add = -4
					scope:spouse = { has_trait = callous }
					desc = "SCHEME_BEFRIEND_THEIR_CALLOUSNESS"
				}
				modifier = {
					add = -4
					scope:spouse = { has_trait = paranoid }
					desc = "SCHEME_BEFRIEND_THEIR_PARANOIA"
				}
				modifier = {
					add = 4
					scope:spouse = { has_trait = trusting }
					desc = "SCHEME_BEFRIEND_THEIR_TRUST"
				}
				modifier = {
					add = 6
					scope:spouse = { has_trait = lifestyle_reveler }
					desc = "SCHEME_BEFRIEND_THEIR_LIFESTYLE"
				}
				modifier = {
					add = scope:spouse.var:recipient_stubborness_scheme
					scope:spouse = {
						has_trait = stubborn
						exists = var:recipient_stubborness_scheme
					}
					desc = "SCHEME_BEFRIEND_THEIR_STUBBORNESS"
				}
				modifier = {
					add = scope:spouse.var:recipient_fickleness_scheme
					scope:spouse = {
						has_trait = fickle
						exists = var:recipient_fickleness_scheme
						NOT = { var:recipient_fickleness_scheme = 0 }
					}
					desc = "SCHEME_BEFRIEND_THEIR_FICKLENESS"
				}
			
				#Trait similarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -50
					max = 50
					multiplier = 2
				}
			
				#Extra rank bonus/penalty if target is arrogant/ambitious
				modifier = {
					desc = SCHEME_SOCIAL_CLIMBER_RANK_BONUS
					add = 10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
						NOT = {
							is_theocratic_lessee = yes
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier > scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier > scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = {
					desc = SCHEME_SOCIAL_CLIMBER_RANK_PENALTY
					add = -10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier < scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier < scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = { # Realm Priests care about Piety Level
					add = {
						add = 5
						multiply = root.piety_level
					}
					desc = "I_AM_PIOUS"
					root.piety_level > 1
					scope:spouse = {
						is_theocratic_lessee = yes
					}
				}
				modifier = { # Realm Priests care about Piety Level
					add = -50
					desc = "I_AM_PIOUS"
					root.piety_level < 0
					scope:spouse = {
						is_theocratic_lessee = yes
					}
				}
		
			}
		
			#Rival 
			75 = { #was 100
				custom_tooltip = debug_rel_rival
				trigger_event = {
					id = zgc_wedding_relationship_events.106
					days = { 3 5 }
				}
			
				trigger = {
					can_set_relation_rival_trigger = { CHARACTER = scope:spouse }					
				}

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = -50
				}

				#Opinion of owner - higher modifier if lower opinion, and vice versa
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = -1.5
					step = 5
				}
			
				#Trait DIFFERENCE to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -50
					max = 50
					multiplier = -2 #Negative multiplier so low compatibility = higher modifier, etc.
				}
			}
		
			#No relation
			250 = { #was 150
				custom_tooltip = debug_rel_none

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = -25
				}

				trigger_event = {
					id = zgc_wedding_relationship_events.107
					days = { 3 5 }
				}
			}
		}
	}
	else_if = { #LOVER
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				any_relation = {
					type = lover
					this = scope:spouse
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.103
			days = { 3 5 }
		}
	}
	else_if = { # SOULMATE
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				any_relation = {
					type = soulmate
					this = scope:spouse
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.104
			days = { 3 5 }
		}
	}
	else_if = { # FRIEND OR BESTFRIEND
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				OR = {
					any_relation = {
						type = best_friend
						this = scope:spouse
					}
					any_relation = {
						type = friend
						this = scope:spouse
					}
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.105
			days = { 3 5 }
		}
	}
	else_if = { # RIVAL OR NEMESIS
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				OR = {
					any_relation = {
						type = rival
						this = scope:spouse
					}
					any_relation = {
						type = nemesis
						this = scope:spouse
					}
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.106
			days = { 3 5 }
		}
	}
	else_if = {
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.107
			days = { 3 5 }
		}
	}
}

# WITH WEDDING COMPATIBILTY - FOR UNLANDED MARRIAGES

zgc_determine_wedding_end_relationship_event_from_compatibility_effect_ai = {
	
	#Sets a new scope for the "other person," so relationship setting can work if fired from
	#either activity owner (i.e. wedding owner) or wedding spouse scopes. This is so the player
	#always gets to see the event, even when they are the wedding spouse. It also avoids duplication.

	if = {
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				NOR = {
					any_relation = {
						type = soulmate
						this = scope:spouse
					}
					any_relation = {
						type = lover
						this = scope:spouse
					}
					any_relation = {
						type = friend
						this = scope:spouse
					}
					any_relation = {
						type = best_friend
						this = scope:spouse
					}
					any_relation = {
						type = rival
						this = scope:spouse
					}
					any_relation = {
						type = nemesis
						this = scope:spouse
					}
				}
			}
		}
		random_list = {
			#Lover - seduction scheme modifiers
			100 = {
				custom_tooltip = debug_rel_lover
				trigger_event = {
					id = zgc_wedding_relationship_events.203
					days = { 10 20 }
				}

				#Sexualtiy - Not attracted to your gender, hard stop
				trigger = {
					can_set_relation_lover_trigger = { CHARACTER = scope:spouse }					
					scope:spouse = { is_attracted_to_gender_of = root }
					root = { is_attracted_to_gender_of = scope:spouse }
					NOT = {
						guaranteed_under_20_incest_rejection_trigger = {
							TARGET = scope:spouse
							SEDUCER = root
						}
					}
				}
			

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 50
				}
			
				#Attraction - not part of vanilla seduce scheme (for some reason)
				modifier = {
					add = root.attraction
				}
			
			
				#Language
				modifier = {
					add = 5
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}
			
				modifier = { # Smooth Operator perk bonus
					desc = SEDUCE_PERK_BONUS
					root = { has_perk = smooth_operator_perk }
					always = yes
					add = smooth_operator_perk_bonus
				}
			
				modifier = { # Legacy bonus
					desc = LEGACY_PERK_BONUS
					root = {
						exists = dynasty
						dynasty = {
							has_dynasty_perk = fp1_adventure_legacy_2
						}
					}
					always = yes
					add = fp1_adventure_legacy_2_success_chance_seduction
				}

				modifier = {
					desc = "SCHEME_SCHEMER_TRAIT"
					root = { has_trait = seducer }
					add = 25
				}
			
				#Beauty good
				modifier = {
					desc = "scheme_beauty_good_1"
					root = { has_trait = beauty_good_1 }
					add = 10
				}
				modifier = {
					desc = "scheme_beauty_good_2"
					root = { has_trait = beauty_good_2 }
					add = 15
				}
				modifier = {
					desc = "scheme_beauty_good_3"
					root = { has_trait = beauty_good_3 }
					add = 20
				}

				#Physique good
				modifier = {
					desc = "scheme_physique_good_1"
					root = { has_trait = physique_good_1 }
					add = 5
				}
				modifier = {
					desc = "scheme_physique_good_2"
					root = { has_trait = physique_good_2 }
					add = 10
				}
				modifier = {
					desc = "scheme_physique_good_3"
					root = { has_trait = physique_good_3 }
					add = 15
				}

				#Beauty bad
				modifier = {
					desc = "scheme_beauty_bad_1"
					root = { has_trait = beauty_bad_1 }
					add = -10
				}
				modifier = {
					desc = "scheme_beauty_bad_2"
					root = { has_trait = beauty_bad_2 }
					add = -15
				}
				modifier = {
					desc = "scheme_beauty_bad_3"
					root = { has_trait = beauty_bad_3 }
					add = -20
				}

				#Venereal diseases
				modifier = {
					desc = "scheme_great_pox"
					root = { has_trait = great_pox }
					add = -50
				}
				modifier = {
					desc = "scheme_lovers_pox"
					root = { has_trait = lovers_pox }
					add = -25
				}
				modifier = {
					desc = "scheme_early_great_pox"
					root = { has_trait = early_great_pox }
					add = -25
				}

				#Sexuality
				modifier = {
					desc = SCHEME_SEDUCE_WRONG_GENDER
					root = {
						NOR = {
							is_attracted_to_gender_of = scope:spouse
							has_perk = unshackled_lust_perk # Removed by the Unshackled Lust Perk
						}
					}
					add = -25
				}


				#TARGET#

				#Lustful/hedonist
				modifier = {
					desc = "SCHEME_REVELER"
					scope:spouse = { has_trait = lifestyle_reveler }
					add = 5
				}
				modifier = {
					desc = "SCHEME_LUSTFUL_TRAIT"
					scope:spouse = { has_trait = lustful }
					add = 10
				}

				#Chaste/shy
				modifier = {
					desc = "SCHEME_CHASTE_TRAIT"
					scope:spouse = { has_trait = chaste }
					add = -15
				}
				modifier = {
					desc = "SCHEME_SHY_TRAIT"
					scope:spouse = { has_trait = shy }
					add = -10
				}

				#Opinion of owner
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = 1.5
					step = 5
				}
			
				#Trait similitarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -100
					max = 80
					multiplier = 2
				}
			
				#Extra rank bonus/penalty if target is arrogant/ambitious
				modifier = {
					trigger = { root = { NOT = { is_consort_of = scope:spouse } } } # No 'social climbing' if you're already their spouse!
					desc = SCHEME_SOCIAL_CLIMBER_RANK_BONUS
					add = 10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
						NOT = {
							is_theocratic_lessee = yes
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier > scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier > scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = {
					trigger = { root = { NOT = { is_consort_of = scope:spouse } } } # No 'social climbing' if you're already their spouse!
					desc = SCHEME_SOCIAL_CLIMBER_RANK_PENALTY
					add = -10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier < scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier < scope:spouse.highest_held_title_tier
						}
					}
				}

				#Taboo
				modifier = { #Incest is taboo (norms & consequences)
					add = -25
					desc = SCHEME_SEDUCE_TABOO_INCEST
					scope:spouse = {
						relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = root }
					}
					root = { # The Subtle Desire Perk nullifies this
						NOT = { has_perk = subtle_desire_perk }
					}
				}
				modifier = { #Character is not willing to engage in incest with root
					add = {
						if = {
							limit = { scope:spouse = { is_close_family_of = root } }
							value = -40
						}
						else_if = {
							limit = { scope:spouse = { is_extended_family_of = root } }
							value = -15
						}
						if = {
							limit = { scope:spouse = { is_deviant_trigger = yes } }
							add = 15
						}
					}
					desc = SCHEME_SEDUCE_UNWILLING_INCEST
					scope:spouse = {
						NOT = { is_consort_of = root }
							is_close_or_extended_family_of = root
						NOR = {
							accepts_incest_with_trigger = { CHARACTER = root } #100% fine with incest with owner
							root = { has_perk = subtle_desire_perk }  # The Subtle Desire Perk nullifies this
							guaranteed_under_20_incest_rejection_trigger = { # handled by hard block modifier
								TARGET = scope:spouse
								SEDUCER = root
							}
						}
					}	
				}
				# scope:spouse = {
				# 	set_variable = {
				# 		name = end_relationship
				# 		value = 2
				# 		months = 2
				# 	}
				# }

			}
	
			#Soulmate - romance scheme modifiers
			75 = { #was 100
				custom_tooltip = debug_rel_soulmate
				trigger_event = {
					id = zgc_wedding_relationship_events.204
					days = { 10 20 }
				}
			
				#Sexualtiy - Not attracted to your gender, hard stop
				trigger = {
					can_set_relation_soulmate_trigger = { CHARACTER = scope:spouse }					
					scope:spouse = { is_attracted_to_gender_of = root }
					root = { is_attracted_to_gender_of = scope:spouse }
				}
		
				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 50
				}

				#Attraction - not part of vanilla seduce scheme (for some reason)
				modifier = {
					add = root.attraction
				}
			
				#Language
				modifier = {
					add = 5
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}

				#Gallant
				modifier = {
					desc = "SCHEME_GALLANT_TRAIT"
				root = { has_trait = gallant }
					add = 30
				}

				#Beauty good
				modifier = {
					desc = "scheme_beauty_good_1"
					root = { has_trait = beauty_good_1 }
					add = 10
				}
				modifier = {
					desc = "scheme_beauty_good_2"
					root = { has_trait = beauty_good_2 }
					add = 15
				}
				modifier = {
					desc = "scheme_beauty_good_3"
					root = { has_trait = beauty_good_3 }
					add = 20
				}

				#Physique good
				modifier = {
					desc = "scheme_physique_good_1"
					root = { has_trait = physique_good_1 }
					add = 5
				}
				modifier = {
					desc = "scheme_physique_good_2"
					root = { has_trait = physique_good_2 }
					add = 10
				}
				modifier = {
					desc = "scheme_physique_good_3"
					root = { has_trait = physique_good_3 }
					add = 15
				}

				#Beauty bad
				modifier = {
					desc = "scheme_beauty_bad_1"
					root = { has_trait = beauty_bad_1 }
					add = -10
				}
				modifier = {
					desc = "scheme_beauty_bad_2"
					root = { has_trait = beauty_bad_2 }
					add = -15
				}
				modifier = {
					desc = "scheme_beauty_bad_3"
					root = { has_trait = beauty_bad_3 }
					add = -20
				}

				#TARGET

				#Opinion of owner
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = 1.5
					step = 5
				}

				#Trait similitarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -100
					max = 80
					multiplier = 3
				}
			
				#Taboo
				modifier = { #Incest is taboo (norms & consequences)
					add = -25
					desc = SCHEME_SEDUCE_TABOO_INCEST
					scope:spouse = {
						relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = root }
					}
					root = { # The Subtle Desire Perk nullifies this
						NOT = { has_perk = subtle_desire_perk }
					}
				}
				modifier = { #Character is not willing to engage in incest with root
					add = {
						if = {
							limit = { scope:spouse = { is_close_family_of = root } }
							value = -40
						}
						else_if = {
							limit = { scope:spouse = { is_extended_family_of = root } }
							value = -15
						}
						if = {
							limit = { scope:spouse = { is_deviant_trigger = yes } }
							add = 15
						}
					}
					desc = SCHEME_SEDUCE_UNWILLING_INCEST
					scope:spouse = {
						NOT = {
							is_consort_of = root
						}
						is_close_or_extended_family_of = root
						NOR = {
							accepts_incest_with_trigger = { CHARACTER = root } #100% fine with incest with owner
							root = { has_perk = subtle_desire_perk }  # The Subtle Desire Perk nullifies this
							guaranteed_under_20_incest_rejection_trigger = { # handled by hard block modifier
								TARGET = scope:spouse
								SEDUCER = root
							}
						}
					}
				}

				modifier = { # Tradition
					add = 40
					desc = SCHEME_TRAIT_POET
					root = {
						has_trait = lifestyle_poet
						culture = {
							has_cultural_parameter = poet_trait_romance_bonuses
						}
					}
				}

				# Courtship Perk
				modifier = {
					add = courtship_court_success_chance_bonus_value
					desc = SCHEME_COURTSHIP_PERK
					root = {
						has_perk = courtship_perk
					}
				}
			}
		
			#Friend - befriend scheme modifiers
			100 = {
				custom_tooltip = debug_rel_friend
				trigger_event = {
					id = zgc_wedding_relationship_events.205
					days = { 10 20 }
				}

				trigger = {
					can_set_relation_friend_trigger = { CHARACTER = scope:spouse }					
				}

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = 25
				}	

				#SCHEME OWNER#
				opinion_modifier = {
					desc = SCHEME_BEFRIEND_THEIR_OPINION
					who = scope:spouse
					opinion_target = root
					max = 30
					min = -30
					multiplier = 0.75
				}
				#Language
				modifier = {
					add = 4
					desc = YOU_SPEAK_THE_LANGUAGE
					root = { knows_language_of_culture = scope:spouse.culture }
				}
				#Owner Traits
				modifier = {
					add = 2
					root = { has_trait = education_diplomacy_1 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 4
					root = { has_trait = education_diplomacy_2 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 6
					root = { has_trait = education_diplomacy_3 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}	
				modifier = {
					add = 8
					root = { has_trait = education_diplomacy_4 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					add = 10
					root = { has_trait = education_diplomacy_5 }
					desc = "SCHEME_BEFRIEND_MY_EDUCATION"
				}
				modifier = {
					root = {
						OR = {
							has_trait = diplomat
							has_trait = family_first
							has_trait = august
						}
					}
					add = {
						value = 0
						if = {
							limit = {
								root = { has_trait = diplomat }
							}
							add = 4
						}
						if = {
							limit = {
								root = { has_trait = family_first }
							}
							add = 8
						}
						if = {
							limit = {
								root = { has_trait = august }
							}
							add = 12
						}
					}
					desc = "SCHEME_BEFRIEND_MY_LIFESTYLE"
				}
				modifier = {
					add = 6
					root = { has_trait = lifestyle_reveler }
					desc = "SCHEME_BEFRIEND_MY_REVELRY"
				}
				modifier = {
					add = -5
					root = { has_trait = shy }
					desc = "SCHEME_BEFRIEND_MY_SHYNESS"
				}
				modifier = {
					add = 5
					root = { has_trait = gregarious }
					desc = "SCHEME_BEFRIEND_MY_GREGARIOUSNESS"
				}
				modifier = {
					add = -4
					root = { has_trait = callous }
					desc = "SCHEME_BEFRIEND_MY_CALLOUSNESS"
				}
				#Target Traits
				modifier = {
					add = -5
					scope:spouse = { has_trait = shy }
					desc = "SCHEME_BEFRIEND_THEIR_SHYNESS"
				}
				modifier = {
					add = 5
					scope:spouse = { has_trait = gregarious }
					desc = "SCHEME_BEFRIEND_THEIR_GREGARIOUSNESS"
				}
				modifier = {
					add = -4
					scope:spouse = { has_trait = callous }
					desc = "SCHEME_BEFRIEND_THEIR_CALLOUSNESS"
				}
				modifier = {
					add = -4
					scope:spouse = { has_trait = paranoid }
					desc = "SCHEME_BEFRIEND_THEIR_PARANOIA"
				}
				modifier = {
					add = 4
					scope:spouse = { has_trait = trusting }
					desc = "SCHEME_BEFRIEND_THEIR_TRUST"
				}
				modifier = {
					add = 6
					scope:spouse = { has_trait = lifestyle_reveler }
					desc = "SCHEME_BEFRIEND_THEIR_LIFESTYLE"
				}
				modifier = {
					add = scope:spouse.var:recipient_stubborness_scheme
					scope:spouse = {
						has_trait = stubborn
						exists = var:recipient_stubborness_scheme
					}
					desc = "SCHEME_BEFRIEND_THEIR_STUBBORNESS"
				}
				modifier = {
					add = scope:spouse.var:recipient_fickleness_scheme
					scope:spouse = {
						has_trait = fickle
						exists = var:recipient_fickleness_scheme
						NOT = { var:recipient_fickleness_scheme = 0 }
					}
					desc = "SCHEME_BEFRIEND_THEIR_FICKLENESS"
				}
			
				#Trait similarity to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -50
					max = 50
					multiplier = 2
				}
			
				#Extra rank bonus/penalty if target is arrogant/ambitious
				modifier = {
					desc = SCHEME_SOCIAL_CLIMBER_RANK_BONUS
					add = 10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
						NOT = {
							is_theocratic_lessee = yes
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier > scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier > scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = {
					desc = SCHEME_SOCIAL_CLIMBER_RANK_PENALTY
					add = -10
					scope:spouse = {
						OR = {
							has_trait = arrogant
							has_trait = ambitious
							has_trait = greedy
						}
					}
					OR = {
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = yes }
							root.highest_held_title_tier < scope:spouse.liege.highest_held_title_tier
						}
						AND = {
							scope:spouse = { personal_scheme_success_compare_target_liege_tier_trigger = no }
							root.highest_held_title_tier < scope:spouse.highest_held_title_tier
						}
					}
				}
				modifier = { # Realm Priests care about Piety Level
					add = {
						add = 5
						multiply = root.piety_level
					}
					desc = "I_AM_PIOUS"
					root.piety_level > 1
					scope:spouse = {
						is_theocratic_lessee = yes
					}
				}
				modifier = { # Realm Priests care about Piety Level
					add = -50
					desc = "I_AM_PIOUS"
					root.piety_level < 0
					scope:spouse = {
						is_theocratic_lessee = yes
					}
				}
				# scope:spouse = {
				# 	set_variable = {
				# 		name = end_relationship
				# 		value = 3
				# 		months = 2
				# 	}
				# }
			}
		
			#Rival 
			75 = { #was 100
				custom_tooltip = debug_rel_rival
				trigger_event = {
					id = zgc_wedding_relationship_events.206
					days = { 10 20 }
				}

				trigger = {
					can_set_relation_rival_trigger = { CHARACTER = scope:spouse }					
				}

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = -50
				}

				#Opinion of owner - higher modifier if lower opinion, and vice versa
				opinion_modifier = {
					who = scope:spouse
					opinion_target = root
					min = -50
					max = 50
					multiplier = -1.5
					step = 5
				}
			
				#Trait DIFFERENCE to owner
				compatibility_modifier = {
					who = scope:spouse
					compatibility_target = root
					min = -50
					max = 50
					multiplier = -2 #Negative multiplier so low compatibility = higher modifier, etc.
				}
				# scope:spouse = {
				# 	set_variable = {
				# 		name = end_relationship
				# 		value = 4
				# 		months = 2
				# 	}
				# }
			}
		
			#No relation
			250 = { #was 150
				custom_tooltip = debug_rel_none
				trigger_event = {
					id = zgc_wedding_relationship_events.207
					days = { 10 20 }
				}

				#Married for Love
				modifier = {
					OR = {
						root = { has_character_flag = marry_for_love }
						scope:spouse = { has_character_flag = marry_for_love }
					}
					add = -25
				}
				# scope:spouse = {
				# 	set_variable = {
				# 		name = end_relationship
				# 		value = 5
				# 		months = 2
				# 	}
				# }
			}
		}
	}
	else_if = { #LOVER
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				any_relation = {
					type = lover
					this = scope:spouse
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.203
			days = { 3 5 }
		}
	}
	else_if = { # SOULMATE
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				any_relation = {
					type = soulmate
					this = scope:spouse
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.204
			days = { 3 5 }
		}
	}
	else_if = { # FRIEND OR BESTFRIEND
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				OR = {
					any_relation = {
						type = best_friend
						this = scope:spouse
					}
					any_relation = {
						type = friend
						this = scope:spouse
					}
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.205
			days = { 3 5 }
		}
	}
	else_if = { # RIVAL OR NEMESIS
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
			root = {
				OR = {
					any_relation = {
						type = rival
						this = scope:spouse
					}
					any_relation = {
						type = nemesis
						this = scope:spouse
					}
				}
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.206
			days = { 3 5 }
		}
	}
	else_if = {
		limit = {
			root = {
				is_alive = yes
			}
			scope:spouse = {
				is_alive = yes
			}
		}
		trigger_event = {
			id = zgc_wedding_relationship_events.207
			days = { 3 5 }
		}
	}
}

zgc_after_wedding_notices_effect = {
	root = {
		save_scope_as = groom
	}
	if = {
		limit = { exists = scope:groom.liege }
		scope:groom.liege = {
			if = {
				limit = {
					OR = {
						is_close_or_extended_family_of = scope:groom
						scope:groom = {
							is_councillor = yes
							has_dynasty = yes
						}
					}
				}		
				add_character_flag = {
					flag = had_court_wedding
					days = 30
				}
			}
		}
	}
	scope:groom = {
		add_character_flag = {
			flag = zgc_just_married
			days = 45
		}
		add_character_modifier = {
			modifier = zgc_just_married_modifier
			days = 60
		}
		if = {
			limit = {
				OR = {
					is_lowborn = no
					scope:spouse = { is_lowborn = no }
				}
				NOT = { has_global_variable = start_wedding_notices }
				NOT = {	has_game_rule = no_zgc_notices }
			}
			every_close_family_member = {
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9000 #End reception event
				}
			}	
		}
		if = {
			limit = {
				OR = {
					is_lowborn = no
					scope:spouse = { is_lowborn = no }
				}
				NOT = { has_global_variable = start_wedding_notices }
				OR = {
					has_game_rule = all_zgc_notices
					has_game_rule = no_zgc_liege_notices
				}
				NOR = {
					has_game_rule = no_zgc_notices
					has_game_rule = no_zgc_extended_notices
				}
			}
			every_extended_family_member = {
				limit = {
					location = scope:groom.location
				}
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9000 #End reception event
				}
			}	
		}
	}
	scope:spouse = {
		add_character_flag = {
			flag = zgc_just_married
			days = 45
		}
		add_character_modifier = {
			modifier = zgc_just_married_modifier
			days = 60
		}
		if = {
			limit = {
				OR = {
					is_lowborn = no
					scope:groom = { is_lowborn = no }
				}
				NOT = { has_global_variable = start_wedding_notices }
				NOT = {	has_game_rule = no_zgc_notices }
			}
			every_close_family_member = {
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9000 #End reception event
				}
			}	
		}
		if = {
			limit = {
				OR = {
					is_lowborn = no
					scope:groom = { is_lowborn = no }
				}
				NOT = { has_global_variable = start_wedding_notices }
				OR = {
					has_game_rule = all_zgc_notices
					has_game_rule = no_zgc_liege_notices
				}
				NOR = {
					has_game_rule = no_zgc_notices
					has_game_rule = no_zgc_extended_notices
				}
			}
			every_extended_family_member = {
				limit = {
					location = scope:groom.location
				}
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9000 #End reception event
				}
			}	
		}
	}
	if = {
		limit = { exists = scope:groom.liege }
		scope:groom.liege = {
			if = {
				limit = {
					OR = {
						scope:groom = { is_lowborn = no }
						scope:spouse = { is_lowborn = no }
					}
					NOT = { has_global_variable = start_wedding_notices }
					NOT = {	this = root }
					NOR = {
						is_close_or_extended_family_of = root
						is_close_or_extended_family_of = scope:spouse
					}
					OR = {
						has_game_rule = all_zgc_notices
						AND = {
							has_game_rule = no_zgc_vassal_notices
							scope:groom = {
								is_courtier_of = scope:groom.liege
								is_councillor_of = scope:groom.liege
							}
						}
					}
					NOR = {
						has_game_rule = no_zgc_notices
						has_game_rule = no_zgc_liege_notices
					}
				}
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9001 #End reception event
				}
			}
		}
	}
	if = {
		limit = { exists = scope:spouse.liege }
		scope:spouse.liege = {
			if = {
				limit = {
					OR = {
						scope:groom = { is_lowborn = no }
						scope:spouse = { is_lowborn = no }
					}
					NOT = { has_global_variable = start_wedding_notices }
					NOR = {
						this = root
						this = scope:spouse
						this = scope:groom.liege	
						is_close_or_extended_family_of = root
						is_close_or_extended_family_of = scope:groom
					}
					OR = {
						has_game_rule = all_zgc_notices
						AND = {
							has_game_rule = no_zgc_vassal_notices
							scope:groom = {
								is_courtier_of = scope:groom.liege
								is_councillor_of = scope:groom.liege
							}
						}
					}
					NOR = {
						has_game_rule = no_zgc_notices
						has_game_rule = no_zgc_liege_notices
					}
				}
				trigger_event = {
					id = zgc_wedding_feast_guest_events.9001 #End reception event
				}
			}
		}	
	}
}