﻿#FEAST ACTIVITY DEFAULT MAIN EVENT

namespace = feast_default

############################
## Setup and maintenance
## 0000-0999
## by Petter Vilberg
############################
#feast_default.0001 - Trigger and weight event

############################
## Events triggered by yourself
## 1000-1999
## by Linnéa Thimrén and Petter Vilberg
############################
#feast_default.1001 - A guest is impressed with your high learning!
#feast_default.1002 - You get grumpy because the food is late
#feast_default.1003 - A Guest is sarcastically impressed with your high Learning
#feast_default.1004 - Enjoy Magnificent Food!
#feast_default.1005 - You're having a hard time socializing
#feast_default.1006 - Reveler is in their element
#feast_default.1007 - Two Gluttons admire each other
#feast_default.1008 - You reveal a secret about yourself
#feast_default.1009 - You reveal a secret about someone else
#feast_default.1010 - Promise someone a favor
#feast_default.1011 - You get drunk and kill someone
#feast_default.1012 - Sneaky murder of character you dislike
#feast_default.1013 - Murder someone for attacking friend/lover/sibling
#feast_default.1014 - Murder someone, one witness!
#feast_default.1015 - Seat important people beside each other

############################
## Events triggered by other characters
## 2000-2999
## by Linnéa Thimrén and Petter Vilberg
############################
#feast_default.2001 - Glutton gets angry waiting for food
#feast_default.2002 - Someone sends you a secret love letter
#feast_default.2003 - Bond with someone you have traits in common with
#feast_default.2005 - Someone throws up on you
#feast_default.2006 - Someone has a befriend/seduce scheme against you
#feast_default.2007 - Two lovers are exposed
#feast_default.2008 - Lustful secret homosexual discovered with a servant
#feast_default.2009 - Learn a secret about someone else
#feast_default.2010 - Learn a secret about someone else from a third party
#feast_default.2011 - Someone makes grand promises to you
#feast_default.2012 - Someone is murdered, you're a witness!
#feast_default.6111 - A guest rambles on and on
#feast_default.6101 - Guest is having a hard time socializing
#feast_default.6251 - You trip - where will you spill your wine?

############################
## Relation events
## 3000-3999
## by Linnéa Thimrén and Petter Vilberg
############################
#feast_default.3001 - Have a good time with a friend
#feast_default.3002 - A chance to exchange "kisses" with a Lover
#feast_default.3003 - Altercation with a Rival
#feast_default.3004 - Insult your rival
#feast_default.3005 - Rival duel!
#feast_default.3006 - Soiree with another attendee
#feast_default.3007 - Caught committing adultery with a Lover

############################
## Events triggered by host/feast conditions
## 5000-5999
## by Linnéa Thimrén and Petter Vilberg
############################
#feast_default.5001 - Host's high Dread causes you Stress
#feast_default.5002 - Host is lunatic
#feast_default.5003 - Host is sadistic
#feast_default.5004 - Host is a reveler
#feast_default.5005 - Enjoy some good garum!

############################
## Host unique events
## 6000-6999
## by Linnéa Thimrén and Petter Vilberg
############################
#feast_default.6001 - Spouse has done a great job
#feast_default.6002 - Guest complements your feast
#feast_default.6003 - Guests getting into a fight
#feast_default.6121 - Serve a guest food you know they hate
#feast_default.6231 - There's no more wine!
#feast_default.6261 - Serve the guests something new (cannibal)

#################################
## MURDER FEAST EVENTS
## 8000-8999
## by Linnéa Thimrén
#################################
#feast_default.8000 - To start it all off...
#feast_default.8001 - For host - They died and I saved my close ones
#feast_default.8002 - For host - They died!!
#feast_default.8003 - For host - They didn't die
#feast_default.8051 - For guest - Enemies of host died and I was spared
#feast_default.8052 - For guest - I died
#feast_default.8061 - For guest - Someone close to me tried to kill people?!

############################
## End Events
## 9000-9999
## by Petter Vilberg
############################
#feast_default.9000 - End events setup
#feast_default.9001 - Host end event
#feast_default.9002 - Guest end event

#####################################################################################


#################################
# Setup and maintenance
# 0000-0999
#################################

#####################
# Trigger and weight event
# by Petter Vilberg
#####################
feast_default.0001 = {
	type = character_event
	hidden = yes

	immediate = {
		feast_default_setup_effect = yes
		trigger_event = {
			id = feast_default.9000
			days = max_feast_duration
		}
	}
}



#################################
# SELF-TRIGGERED EVENTS
# 1000-1999
#################################

#####################
# A guest is impressed with your high learning!
# by Petter Vilberg
#####################
feast_default.1001 = {
	type = character_event
	title = feast_default.1001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { learning >= 20 }
				desc = feast_default.1001.very_high_learning
			}
			triggered_desc = {
				trigger = { learning >= 15 }
				desc = feast_default.1001.high_learning
			}
			triggered_desc = {
				trigger = { learning >= 8 }
				desc = feast_default.1001.average_learning
			}
			triggered_desc = {
				desc = feast_default.1001.low_learning
			}
		}
	}
	left_portrait = {
		character = scope:impressed_guest
		animation = admiration
	}
	theme = feast_activity
	
	trigger = {
		NOT = { exists = local_var:had_1001}
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				learning < root.learning
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1001
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					learning < root.learning
				}
				save_scope_as = impressed_guest
			}
		}
	}

	option = { #Why, of course
		name = feast_default.1001.a
		add_prestige = minor_prestige_gain
		scope:impressed_guest = {
			add_opinion = {
				target = root
				modifier = learned_at_feast_opinion
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# You get grumpy because the food is late
# by Petter Vilberg
#####################
scripted_trigger feast_default_1002_annoyed_guest_trigger = {
	feast_default_participant_trigger = yes
	NOT = { has_trait = gluttonous }
	NOT = { has_trait = impatient }
	NOT = {
		has_opinion_modifier = {
			target = root
			modifier = annoying_glutton_at_feast_opinion
		}
	}
}

#Triggered by being Gluttonous
feast_default.1002 = {
	type = character_event
	title = feast_default.1002.t
	desc = feast_default.1002.desc
	theme = feast_activity
	left_portrait = {
		character = scope:other_guest
		animation = disgust
	}
	
	trigger = {
		NOT = { exists = local_var:had_1002 }
		has_trait = gluttonous
		NOT = { has_trait = patient }
		NOT = { has_character_modifier = feast_gratifying_complaints_modifier }
		scope:activity = {
			any_participant = { #There needs to exist someone who can get annoyed at you
				feast_default_1002_annoyed_guest_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #Wrathful characters are more likely to be angry
			add = 0.5
			has_trait = wrathful
		}
		modifier = { #Wrathful characters are more likely to be angry
			add = 0.5
			has_trait = impatient
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1002
			value = yes
		}
		scope:activity = {	
			random_participant = { #Find someone who can be annoyed at you
				limit = {
					feast_default_1002_annoyed_guest_trigger = yes
				}
				save_scope_as = other_guest
			}
		}
	}


	option = {
		name = feast_default.1002.a
		add_character_modifier = {
			modifier = feast_gratifying_complaints_modifier
			years = 5
		}
		scope:activity = {
			every_participant = {
				custom = feast_default.1002.gluttons_and_impatients
				limit = {
					feast_default_participant_trigger = yes
					NOT = { this = scope:other_guest }
					OR = {
						has_trait = gluttonous
						has_trait = impatient
					}
				}
				add_opinion = {
					target = root
					modifier = complained_on_my_behalf_opinion
				}
			}
		}
		scope:other_guest = {
			add_opinion = {
				target = root
				modifier = annoying_glutton_at_feast_opinion
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# A Guest is sarcastically impressed with your high Learning
# by Petter Vilberg
#####################
scripted_trigger feast_default_1003_learned_guest_trigger = {
	feast_default_participant_trigger = yes
	learning >= 15
	OR = {
		has_relation_rival = root
		NOT = { has_any_scripted_relation = root }
	}
}

feast_default.1003 = {
	type = character_event
	title = feast_default.1003.t
	desc = feast_default.1003.desc
	left_portrait = {
		character = scope:other_guest
		animation = scadenfreude
	}
	theme = feast_activity
	
	trigger = {
		NOT = { exists = local_var:had_1003 }
		learning <= 7
		scope:activity = {
			any_participant = {
				feast_default_1003_learned_guest_trigger = yes
			}
		}	
	}

	immediate = {
		set_local_variable = {
			name = had_1003
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1003_learned_guest_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = other_guest
			}
		}
	}

	option = { #I feel pretty good about that!
		name = feast_default.1003.a
		trigger = {
			scope:other_guest = {
				NOT = { has_relation_rival = root }
			}
		}
		skill = learning
		add_character_modifier = {
			modifier = feast_scholarly_confidence_modifier
			years = 5
		}
		hidden_effect = {
			add_opinion = {
				target = scope:other_guest
				modifier = compliment_opinion
				opinion = 20
			}
		}
		reverse_add_opinion = {
			target = scope:other_guest
			modifier = was_unimpressed_at_feast_opinion
		}
		hidden_effect = {
			if = {
				limit = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:other_guest }
				}
				set_relation_potential_rival = scope:other_guest
			}
		}
	}

	option = { #I didn't realise they felt that way
		name = feast_default.1003.b
		trigger = {
			scope:other_guest = {
				has_relation_rival = root
			}
		}
		skill = learning
		add_character_modifier = {
			modifier = feast_scholarly_confidence_modifier
			years = 5
		}
		hidden_effect = {
			add_opinion = {
				target = scope:other_guest
				modifier = compliment_opinion
				opinion = 20
			}
		}
		reverse_add_opinion = {
			target = scope:other_guest
			modifier = was_unimpressed_at_feast_opinion
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Enjoy Magnificent Food!
# by Petter Vilberg
#####################
feast_default.1004 = {
	type = character_event
	title = feast_default.1004.t
	desc = feast_default.1004.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = happiness
	}

	trigger = {
		NOT = { exists = local_var:had_1004 }
		NOR = {
			has_trait = greedy
			has_trait = temperate
			has_trait = inappetetic
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1004
			value = yes
		}
	}

	option = { #Amazing!
		name = feast_default.1004.a
		add_stress = medium_stress_loss
		add_character_modifier = {
			modifier = feast_life_reaffirmed_modifier
			years = 5
		}
		scope:activity.activity_owner = {
			add_prestige = minor_prestige_gain
		}
	}

	option = { #INCREDIBLE!
		name = feast_default.1004.b
		trigger = {
			OR = {
				has_trait = gluttonous
				has_trait = comfort_eater
			}
		}
		exclusive = yes
		stress_impact = {
			base = medium_stress_loss
			gluttonous = medium_stress_loss
			comfort_eater = medium_stress_loss
		}
		add_character_modifier = {
			modifier = feast_life_reaffirmed_modifier
			years = 5
		}
		scope:activity.activity_owner = {
			add_prestige = minor_prestige_gain
			add_opinion = {
				target = root
				modifier = feast_amazing_food_glutton_opinion
			}
			hidden_effect = {
				random_spouse = {
					reverse_add_opinion = {
						target = root
						modifier = feast_amazing_food_glutton_opinion
					}	
				}
			}
		}
	}	

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# You're having a hard time socializing
# by Petter Vilberg
#####################
feast_default.1005 = {
	type = character_event
	title = feast_default.1005.t
	desc = {
		desc = feast_default.1005.desc
		triggered_desc = {
			trigger = {
				exists = scope:friendly_guest
			}
			desc = feast_default.1005.desc_friendly_guest
		}
	}
	theme = feast_activity
	left_portrait = {
		character = root
		animation = stress
	}
	right_portrait = {
		character = scope:friendly_guest
		animation = personality_compassionate
	}

	trigger = {
		NOT = { exists = local_var:had_1005 }
		OR = {
			has_trait = shy
			has_trait = reclusive
		}
		NOT = { has_trait = lifestyle_reveler }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				has_friendly_relationship_trigger = {
					CHARACTER = root
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		set_local_variable = {
			name = had_1005
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_friendly_relationship_trigger = {
						CHARACTER = root
					}
				}
				save_scope_as = friendly_guest
			}
		}
	}

	option = { #you try to get through the party alone
		name = feast_default.1005.a
		add_prestige = medium_prestige_loss
		stress_impact = {
			base = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			reclusive = minor_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_energy = -0.25
			}
		}
	}

	option = { #you have a friend at the party
		name = feast_default.1005.b
		trigger = {
			exists = scope:friendly_guest
		}
		hidden_effect = {
			add_opinion = {
				modifier = friendly_interaction
				target = scope:friendly_guest
			}
		}
		add_prestige = medium_prestige_gain
		scope:friendly_guest = {
			add_opinion = {
				target = root
				modifier = friendly_interaction
			}
		}
		stress_impact = {
			craven = minor_stress_impact_gain
		}
		ai_chance = {
			base = 1000
		}
	}

	option = { #you make awkward attempts at social interaction
		name = feast_default.1005.c
		add_prestige = medium_prestige_gain
		stress_impact = {
			craven = minor_stress_impact_gain
			shy = medium_stress_impact_gain
			reclusive = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_energy = 0.25
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Reveler in their element
# by Petter Vilberg
#####################

#Trigger for suitable compatriots
scripted_trigger feast_default_1006_potentially_entertained_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	NOT = { has_relation_rival = root }
}

feast_default.1006 = {
	type = character_event
	title = feast_default.1006.t
	desc = feast_default.1006.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest_1
		animation = happiness
	}
	right_portrait = {
		character = scope:guest_2
		animation = admiration
	}
	lower_left_portrait = scope:guest_3
	
	trigger = {
		NOT = { exists = local_var:had_1006 }
		has_trait = lifestyle_reveler
		scope:activity = {
			any_participant = {
				feast_default_1006_potentially_entertained_trigger = yes
				count >= 3
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1006
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1006_potentially_entertained_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = guest_1
				add_to_list = table_companions
			}
			random_participant = {
				limit = {
					feast_default_1006_potentially_entertained_trigger = yes
					NOT = { this = scope:guest_1 }
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = guest_2
				add_to_list = table_companions
			}
			random_participant = {
				limit = {
					feast_default_1006_potentially_entertained_trigger = yes
					NOT = { this = scope:guest_1 }
					NOT = { this = scope:guest_2 }
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 5
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = guest_3
				add_to_list = table_companions
			}
		}
	}

	option = {
		name = feast_default.1006.a
		trigger = {
			has_trait_rank = {
				trait = lifestyle_reveler
				rank = 1
			}
		}
		trait = reveler_1
		every_in_list = {
			list = table_companions
			custom = feast_default.1006.table_companions
			add_opinion = {
				modifier = feast_life_of_the_party_opinion
				target = root
				opinion = 10
			}
		}
		stress_impact = {
			reveler_1 = medium_stress_loss
			gregarious = medium_stress_loss
		}
	}

	option = {
		name = feast_default.1006.b
		trigger = {
			has_trait_rank = {
				trait = lifestyle_reveler
				rank = 2
			}
		}
		trait = reveler_2
		every_in_list = {
			list = table_companions
			custom = feast_default.1006.table_companions
			add_opinion = {
				modifier = feast_life_of_the_party_opinion
				target = root
				opinion = 20
			}
		}
		stress_impact = {
			reveler_2 = medium_stress_loss
			gregarious = medium_stress_loss
		}
	}
	
	option = {
		name = feast_default.1006.c
		trigger = {
			has_trait_rank = {
				trait = lifestyle_reveler
				rank = 3
			}
		}
		trait = reveler_3
		every_in_list = {
			list = table_companions
			custom = feast_default.1006.table_companions
			add_opinion = {
				modifier = feast_life_of_the_party_opinion
				target = root
				opinion = 30
			}
		}
		stress_impact = {
			reveler_3 = major_stress_loss
			gregarious = medium_stress_loss
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Two Gluttons eat immensely
# by Petter Vilberg
#####################

scripted_trigger feast_default_1007_glutton_trigger = {
	feast_default_participant_trigger = yes
	has_trait = gluttonous
}

feast_default.1007 = {
	type = character_event
	title = feast_default.1007.t
	desc = feast_default.1007.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:other_glutton
		animation = ecstasy
	}
	
	trigger = {
		NOT = { exists = local_var:had_1007 }
		has_trait = gluttonous
		scope:activity = {
			any_participant = {
				feast_default_1007_glutton_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1007
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1007_glutton_trigger = yes
				}
				weight = {
					base = 1
					interesting_feast_participant_modifier = yes
				}
				save_scope_as = other_glutton
			}
		}
	}

	option = { #What an impressive eater!
		name = feast_default.1007.a
		reverse_add_opinion = {
			target = scope:other_glutton
			modifier = respect_opinion
			opinion = 20
		}
		add_opinion = {
			target = scope:other_glutton
			modifier = respect_opinion
			opinion = 20
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
			}
		}
	}

	option = { #I'll eat them under the table!
		name = feast_default.1007.b
		add_internal_flag = dangerous
		reverse_add_opinion = {
			target = scope:other_glutton
			modifier = respect_opinion
			opinion = 40
		}
		random = {
			chance = 20
			increase_wounds_effect = {
				REASON = ate_themselves_to_death
			}
		}
		ai_chance = {
			base = 20
			ai_value_modifier = {
				ai_greed = 1
				ai_rationality = -0.5
				ai_boldness = 0.5
			}
			modifier = {
				factor = 0.2
				has_trait_rank = {
					trait = wounded
					rank > 2
				}
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#####################
# Accidentally spill secrets about yourself
# by Petter Vilberg
#####################
scripted_trigger feast_default_1008_secret_recipient_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	save_temporary_scope_as = secret_recipient_check
	root = {
		any_secret = {
			NOT = { is_known_by = scope:secret_recipient_check }
		}
	}
}

feast_default.1008 = {
	type = character_event
	title = feast_default.1008.t
	desc = feast_default.1008.desc
	theme = feast_activity
	left_portrait = {
		character = scope:secret_recipient
		animation = schadenfreude
	}
	
	trigger = {
		NOT = { exists = local_var:had_1008 }
		drinks_alcohol_trigger = yes
		scope:activity = {
			any_participant = {
				feast_default_1008_secret_recipient_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = drunkard
		}
		modifier = {
			add = -0.9
			has_trait = temperate
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1008
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = { feast_default_1008_secret_recipient_trigger = yes }
				weight = {
					base = 1
					interesting_feast_participant_modifier = yes
				}
				save_scope_as = secret_recipient
			}
		}
		random_secret = {
			limit = { NOT = { is_known_by = scope:secret_recipient } }
			save_scope_as = secret_to_reveal
		}
	}

	option = {
		name = feast_default.1008.a
		flavor = feast_default.1008.a.flavor
		scope:secret_to_reveal = {
			reveal_to = scope:secret_recipient
		}
		stress_impact = {
			contrite = medium_stress_impact_loss
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#####################
# Accidentally spill secrets about someone else
# by Petter Vilberg
#####################
scripted_trigger feast_default_1009_secret_recipient_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	save_temporary_scope_as = secret_recipient_check
	root = {
		any_known_secret = {
			NOT = { secret_owner = root }
			NOT = { is_known_by = scope:secret_recipient_check }
		}
	}
}

feast_default.1009 = {
	type = character_event
	title = feast_default.1009.t
	desc = feast_default.1009.desc
	theme = feast_activity
	left_portrait = {
		character = scope:secret_recipient
		animation = schadenfreude
	}
	lower_left_portrait = scope:secret_owner
	
	trigger = {
		NOT = { exists = local_var:had_1009 }
		drinks_alcohol_trigger = yes
		scope:activity = {
			any_participant = {
				feast_default_1009_secret_recipient_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = drunkard
		}
		modifier = {
			add = -0.9
			has_trait = temperate
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1009
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = { feast_default_1009_secret_recipient_trigger = yes }
				weight = {
					base = 1
					interesting_feast_participant_modifier = yes
				}
				save_scope_as = secret_recipient
			}
		}
		random_known_secret = {
			limit = {
				NOT = { secret_owner = root }
				NOT = { is_known_by = scope:secret_recipient }
			}
			secret_owner = {
				save_scope_as = secret_owner
			}
			save_scope_as = secret_to_reveal
		}
	}

	option = {
		name = feast_default.1009.a
		flavor = feast_default.1008.a.flavor
		scope:secret_to_reveal = {
			reveal_to = scope:secret_recipient
		}
		stress_impact = {
			contrite = minor_stress_impact_loss
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# You promise someone a little too much
# by Petter Vilberg
#####################
scripted_trigger feast_default_1010_favor_recipient_trigger = {
	feast_default_participant_trigger = yes
	is_landed = yes
	can_add_hook = {
		target = root
		type = favor_hook
	}
	OR = {
		AND = {
			exists = root.liege
			this = root.liege
		}
		AND = {
			exists = liege
			liege = root
		}
	}
}

feast_default.1010 = {
	type = character_event
	title = feast_default.1010.t
	desc = feast_default.1010.desc
	theme = feast_activity
	left_portrait = {
		character = scope:favor_recipient
		animation = happiness
	}
	
	trigger = {
		NOT = { exists = local_var:had_1010 }
		NOR = {
			has_trait = deceitful
			has_trait = shy
			has_trait = temperate
		}
		scope:activity = {
			any_participant = {
				feast_default_1010_favor_recipient_trigger = yes
			}
		}
		drinks_alcohol_trigger = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 0.5
			has_trait = gregarious
		}
		modifier = {
			add = 0.5
			has_trait = drunkard
		}
		modifier = {
			add = 0.25
			OR = {
				has_diplomacy_lifestyle_trait_trigger = yes
				has_trait = lifestyle_reveler
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1010
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1010_favor_recipient_trigger = yes
				}
				save_scope_as = favor_recipient
			}
		}
	}

	option = {
		name = feast_default.1010.a
		scope:favor_recipient = {
			add_hook = {
				target = root
				type = favor_hook
			}
		}
		stress_impact = {
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_rationality = 0.5
			}
		}
	}

	option = {
		name = feast_default.1010.b
		scope:activity = {
			every_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = { this = scope:favor_recipient }
					opinion = {
						target = scope:favor_recipient
						value > 0
					}
				}
				custom = feast_default.1010.every_participant_with_high_opinion
				add_opinion = {
					modifier = respect_opinion
					target = root
					opinion = -15
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
			ai_value_modifier = {
				ai_greed = 1
				ai_boldness = 0.5
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#####################
# You get drunk and kill someone
# by Linnéa Thimrén
#####################

scripted_trigger feast_default_1011_find_guest_trigger = {
	feast_default_participant_trigger = yes
	OR = {
		is_of_major_interest_trigger = {
			CHARACTER = root
		}
		is_of_minor_interest_trigger = {
			CHARACTER = root
		}
	}
	NOT = { is_powerful_vassal_of = root }
}

scripted_trigger feast_default_1011_disliked_guest_trigger = {
	feast_default_participant_trigger = yes
	reverse_opinion = {
		target = root
		value <= -10
	}
}

feast_default.1011 = {
	type = character_event
	title = feast_default.1011.t
	desc = feast_default.1011.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest_to_murder
		animation = pain
	}
	lower_left_portrait = scope:disliked_guest

	trigger = {
		is_ai = no
		NOR = {
			exists = local_var:had_1011
			exists = local_var:had_1012
			exists = local_var:had_1013
			exists = local_var:had_1014
		}
		scope:activity = { #Is there _someone_ at my feast?!
			any_participant = {
				feast_default_1011_disliked_guest_trigger = yes
				save_temporary_scope_as = disliked
			}
			any_participant = {
				is_alive = yes
				NOT = { this = scope:disliked }
				feast_default_1011_find_guest_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 0.1
		modifier = { #More likely of you're a drunkard or wrathful
			add = 0.4
			OR = {
				has_trait = drunkard
				has_trait = wrathful
			}
		}
		modifier = { #Much more likely of you're a drunkard AND wrathful
			add = 0.5
			has_trait = drunkard
			has_trait = wrathful
		}
		ai_value_modifier = {
			ai_compassion = -0.01 # -1 to +1
		}
		modifier = { #More likely if you have someone you dislike to blame
			add = 0.2
			scope:activity = {
				any_participant = {
					feast_default_1011_disliked_guest_trigger = yes
					OR = {
						has_relation_rival = root
						has_relation_potential_rival = root
					}
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1011
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1011_disliked_guest_trigger = yes
				}
				alternative_limit = {
					OR = {
						has_relation_rival = root
						has_relation_potential_rival = root
					}
				}
				save_scope_as = disliked_guest
			}
			random_participant = {
				limit = {
					NOT = { this = scope:disliked_guest }
					feast_default_1011_find_guest_trigger = yes
				}
				save_scope_as = guest_to_murder
			}
		}
		add_character_flag = {
			flag = murdered_someone_during_feast
			days = 100
		}
	}

	option = { #Try to convince people they deserved it
		name = feast_default.1011.a

		duel = {
			skill = diplomacy
			value = 10
			30 = {
				desc = feast_default.1011.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = feast_default.1011.a.success
					left_icon = root
					scope:guest_to_murder = {
						death = { death_reason = death_accident }
					}
				}
			}
			10 = {
				desc = feast_default.1011.a.failure
				send_interface_toast = {
					title = feast_default.1011.a.failure
					left_icon = root
					known_murder_effect = {
						VICTIM = scope:guest_to_murder
						MURDERER = root
						EXPOSER = root
					}
				}
			}
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				has_trait = honest
			}
			modifier = {
				add = 25
				OR = {
					has_trait = compassionate
					has_trait = just
				}
			}
		}
	}

	option = { #Hide the body!
		name = feast_default.1011.b
		duel = {
			skill = intrigue
			value = 10
			30 = {
				desc = feast_default.1011.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = feast_default.1011.b.success
					left_icon = root
					unknown_murder_effect = {
						VICTIM = scope:guest_to_murder
						MURDERER = root
						REASON = death_mysterious
					}
				}
			}
			10 = {
				desc = feast_default.1011.b.failure
				send_interface_toast = {
					title = feast_default.1011.b.failure
					left_icon = root
					known_murder_effect = {
						VICTIM = scope:guest_to_murder
						MURDERER = root
						EXPOSER = root
					}
				}
			}
		}

		stress_impact = {
			honest = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				intrigue >= medium_skill_rating
			}
		}
	}

	option = { #Blame another guest
		name = feast_default.1011.c
		trigger = {
			intrigue >= high_skill_rating
		}
		skill = intrigue

		known_murder_effect = {
			VICTIM = scope:guest_to_murder
			MURDERER = scope:disliked_guest
			EXPOSER = root
		}

		stress_impact = {
			honest = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}

		ai_chance = {
			base = 50
			modifier = {
				add = 100
				intrigue >= high_skill_rating
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Sneaky murder of character you dislike
# by Linnéa Thimrén
#####################
scripted_trigger feast_default_1012_guest_to_murder_trigger = {
	feast_default_participant_trigger = yes
	reverse_opinion = {
		target = root
		value <= -20
	}
	OR = {
		has_relation_rival = root
		has_relation_potential_rival = root
		any_targeting_scheme = {
			scheme_owner = { this = root }
			scheme_type = murder
		}
	}
}

feast_default.1012 = {
	type = character_event
	title = feast_default.1012.t
	desc = feast_default.1012.desc_opening
	theme = feast_activity
	left_portrait = {
		character = scope:guest_to_murder
		animation = pain
	}
	
	trigger = {
		is_ai = no
		NOR = {
			exists = local_var:had_1011
			exists = local_var:had_1012
			exists = local_var:had_1013
			exists = local_var:had_1014
		}
		OR = {
			has_lifestyle = intrigue_lifestyle
			intrigue >= high_skill_rating
			has_education_intrigue_trigger = yes
		}
		scope:activity = {
			any_participant = {
				feast_default_1012_guest_to_murder_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = {
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_1012_guest_to_murder_trigger = yes
					has_trait = drunkard
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1012
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1012_guest_to_murder_trigger = yes
				}
				save_scope_as = guest_to_murder
			}
		}
		unknown_murder_effect = {
			VICTIM = scope:guest_to_murder
			MURDERER = root
			REASON = death_mysterious
		}
	}

	option = { #Fool!
		name = feast_default.1012.a
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Murder someone for attacking friend/lover/sibling
# by Linnéa Thimrén
#####################
scripted_trigger feast_default_1013_liked_guest_trigger = {
	feast_default_participant_trigger = yes
	OR = {
		has_relation_friend = root
		has_relation_lover = root
		AND = {
			is_sibling_of = root
			reverse_opinion = {
				target = root
				value >= 10
			}
		}
	}
}

scripted_trigger feast_default_1013_murder_guest_trigger = {
	feast_default_participant_trigger = yes
	OR = {
		has_relation_rival = scope:guest_check
		has_relation_potential_rival = scope:guest_check
		opinion = {
			target = scope:guest_check
			value <= -20
		}
	}
	OR = {
		has_trait = wrathful
		ai_compassion <= low_negative_compassion
	}
}

feast_default.1013 = {
	type = character_event
	title = feast_default.1013.t
	desc = feast_default.1013.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest_to_save
		animation = fear
	}
	right_portrait = {
		character = scope:guest_to_kill
		animation = rage
	}
	
	trigger = {
		is_ai = no
		NOR = {
			exists = local_var:had_1011
			exists = local_var:had_1012
			exists = local_var:had_1013
			exists = local_var:had_1014
		}
		scope:activity = {
			any_participant = {
				feast_default_1013_liked_guest_trigger = yes
				save_temporary_scope_as = guest_check
			}
			any_participant = {
				feast_default_1013_murder_guest_trigger = yes
				NOT = { this = scope:guest_check }
			}
		}
	}

	weight_multiplier = {
		base = 0.5
	}

	immediate = {
		set_local_variable = {
			name = had_1013
			value = yes
		}
		scope:activity = {
			every_participant = {
				limit = {
					feast_default_1013_liked_guest_trigger = yes
				}
				add_to_list = guest_to_save_list
			}
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = { is_in_list = guest_to_save_list }
					OR = {
						any_relation = {
							type = rival
							is_in_list = guest_to_save_list
						}
						any_relation = {
							type = potential_rival
							is_in_list = guest_to_save_list
						}
						any_in_list = {
							list = guest_to_save_list
							reverse_opinion = {
								target = prev
								value <= -20
							}
						}
					}
					OR = {
						has_trait = wrathful
						ai_compassion <= low_negative_compassion
					}
				}
				save_scope_as = guest_to_kill
			}
			random_in_list = {
				list = guest_to_save_list
				limit = {
					feast_default_participant_trigger = yes
					OR = {
						has_relation_rival = scope:guest_to_kill
						has_relation_potential_rival = scope:guest_to_kill
						reverse_opinion = {
							target = scope:guest_to_kill
							value <= -20
						}
					}
				}
				save_scope_as = guest_to_save
			}
		}
	}

	option = { #Kill the attacker
		name = {
			text = feast_default.1013.a
		}
		name = {
			trigger = {
				OR = {
					has_trait = wrathful
					has_trait = callous
					has_trait = sadistic
					has_trait = vengeful
				}
			}
			text = feast_default.1013.a_1
		}

		scope:guest_to_save = {
			add_opinion = {
				target = root
				modifier = feast_saved_my_life_opinion
			}
			root = {
				add_hook = {
					type = favor_hook
					target = scope:guest_to_save
				}
			}
		}
		known_murder_effect = {
			VICTIM = scope:guest_to_kill
			MURDERER = root
			EXPOSER = scope:activity.activity_owner
		}
		add_character_flag = {
			flag = murdered_someone_during_feast
			days = 100
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 0.75
			}
		}
	}

	option = { #I will deflect the knife!
		name = feast_default.1013.b
		duel = {
			skill = prowess
			target = scope:guest_to_kill
			30 = {
				desc = feast_default.1013.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				send_interface_toast = {
					title = feast_default.1011.b.success
					left_icon = scope:guest_to_save
				}
			}
			15 = {
				desc = feast_default.1013.b.failure
				send_interface_toast = {
					title = feast_default.1011.b.failure
					left_icon = scope:guest_to_save
					scope:guest_to_save = {
						increase_wounds_effect = { REASON = attacked }
					}
				}
			}
			7 = {
				desc = feast_default.1013.b.big_failure
				send_interface_toast = {
					title = feast_default.1013.b.big_failure
					left_icon = scope:guest_to_save
					known_murder_effect = {
						VICTIM = scope:guest_to_save
						MURDERER = scope:guest_to_kill
						EXPOSER = scope:guest_to_kill
					}
				}
			}
		}
		scope:guest_to_kill = {
			add_secret = {
				type = secret_murder_attempt
				target = scope:guest_to_save
			}
			random_secret = {
				limit = {
					secret_type = secret_murder_attempt
					secret_target = scope:guest_to_save
				}
				expose_secret = scope:guest_to_kill
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			modifier = {
				add = 50
				prowess >= high_skill_rating
			}
			ai_value_modifier = {
				ai_boldness = 0.75
			}
		}
	}

	option = { #I do nothing
		name = feast_default.1013.c
		known_murder_effect = {
			VICTIM = scope:guest_to_save
			MURDERER = scope:guest_to_kill
			EXPOSER = scope:guest_to_kill
		}
		stress_impact = {
			brave = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				has_trait = craven
			}
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}

	option = { #Kill attacker and convince people it had to be done
		name = feast_default.1013.d
		trigger = {
			diplomacy >= high_skill_rating
		}
		skill = diplomacy
		scope:guest_to_kill = {
			death = { death_reason = death_attacked }
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Murder someone, one witness!
# by Linnéa Thimrén
#####################

scripted_trigger feast_default_1014_participant_basic_trigger = {
	feast_default_participant_trigger = yes
	NOT = { this = scope:activity.activity_owner }
}

feast_default.1014 = {
	type = character_event
	title = feast_default.1014.t
	desc = feast_default.1014.desc
	left_portrait = {
		character = scope:guest_to_murder
		animation = pain
	}
	right_portrait = {
		character = scope:witness
		animation = shock
	}
	theme = feast_activity
	
	trigger = {
		is_ai = no
		NOR = {
			exists = local_var:had_1011
			exists = local_var:had_1012
			exists = local_var:had_1013
			exists = local_var:had_1014
		}
		scope:activity = {
			any_participant = {
				feast_default_1014_participant_basic_trigger = yes
				OR = {
					has_relation_rival = root
					has_relation_potential_rival = root
					opinion = {
						target = root
						value <= -30
					}
				}
				save_temporary_scope_as = guest_check
			}
			any_participant = {
				feast_default_1014_participant_basic_trigger = yes
				NOT = { this = scope:guest_check }
			}
		}
	}

	weight_multiplier = {
		base = 0.1
		modifier = { #More likely if you're wrathful
			add = 0.5
			has_trait = wrathful
		}
		modifier = { #More likely if you already plan to murder them
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_1014_participant_basic_trigger = yes
					any_targeting_scheme = {
						scheme_type = murder
						scheme_owner = root
					}
					OR = {
						has_relation_rival = root
						has_relation_potential_rival = root
						opinion = {
							target = root
							value <= -30
						}
					}
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_1014
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_1014_participant_basic_trigger = yes
					OR = {
						has_relation_rival = root
						has_relation_potential_rival = root
						opinion = {
							target = root
							value <= -30
						}
					}
				}
				save_scope_as = guest_to_murder
			}
			random_participant = {
				limit = {
					feast_default_1014_participant_basic_trigger = yes
					NOT = { this = scope:guest_to_murder }
				}
				save_scope_as = witness
			}
		}
		unknown_murder_effect = {
			VICTIM = scope:guest_to_murder
			MURDERER = root
			REASON = death_mysterious
		}
		add_character_flag = {
			flag = murdered_someone_during_feast
			days = 100
		}
	}

	option = {
		name = {
			text = feast_default.1014.a
		}
		name = {
			trigger = { has_trait = wrathful }
			text = feast_default.1014.a_2
		}
		random_secret = {
			limit = {
				secret_type = secret_murder
				secret_target = scope:guest_to_murder
			}
			reveal_to = scope:witness
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_compassion = 0.5
			}
			opinion_modifier = {
				opinion_target = scope:witness
			}
		}
	}

	option = { #leave no witnesses!
		name = feast_default.1014.b
		trait = wrathful
		trait = sadistic
		trait = callous
		trait = diligent

		unknown_murder_effect = {
			VICTIM = scope:witness
			MURDERER = root
			REASON = death_mysterious
		}
		ai_chance = {
			base = 25
			modifier = {
				add = 50
				OR = {
					has_trait = wrathful
					has_trait = sadistic
					has_trait = callous
					has_trait = diligent
				}
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#################################
# "TARGET" TRIGGERED EVENTS
# 2000-2999
#################################

#####################
# Glutton gets annoyed waiting for food
# by Petter Vilberg
#####################
scripted_trigger feast_default_2001_annoying_glutton_trigger = {
	feast_default_participant_trigger = yes
	has_trait = gluttonous
	NOT = {
		reverse_has_opinion_modifier = {
			target = root
			modifier = annoying_glutton_at_feast_opinion
		}
	}
}

feast_default.2001 = {
	type = character_event
	title = feast_default.2001.t
	desc = feast_default.2001.desc
	theme = feast_activity
	left_portrait = {
		character = scope:glutton
		animation = anger
	}
	
	trigger = {
		NOT = { exists = local_var:had_2001 }
		NOT = { has_trait = gluttonous }
		scope:activity = {
			any_participant = {
				feast_default_2001_annoying_glutton_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:activity = {
				any_participant = {
					feast_default_2001_annoying_glutton_trigger = yes
					OR = {
						has_trait = wrathful
						has_trait = impatient
					}
					NOT = {
						reverse_has_opinion_modifier = {
							target = root
							modifier = annoying_glutton_at_feast_opinion
						}
					}
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2001
			value = yes
		}
		scope:activity = {
			activity_owner = {
				save_scope_as = host
			}
			random_participant = {
				limit = {
					feast_default_2001_annoying_glutton_trigger = yes
					OR = {
						has_trait = wrathful
						has_trait = impatient
					}
				}
				alternative_limit = {
					feast_default_2001_annoying_glutton_trigger = yes
				}
				save_scope_as = glutton
			}
		}
	}

	option = { #They are making a fool of themselves
		name = feast_default.2001.a
		ai_chance = {
			base = 90
		}
		add_character_modifier = {
			modifier = i_am_corteous_guest_modifier
			years = 5
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			gluttonous = minor_stress_impact_gain
		}
		hidden_effect = {
			add_opinion = {
				target = scope:glutton
				modifier = annoying_glutton_at_feast_opinion
			}
		}
	}

	option = { # Yeah, where's the food?!
		name = feast_default.2001.b
		stress_impact = {
			base = medium_stress_loss
			comfort_eater = minor_stress_impact_loss
			temperate = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		hidden_effect = {
			add_opinion = {
				target = scope:activity.activity_owner
				modifier = disorganized_feast_opinion
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 200
				has_trait = gluttonous
			}
			modifier = {
				add = 100
				stress >= high_medium_stress
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Someone sends you a secret love letter
# by Petter Vilberg
#####################
scripted_trigger feast_default_2002_letter_author_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	#mgr_can_seduce = yes
	OR = {
		any_scheme = {
			OR = {
				scheme_type = seduce
				scheme_type = courting
			}
		}
		has_relation_crush = root
		has_relation_potential_lover = root
	}
}

scripted_trigger feast_default_2002_potentially_interested_trigger = {
	is_adult = yes
	is_ai = yes
	this = root
	possibly_interested_in_character_trigger = {
		CHARACTER = root
	}
}

feast_default.2002 = {
	type = character_event
	title = feast_default.2002.t
	desc = feast_default.2002.desc
	theme = feast_activity
	left_portrait = {
		character = scope:crush_1
		animation = flirtation_left
	}
	right_portrait = {
		character = scope:crush_2
		animation = admiration
	}
	lower_center_portrait = scope:crush_3
	
	trigger = {
		is_ai = no
		NOT = { exists = local_var:had_2002 }
		scope:activity = {
			any_participant = {
				feast_default_2002_letter_author_trigger = yes
				save_temporary_scope_as = crush_check
			}
			any_participant = {
				count >= 2
				NOT = { this = scope:crush_check }
				feast_default_2002_potentially_interested_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 2
			has_focus_or_focus_trait_trigger = { FOCUS = intrigue_temptation_focus }
		}
		modifier = {
			add = 1
			scope:activity = {
				any_participant = {
					feast_default_2002_letter_author_trigger = yes
					has_focus_or_focus_trait_trigger = { FOCUS = intrigue_temptation_focus }
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2002
			value = yes
		}
		hidden_effect = {
			scope:activity = {
				random_participant = {
					limit = {
						feast_default_2002_letter_author_trigger = yes
					}
					save_scope_as = letterAuthor
					love_letter_calculation_effect = yes
					add_to_list = letter_candidates
				}
				random_participant = {
					limit = {
						feast_default_2002_potentially_interested_trigger = yes
						NOT = { is_in_list = letter_candidates }
					}
					add_to_list = letter_candidates
				}
				random_participant = {
					limit = {
						feast_default_2002_potentially_interested_trigger = yes
						NOT = { is_in_list = letter_candidates }
					}
					add_to_list = letter_candidates
				}
				every_in_list = {
					list = letter_candidates
					random_list = {
						1 = {
							trigger = { NOT = { exists = scope:crush_1 } }
							save_scope_as = crush_1
						}
						1 = {
							trigger = { NOT = { exists = scope:crush_2 } }
							save_scope_as = crush_2
						}
						1 = {
							trigger = { NOT = { exists = scope:crush_3 } }
							save_scope_as = crush_3
						}
					}
				}
			}
			save_scope_as = letterRecipient # Saved for letter effects
		}
	}

	option = { #It must have been crush_1!
		name = feast_default.2002.a
		reverse_add_opinion = {
			target = scope:crush_1
			modifier = offered_attention_at_feast_opinion
		}
		custom_tooltip = feast_default.2002.potential_lover_tt
		hidden_effect = {
			add_opinion = {
				target = scope:crush_1
				modifier = wrote_love_letter_at_feast_opinion
			}
			if = {
				limit = { scope:crush_1 = scope:letterAuthor }
				progress_towards_lover_effect = {
					CHARACTER = scope:crush_1
					OPINION = no
				}
			}
		}
	}

	option = { #Maybe it was crush_2?
		name = feast_default.2002.b
		name = feast_default.2002.a
		reverse_add_opinion = {
			target = scope:crush_2
			modifier = offered_attention_at_feast_opinion
		}
		custom_tooltip = feast_default.2002.potential_lover_tt
		hidden_effect = {
			add_opinion = {
				target = scope:crush_2
				modifier = wrote_love_letter_at_feast_opinion
			}
			if = {
				limit = { scope:crush_2 = scope:letterAuthor }
				progress_towards_lover_effect = {
					CHARACTER = scope:crush_2
					OPINION = no
				}
			}
		}
	}
	
	option = { #Definitely crush_3
		name = feast_default.2002.c
		name = feast_default.2002.a
		reverse_add_opinion = {
			target = scope:crush_3
			modifier = offered_attention_at_feast_opinion
		}
		custom_tooltip = feast_default.2002.potential_lover_tt
		hidden_effect = {
			add_opinion = {
				target = scope:crush_3
				modifier = wrote_love_letter_at_feast_opinion
			}
			if = {
				limit = { scope:crush_3 = scope:letterAuthor }
				progress_towards_lover_effect = {
					CHARACTER = scope:crush_3
					OPINION = no
				}
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# You really enjoy the company of someone you have a lot in common with
# by Petter Vilberg
#####################
scripted_trigger feast_default_2003_potential_friend_trigger = {
	feast_default_participant_trigger = yes
	NOT = {
		is_close_family_trigger = {
			CHARACTER = root
		}
	}
	number_of_traits_in_common = {
		target = root
		value >= 1
	}
	NOT = { has_relation_friend = root }
}

feast_default.2003 = {
	type = character_event
	title = feast_default.2003.t
	desc = feast_default.2003.desc
	theme = feast_activity
	left_portrait = {
		character = scope:other_guest
		animation = happiness
	}
	
	trigger = {
		NOT = { exists = local_var:had_2003 }
		scope:activity = {
			any_participant = {
				feast_default_2003_potential_friend_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		#Likelihood increases the more traits you have in common
		modifier = {
			add = 0.3
			scope:activity = {
				any_participant = {
					feast_default_2003_potential_friend_trigger = yes
					number_of_traits_in_common = {
						target = root
						value >= 2
					}
				}
			}
		}
		modifier = {
			add = 0.3
			scope:activity = {
				any_participant = {
					feast_default_2003_potential_friend_trigger = yes
					number_of_traits_in_common = {
						target = root
						value >= 3
					}
				}
			}
		}
		modifier = {
			add = 0.4
			scope:activity = {
				any_participant = {
					feast_default_2003_potential_friend_trigger = yes
					number_of_traits_in_common = {
						target = root
						value >= 4
					}
				}
			}
		}
		modifier = {
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_2003_potential_friend_trigger = yes
					is_of_minor_interest_to_root_trigger = yes
				}
			}
		}
		modifier = {
			add = 1
			scope:activity = {
				any_participant = {
					feast_default_2003_potential_friend_trigger = yes
					is_of_major_interest_to_root_trigger = yes
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2003
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2003_potential_friend_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 2
						number_of_traits_in_common = {
							target = root
							value >= 2
						}
					}
					modifier = {
						add = 2
						number_of_traits_in_common = {
							target = root
							value >= 3
						}
					}
					modifier = {
						add = 2
						number_of_traits_in_common = {
							target = root
							value >= 4
						}
					}
					modifier = {
						add = 5
						has_relation_potential_friend = root
					}
					modifier = {
						add = 10
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 20
						is_of_major_interest_to_root_trigger = yes
					}
				}
				save_scope_as = other_guest
			}
		}
	}

	option = {
		name = feast_default.2003.a
		reverse_add_opinion = {
			target = scope:other_guest
			modifier = feast_had_good_time_together_opinion
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:other_guest
			OPINION = no
		}
		hidden_effect = {
			add_opinion = {
				target = scope:other_guest
				modifier = feast_had_good_time_together_opinion
			}
		}
	}	

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Someone throws up on you
# by Petter Vilberg
#####################
scripted_trigger feast_default_2005_drunk_trigger = {
	feast_default_participant_trigger = yes
	NOT = { has_trait = temperate }
}

feast_default.2005 = {
	type = character_event
	title = feast_default.2005.t
	desc = feast_default.2005.desc
	theme = feast_activity
	left_portrait = {
		character = scope:drunk
		animation = pain
	}
	
	trigger = {
		NOT = { exists = local_var:had_2005 }
		scope:activity = {
			any_participant = {
				feast_default_2005_drunk_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2005
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2005_drunk_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 30
						has_trait = drunkard
					}
					modifier = {
						add = 100
						root = {
							has_relation_oaf = prev
						}
					}
					modifier = {
						add = 40
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = {
						add = 20
						is_of_minor_interest_to_root_trigger = yes
					}
					modifier = { # Reduce the chance of it being someone you might be forced to respect
						factor = 0.2
						highest_held_title_tier > root.highest_held_title_tier
					}
				}
				save_scope_as = drunk
			}
		}
		hidden_effect = {
			set_as_oaf_effect = {
				CHARACTER = scope:drunk
			}
		}
	}

	option = { #What shameful behavior!
		name = feast_default.2005.a
		if = {
			limit = { NOT = { has_trait = arbitrary } }
			stress_impact = {
				drunkard = minor_stress_impact_gain
				humble = minor_stress_impact_gain
				craven = minor_stress_impact_gain
				shy = minor_stress_impact_gain
				forgiving = medium_stress_impact_gain
				reveler_1 = medium_stress_gain
				reveler_2 = medium_stress_gain
				reveler_3 = medium_stress_gain
			}
		}
		add_character_modifier = {
			modifier = feast_higher_standards_modifier
			years = 5
		}
		scope:drunk = {
			add_prestige = medium_prestige_loss
			add_opinion = {
				target = root
				opinion = -10
				modifier = angry_opinion
			}
		}
		hidden_effect = {
			add_opinion = {
				target = scope:drunk
				modifier = feast_threw_up_on_me_opinion
			}
		}
	}

	option = { #What's a little vomit among friends
		name = feast_default.2005.b
		if = {
			limit = { NOT = { has_trait = arbitrary } }
			stress_impact = {
				base = minor_stress_impact_gain
				temperate = medium_stress_impact_gain
				diligent = minor_stress_impact_gain
				vengeful = medium_stress_impact_gain
				arrogant = minor_stress_impact_gain
				gregarious = minor_stress_impact_gain
			}
		}
		add_prestige = minor_prestige_loss
		scope:drunk = {
			add_opinion = {
				target = root
				modifier = kindness_opinion
				opinion = 30
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_compassion = 0.25
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Someone has a befriend/seduce scheme against you
# by Linnéa Thimrén
#####################

scripted_trigger feast_default_2006_trigger = {
	feast_default_participant_trigger = yes
	NOT = { has_trait = gregarious }
	OR = {
		any_scheme = {
			scheme_type = befriend
			scheme_target = {
				this = root
			}
		}
		any_scheme = {
			scheme_type = seduce
			scheme_target = {
				this = root
			}
		}
	}
}

feast_default.2006 = {
	type = character_event
	title = feast_default.2006.t
	desc = feast_default.2006.desc
	theme = feast_activity
	left_portrait = {
		character = scope:befriending_guest
		animation = personality_compassionate
	}

	trigger = {
		NOT = { exists = local_var:had_2006 }
		scope:activity = {
			any_participant = {
				feast_default_2006_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2006
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2006_trigger = yes
				}
				save_scope_as = befriending_guest
			}
		}
	}

	option = { #Humor them
		name = feast_default.2006.a
		trigger = {
			scope:befriending_guest = {
				any_scheme = {
					scheme_type = befriend
				}
			}
		}
		add_opinion = {
			modifier = friendly_interaction
			target = scope:befriending_guest
		}
		scope:befriending_guest = {
			add_opinion = {
				modifier = friendly_interaction
				target = root
			}
			random_scheme = {
				limit = {
					scheme_type = befriend
					scheme_target = {
						this = root
					}
				}
				hidden_effect = { add_scheme_progress = scheme_progress_gain }
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 40
				OR = {
					has_trait = gregarious
					has_trait = compassionate
				}
			}
		}
	}

	option = { #Humor them
		name = feast_default.2006.b
		trigger = {
			scope:befriending_guest = {
				any_scheme = {
					scheme_type = seduce
				}
			}
		}
		scope:befriending_guest = {
			random_scheme = {
				limit = {
					scheme_type = seduce
					scheme_target = {
						this = root
					}
				}
				hidden_effect = { add_scheme_progress = scheme_progress_gain }
			}
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 40
				OR = {
					has_trait = gregarious
					has_trait = compassionate
					has_trait = lustful
				}
			}
		}
	}

	option = { #Discourage them
		name = feast_default.2006.c
		trigger = {
			OR = {
				diplomacy >= high_skill_rating
			}
		}
		skill = diplomacy

		add_prestige = medium_prestige_gain
		scope:befriending_guest = {
			add_opinion = {
				modifier = humiliated_opinion
				target = root
				opinion = -10
			}
		}
		stress_impact = {
			reclusive = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 40
				has_trait = arrogant
			}
		}
	}

	option = { #Discourage them
		name = feast_default.2006.d
		add_prestige = minor_prestige_gain
		scope:befriending_guest = {
			add_opinion = {
				modifier = rude_opinion
				target = root
			}
		}
		stress_impact = {
			reclusive = medium_stress_impact_loss
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 40
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = reclusive
				}
			}
			modifier = {
				add = 75
				has_trait = celibate
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Two ai lovers are exposed
# by Linnéa Thimrén
#####################

scripted_trigger feast_default_2007_lover_basic_trigger = {
	feast_default_participant_trigger = yes
	mgr_can_seduce = yes
	NOT = { is_spouse_of = root	}
	NOR = {
		has_trait = celibate
		has_trait = chaste
	}
	might_cheat_on_every_partner_trigger = yes
}


feast_default.2007 = {
	type = character_event
	title = feast_default.2007.t
	desc = feast_default.2007.desc
	theme = feast_activity
	left_portrait = {
		character = scope:lover_guest_1
		animation = shame
	}
	right_portrait = {
		character = scope:lover_guest_2
		animation = shock
	}
	theme = seduction

	trigger = {
		is_ai = no # Player only, otherwise they'll just be sending secret discovery notifications out of nowhere
		NOT = { exists = scope:activity.var:had_2007 }
		scope:activity = {
			any_participant = {
				feast_default_2007_lover_basic_trigger = yes
				save_temporary_scope_as = lover_check
				scope:activity = {
					any_participant = {
						NOT = { this = scope:lover_check }
						feast_default_2007_lover_basic_trigger = yes
						OR = { #Can they become lovers, or are they lovers already?
							AND = {
								can_set_relation_lover_trigger = { CHARACTER = scope:lover_check }
								NOT = { any_close_family_member = { this = scope:lover_check } } #No incest if it's not already set as a secret!
							}
							any_secret = {
								secret_type = secret_lover
								secret_target = scope:lover_check
							}
						}
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = {
			add = 0.75
			scope:activity = {
				any_participant = {
					feast_default_2007_lover_basic_trigger = yes
					any_secret = {
						secret_type = secret_lover
						secret_target = {
							feast_default_2007_lover_basic_trigger = yes
							save_temporary_scope_as = lover_check
							scope:activity = { any_participant = { this = scope:lover_check } }
						}
					}
				}
			}
		}
	}

	immediate = {
		scope:activity = {
			set_variable = {
				name = had_2007
				value = yes
			}
			random_participant = {
				limit = {
					feast_default_2007_lover_basic_trigger = yes
					save_temporary_scope_as = lover_check
					scope:activity = {
						any_participant = {
							NOT = { this = scope:lover_check }
							feast_default_2007_lover_basic_trigger = yes
							OR = { #Can they become lovers, or are they lovers already?
								AND = {
									can_set_relation_lover_trigger = { CHARACTER = scope:lover_check }
									NOT = { any_close_family_member = { this = scope:lover_check } } #No incest if it's not already set as a secret!
								}
								any_secret = {
									secret_type = secret_lover
									secret_target = scope:lover_check
								}
							}
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 2
						has_trait = lustful
					}
					modifier = {
						add = 10
						any_secret = {
							secret_type = secret_lover
							secret_target = {
								feast_default_2007_lover_basic_trigger = yes
								save_temporary_scope_as = lover_check
								scope:activity = { any_participant = { this = scope:lover_check } }
							}
						}
					}
				}
				save_scope_as = lover_guest_1
			}
			random_participant = {
				limit = {
					NOT = { this = scope:lover_guest_1 }
					feast_default_2007_lover_basic_trigger = yes
					any_secret = {
						secret_type = secret_lover
						secret_target = scope:lover_guest_1
					}
				}
				alternative_limit = {
					NOT = { this = scope:lover_guest_1 }
					feast_default_2007_lover_basic_trigger = yes
					can_set_relation_lover_trigger = { CHARACTER = scope:lover_guest_1 }
					NOT = { any_close_family_member = { this = scope:lover_check } } #No incest if it's not already set as a secret!
				}
				weight = {
					base = 1
					modifier = {
						add = 2
						has_trait = lustful
					}
				}
				save_scope_as = lover_guest_2

				#Set their secret and expose it
				hidden_effect = {
					if = {
						limit = {
							can_set_relation_lover_trigger = { CHARACTER = scope:lover_guest_1 }
						}
						set_relation_lover = scope:lover_guest_1
					}
				}
				random_secret = {
					limit = {
						secret_type = secret_lover
						secret_target = scope:lover_guest_1
					}
					save_scope_as = lover_secret

					expose_secret = root
				}
			}
		}
	}

	option = {
		name = feast_default.2007.a_chaste
		trigger = {
			has_trait = chaste
		}
		trait = chaste
		stress_impact = {
			chaste = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = feast_default.2007.a_lustful
		trigger = {
			has_trait = lustful
		}
		trait = lustful
		stress_impact = {
			lustful = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = feast_default.2007.a_sadistic
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		stress_impact = {
			sadistic = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = feast_default.2007.a_compassionate
		trigger = {
			has_trait = compassionate
		}
		trait = compassionate
		stress_impact = {
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = feast_default.2007.b
		trigger = { always = no }
		fallback = yes
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Lustful Homosexual character gets inappropriate with a servant
# by Petter Vilberg
#####################
scripted_trigger feast_default_2008_homosexual_trigger = {
	feast_default_participant_trigger = yes
	has_trait = lustful
	is_adult = yes
	any_secret = {
		secret_type = secret_homosexual
		NOT = { is_known_by = root }
		is_blackmailable_secret_trigger = {
			PARTICIPANT = prev
			BLACKMAILER = root
		}
	}
	root = {
		can_add_hook = {
			type = favor_hook
			target = prev
		}
	}
	might_cheat_on_every_partner_trigger = yes
}


feast_default.2008 = {
	type = character_event
	title = feast_default.2008.t
	desc = feast_default.2008.desc
	theme = feast_activity
	left_portrait = {
		character = scope:homosexual_character
		animation = shame
	}
	
	trigger = {
		NOT = { exists = local_var:had_2008 }
		scope:activity = {
			any_participant = {
				feast_default_2008_homosexual_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2008
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2008_homosexual_trigger = yes
				}
				save_scope_as = homosexual_character
				romance_target_gender_effect = { SCOPE_NAME = romance_target }
				random_secret = {
					limit = {
						secret_type = secret_homosexual
						NOT = { is_known_by = root }
					}
					save_scope_as = secret
					reveal_to_without_events_effect = {
						CHARACTER = root
					}
				}
			}
		}
	}

	option = { #What a shameful display!
		name = feast_default.2008.a
		scope:secret = {
			expose_secret = root
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_boldness = 1
			}
		}
	}

	option = { #Your secret is safe with me
		name = feast_default.2008.b
		blackmail_target_with_secret_effect = {
			SECRET = scope:secret
			TARGET = scope:homosexual_character
		}
		stress_impact = {
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_rationality = 1
			}
		}
	}
	
	option = { #You're doing WHAT without my approval???
		name = feast_default.2008.c
		trigger = {
			has_trait = vengeful
			this = root
		}
		trait = vengeful
		add_dread = medium_dread_gain
		add_character_modifier = {
			modifier = feast_loyal_servantry_modifier
			years = 5
		}
		scope:secret = {
			expose_secret = root	
		}
		hidden_effect = {
			add_opinion = {
				target = scope:homosexual_character
				modifier = respect_opinion
				opinion = -20
			}
		}
		ai_chance = {
			base = 500
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { #You too?
		name = feast_default.2008.d
		trigger = {
			OR = {
				any_secret = { secret_type = secret_homosexual }
				has_sexuality = homosexual
			}
		}
		add_internal_flag = special
		custom_tooltip = feast_default.2008.d.unlock_text
		if = {
			limit = {
				any_secret = {
					secret_type = secret_homosexual
					NOT = { is_known_by = scope:homosexual_character }
				}
			}
			random_secret = {
				limit = { secret_type = secret_homosexual }
				reveal_to = scope:homosexual_character
			}
		}
		reverse_add_opinion = {
			target = scope:homosexual_character
			modifier = feast_common_burden_opinion
		}
		hidden_effect = {
			add_opinion = {
				target = scope:homosexual_character
				modifier = feast_common_burden_opinion
			}
		}
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:homosexual_character }
			}
			if = {
				limit = {
					has_relation_potential_friend = scope:homosexual_character
					can_set_relation_friend_trigger = { CHARACTER = scope:homosexual_character }
				}
				set_relation_friend = scope:homosexual_character
			}
			else_if = {
				limit = {
					has_relation_potential_lover = scope:homosexual_character
					can_set_relation_lover_trigger = { CHARACTER = scope:homosexual_character }
				}
				set_relation_lover = scope:homosexual_character
			}
			else = {
				progress_towards_friend_effect = {
					CHARACTER = scope:homosexual_character
					OPINION = no
				}
			}
		}
		stress_impact = {
			base = medium_stress_loss
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
				ai_compassion = 0.5
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#####################
# Learn someone's secret
# by Petter Vilberg
#####################
scripted_trigger feast_default_2009_secret_holder_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	any_secret = {
		NOT = { is_known_by = root }
	}
	NOT = { has_trait = temperate }
	drinks_alcohol_trigger = yes
}

feast_default.2009 = {
	type = character_event
	title = feast_default.2009.t
	desc = feast_default.2009.desc
	theme = feast_activity
	left_portrait = {
		character = scope:secret_holder
		animation = worry
	}
	
	trigger = {
		NOT = { exists = local_var:had_2009 }
		scope:activity = {
			any_participant = {
				feast_default_2009_secret_holder_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2009
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = { feast_default_2009_secret_holder_trigger = yes }
				save_scope_as = secret_holder
				random_secret = {
					limit = { NOT = { is_known_by = root } }
					save_scope_as = secret_to_reveal
				}
			}
		}
	}

	option = {
		name = feast_default.2009.a
		scope:secret_to_reveal = {
			reveal_to = root
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Learn someone else's secret
# by Petter Vilberg
#####################
scripted_trigger feast_default_2010_secret_knower_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	any_known_secret = {
		NOT = { secret_owner = prev }
		NOT = { is_known_by = root }
	}
	drinks_alcohol_trigger = yes
}

feast_default.2010 = {
	type = character_event
	title = feast_default.2009.t
	desc = feast_default.2009.desc
	theme = feast_activity
	left_portrait = {
		character = scope:secret_holder
		animation = worry
	}
	right_portrait = {
		character = scope:secret_knower
		animation = scheme
	}
	
	trigger = {
		NOT = { exists = local_var:had_2010 }
		scope:activity = {
			any_participant = {
				feast_default_2010_secret_knower_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2010
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = { feast_default_2010_secret_knower_trigger = yes }
				save_scope_as = secret_knower
				random_known_secret = {
					limit = {
						NOT = { is_known_by = root }
						NOT = { secret_owner = prev }
					}
					secret_owner = {
						save_scope_as = secret_holder
					}
					save_scope_as = secret_to_reveal
				}
			}
		}
	}

	option = {
		name = feast_default.2009.a
		scope:secret_to_reveal = {
			reveal_to = root
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Someone makes grand promises to you
# by Petter Vilberg
#####################
scripted_trigger feast_default_2011_favor_character_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	NOT = { has_trait = temperate }
	NOT = { has_trait = shy }
	NOT = { has_trait = deceitful }
	root = {
		can_add_hook = {
			target = prev
			type = favor_hook
		}
	}
	opinion = {
		target = root
		value > 15
	}
	drinks_alcohol_trigger = yes
}

feast_default.2011 = {
	type = character_event
	title = feast_default.2011.t
	desc = feast_default.2011.desc
	theme = feast_activity
	left_portrait = {
		character = scope:favor_character
		animation = personality_bold
	}
	
	trigger = {
		NOT = { exists = local_var:had_2011 }
		scope:activity = {
			any_participant = {
				feast_default_2011_favor_character_trigger = yes
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = {
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_2011_favor_character_trigger = yes
					has_trait = gregarious
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2011
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2011_favor_character_trigger = yes
				}
				weight = {
					base = 1
					interesting_feast_participant_modifier = yes
					modifier = {
						add = 3
						has_trait = gregarious
					}
				}
				save_scope_as = favor_character
			}
		}
	}

	option = { #That's a generous promise
		name = feast_default.2011.a
		add_hook = {
			type = favor_hook
			target = scope:favor_character
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_greed = 2
			}
		}
	}

	option = { # Let's ignore it
		name = feast_default.2011.b
		scope:favor_character = {
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 30
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Someone is murdered, you're a witness!
# by Linnéa Thimrén
#####################

scripted_trigger feast_default_2012_victim_trigger = {
	feast_default_participant_trigger = yes
	save_temporary_scope_as = murdered_guest
	scope:activity = {
		any_participant = {
			feast_default_2012_murderer_trigger = yes
		}
	}
}

scripted_trigger feast_default_2012_murderer_trigger = {
	feast_default_participant_trigger = yes
	NOT = { this = scope:murdered_guest }
	opinion = {
		target = scope:murdered_guest
		value <= -30
	}
	OR = {
		ai_vengefulness >= high_positive_ai_value
		has_trait = wrathful
	}
}

feast_default.2012 = {
	type = character_event
	title = feast_default.2012.t
	desc = feast_default.2012.desc
	left_portrait = {
		character = scope:murderer
		animation = anger
	}
	right_portrait = {
		character = scope:murdered_guest
		animation = pain
	}
	theme = feast_activity
	
	trigger = {
		NOT = { exists = local_var:had_2012 }
		is_ai = no
		scope:activity = {
			any_participant = {
				feast_default_2012_victim_trigger = yes
				save_temporary_scope_as = murdered_guest
			}
			any_participant = {
				feast_default_2012_murderer_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_2012
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_2012_victim_trigger = yes
				}
				save_scope_as = murdered_guest
			}
			random_participant = {
				limit = {
					feast_default_2012_murderer_trigger = yes
				}
				weight = {
					base = 1
					modifier = {
						add = 5
						any_scheme = {
							scheme_type = murder
							scheme_target = scope:murdered_guest
						}
					}
					modifier = {
						add = 5
						has_relation_rival = scope:murdered_guest
					}
				}
				save_scope_as = murderer
			}
		}

		unknown_murder_effect = {
			VICTIM = scope:murdered_guest
			MURDERER = scope:murderer
			REASON = death_mysterious
		}
		scope:murderer = {
			random_secret = {
				limit = {
					secret_type = secret_murder
					secret_target = scope:murdered_guest
				}
				reveal_to = root
				save_scope_as = secret
			}
		}
	}

	option = {
		name = feast_default.2012.a
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
	}

	option = { #I will tell everyone!
		name = feast_default.2012.b
		scope:secret = {
			expose_secret = root	
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			contrite = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_trait = honest
					has_trait = just
				}
			}
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}
	}

	option = {
		name = feast_default.2012.c
		trigger = {
			scope:murderer = { short_term_gold >= root.minor_gold_value }
		}
		scope:murderer = {
			pay_short_term_gold = {
				target = root
				gold = root.minor_gold_value
			}
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 0.75
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#################################
# RELATION EVENTS
# 3000-3999
#################################

#####################
# A good time with a Friend
# by Petter Vilberg
#####################
feast_default.3001 = {
	type = character_event
	title = feast_default.3001.t
	desc = feast_default.3001.desc
	theme = feast_activity
	left_portrait = {
		character = scope:friend
		animation = happiness
	}
	
	trigger = {
		NOT = { has_character_flag = had_feast_default_3001 }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				has_relation_friend = root
			}
		}	
	}

	immediate = {
		add_character_flag = {
			flag = had_feast_default_3001
			years = 7
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_relation_friend = root
				}
				save_scope_as = friend
			}
		}
	}

	option = {
		name = feast_default.3001.a
		add_stress = major_stress_loss
		add_character_modifier = {
			modifier = feast_reinvigorated_by_friend_modifier
			years = 5
		}
		reverse_add_opinion = {
			target = scope:friend
			modifier = friend_had_good_time_at_feast_opinion	
		}
		hidden_effect = {
			add_opinion = {
				target = scope:friend
				modifier = friend_had_good_time_at_feast_opinion
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# A chance to exchange secret kisses with a Lover
# by Petter Vilberg
#####################
scripted_trigger feast_default_3002_lover_trigger = {
	feast_default_participant_trigger = yes
	lover_is_secret_trigger = {
		CHARACTER = root
	}
}

feast_default.3002 = {
	type = character_event
	title = feast_default.3002.t
	desc = feast_default.3002.desc
	theme = feast_activity
	left_portrait = {
		character = scope:lover
		animation = flirtation
	}
	
	trigger = {
		NOT = { has_character_flag = had_feast_default.3002_event }
		scope:activity = {
			any_participant = {
				feast_default_3002_lover_trigger = yes
			}
		}	
	}

	immediate = {
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_3002_lover_trigger = yes
				}
				save_scope_as = lover
			}
		}
		add_character_flag = {
			flag = had_feast_default.3002_event
			years = 10
		}
	}

	option = { #This is our chance!
		name = feast_default.3002.a
		hidden_effect = {
			add_opinion = {
				target = scope:lover
				modifier = lover_feast_secret_dalliance_opinion
			}
		}
		add_stress = major_stress_loss
		add_character_modifier = {
			modifier = feast_practiced_secrecy_modifier
			years = 10
		}
		reverse_add_opinion = {
			target = scope:lover
			modifier = lover_feast_secret_dalliance_opinion	
		}
		if = { #There is a chance of the activity owner discovering the secret
			limit = {
				scope:activity.activity_owner = {
					is_ai = yes
					NOT = { this = root }
					NOT = { this = scope:lover }
				}
			}
			custom_tooltip = feast_default.3002.discovery_tt
			random = {
				chance = 5
				random_secret = {
					limit = {
						secret_type = secret_lover
						secret_target = scope:lover
					}
					reveal_to = scope:activity.activity_owner
				}
			}
		}
		stress_impact = {
			chaste = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #No, we might be discovered!
		name = feast_default.3002.b
		add_character_modifier = {
			modifier = feast_showed_great_restraint_modifier
			years = 10
		}
		reverse_add_opinion = {
			target = scope:lover
			modifier = feast_rejected_dalliance_opinion
		}
		stress_impact = {
			lustful = major_stress_impact_gain
		}
		ai_chance = {
			base = 20
			modifier = {
				add = 100
				has_trait = temperate
			}
			modifier = {
				factor = 0
				has_trait = lustful
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# An altercation with a Rival
# by Petter Vilberg
#####################
scripted_trigger feast_default_3003_rival_trigger = {	
	feast_default_participant_trigger = yes
	has_relation_rival = root
}

feast_default.3003 = {
	type = character_event
	title = feast_default.3003.t
	desc = feast_default.3003.desc
	theme = feast_activity
	left_portrait = {
		character = scope:rival
		animation = anger
	}
	
	trigger = {
		NOT = { has_character_flag = had_feast_default.3003_event }
		scope:activity = {
			any_participant = {
				feast_default_3003_rival_trigger = yes
			}
		}	
	}

	immediate = {
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_3003_rival_trigger = yes
				}
				save_scope_as = rival
			}
		}
		add_character_flag = {
			flag = had_feast_default.3003_event
			years = 10
		}
	}

	option = {
		name = feast_default.3003.a
		add_character_modifier = {
			modifier = feast_bad_form_with_rival_modifier
			years = 5
		}
		reverse_add_opinion = {
			target = scope:rival
			modifier = rival_feast_altercation_opinion	
		}
		hidden_effect = {
			add_opinion = {
				target = scope:rival
				modifier = rival_feast_altercation_opinion
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Insult your rival
# by Linnéa Thimrén
#####################
feast_default.3004 = {
	type = character_event
	title = feast_default.3004.t
	desc = feast_default.3004.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:rival_guest
		animation = anger
	}

	trigger = {
		NOT = { exists = local_var:had_3004 }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				has_relation_rival = root
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3004
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_relation_rival = root
				}
				save_scope_as = rival_guest
			}
		}
	}

	option = { #Be reasonable and tell them to calm down
		name = feast_default.3004.a
		add_prestige = minor_prestige_gain
		scope:rival_guest = {
			add_prestige = medium_prestige_loss
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_honor = 0.5
				ai_compassion = 0.5
				ai_rationality = 0.25
			}
		}
	}

	option = { #Let's get this insult-battle going!
		name = feast_default.3004.b
		trait = wrathful
		duel = {
			skill = prowess
			target = scope:rival_guest
			12 = {
				desc = feast_default.3004.b.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				scope:rival_guest = { increase_wounds_effect = { REASON = fight } }
			}
			8 = {
				desc = feast_default.3004.b.failure
				increase_wounds_effect = { REASON = fight }
			}
		}
		add_character_modifier = {
			modifier = feast_had_good_fight_modifier
			years = 5
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			content = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
			ai_value_modifier = {
				ai_vengefulness = 0.75
				ai_energy = 0.75
				ai_boldness = 0.5
				ai_compassion = -0.25
			}
		}
	}

	option = { #Please leave my party
		name = feast_default.3004.c
		flavor = feast_default.3004.c.tt
		trigger = {
			OR = {
				has_trait = gregarious
				probably_intelligent_trigger = yes
			}
		}
		trait = gregarious
		add_prestige = medium_prestige_gain
		scope:rival_guest = {
			add_prestige = medium_prestige_loss
			add_opinion = {
				modifier = feast_threw_me_out_opinion
				target = root
			}
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			craven = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.75
				ai_honor = 0.25
				ai_rationality = 0.25
				ai_energy = 0.25
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Rival duel!
# by Linnéa Thimrén
#####################
feast_default.3005 = {
	type = character_event
	title = feast_default.3005.t
	desc = {
		desc = feast_default.3005.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = won_fight
				}
				desc = feast_default.3005.desc_won
			}
			desc = feast_default.3005.desc_lost
		}
	}
	theme = feast_activity
	left_portrait = {
		character = root
		animation = anger
	}
	
	trigger = {
		NOT = { exists = local_var:had_3005 }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				has_relation_rival = root
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = { #Less likely if they are wounded
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_participant_trigger = yes
					has_relation_rival = root
					has_trait_rank = {
						trait = wounded
						rank <= 2
					}
				}
			}
		}
		modifier = {#More likely if they are wrathful
			add = 0.3
			scope:activity = {
				any_participant = {
					feast_default_participant_trigger = yes
					has_relation_rival = root
					has_trait = wrathful
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3005
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_relation_rival = root
				}
				save_scope_as = rival_to_duel
			}
		}
		hidden_effect = {
			random_list = {
				60 = {
					modifier = {
						add = 20
						martial > scope:rival_to_duel.martial
					}
					modifier = {
						add = 5
						scope:rival_to_duel = {
							has_trait = drunkard
						}
					}
					modifier = {
						add = -5
						has_trait = drunkard
					}
					modifier = {
						add = 10
						scope:rival_to_duel = {
							has_trait_rank = {
								trait = wounded
								rank >= 2
							}
						}
					}
					modifier = {
						add = -10
						has_trait_rank = {
							trait = wounded
							rank >= 2
						}
					}
					add_character_flag = {
						flag = won_fight
						days = 50
					}
				}
				40 = {	}
			}
		}
		if = {
			limit = {
				has_character_flag = won_fight
			}
			add_prestige = medium_prestige_gain
		}
		if = {
			limit = {
				NOT = { has_character_flag = won_fight }
			}
			scope:rival_to_duel = {
				add_prestige = medium_prestige_gain
			}
		}
	}

	option = { #You won - injure them
		name = feast_default.3005.a
		trigger = {
			has_character_flag = won_fight
		}
		scope:rival_to_duel = {
			increase_wounds_effect = { REASON = fight }
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			sadistic = medium_stress_impact_loss
			vengeful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 20
				has_trait = sadistic
			}
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}

	option = { #You lost - they injure you
		name = feast_default.3005.b
		trigger = {
			NOT = { has_character_flag = won_fight }
		}
		increase_wounds_effect = { REASON = fight }
		random = {
			chance = 50
			scope:rival_to_duel = {
				increase_wounds_effect = { REASON = fight }
			}
		}
		stress_impact = {
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 20
				has_trait = stubborn
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { #You lost - give up
		name = feast_default.3005.c
		trigger = {
			NOT = { has_character_flag = won_fight }
		}
		add_prestige = minor_prestige_loss
		stress_impact = {
			arrogant = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			craven = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #You won - be an ass about it
		name = feast_default.3005.d
		trigger = {
			has_character_flag = won_fight
		}
		scope:rival_to_duel = {
			add_prestige = medium_prestige_loss
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = { #You lost - slit their Achilles tendon
		name = feast_default.3005.e
		trigger = {
			NOT = { has_character_flag = won_fight }
			intrigue >= high_skill_rating
		}
		skill = intrigue
		scope:rival_to_duel = {
			increase_wounds_effect = { REASON = fight }
		}

		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 500
		}
	}

	after = {
		remove_character_flag = won_fight
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}



#####################
# Soiree with another attendee
# by Petter Vilberg and Linnéa Thimrén
#####################
scripted_trigger feast_default_3006_adultery_target_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	NOT = {
		any_consort = {
			this = root
		}
	}
	NOT = { has_trait = chaste }
	num_of_relation_lover < 2
	NOT = { has_relation_lover = root }
	save_temporary_scope_as = adultery_target_check
	possible_mutual_interest_trigger = {
		CHARACTER_1 = scope:adultery_target_check
		CHARACTER_2 = root
	}
	opinion = {
		target = root
		value > 0
	}
	might_cheat_on_every_partner_trigger = yes
}

feast_default.3006 = {
	type = character_event
	title = feast_default.3006.t
	desc = {
		random_valid = {
			desc = feast_default.3006.opening_1
			desc = feast_default.3006.opening_2
			desc = feast_default.3006.opening_3
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_opinion_modifier = {
						target = scope:partner
						modifier = love_opinion
					}
				}
				desc = {
					first_valid = {
						triggered_desc = {
							trigger = {
								is_married = yes
								scope:partner = {
									OR = {
										is_married = yes
										is_concubine = yes
									}
								}
							}
							desc = feast_default.3006.both_married_love
						}
						triggered_desc = {
							trigger = {
								is_married = yes
								scope:partner = {
									is_married = no
									is_concubine = no
								}
							}
							desc = feast_default.3006.married_love
						}
						triggered_desc = {
							trigger = {
								is_married = no
								scope:partner = {
									OR = {
										is_married = yes
										is_concubine = yes
									}
								}
							}
							desc = feast_default.3006.partner_married_love
						}
						triggered_desc = {
							trigger = {
								is_married = no
								scope:partner = {
									is_married = no
									is_concubine = no
								}
							}
							desc = feast_default.3006.unmarried_love
						}
					}
				}
			}
			triggered_desc = {
				trigger = {
					is_married = yes
					scope:partner = {
						OR = {
							is_married = yes
							is_concubine = yes
						}
					}
				}
				desc = feast_default.3006.both_married
			}
			triggered_desc = {
				trigger = {
					is_married = yes
					scope:partner = {
						is_married = no
						is_concubine = no
					}
				}
				desc = feast_default.3006.married
			}
			triggered_desc = {
				trigger = {
					is_married = no
					scope:partner = {
						OR = {
							is_married = yes
							is_concubine = yes
						}
					}
				}
				desc = feast_default.3006.partner_married
			}
			triggered_desc = {
				trigger = {
					is_married = no
					scope:partner = {
						is_married = no
						is_concubine = no
					}
				}
				desc = feast_default.3006.unmarried
			}
		}
	}
	theme = feast_activity
	override_background = {
		event_background = sitting_room
	}
	left_portrait = {
		character = scope:partner
		animation = flirtation
	}
	lower_left_portrait = scope:spouse
	lower_center_portrait = scope:partner_spouse
	
	trigger = {
		NOT = { exists = local_var:had_3006 }
		NOT = { has_trait = chaste }
		mgr_can_seduce = yes
		might_cheat_on_every_partner_trigger = yes
		scope:activity = {
			any_participant = {
				OR = {
					feast_default_3006_adultery_target_trigger = yes
					any_consort = {	
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					any_child = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					any_sibling = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					any_parent = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 0.75
		modifier = {
			add = -0.5
			num_of_relation_lover > 0
		}
		modifier = {
			add = -0.3
			num_of_relation_lover > 1
		}
		modifier = {
			add = 0.5
			has_trait = drunkard
		}
		modifier = {
			add = 1
			has_trait = lustful
		}
		modifier = {
			add = -0.5
			any_spouse = {
				reverse_opinion = {
					target = root
					value >= 60
				}
			}
		}
		modifier = {
			add = -0.4
			any_spouse = {
				reverse_opinion = {
					target = root
					value >= 90
				}
			}
		}
		modifier = {
			add = -0.4
			any_spouse = {
				reverse_has_opinion_modifier = {
					target = root
					modifier = love_opinion
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3006
			value = yes
		}
		scope:activity = {
			every_participant = { #Build a list of potential targets
				if = {
					limit = { feast_default_3006_adultery_target_trigger = yes }
					add_to_list = potential_adulterer
				}
				every_consort = {
					limit = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					add_to_list = potential_adulterer
				}
				every_child = {
					limit = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					add_to_list = potential_adulterer
				}
				every_sibling = {
					limit = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					add_to_list = potential_adulterer
				}
				every_parent = {
					limit = {
						is_landed = no
						feast_default_3006_adultery_target_trigger = yes
					}
					add_to_list = potential_adulterer
				}
			}
		}
		random_in_list = {
			list = potential_adulterer
			weight = {
				base = 5
				interesting_feast_participant_modifier = yes
				modifier = {
					add = 20
					any_consort = {
						is_of_major_interest_to_root_trigger = yes
					}
				}
				modifier = {
					add = 10
					any_consort = {
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				modifier = {
					add = 50
					has_relation_potential_lover = root
				}
			}
			save_scope_as = partner
		}
		scope:partner = {
			add_opinion = {
				modifier = love_opinion
				target = root
				opinion = 15
			}
			hidden_effect = {
				if = { #Character becomes root's potential lover for future reference
					limit = {
						can_set_relation_potential_lover_trigger = { CHARACTER = root }
						opinion = {
							target = root
							value > 10
						}
					}
					set_relation_potential_lover = root
				}
			}
			if = {
				limit ={
					OR = {
						is_married = yes
						is_concubine = yes
					}
				}
				primary_partner = {
					save_scope_as = partner_spouse
				}
			}
		}
		had_sex_with_effect = {
			CHARACTER = scope:partner
			PREGNANCY_CHANCE = pregnancy_chance
		}
		if = {
			limit ={
				OR = {
					is_married = yes
					is_concubine = yes
				}
			}
			primary_partner = {
				save_scope_as = spouse
			}
		}
	}

	option = { #I must see you again!
		name = feast_default.3006.a
		progress_towards_lover_effect = {
			CHARACTER = scope:partner
			OPINION = no
		}
		stress_impact = {
			callous = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 0.5
				ai_honor = -0.25
				ai_boldness = 0.5
			}
		}
	}

	option = { #Let's go for another round
		name = feast_default.3006.b
		add_character_modifier = {
			modifier = feast_blew_off_steam_modifier
			years = 5
		}
		had_sex_with_effect = {
			CHARACTER = scope:partner
			PREGNANCY_CHANCE = pregnancy_chance
		}
		stress_impact = {
			rakish = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.25
				ai_boldness = 0.5
			}
		}
	}


	option = { #Let us not speak of this again
		name = feast_default.3006.c
		custom_tooltip = feast_default.3006.c.tt
		stress_impact = {
			lustful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			opinion_modifier = {
				trigger = { exists = scope:spouse }
				opinion_target = scope:spouse
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Caught committing adultery with a Lover
# by Petter Vilberg
#####################
###Your spouse discovers your adultery during the feast
#
#Trigger for making sure a suitable secret lover is present
scripted_trigger feast_default_3007_lover_trigger = {
	feast_default_participant_trigger = yes
	is_adult = yes
	has_relation_lover = root
	NOT = {
		any_consort = {
			this = root
		}
	}
	save_temporary_scope_as = lover_check
	root = {
		exists = primary_partner
		primary_partner = {
			save_temporary_scope_as = spouse_check
		}
		any_secret = {
			secret_type = secret_lover
			secret_target = scope:lover_check
			NOT = { is_known_by = scope:spouse_check }
		}
	}
}

feast_default.3007 = {
	type = character_event
	title = feast_default.3007.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_opinion_modifier = {
							target = scope:lover
							modifier = love_opinion
						}
						opinion = {
							target = scope:lover
							value > 75
						}
					}
				}
				desc = feast_default.3007.love
			}
			triggered_desc = {
				trigger = {
					opinion = {
						target = scope:lover
						value < 20
					}
				}
				desc = feast_default.3007.not_love
			}
			desc = feast_default.3007.ambiguous
		}
		desc = feast_default.3007.end
	}
	theme = feast_activity
	left_portrait = {
		character = scope:lover
		animation = shock
	}
	right_portrait = {
		character = scope:spouse
		animation = anger
	}
	
	trigger = {
		is_ai = no
		NOT = { exists = local_var:had_3007 }
		is_married = yes
		scope:activity = {
			any_participant = {
				OR = {
					feast_default_3007_lover_trigger = yes
					any_consort = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					any_parent = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					any_sibling = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					any_child = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = lustful
		}
		modifier = {
			add = 0.5
			num_of_relation_lover > 1
		}
	}

	immediate = {
		set_local_variable = {
			name = had_3007
			value = yes
		}
		scope:activity = {
			every_participant = {
				if = {
					limit = { feast_default_3007_lover_trigger = yes }
					add_to_list = lover_potential
				}
				random_consort = {
					limit = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					add_to_list = lover_potential
				}
				random_parent = {
					limit = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					add_to_list = lover_potential
				}
				random_sibling = {
					limit = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					add_to_list = lover_potential
				}
				random_child = {
					limit = {
						is_landed = no
						feast_default_3007_lover_trigger = yes
					}
					add_to_list = lover_potential
				}
			}
		}
		random_in_list = {
			list = lover_potential
			save_scope_as = lover
		}
		primary_partner = {
			save_scope_as = spouse
		}
		random_secret = {
			limit = {
				secret_type = secret_lover
				secret_target = scope:lover
				NOT = { is_known_by = scope:spouse }
			}
			save_scope_as = secret
		}
		had_sex_with_effect = {
			CHARACTER = scope:lover
			PREGNANCY_CHANCE = pregnancy_chance
		}
	}

	option = { #No, it means nothing!
		name = feast_default.3007.a
		remove_relation_lover = scope:lover
		scope:lover = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -40
			}
		}
		scope:spouse = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -20
			}
		}
		if = {
			limit = {
				opinion = {
					target = scope:lover
					value >= 75
				}
			}
			stress_impact = {
				compassionate = minor_stress_impact_gain
				stubborn = minor_stress_impact_gain
				honest = medium_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				compassionate = minor_stress_impact_gain
				stubborn = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:spouse
			}
			opinion_modifier = {
				opinion_target = scope:lover
				multiplier = -1
			}
			ai_value_modifier = {
				ai_honor = 0.5
			}
		}
	}

	option = { #I love them!
		name = feast_default.3007.b
		scope:lover = {
			add_opinion = {
				target = root
				modifier = love_opinion
				opinion = 20
			}
		}
		scope:secret = {
			expose_secret = scope:spouse
		}
		if = {
			limit = {
				opinion = {
					target = scope:lover
					value >= 75
				}
			}
			stress_impact = {
				callous = medium_stress_impact_gain
				sadistic = medium_stress_impact_gain
				cynical = minor_stress_impact_gain
				craven = minor_stress_impact_gain
				content = medium_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				callous = medium_stress_impact_gain
				sadistic = medium_stress_impact_gain
				cynical = minor_stress_impact_gain
				craven = minor_stress_impact_gain
				content = medium_stress_impact_gain
				deceitful = medium_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:lover
			}
			opinion_modifier = {
				opinion_target = scope:spouse
				multiplier = -1
			}
			ai_value_modifier = {
				ai_greed = 0.25
				ai_boldness = 0.25
			}
		}
	}

	option = { #Be quiet, I do as I please
		name = feast_default.3007.c
		trigger = {
			OR = {
				has_trait = arrogant
				has_trait = sadistic
				has_trait = arbitrary
			}
		}
		trait = arrogant
		trait = sadistic
		trait = arbitrary
		scope:secret = {
			expose_secret = scope:spouse
		}
		scope:lover = {
			if = {
				limit = {
					scope:lover = {
						OR = {
							has_trait = arrogant
							has_trait = sadistic
							has_trait = arbitrary
						}
					}
				}
				scope:lover = {
					add_opinion = {
						target = root
						modifier = respect_opinion
						opinion = 15
					}
				}
			}
			else = {
				scope:lover = {
					add_opinion = {
						target = root
						modifier = kindness_opinion
						opinion = 15
					}
				}
			}
		}
		scope:spouse = {
			add_opinion = {
				target = root
				modifier = love_opinion
				opinion = -20
			}
		}
		ai_chance = {
			base = 500
			ai_value_modifier = {
				ai_compassion = -1
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#################################
# HOST-TRIGGERED EVENTS
# 5000-5999
#################################

#####################
# The Host's high Dread freaks you out
# by Petter Vilberg
#####################
feast_default.5001 = {
	type = character_event
	title = feast_default.5001.t
	desc = {
		first_valid = {
			random_valid = {
				triggered_desc = {
					trigger = { exists = scope:friend }
					desc = feast_default.5001.friend_reminder
				}
				triggered_desc = {
					trigger = { exists = scope:rival }
					desc = feast_default.5001.rival_reminder
				}
				triggered_desc = {
					trigger = { exists = scope:spouse }
					desc = feast_default.5001.spouse_reminder
				}
				triggered_desc = {
					trigger = { exists = scope:sadist }
					desc = feast_default.5001.sadist_reminder
				}
			}
			desc = feast_default.5001.reminder
		}
		desc = feast_default.5001.worry
	}
	left_portrait = {
		character = scope:host
		animation = personality_callous
	}
	theme = feast_activity
	
	trigger = {
		NOT = { exists = local_var:had_5001 }
		scope:activity.activity_owner = {
			is_alive = yes
			is_imprisoned = no
			dread >= medium_dread
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #You're less likely to be intimidated if you're brave
			factor = 0.3
			has_trait = brave
		}
		compare_modifier = {
			value = root.dread
			multiplier = 0.02
		}
	}

	immediate = {
		set_local_variable = {
			name = had_5001
			value = yes
		}
		scope:activity = {
			activity_owner = {
				save_scope_as = host
			}
			random_participant = {
				limit = {
					has_relation_friend = root
				}
				save_scope_as = friend
			}
			random_participant = {
				limit = {
					has_relation_rival = root
				}
				save_scope_as = rival
			}
			random_participant = {
				limit = {
					has_trait = sadistic
				}
				save_scope_as = sadist
			}
		}
		random_spouse = { #root character's spouse, not necessarily a part of the activity
			save_scope_as = spouse
		}
	}

	option = { #This is too much
		name = feast_default.5001.a
		stress_impact = {
			base = medium_stress_gain
		}
	}	

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Host is a lunatic
# by Linnéa Thimrén
#####################
feast_default.5002 = {
	type = character_event
	title = feast_default.5002.t
	desc = {
		random_valid = {
			desc = feast_default.5002.desc_chair
			desc = feast_default.5002.desc_chicken
			desc = feast_default.5002.desc_drapes
		}
	}
	theme = feast_activity
	left_portrait = {
		character = scope:lunatic_host
		animation = personality_irrational
	}

	trigger = {
		NOT = { exists = local_var:had_5002 }
		scope:activity.activity_owner = {
			is_alive = yes
			is_imprisoned = no
			has_trait = lunatic
		}
	}

	immediate = {
		set_local_variable = {
			name = had_5002
			value = yes
		}
		scope:activity = {
			activity_owner = {
				save_scope_as = lunatic_host
			}
		}
	}

	option = { #Come now, let's go outside
		name = feast_default.5002.a
		scope:lunatic_host = {
			add_opinion = {
				modifier = kindness_opinion
				target = root
				opinion = 20
			}
		}
		stress_impact = {
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.75
			}
		}
	}

	option = { #I will stop them!
		name = feast_default.5002.b
		scope:activity = {
			every_participant = {
				custom = every_guest_scope_tt
				add_opinion = {
					target = root
					modifier = respect_opinion
					opinion = 10
				}
			}
		}
		scope:lunatic_host = {
			add_opinion = {
				modifier = rude_opinion
				target = root
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
		}
		add_prestige = medium_prestige_gain
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	option = { #Also lunatic, join in on the fun
		name = feast_default.5002.c
		trigger = {
			has_trait = lunatic
		}
		trait = lunatic_1
		trait = lunatic_genetic
		exclusive = yes
		scope:lunatic_host = {
			add_opinion = {
				modifier = friendliness_opinion
				target = root
				opinion = 20
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Host is sadistic
# by Linnéa Thimrén
#####################
feast_default.5003 = {
	type = character_event
	title = feast_default.5003.t
	desc = feast_default.5003.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest
		animation = fear
	}
	right_portrait = {
		character = scope:sadistic_host
		animation = schadenfreude
	}

	trigger = {
		NOT = { exists = local_var:had_5003 }
		scope:activity = {
			activity_owner = {
				is_alive = yes
				is_imprisoned = no
				has_trait = sadistic
			}
			any_participant = {
				feast_default_participant_trigger = yes
				NOT = { this = root }
				NOT = {	this = scope:activity.activity_owner }
				is_ai = yes
				save_temporary_scope_as = guest_check
			}
		}
		can_add_hook = {
			target = scope:guest_check
			type = favor_hook
		}
	}

	immediate = {
		set_local_variable = {
			name = had_5003
			value = yes
		}
		scope:activity = {
			activity_owner = {
				save_scope_as = sadistic_host
			}
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = { this = root }
					NOT = {	this = scope:sadistic_host }
					is_ai = yes
					can_add_hook = {
						target = root
						type = favor_hook
					}
				}
				weight = {
					base = 1
					modifier = { #Less likely to pick someone you actively dislike
						add = -0.75
						OR = {
							has_relation_rival = root
							has_relation_potential_rival = root
							reverse_opinion = {
								target = root
								value <= -10
							}
						}
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_powerful_vassal = yes
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						save_temporary_scope_as = guest_check
						scope:sadistic_host = {
							any_councillor = {
								this = scope:guest_check
							}
						}
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_of_major_interest_to_root_trigger = yes
					}
				}
				save_scope_as = guest
			}
		}
	}

	option = { #This has to stop!
		name = feast_default.5003.a
		scope:activity = {
			every_participant = {
				custom = every_guest_scope_tt
				add_opinion = {
					target = root
					modifier = respect_opinion
					opinion = 10
				}
			}
		}
		scope:sadistic_host = {
			add_opinion = {
				modifier = rude_opinion
				target = root
			}
		}
		add_prestige = medium_prestige_gain
		stress_impact = {
			craven = major_stress_impact_gain
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_trait = brave
					has_trait = vengeful
					has_trait = wrathful
					has_trait = just
				}
			}
			modifier = {
				add = 20
				OR = {
					has_trait = arrogant
					has_trait = zealous
				}
			}
		}
	}

	option = { #I'm too scared to intervene
		name = feast_default.5003.b
		add_hook = {
			target = scope:guest
			type = favor_hook
		}
		stress_impact = {
			wrathful = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.75
			}
		}
	}

	option = { #Also sadistic, what a party!
		name = feast_default.5003.c
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		exclusive = yes

		scope:sadistic_host = {
			add_opinion = {
				modifier = friendliness_opinion
				target = root
				opinion = 20
			}
		}
		stress_impact = {
			base = minor_stress_loss
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Host is a reveler, offers you more! More!
# by Petter Vilberg
#####################
feast_default.5004 = {
	type = character_event
	title = feast_default.5004.t
	desc = feast_default.5004.desc
	theme = feast_activity
	left_portrait = {
		character = scope:host
		animation = ecstasy
	}
	
	trigger = {
		NOT = { exists = local_var:had_5004 }
		scope:activity.activity_owner = {
			is_alive = yes
			is_imprisoned = no
			has_trait = lifestyle_reveler
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 0.5
			root = {
				has_trait_rank = {
					trait = lifestyle_reveler
					rank > 1
				}
			}
		}
		modifier = {
			add = 0.5
			root = {
				has_trait_rank = {
					trait = lifestyle_reveler
					rank > 2
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_5004
			value = yes
		}
		scope:activity = {
			activity_owner = {
				save_scope_as = host
			}
		}
	}

	option = { #This is great!
		name = feast_default.5004.a
		random = {
			chance = 10
			add_trait = drunkard
		}
		scope:host = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 15
			}
		}
		hidden_effect = { #Progress in the reveler lifestyle
			if = {
				limit = { NOT = { has_variable = reveler_lifestyle_progress } }
				set_variable = {
					name = reveler_lifestyle_progress
					value = 1
				}
			}
			else = {
				change_variable = {
					name = reveler_lifestyle_progress
					add = 1
				}
			}
		}
		stress_impact = {
			reveler_1 = minor_stress_impact_loss
			reveler_2 = minor_stress_impact_loss
			reveler_3 = minor_stress_impact_loss
			comfort_eater = minor_stress_impact_loss
			drunkard = minor_stress_impact_loss
			shy = minor_stress_impact_gain
			temperate = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
			modifier = {
				add = 100
				has_trait = lifestyle_reveler
			}
		}
	}

	option = { #No, I cannot take anymore
		name = feast_default.5004.b
		scope:host = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -10
			}
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
			gluttonous = minor_stress_impact_gain
			inappetetic = minor_stress_impact_loss
		}
	}

	option = { #Make yourself disappear
		name = feast_default.5004.c
		trigger = {
			OR = {
				has_trait = shy
				has_trait = reclusive
			}
		}
		trait = shy
		trait = reclusive
		reverse_add_opinion = {
			target = scope:host
			modifier = respect_opinion
			opinion = -10
		}
		stress_impact = {
			shy = medium_stress_loss
			reclusive = medium_stress_impact_loss
		}
		ai_chance = {
			base = 1000
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


################################
# You just love garum
# by Petter Vilberg
################################
feast_default.5005 = {
	type = character_event
	title = feast_default.5005.t
	desc = feast_default.5005.desc
	theme = feast_activity
	left_portrait = {
		character = scope:host
		animation = happiness
	}
	right_portrait = {
		character = root
		animation = ecstasy
	}
	
	trigger = {
		NOT = { exists = local_var:had_5005 }
		NOR = {
			has_character_modifier = feast_hearty_diet_modifier
			has_character_modifier = feast_obsessed_with_garum_modifier
		}
		scope:activity.activity_owner = {
			is_alive = yes
			is_imprisoned = no
			OR = {
				culture = culture:greek
				culture = culture:baranis
				culture = culture:levantine
				culture = culture:andalusian
				culture = culture:egyptian
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		set_local_variable = {
			name = had_5005
			value = yes
		}
		scope:activity.activity_owner = {
			save_scope_as = host
		}
	}

	option = { # I need to eat this regularly!
		name = feast_default.5005.a
		add_character_modifier = {
			modifier = feast_hearty_diet_modifier
			years = 10
		}
	}

	option = { # Wow, this is incredible, host!
		name = feast_default.5005.b
		scope:host = {
			add_opinion = {
				target = scope:host
				modifier = compliment_opinion
				opinion = 20
			}
		}
	}

	option = { # I know a fun fact!
		name = feast_default.5005.c
		flavor = feast_default.5005.c.flavor
		trigger = {
			OR = {
				has_trait = scholar
				has_trait = education_learning_4
				has_trait = intellect_good_2
				has_trait = intellect_good_3
			}
		}
		trait = scholar
		trait = education_learning_4
		trait = intellect_good_2
		trait = intellect_good_3

		add_prestige = medium_prestige_gain
	}

	option = { # Yes, more garum!
		name = feast_default.5005.d
		trigger = { has_trait = gluttonous }
		trait = gluttonous
		add_character_modifier = {
			modifier = feast_obsessed_with_garum_modifier
			years = 10
		}
	}
}

#################################
# HOST EVENTS
# 6000-6999
#################################

#####################
# Your spouse is doing an incredible job
# by Petter Vilberg
#####################
feast_default.6001 = {
	type = character_event
	title = feast_default.6001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					reverse_opinion = {
						target = scope:spouse
						value < 0
					}
				}
				desc = feast_default.6001.dislike_spouse
			}
			desc = feast_default.6001.like_spouse
		}
	}
	theme = feast_activity
	left_portrait = {
		character = scope:spouse
		animation = personality_bold
	}
	
	trigger = {
		NOR = {
			exists = local_var:had_6001
			exists = local_var:had_6002
		}
		any_spouse = {
			is_available = yes
			NOT = { has_trait = lazy }
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6001
			value = yes
		}
		random_spouse = {
			limit = {
				has_trait = diligent
			}
			alternative_limit = {
				NOT = { has_trait = lazy }
			}
			save_scope_as = spouse
		}
	}

	option = {
		name = feast_default.6001.a
		add_character_modifier = {
			modifier = feast_household_efforts_modifier
			years = 5
		}
		hidden_effect = {
			add_opinion = {
				target = scope:spouse
				modifier = feast_spouse_doing_impressive_job_opinion
			}
		}
		stress_impact = {
			base = minor_stress_loss
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Guest compliments you on your feast
# by Petter Vilberg
#####################
feast_default.6002 = {
	type = character_event
	title = feast_default.6002.t
	desc = feast_default.6002.desc
	left_portrait = {
		character = scope:guest
		animation = happiness
	}
	right_portrait = {
		character = scope:spouse
		animation = personality_bold
	}
	theme = feast_activity
	
	trigger = {
		NOR = {
			exists = local_var:had_6002
			exists = local_var:had_6001
		}
		scope:activity = {
			activity_owner = {
				is_married = yes
				primary_partner = { 
					feast_default_participant_trigger = yes
				}
			}
			any_participant = {
				feast_default_participant_trigger = yes
				NOT = { this = scope:activity.activity_owner.primary_partner }
				opinion = {
					target = scope:activity.activity_owner
					value >= 20
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6002
			value = yes
		}
		primary_partner = {
			save_scope_as = spouse
		}

		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = { this = scope:spouse } # Spouse should not compliment themselves
					opinion = {
						target = scope:activity.activity_owner
						value >= 20
					}
				}
				save_scope_as = guest
			}
		}
	}

	option = { # Yes, I've really done something here
		name = feast_default.6002.a
		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_trait = arrogant
			}
		}
		stress_impact = {
			humble = medium_stress_impact_gain
			family_first = minor_stress_impact_gain
		}
		add_prestige = medium_prestige_gain
		reverse_add_opinion = {
			target = scope:spouse
			modifier = feast_spouse_did_not_credit_me_opinion
		}
	}	

	option = { #It is all thanks to my spouse
		name = feast_default.6002.b
		trigger = {
			exists = scope:spouse
		}
		add_character_modifier = {
			modifier = feast_household_efforts_modifier
			years = 5
		}
		reverse_add_opinion = {
			target = scope:spouse
			modifier = feast_spouse_gave_me_credit_opinion
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			compare_modifier = {
				target = scope:activity.activity_owner
				value = ai_honor
			}
			opinion_modifier = {
				opinion_target = scope:spouse
				min = -99
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}

#####################
# Two guests get into a fight
# by Petter Vilberg
#####################

scripted_trigger feast_default_6003_fighter_2_trigger = {
	feast_default_participant_trigger = yes
	NOT = { this = scope:fighter_1 }
	OR = {
		has_relation_rival = scope:fighter_1
		AND = {
			opinion = {
				target = scope:fighter_1
				value <= -20
			}
			reverse_opinion = {
				target = scope:fighter_1
				value <= -20	
			}
			OR = {
				AND = {
					is_female = yes
					scope:fighter_1 = { is_female = yes }
				}
				AND = {
					is_male = yes
					scope:fighter_1 = { is_male = yes }
				}
			}
		}
	}
}

scripted_trigger feast_default_6003_fighter_1_trigger = {
	feast_default_participant_trigger = yes
	save_temporary_scope_as = fighter_1
	scope:activity = {
		any_participant = {
			feast_default_6003_fighter_2_trigger = yes
		}
	}
}

feast_default.6003 = {
	type = character_event
	title = feast_default.6003.t
	desc = {
		desc = feast_default.6003.opening
		desc = feast_default.6003.guard
	}
	theme = feast_activity
	left_portrait = {
		character = scope:fighter_1
		animation = rage
	}
	right_portrait = {
		character = scope:fighter_2
		animation = anger
	}
	
	trigger = {
		NOT = { exists = local_var:had_6003 }
		scope:activity = {
			any_participant = {
				feast_default_6003_fighter_1_trigger = yes
				save_temporary_scope_as = fighter_1
			}
			any_participant = {
				feast_default_6003_fighter_2_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6003
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_6003_fighter_1_trigger = yes
				}
				save_scope_as = fighter_1
			}
			random_participant = {
				limit = {
					feast_default_6003_fighter_2_trigger = yes
				}
				save_scope_as = fighter_2
			}
		}
	}

	option = { #Side with fighter_1
		name = feast_default.6003.a
		reverse_add_opinion = {
			target = scope:fighter_1
			modifier = feast_sided_with_me_in_my_fight_opinion
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:fighter_1
			OPINION = no
		}
		reverse_add_opinion = {
			target = scope:fighter_2
			modifier = feast_sided_against_me_in_my_fight_opinion
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:fighter_2
			OPINION = no
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:fighter_1
				min = -99
			}
			modifier = {
				add = 500
				has_relation_friend = scope:fighter_1
			}
		}
	}

	option = { #Side with fighter_2
		name = feast_default.6003.b
		reverse_add_opinion = {
			target = scope:fighter_2
			modifier = feast_sided_with_me_in_my_fight_opinion
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:fighter_2
			OPINION = no
		}
		reverse_add_opinion = {
			target = scope:fighter_1
			modifier = feast_sided_against_me_in_my_fight_opinion
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:fighter_1
			OPINION = no
		}
		ai_chance = {
			base = 100
			opinion_modifier = {
				opinion_target = scope:fighter_1
				min = -99
			}
			modifier = {
				add = 500
				has_relation_friend = scope:fighter_1
			}
		}
	}	

	option = { #Resolve fight amicably
		name = feast_default.6003.c
		trigger = {
			diplomacy >= 15
		}
		skill = diplomacy
		add_prestige = medium_prestige_gain
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Guest is having a hard time socializing - help or laugh at them!
# by Linnéa Thimrén
#####################
feast_default.6101 = {
	type = character_event
	title = feast_default.6101.t
	desc = {
		desc = feast_default.6101.desc_opening
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = liked_by_host
				}
				desc = feast_default.6101.desc_liked
			}
			triggered_desc = {
				trigger = {
					has_character_flag = disliked_by_host
				}
				desc = feast_default.6101.desc_disliked
			}
		}
	}
	theme = feast_activity
	left_portrait = {
		character = scope:troubled_guest
		animation = worry
	}

	trigger = {
		NOT = { exists = local_var:had_6101 }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				has_trait = shy
				save_temporary_scope_as = guest_check
			}
		}
		can_add_hook = {
			target = scope:guest_check
			type = favor_hook
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6101
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_trait = shy
				}
				weight = {
					base = 1
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_powerful_vassal = yes
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						save_temporary_scope_as = guest_check
						root = {
							any_councillor = {
								this = scope:guest_check
							}
						}
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_of_major_interest_to_root_trigger = yes
					}
				}
				save_scope_as = troubled_guest
			}
		}
		if = {
			limit = {
				OR = {
					has_relation_friend = scope:troubled_guest
					has_relation_potential_friend = scope:troubled_guest
					has_relation_lover = scope:troubled_guest
					has_relation_potential_lover = scope:troubled_guest
					opinion = {
						target = scope:troubled_guest
						value >= 10
					}
				}
			}
			add_character_flag = {
				flag = liked_by_host
				days = 10
			}
		}
		else = {
			add_character_flag = {
				flag = disliked_by_host
				days = 10
			}
		}
	}

	option = { #you save them from having to be social
		name = feast_default.6101.a
		reverse_add_opinion = {
			modifier = kindness_opinion
			target = scope:troubled_guest
			opinion = 15
		}
		add_hook = {
			target = scope:troubled_guest
			type = favor_hook
		}
		stress_impact = {
			shy = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.7
				ai_honor = 0.25
				ai_boldness = 0.25
			}
		}
	}

	option = { #Mercilessly push them
		name = feast_default.6101.b
		reverse_add_opinion = {
			modifier = cruelty_opinion
			target = scope:troubled_guest
			opinion = -20
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:troubled_guest
			OPINION = no
		}
		scope:activity = {
			every_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = {	this = scope:troubled_guest	}
				}
				custom = every_guest_scope_tt
				add_opinion = {
					target = root
					modifier = friendliness_opinion
					opinion = 10
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			sadistic = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_energy = 0.25
				ai_boldness = 0.25
			}
		}
	}

	option = { #You save him
		name = feast_default.6101.c
		flavor = feast_default.6101.c.tt
		trigger = {
			OR = {
				has_trait = shy
				has_trait = reclusive
			}
		}
		trait = shy
		trait = reclusive
		add_prestige = medium_prestige_loss
		reverse_add_opinion = {
			modifier = friendliness_opinion
			target = scope:troubled_guest
			opinion = 20
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:troubled_guest
			OPINION = no
		}
		add_hook = {
			target = scope:troubled_guest
			type = favor_hook
		}
		stress_impact = {
			shy = minor_stress_impact_loss
			reclusive = medium_stress_impact_loss
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				has_trait = shy
			}
			ai_value_modifier = {
				ai_compassion = 0.7
				ai_honor = 0.25
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# A guest rambles on and on
# by Linnéa Thimrén
#####################
scripted_trigger feast_default_6111_character_trigger = {
	feast_default_participant_trigger = yes
}

feast_default.6111 = {
	type = character_event
	title = feast_default.6111.t
	desc = feast_default.6111.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest_to_talk_to
		animation = personality_content
	}

	trigger = {
		NOT = { exists = local_var:had_6111 }
		scope:activity = {
			any_participant = {
				feast_default_6111_character_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6111
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_6111_character_trigger = yes
					any_targeting_scheme = { #to prioritize characters that you want to get to know
						scheme_owner = root
						scheme_type = befriend
					}
				}
				alternative_limit = {
					feast_default_6111_character_trigger = yes
					has_same_education_trait_as_character_trigger = {
						CHARACTER = root
					}
				}
				alternative_limit = {
					feast_default_6111_character_trigger = yes
				}
				weight = {
					base = 1
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = { #More likely to pick someone that matters
						add = 0.75
						is_powerful_vassal = yes
					}
					modifier = { #More likely to pick someone that matters
						add = 0.5
						save_temporary_scope_as = guest_check
						root = {
							any_councillor = {
								this = scope:guest_check
							}
						}
					}
				}
				save_scope_as = guest_to_talk_to
			}
		}
	}

	option = { #you're actually interested
		name = feast_default.6111.a
		
		add_character_modifier = {
			modifier = feast_had_interesting_conversation_modifier
			years = 10
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.25
				ai_rationality = 0.25
			}
		}
	}

	option = { #Let's talk about you instead
		name = feast_default.6111.b
		progress_towards_friend_effect = {
			CHARACTER = scope:guest_to_talk_to
			OPINION = 20
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			gregarious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					scope:guest_to_talk_to = {
						any_targeting_scheme = {
							scheme_owner = root
							scheme_type = befriend
						}
					}
					number_of_personality_traits_in_common = {
						target = scope:guest_to_talk_to
						value >= 2
					}
					scope:guest_to_talk_to = {
						has_same_education_trait_as_character_trigger = {
							CHARACTER = root
						}
					}
				}
			}
		}
	}

	option = { #they just won't shut up!
		name = feast_default.6111.c
		trigger = {
			OR = {
				has_trait = sadistic
				has_trait = callous
				has_trait = irritable
			}
		}
		trait = sadistic
		trait = callous
		trait = irritable
		scope:activity = {
			every_participant = {
				limit = {
					feast_default_participant_trigger = yes
					NOT = { this = scope:guest_to_talk_to }
					ai_compassion <= medium_negative_compassion
				}
				custom = every_evil_guest_scope_tt
				add_opinion = {
					target = root
					modifier = amused_opinion
					opinion = 10
				}
			}
		}
		reverse_add_opinion = {
			modifier = publicly_ridiculed
			target = scope:guest_to_talk_to
		}
		if = {
			limit = {
				can_set_relation_potential_rival_trigger = { CHARACTER = scope:guest_to_talk_to }
			}
			set_relation_potential_rival = scope:guest_to_talk_to
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			sadistic = medium_stress_impact_loss
			callous = minor_stress_impact_loss
			irritable = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				opinion = {
					target = scope:guest_to_talk_to
					value <= 0
				}
			}
			ai_value_modifier = {
				ai_vengefulness = 0.75
				ai_compassion = -0.5
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}

#####################
# Serve a guest food you know they hate
# by Linnéa Thimrén
#####################
feast_default.6121 = {
	type = character_event
	title = feast_default.6121.t
	desc = feast_default.6121.desc
	theme = feast_activity
	left_portrait = {
		character = scope:hated_guest
		animation = disgust
	}

	trigger = {
		NOT = { exists = local_var:had_6121 }
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				opinion = {
					target = scope:activity.activity_owner
					value <= -10
				}
				save_temporary_scope_as = guest_check
				root = {
					can_add_hook = {
						target = scope:guest_check
						type = favor_hook
					}
				}
			}
		}
	}

	weight_multiplier = {
		base = 0.5
		modifier = { #More likely if there's someone you actually dislike
			scope:activity = {
				any_participant = {
					feast_default_participant_trigger = yes
					OR = {
						opinion = {
							target = scope:activity.activity_owner
							value <= -40
						}
						has_relation_rival = scope:activity.activity_owner
						has_relation_potential_rival = scope:activity.activity_owner
					}
					save_temporary_scope_as = guest_check
					root = {
						can_add_hook = {
							target = scope:guest_check
							type = favor_hook
						}
					}
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6121
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					has_relation_rival = scope:activity.activity_owner
					save_temporary_scope_as = guest_check
					root = {
						can_add_hook = {
							target = scope:guest_check
							type = favor_hook
						}
					}

				}
				alternative_limit = {
					feast_default_participant_trigger = yes
					has_relation_potential_rival = scope:activity.activity_owner
					save_temporary_scope_as = guest_check
					root = {
						can_add_hook = {
							target = scope:guest_check
							type = favor_hook
						}
					}
				}
				alternative_limit = {
					feast_default_participant_trigger = yes
					opinion = {
						target = scope:activity.activity_owner
						value <= -20
					}
					save_temporary_scope_as = guest_check
					root = {
						can_add_hook = {
							target = scope:guest_check
							type = favor_hook
						}
					}
				}
				alternative_limit = {
					feast_default_participant_trigger = yes
					opinion = {
						target = scope:activity.activity_owner
						value <= -10
					}
					save_temporary_scope_as = guest_check
					root = {
						can_add_hook = {
							target = scope:guest_check
							type = favor_hook
						}
					}
				}
				weight = {
					base = 1
					modifier = { #Less likely to choose someone you probably like
						add = -1
						OR = {
							has_relation_friend = root
							has_relation_potential_friend = root
							has_relation_lover = root
							has_relation_potential_lover = root
						}
					}
					modifier = { #More likely to choose someone you want dead
						add = 1
						any_targeting_scheme = {
							scheme_owner = root
							scheme_type = murder
						}
					}
				}
				save_scope_as = hated_guest
			}
		}
	}

	option = { #Laugh as they suffer
		name = feast_default.6121.a
		scope:hated_guest = {
			add_character_modifier = {
				modifier = feast_bad_reaction_to_food
				years = 7
			}
		}
		if = {
			limit = {
				OR = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:hated_guest }
					can_set_relation_rival_trigger = { CHARACTER = scope:hated_guest }
				}
			}
			progress_towards_rival_effect = {
				CHARACTER = scope:hated_guest
				OPINION = no
			}
		}
		else = {
			scope:hated_guest = {
				add_opinion = {
					target = root
					modifier = cruelty_opinion
					opinion = -20
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.25
				ai_compassion = -0.25
			}
		}
	}

	option = { #"Save" them
		name = feast_default.6121.b
		add_prestige = minor_prestige_gain
		add_hook = {
			type = favor_hook
			target = scope:hated_guest
		}
		stress_impact = {
			sadistic = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
			ai_value_modifier = {
				ai_compassion = 0.75
				ai_honor = 0.25
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# There's no more wine!
# by Linnéa Thimrén
#####################
feast_default.6231 = {
	type = character_event
	title = feast_default.6231.t
	desc = feast_default.6231.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = shock
	}

	trigger = {
		NOT = { exists = local_var:had_6231 }
	}

	immediate = {
		set_local_variable = {
			name = had_6231
			value = yes
		}
	}

	option = { #We must buy more!
		name = feast_default.6231.a
		trigger = {
			short_term_gold >= medium_gold_value
		}
		show_as_unavailable = {
			short_term_gold < medium_gold_value
		}
		scope:activity = {
			every_participant = {
				limit = {
					feast_default_participant_trigger = yes
				}
				custom = every_guest_scope_tt
				add_opinion = {
					target = root
					modifier = pleased_opinion
					opinion = 10
				}
			}
			if = {
				limit = {
					any_participant = {
						has_trait = drunkard
					}
				}
				every_participant = {
					limit = {
						feast_default_participant_trigger = yes
						has_trait = drunkard
					}
					custom = every_drunkard_guest_scope_tt
					add_opinion = {
						target = root
						modifier = grateful_opinion
						opinion = 20
					}
				}
			}
		}
		add_character_modifier = {
			modifier = feast_bought_more_drink_modifier
			years = 10
		}
		remove_short_term_gold = medium_gold_value
		stress_impact = {
			greedy = medium_stress_impact_gain
			drunkard = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_energy = 0.5
				ai_honor = 0.25
				ai_compassion = 0.25
			}
		}
	}

	option = { #We all have to pitch in!
		name = feast_default.6231.b
		add_prestige = minor_prestige_loss
		add_gold = minor_gold_value
		stress_impact = {
			just = medium_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 0.5
			}
		}
	}

	option = { #I have a private stash!
		name = feast_default.6231.c
		trigger = {
			has_trait = lifestyle_reveler
		}
		trait = reveler_1
		trait = reveler_2
		trait = reveler_3
		add_prestige = medium_prestige_gain
		add_character_modifier = {
			modifier = feast_bought_more_drink_modifier
			years = 10
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 500
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Chance to become friend or rival
# by Linnéa Thimrén
#####################
scripted_trigger feast_default_participant_requirements_trigger = {
	feast_default_participant_trigger = yes
	NOR = {
		has_relation_friend = root
		has_relation_rival = root
		has_relation_lover = root
	}
}

feast_default.6251 = {
	type = character_event
	title = feast_default.6251.t
	desc = feast_default.6251.desc
	theme = feast_activity
	left_portrait = {
		character = scope:guest
		animation = happiness
	}

	trigger = {
		NOT = { exists = local_var:had_6251 }
		scope:activity = {
			any_participant = {
				feast_default_participant_requirements_trigger = yes
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6251
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_requirements_trigger = yes
				}
				weight = {
					base = 1
					modifier = { #More likely to pick someone that matters
						add = 2
						is_of_major_interest_to_root_trigger = yes
					}
					modifier = { #More likely to pick someone that matters
						add = 1
						is_of_minor_interest_to_root_trigger = yes
					}
				}
				save_scope_as = guest
			}
		}
	}

	option = { #friendly
		name = feast_default.6251.a
		reverse_add_opinion = {
			modifier = friendliness_opinion
			target = scope:guest
			opinion = 20
		}
		if = {
			limit = {
				NOR = {
					has_relation_friend = scope:guest
					has_relation_potential_friend = scope:guest
				}
			}
			set_relation_potential_friend = scope:guest
		}
		if = {
			limit = {
				has_relation_potential_friend = scope:guest
			}
			set_relation_friend = scope:guest
		}
		stress_impact = {
			gregarious = minor_stress_impact_loss
			compassionate = minor_stress_impact_loss
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 40
			modifier = {
				add = 60
				opinion = {
					target = scope:guest
					value >= 40
				}
			}
			ai_value_modifier = {
				ai_compassion = 0.75
			}
		}
	}

	option = { #Rival
		name = feast_default.6251.b
		reverse_add_opinion = {
			modifier = cruelty_opinion
			target = scope:guest
			opinion = -20
		}
		if = {
			limit = {
				OR = {
					can_set_relation_potential_rival_trigger = { CHARACTER = scope:guest }
					can_set_relation_rival_trigger = { CHARACTER = scope:guest }
				}
			}
			progress_towards_rival_effect = {
				CHARACTER = scope:guest
				OPINION = no
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 40
			modifier = {
				add = 20
				opinion = {
					target = scope:guest
					value <= 0
				}
			}
			modifier = {
				add = 20
				OR = {
					has_trait = sadistic
					has_trait = vengeful
					has_trait = wrathful
				}
			}
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = feast_default.6251.c
		trigger = {
			OR = {
				matching_gender_and_sexuality_trigger = { CHARACTER_1 = root CHARACTER_2 = scope:guest }
				AND = {
					scope:guest = { is_attracted_to_gender_of = root }
					root = { has_perk = unshackled_lust_perk }
				}
			}
		}
		reverse_add_opinion = {
			modifier = friendliness_opinion
			target = scope:guest
			opinion = 20
		}
		progress_towards_lover_effect = {
			CHARACTER = scope:guest
			OPINION = no
		}
		stress_impact = {
			celibate = major_stress_impact_gain
			lustful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 20
			modifier = {
				add = 100
				has_trait = lustful
			}
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#####################
# Serve the guests something new (cannibal)
# by Linnéa Thimrén
#####################
feast_default.6261 = {
	type = character_event
	title = feast_default.6261.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = lunatic
						has_trait = possessed
					}
				}
				desc = feast_default.6261.desc_lunatic
			}
			triggered_desc = {
				trigger = {
					NOR = {
						has_trait = lunatic
						has_trait = possessed
					}
				}
				desc = feast_default.6261.desc_not_lunatic
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:cannibal_guest
				}
				desc = feast_default.6261.desc_cannibal_guest
			}
			triggered_desc = {
				trigger = {
					exists = scope:concerned_guest
				}
				desc = feast_default.6261.desc_concerned_guest
			}
		}
	}
	theme = feast_activity
	left_portrait = {
		character = scope:concerned_guest
		animation = worry
	}
	right_portrait = {
		character = scope:cannibal
		animation = ecstasy
	}

	trigger = {
		NOT = { exists = local_var:had_6261 }
		is_cannibal_trigger = yes
		scope:activity = {
			any_participant = {
				feast_default_participant_trigger = yes
				is_cannibal_trigger = no
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #More likely to fire if a guest is cannibal!
			add = 0.5
			scope:activity = {
				any_participant = {
					feast_default_participant_trigger = yes
					is_cannibal_trigger = yes
				}
			}
		}
	}

	immediate = {
		set_local_variable = {
			name = had_6261
			value = yes
		}
		scope:activity = {
			random_participant = {
				limit = {
					feast_default_participant_trigger = yes
					is_cannibal_trigger = yes
				}
				save_scope_as = cannibal_guest
			}
			if = {
				limit = {
					NOT = { exists = scope:cannibal_guest }
				}
				random_participant = {
					limit = {
						feast_default_participant_trigger = yes
						is_cannibal_trigger = no
						probably_intelligent_trigger = yes
					}
					alternative_limit = {
						feast_default_participant_trigger = yes
						is_cannibal_trigger = no
					}
					weight = {
						base = 1
						modifier = {
							add = 2
							is_of_major_interest_to_root_trigger = yes
						}
						modifier = {
							add = 1
							is_of_minor_interest_to_root_trigger = yes
						}
					}
					save_scope_as = concerned_guest
				}
			}
		}
		if = {
			limit = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
				}
			}
			add_trait = maimed
		}
	}

	option = { #Exposed cannibal - don't care about the guest
		name = feast_default.6261.a_exposed
		trigger = {
			has_trait = cannibal
		}
		scope:concerned_guest = {
			add_character_modifier = {
				modifier = stress_starvation
				days = 1825
			}
		}
		add_character_modifier = {
			modifier = feast_good_food_modifier
			years = 10
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}

	option = { #Not exposed as cannibal - don't care about the guest
		name = feast_default.6261.a
		trigger = {
			NOT = { has_trait = cannibal }
		}
		random = {
			chance = 25
			if = {
				limit = {
					any_secret = {
						secret_type = secret_cannibal
						NOT = { is_known_by = scope:concerned_guest }
					}
				}
				random_secret = {
					limit = {
						secret_type = secret_cannibal
						NOT = { is_known_by = scope:concerned_guest }
					}
					reveal_to = scope:concerned_guest
				}
			}
		}
		add_character_modifier = {
			modifier = feast_good_food_modifier
			years = 10
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}

	option = { #Bring them something else to eat
		name = feast_default.6261.b
		add_prestige = medium_prestige_gain
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:concerned_guest
			opinion = 15
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.75
				ai_honor = 0.25
			}
		}
	}

	option = { #Flesh-friend! Bond over shared dietary tips and trix
		name = feast_default.6261.c
		trigger = {
			exists = scope:cannibal_guest
		}
		exclusive = yes
		scope:cannibal_guest = {
			if = {
				limit = {
					any_secret = {
						secret_type = secret_cannibal
						NOT = { is_known_by = scope:activity.activity_owner }
					}
				}
				random_secret = {
					limit = {
						secret_owner = {
							scope:cannibal_guest = this
						}
						secret_type = secret_cannibal
						NOT = { is_known_by = scope:activity.activity_owner }
					}
					reveal_to = scope:activity.activity_owner
				}
			}
		}
		if = {
			limit = {
				any_secret = {
					secret_type = secret_cannibal
					NOT = { is_known_by = scope:cannibal_guest }
				}
			}
			random_secret = {
				limit = {
					secret_type = secret_cannibal
					NOT = { is_known_by = scope:cannibal_guest }
				}
				reveal_to = scope:cannibal_guest
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:cannibal_guest
			OPINION = 20
		}
		reverse_add_opinion = {
			modifier = friendly_interaction
			target = scope:cannibal_guest
		}
		ai_chance = {
			base = 100
		}
	}

	after = {
		hidden_effect = {
			feast_wrap_up_or_fire_random_event_effect = yes
		}
	}
}


#################################
# MURDER FEAST EVENTS
# by Linnéa Thimrén
# 8000-8999
#################################

scripted_trigger murder_feast_default_participant_trigger = {
	is_alive = yes
	NOT = { this = root }
	is_imprisoned = no
}

#To start it all off...
feast_default.8000 = {
	hidden = yes

	immediate = {
		save_scope_as = host
		random_list = {
			80 = { #You succeeded! They will die.
				add_character_flag = {
					flag = murder_feast_success
					days = 50
				}
				if = {
					limit = {
						scope:activity = {
							any_participant = {
								murder_feast_default_participant_trigger = yes
								has_character_flag = murder_feast_to_spare
							}
						}
					}
					trigger_event = feast_default.8001
					scope:activity = {
						every_participant = { #To trigger the events for the participants
							limit = {
								murder_feast_default_participant_trigger = yes
								has_character_flag = murder_feast_to_spare
							}
							trigger_event = feast_default.8051
						}
						every_participant = {
							limit = {
								murder_feast_default_participant_trigger = yes
								NOT = { has_character_flag = murder_feast_to_spare }
							}
							trigger_event = feast_default.8052
						}
					}
				}
				else = {
					trigger_event = feast_default.8002
					scope:activity = {
						every_participant = {
							limit = {
								murder_feast_default_participant_trigger = yes
							}
							trigger_event = feast_default.8052
						}
					}
				}
			}
			10 = { #Bummer, they won't die...
				#The chance to fail is greater if you're dumb
				modifier = {
					factor = 2
					has_trait_rank = {
						trait = intellect_bad
						rank > 1
					}
				}
				modifier = {
					factor = 2
					has_trait_rank = {
						trait = intellect_bad
						rank > 2
					}
				}

				trigger_event = feast_default.8003

				scope:activity = {
					every_participant = {
						limit = {	
							murder_feast_default_participant_trigger = yes
						}
						trigger_event = feast_default.8061
					}
				}
			}
		}

		scope:activity = {
			set_variable = {
				name = end_feast_now
				value = yes
			}
		}
		trigger_event = {
			id = feast_default.9000
			days = 20
		}
	}
}


#For host - They died and I saved my close ones
feast_default.8001 = {
	type = character_event
	title = feast_default.8001.t
	desc = feast_default.8001.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = ecstasy
	}

	option = {
		name = feast_default.8001.a
		add_dread = major_dread_gain
		scope:activity = {
			activity_owner = {
				add_character_flag = {
					flag = sent_relevant_death_event
					days = 2
				}
			}
			every_participant = {
				limit = {
					murder_feast_default_participant_trigger = yes
					NOT = { has_character_flag = murder_feast_to_spare }
				}
				#add_character_flag = {
				#	flag = murder_feast_victim
				#	days = 3
				#}
				death = {
					death_reason = death_burned
					killer = scope:host
				}
			}
			every_participant = {
				limit = {
					murder_feast_default_participant_trigger = yes
					has_character_flag = murder_feast_to_spare
					NOR = {
						has_trait = sadistic
						has_trait = callous
					}
				}
				custom = feast_default.8001_survivors
				add_opinion = {
					target = scope:host
					modifier = cruelty_opinion
					opinion = -10
				}
			}
		}
	}
}

#For host - They died!!
feast_default.8002 = {
	type = character_event
	title = feast_default.8002.t
	desc = feast_default.8002.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = ecstasy
	}

	option = {
		name = feast_default.8002.a
		add_dread = major_dread_gain
		scope:activity = {
			every_participant = {
				limit = {
					murder_feast_default_participant_trigger = yes
				}
				custom = feast_default.8002_death
				save_scope_as = dead
				scope:activity.activity_owner = {
					add_death_event_blocker_effect = { DEAD = scope:dead }
				}
				death = {
					death_reason = death_burned
				}
			}
		}
	}
}

#For host - They didn't die
feast_default.8003 = {
	type = character_event
	title = feast_default.8003.t
	desc = feast_default.8003.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = disbelief
	}
	right_portrait = {
		character = scope:enemy_1
		animation = anger
	}

	option = {
		name = feast_default.8003.a
		add_prestige = medium_prestige_loss
		show_as_tooltip = {
			scope:activity = {
				every_participant = {
					limit = {
						murder_feast_default_participant_trigger = yes
					}
					custom = every_guest_scope_tt
					add_opinion = {
						target = scope:host
						modifier = suspicion_opinion
						opinion = -5
					}
				}
			}
		}
	}
}

#For guest - Enemies of host died and I was spared
feast_default.8051 = {
	type = character_event
	title = feast_default.8051.t
	desc = feast_default.8051.desc
	theme = feast_activity
	left_portrait = {
		character = scope:host
		animation = ecstasy
	}

	immediate = {
		scope:activity.activity_owner = {
			save_scope_as = host
		}
	}

	option = {
		name = feast_default.8051.a
		show_as_tooltip = {
			scope:activity = {
				every_participant = {
					limit = {
						murder_feast_default_participant_trigger = yes
						NOT = { has_character_flag = murder_feast_to_spare }
					}
					custom = feast_default.8051.a_death
					death = {
						death_reason = death_burned
					}
				}
			}
			scope:host = {
				add_dread = major_dread_gain
			}
		}
	}
}

#For guest - I died
feast_default.8052 = {
	type = character_event
	title = feast_default.8002.t
	desc = feast_default.8052.desc
	theme = feast_activity
	left_portrait = {
		character = root
		animation = pain
	}
	right_portrait = {
		character = scope:host
		animation = ecstasy
	}

	immediate = {
		scope:activity.activity_owner = {
			save_scope_as = host
		}
	}

	option = {
		name = feast_default.8052.a
		show_as_tooltip = {
			death = {
				death_reason = death_burned
			}
		}
	}
}

#For guest - Someone close to me tried to kill people?!
feast_default.8061 = {
	type = character_event
	title = feast_default.8003.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = murder_feast_to_spare	
				}
				desc = feast_default.8061.desc_tried_to_spare_me
			}
			desc = feast_default.8061.desc
		}
	}
	theme = feast_activity
	left_portrait = {
		character = scope:host
		animation = shock
	}

	immediate = {
		scope:activity.activity_owner = {
			save_scope_as = host
		}
	}

	option = {
		name = feast_default.8061.a
		show_as_tooltip = {
			scope:host = {
				add_prestige = medium_prestige_loss
			}
			scope:activity = {
				every_participant = {
					limit = {
						murder_feast_default_participant_trigger = yes
					}
					custom = every_guest_scope_tt
					add_opinion = {
						target = scope:host
						modifier = suspicion_opinion
						opinion = -5
					}
				}
			}
		}
		add_opinion = {
			target = scope:host
			modifier = suspicion_opinion
			opinion = -5
		}
	}
}


#################################
# END EVENTS
# by Petter Vilberg
# 9000-9999
#################################

scripted_trigger feast_end_events_participant_trigger = {
	NOT = { this = scope:host }
	is_alive = yes
	is_imprisoned = no
}

#End events setup
feast_default.9000 = {
	type = character_event
	hidden = yes

	trigger = {
		exists = scope:activity
	}
	
	immediate = {
		if = {
			limit = {
				OR = {
					# Everyone has wrapped up their events
					scope:activity = {
						debug_log_details = checking_participants
						any_participant = {
							count = all
							trigger_if = {
								limit = {
									is_alive = yes
									is_imprisoned = no
								}
								save_temporary_scope_as = participant_check
								scope:activity = {
									is_target_in_variable_list = {
										name = finished_participants
										target = scope:participant_check
									}
								}
							}
							trigger_else = { always = yes }
						}
					}
					# There exists a special exception
					exists = scope:activity.var:end_feast_now
					# Has attempted to wrap up the feast already
					AND = {
						trigger_if = {
							limit = {
								exists = scope:activity.var:attempted_to_end_feast
							}
							scope:activity.var:attempted_to_end_feast > 2
						}
						trigger_else = {
							always = no
						}
					}
				}
			}
			scope:activity = {
				activity_owner = {
					save_scope_as = host
					random_spouse = {
						limit = {
							is_imprisoned = no
							is_landed = no
							is_alive = yes
							this = root.primary_partner
						}
						alternative_limit = {
							is_imprisoned = no
							is_landed = no
							is_alive = yes
						}
						save_scope_as = spouse
					}
				}

				every_participant = {
					limit = { feast_end_events_participant_trigger = yes }
					trigger_event = feast_default.9002
				}
				activity_owner = {
					trigger_event = feast_default.9001
				}
			}
		}
		if = {
			limit = { NOT = { exists = scope:activity.var:attempted_to_end_feast } }
			scope:activity = {
				set_variable = {
					name = attempted_to_end_feast
					value = 1
				}
			}
		}
		else = {
			scope:activity = {
				change_variable = {
					name = attempted_to_end_feast
					add = 1
				}
			}
		}
		trigger_event = {
			id = feast_default.9000
			days = 20
		}
	}
}


#Host end event
feast_default.9001 = {
	type = character_event
	title = feast_default.9001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:murder_feast
				}
				desc = {
					first_valid = {
						triggered_desc = {
							trigger = {
								has_character_flag = murder_feast_success
							}
							desc = feast_default.9001.desc_murder_feast_success
						}
						desc = feast_default.9001.desc_murder_feast_fail
					}
				}
			}
			triggered_desc = {
				trigger = {
					has_character_flag = murdered_someone_during_feast
				}
				desc = feast_default.9001.desc_murder
			}
			desc = feast_default.9001.desc
		}
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:spouse }
				desc = feast_default.9001.spouse
			}
			desc = feast_default.9001.no_spouse
		}
	}
	theme = feast_activity
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:spouse
		animation = personality_bold
	}

	immediate = {
		if = {
			limit = {
				NOT = { exists = scope:spouse }
				is_married = yes
			}
			random_spouse = {	
				limit = {
					is_available = yes
					this = root.primary_spouse
				}
				alternative_limit = {
					is_available = yes
				}
				save_scope_as = spouse
			}
		}
	}
	
	option = {
		name = feast_default.9001.a
		hosted_successful_feast_effect = yes
	}

	after = {
		scope:activity = {
			complete_activity = yes
		}
		if = {
			limit = {
				has_character_flag = murdered_someone_during_feast
			}
			remove_character_flag = murdered_someone_during_feast
		}
	}
}



#Guest end event
feast_default.9002 = {
	type = character_event
	title = feast_default.9002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:murder_feast
				}
				desc = feast_default.9002.desc_murder_feast
			}
			desc = feast_default.9002.desc
		}
		desc = feast_default.9002.desc_ending
	}
	theme = feast_activity
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:host
		animation = happiness
	}

	option = {
		name = feast_default.9002.a
		feast_end_guest_effect = yes
		reverse_add_opinion = {
			target = scope:host
			modifier = feast_attended_my_feast_opinion
		}
	}
}



#################
# Feast Support
#################
# Feast reroll event - in case no event is available
feast_default.9999 = {
	hidden = yes

	trigger = {
		exists = scope:activity
	}

	immediate = {
		feast_wrap_up_or_fire_random_event_effect = yes	
	}
}