###################################
#
# Events for Feasts
#
# Id 72000 - 72999 is reserved
#
###################################
#
# Designed by Johan Andersson
# Written by Sara Wendel-Örtqvist
# Reworked by Rylock

#Starting the feast
character_event = {
	id = 72109
	desc = "EVTDESC72109"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no
	has_character_flag = planning_feast

	trigger = {
		month = 10
		is_not_busy_trigger = yes
		NOT = { is_inaccessible_trigger = yes }
	}

	immediate = {
		add_character_modifier = {
			name = holding_large_feast
			duration = -1
		}
		set_character_flag = held_recent_feast
		clr_character_flag = planning_feast
		clr_character_flag = sent_invitations
		clr_character_flag = host_feast_started
		clr_character_flag = feast_jongleur
		clr_character_flag = feast_musicians
		clr_character_flag = dealt_with_robber_band
		clr_character_flag = guest_daughter_event
		clr_character_flag = guest_claim_event
		clr_character_flag = feast_minstrel
		clr_character_flag = feast_fireeaters
		clr_character_flag = feast_conjurer
		clr_character_flag = lavishly_food
		clr_character_flag = medium_food
		clr_character_flag = low_food
		clr_character_flag = castle_problems
		clr_character_flag = feast_jester
		clr_character_flag = feast_drunkard_guest
		clr_character_flag = feast_duel
		clr_character_flag = feast_boar_hunt
		hidden_tooltip = {
			character_event = { id = 72003 days = 25 random = 10 } # food preparations
			character_event = { id = 72997 days = 7 random = 5 } # first pre-feast event trigger
			character_event = { id = 72999 days = 300 }	# Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 85
				hidden = yes
			}
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA72109"
	}
}

#Main trigger for pre-feast events
character_event = {
	id = 72997

	hide_window = yes
	is_triggered_only = yes
	war = no

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = { has_character_flag = host_feast_started }
	}

	immediate = {
		random_list = {
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_jongleur
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72000 } # wandering jongleurs
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_minstrel
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72001 } # traveling minstrel
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_musicians
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72002 } # musician
			}
			20 = {
				modifier = {
					factor = 0
					OR = {
						has_character_flag = castle_problems
						NOT = { any_courtier = { has_job_title = job_treasurer } }
					}
				}
				modifier = {
					factor = 0.5
					OR = {
						has_character_flag = castle_problems
						has_character_flag = dealt_with_robber_band
						has_character_flag = feast_boar_hunt
					}
				}
				character_event = { id = 72004 } # castle problems
			}
			50 = {
				modifier = {
					factor = 0
					OR = {
						has_character_flag = dealt_with_robber_band
						NOT = { any_courtier = { has_job_title = job_marshal } }
						NOT = { location = { has_province_modifier = highway_robber_band } }
					}
				}
				modifier = {
					factor = 0.5
					OR = {
						has_character_flag = castle_problems
						has_character_flag = dealt_with_robber_band
						has_character_flag = feast_boar_hunt
					}
				}
				character_event = { id = 72005 } # highway robber band
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_fireeaters
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72006 } # fire-eaters
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_conjurer
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72007 } # conjurer
			}
			20 = {
				modifier = {
					factor = 2.5
					trait = hunter
				}
				modifier = {
					factor = 0
					OR = {
						religion = cathar
						religion = jain
						religion_group = jewish_group
						has_character_flag = feast_boar_hunt
						NOT = { any_courtier = { has_job_title = job_marshal } }
					}
				}
				modifier = {
					factor = 0.5
					OR = {
						has_character_flag = castle_problems
						has_character_flag = dealt_with_robber_band
						has_character_flag = feast_boar_hunt
					}
				}
				character_event = { id = 72008 } # boar hunt
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_acrobats
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72009 } # acrobats
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = feast_dancers
				}
				modifier = {
					factor = 0.5
					lower_tier_than = KING
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				character_event = { id = 72120 } # traveling dancers
			}
			100 = {
				modifier = {
					factor = 0
					higher_tier_than = COUNT
					NOT = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				modifier = {
					factor = 2
					tier = COUNT
				}
				modifier = {
					factor = 0.5
					higher_tier_than = DUKE
				}
				modifier = {
					factor = 2
					OR = {
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
					}
				}
				modifier = {
					factor = 5
					calc_true_if = {
						amount = 2
						has_character_flag = feast_jongleur
						has_character_flag = feast_minstrel
						has_character_flag = feast_musicians
						has_character_flag = feast_fireeaters
						has_character_flag = feast_conjurer
						has_character_flag = feast_acrobats
						has_character_flag = feast_dancers
						has_character_flag = castle_problems
						has_character_flag = dealt_with_robber_band
						has_character_flag = feast_boar_hunt
					}
				}
				# no event
			}
		}
		repeat_event = { id = 72997 days = 10 random = 5 }
	}
}


###################################
#Events before the Feast
###################################

### A troop of wandering jongleurs seek your patronage ###
character_event = {
	id = 72000
	desc = "EVTDESC72000"
	picture = GFX_evt_jugglers

	prisoner = no
	only_rulers = yes
	capable_only = yes
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_jongleur
		}
	}

	option = {
		name = "EVTOPTA72000"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 30
				treasury = 30
			}
		}
		treasury = -10
		set_character_flag = feast_jongleur
	}
	option = {
		name = "EVTOPTB72000"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 30
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#A travelling minstrel seeks your patronage
character_event = {
	id = 72001
	desc = "EVTDESC72001"
	picture = GFX_evt_feast

	prisoner = no
	only_rulers = yes
	capable_only = yes
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_minstrel
		}
	}

	option = {
		name = "EVTOPTA72001"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 30
				treasury = 30
			}
		}
		set_character_flag = feast_minstrel
		treasury = -10
	}
	option = {
		name = "EVTOPTB72001"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 30
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#Musicians seek your patronage
character_event = {
	id = 72002
	desc = "EVTDESC72002"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_musicians
		}
	}

	option = {
		name = "EVTOPTA72002"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 30
				treasury = 30
			}
		}
		set_character_flag = feast_musicians
		treasury = -10
	}
	option = {
		name = "EVTOPTB72002"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 30
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#Food Preparations
character_event = {
	id = 72003
	desc = "EVTDESC72003"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = lavishly_food
			has_character_flag = medium_food
			has_character_flag = low_food
		}
	}

	option = {
		name = "EVTOPTA72003" #Spend lavishly on food
		trigger = { NOT = { trait = temperate } }
		ai_chance = {

			factor = 30

			modifier = {
				factor = 0.5
				trait = greedy
			}
			modifier = {
				factor = 3
				trait = gluttonous
			}
			modifier = {
				factor = 0.1
				trait = temperate
			}
			modifier = {
				factor = 2
				primary_title = { higher_tier_than = DUKE }
			}
		}
		set_character_flag = lavishly_food
		treasury = -20
		prestige = 10
		hidden_tooltip = {
			character_event = { id = 72010 days = 2 random = 5 } # send invitations
		}
	}
	option = {
		name = "EVTOPTB72003" #Spend medium on food
		ai_chance = {
			factor = 30

			modifier = {
				factor = 0.5
				NOT = { trait = greedy }
			}
			modifier = {
				factor = 2
				NOT = { trait = gluttonous }
			}
			modifier = {
				factor = 2
				primary_title = { tier = DUKE }
			}
		}
		set_character_flag = medium_food
		treasury = -10
		hidden_tooltip = {
			character_event = { id = 72010 days = 2 random = 5 } # send invitations
		}

	}
	option = {
		name = "EVTOPTC72003" #Spend low on food
		trigger = { NOT = { trait = gluttonous } }
		ai_chance = {
			factor = 30

			modifier = {
				factor = 2.5
				trait = greedy
			}
			modifier = {
				factor = 0.1
				trait = gluttonous
			}
			modifier = {
				factor = 2
				primary_title = { tier = COUNT }
			}
		}
		set_character_flag = low_food
		treasury = -5
		prestige = -5
		hidden_tooltip = {
			character_event = { id = 72010 days = 2 random = 5 } # send invitations
		}

	}
}

#Castle problems
character_event = {
	id = 72004
	desc = "EVTDESC72004"
	picture = GFX_evt_castle_construction

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = castle_problems
		}
		any_courtier = {
			has_job_title = job_treasurer
		}
	}

	option = {
		name = "EVTOPTA72004"
		set_character_flag = castle_problems
		scaled_wealth = -0.2
	}
}

#Send Marshal to deal with Highway Robber Band
character_event = {
	id = 72005
	desc = "EVTDESC72005"
	picture = GFX_evt_bandits

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = dealt_with_robber_band
		}
		any_courtier = { has_job_title = job_marshal }
		location = { has_province_modifier = highway_robber_band }
	}

	option = {
		name = "EVTOPTA72005"
		job_marshal = {
			random_list = {
				5 = {
					death = { death_reason = death_rabble }
				}
				50 = {
					ROOT = {
						location = {
							remove_province_modifier = highway_robber_band
						}
					}
				}
				45 = {
				}
			}
		}
	}
	option = {
		name = "EVTOPTB72005"
		prestige = -10
	}
}

#Fire-eaters seek your patronage
character_event = {
	id = 72006
	desc = "EVTDESC72006"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_fireeaters
		}
	}

	option = {
		name = "EVTOPTA72006"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 20
				treasury = 30
			}
		}
		set_character_flag = feast_fireeaters
		treasury = -10
	}
	option = {
		name = "EVTOPTB72006"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 20
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#A Conjurer seeks your patronage
character_event = {
	id = 72007
	desc = "EVTDESC72007"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_conjurer
		}
	}

	option = {
		name = "EVTOPTA72007"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 20
				treasury = 30
			}
		}
		set_character_flag = feast_conjurer
		treasury = -10
	}
	option = {
		name = "EVTOPTB72007"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 20
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#Hunt for boars for winter feast
character_event = {
	id = 72008
	desc = "EVTDESC72008"
	picture = GFX_evt_hunt

	only_rulers = yes
	prisoner = no
	capable_only = yes
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			religion = cathar
			religion = jain
			religion_group = jewish_group
			has_character_flag = feast_boar_hunt
			has_character_flag = host_feast_started
		}
		any_courtier = { has_job_title = job_marshal }
	}

	immediate = {
		set_character_flag = feast_boar_hunt
	}

	option = {
		name = "EVTOPTA72008"
		job_marshal = {
			prestige = 10
			opinion = {
				modifier = opinion_flattered
				who = ROOT
				years = 10
			}
			random_list = {
				80 = { }
				10 = { change_martial = 1 }
				7 = {
					add_trait = wounded
					hidden_tooltip = { character_event = { id = 38280 } }
				}
				2 = {
					add_maimed_trait_effect = yes
					hidden_tooltip = { character_event = { id = 38281 } }
				}
				1 = {
					death = { death_reason = death_accident_boar }
				}
			}
			hidden_tooltip = { change_variable = { which = "lifestyle_martial" value = 1 } }
		}
	}
	option = {
		name = "EVTOPTB72008"
		trigger = {
			any_child = {
				age = 14
				is_female = no
				is_abroad_trigger = no
				prisoner = no
				liege = { character = ROOT }
				NOT = { health_traits = 1 }
				is_alive = yes
			}
		}
		random_child = {
			limit = {
				age = 14
				is_female = no
				is_abroad_trigger = no
				prisoner = no
				liege = { character = ROOT }
				NOT = { health_traits = 1 }
				is_alive = yes
			}
			prestige = 10
			opinion = {
				modifier = opinion_flattered
				who = ROOT
				years = 10
			}
			random_list = {
				80 = { }
				10 = { change_martial = 1 }
				7 = {
					add_trait = wounded
					hidden_tooltip = { character_event = { id = 38280 } }
				}
				2 = {
					add_maimed_trait_effect = yes
					hidden_tooltip = { character_event = { id = 38281 } }
				}
				1 = {
					death = { death_reason = death_accident_boar }
				}
			}
			hidden_tooltip = { change_variable = { which = "lifestyle_martial" value = 1 } }
		}
	}
	option = {
		name = "EVTOPTC72008"
		trigger = {
			age = 14
			is_female = no
			NOT = { health_traits = 1 }
			NOT = { trait = craven }
		}
		prestige = 10
		random_list = {
			80 = { }
			10 = { change_martial = 1 }
			7 = {
				add_trait = wounded
				hidden_tooltip = { character_event = { id = 38280 } }
			}
			2 = {
				add_maimed_trait_effect = yes
				hidden_tooltip = { character_event = { id = 38281 } }
			}
			1 = {
				death = { death_reason = death_accident_boar }
			}
		}
		hidden_tooltip = { change_variable = { which = "lifestyle_martial" value = 1 } }
	}
	option = {
		name = "EVTOPTD72008"
	}
}

#Acrobats seek your patronage
character_event = {
	id = 72009
	desc = "EVTDESC72009"
	picture = GFX_evt_feast

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_acrobats
		}
	}

	option = {
		name = "EVTOPTA72009"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 20
				treasury = 30
			}
		}
		set_character_flag = feast_acrobats
		treasury = -10
	}
	option = {
		name = "EVTOPTB72009"
		ai_chance = {
			factor = 5

			modifier = {
				factor = 20
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

#Traveling Dancers seek your patronage
character_event = {
	id = 72120
	desc = EVTDESC72120
	picture = GFX_evt_jugglers

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = {
			has_character_flag = host_feast_started
			has_character_flag = feast_dancers
		}
	}

	option = {
		name = EVTOPTA72120
		ai_chance = {
			factor = 5

			modifier = {
				factor = 0.1
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 20
				treasury = 30
			}
		}
		set_character_flag = feast_dancers
		wealth = -10
	}
	option = {
		name = EVTOPTB72120
		ai_chance = {
			factor = 5

			modifier = {
				factor = 20
				NOT = {
					treasury = 30
				}
			}
			modifier = {
				factor = 0.1
				treasury = 30
			}
		}
		prestige = -10
	}
}

###################################
#Invitations to Feast
###################################

#Send invites
character_event = {
	id = 72010
	desc = "EVTDESC72010"
	picture = GFX_evt_feast

	is_triggered_only = yes

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		has_character_modifier = holding_large_feast
		OR = {
			has_character_flag = lavishly_food
			has_character_flag = medium_food
			has_character_flag = low_food
		}
		NOT = { has_character_flag = sent_invitations }
	}

	option = {
		name = "EVTOPTA72010"
		set_character_flag = sent_invitations
		any_vassal = {
			limit = {
				NOT = { is_inaccessible_trigger = yes }
				prisoner = no
				NOT = { trait = incapable }
				is_not_busy_trigger = yes
				war = no
				is_adult = yes
			}
			letter_event = { id = 72011 days = 1 random = 2 tooltip = "EVTTOOLTIP72011" } # send invitation
		}
		hidden_tooltip = {
			character_event = { id = 72015 days = 10 } # start the feast
		}
	}
}

#Vassal is invited to the feast
letter_event = {
	id = 72011

	desc = {
		text = EVTDESC72011
		trigger = {
			FROM = { NOT = { has_character_flag = nerthus_feast } }
		}
	}
	desc = {
		text = EVTDESC72011_nerthus
		trigger = {
			FROM = { has_character_flag = nerthus_feast }
		}
	}

	is_triggered_only = yes

	trigger = { NOT = { is_inaccessible_trigger = yes } }

	option = {
		name = "EVTOPTA72011" #Travel to the feast
		ai_chance = {
			factor = 1
			modifier  = {
				factor = 0.1
				ai = yes
				is_inaccessible_trigger = yes
			}
			modifier = {
				factor = 2
				opinion = { who = from value = -40 }
			}
			modifier  = {
				factor = 2
				opinion = { who = from value = -20 }
			}
		}
		set_character_flag = coming_to_feast
		hidden_tooltip = {
			character_event = { id = 72998 days = 60 }	# Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 40
				hidden = yes
			}
		}
		if = {
			limit = { is_inaccessible_trigger = yes	}
			end_inaccessibility_effect = yes
		}
		clr_character_flag = guest_feast_started
		clr_character_flag = wounded_opponent
		clr_character_flag = maimed_opponent
		clr_character_flag = killed_opponent
		clr_character_flag = passionated_guest
	}
	option = {
		name = "EVTOPTB72011" #Refuse
		ai_chance = {
			factor = 1
			modifier  = {
				factor = 0
				opinion = { who = from value = 0 }
				NOT = { is_inaccessible_trigger = yes }
			}
			modifier  = {
				factor = 2
				NOT = { opinion = { who = from value = -60 } }
			}
			modifier  = {
				factor = 2
				NOT = { opinion = { who = from value = -80 } }
			}
		}
		FROM = {
			letter_event = {
				id = 72012
				days = 1
				tooltip = "EVTTOOLTIP72012"
			}
		}
	}
}

#Vassal refused to come to the feast
letter_event = {
	id = 72012
	desc = "EVTDESC72012"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72012"
		opinion = {
			modifier = opinion_dislike
			who = FROM
			years = 10
		}
	}
}

#The guests have arrived
character_event = {
	id = 72015
	picture = GFX_evt_feast

	desc = {
		text = EVTDESC72015
		trigger = {
			NOT = { has_character_flag = nerthus_feast }
		}
	}
	desc = {
		text = EVTDESC72015_nerthus
		trigger = {
			has_character_flag = nerthus_feast
		}
	}

	only_rulers = yes
	capable_only = yes
	prisoner = no
	war = no
	has_character_flag = sent_invitations

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_large_feast
		NOT = { has_character_flag = host_feast_started }
	}

	immediate = {
		set_character_flag = host_feast_started
	}

	option = {
		name = "EVTOPTA72015"
		any_vassal = {
			limit = { has_character_flag = coming_to_feast }
			character_event = {
				id = 72016
				tooltip = "EVTTOOLTIP72016"
			}
		}
		hidden_tooltip = {
			character_event = { id = 72995 days = 5 random = 5 } # first main trigger event
			character_event = { id = 72110 days = 30 } # feast ends
		}
	}
}

#Welcome to the feast!
character_event = {
	id = 72016
	desc = "EVTDESC72016"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72016"
		set_character_flag = guest_feast_started
		hidden_tooltip = {
			character_event = { id = 72996 days = 3 random = 25 } # main guest trigger event
		}
	}
}

###################################
#Events during feast
###################################

#Main trigger for host's feast events
character_event = {
	id = 72995

	hide_window = yes
	is_triggered_only = yes

	only_rulers = yes
	war = no
	prisoner = no
	has_character_flag = host_feast_started

	trigger = {
		NOT = { trait = incapable }
		has_character_modifier = holding_large_feast
	}

	immediate = {
		random_list = {
			10 = {
				modifier = {
					factor = 0
					OR = {
						NOT = {
							any_courtier = {
								has_minor_title = title_court_jester
								NOT = { opinion = { who = ROOT value = 25 } }
							}
						}
						has_character_flag = feast_jester
						NOT = { any_vassal = { has_character_flag = guest_feast_started } }
					}
				}
				modifier = {
					factor = 2
					any_courtier = {
						has_minor_title = title_court_jester
						NOT = { opinion = { who = ROOT value = -25 } }
					}
				}
				character_event = { id = 72060 } #Jester jokes about your rule
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_jongleur }
				}
				character_event = { id = 72063 } #Jongleurs entertain the guests
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_minstrel }
				}
				character_event = { id = 72065 } #Minstrel entertain the guests
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_musicians }
				}
				character_event = { id = 72067 } #Musicians entertain the guests
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_fireeaters }
				}
				character_event = { id = 72069 } #Fire-eaters entertain the guests
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_conjurer }
				}
				character_event = { id = 72071 } #Conjurer entertain the guests
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_acrobats }
				}
				character_event = { id = 4160 } #Travelling Acrobats
			}
			50 = {
				modifier = {
					factor = 0
					NOT = { has_character_flag = feast_dancers }
				}
				character_event = { id = 4165 } #Travelling dancers
			}
			10 = {
				modifier = {
					factor = 4
					trait = lustful
				}
				modifier = {
					factor = 3
					has_focus = focus_seduction
				}
				modifier = {
					factor = 2
					trait = hedonist
				}
				modifier = {
					factor = 0.1
					trait = chaste
				}
				modifier = {
					factor = 0
					religion = cathar
				}
				modifier = {
					factor = 0
					OR = {
						NOT = { fertility = 0.4 }
						age = 60
						AND = {
							OR = {
								has_lover = yes
								is_married = yes
							}
							NOT = {
								ai = no
								trait = lustful
								trait = hedonist
								trait = deceitful
								trait = seducer
								trait = seductress
								any_spouse = {
									NOT = { reverse_opinion = { who = ROOT value = 0 } }
								}
							}
						}
					}
				}
				modifier = {
					factor = 0
					NOT = {
						any_vassal = {
							has_character_flag = guest_feast_started
							OR = {
								AND = {
									is_adult = yes
									opinion = { who = ROOT value = 20 }
									OR = {
										AND = {
											same_sex = ROOT
											ROOT = { trait = homosexual }
										}
										AND = {
											is_opposite_sex = ROOT
											NOT = { ROOT = { trait = homosexual } }
										}
									}
									is_pregnant = no
									NOT = {
										age = 30
										trait = celibate
										trait = chaste
										trait = eunuch
										is_close_relative = ROOT
										any_spouse = { character = ROOT }
										any_lover = { character = ROOT }
									}
								}
								any_spouse = {
									is_adult = yes
									OR = {
										AND = {
											same_sex = ROOT
											ROOT = { trait = homosexual }
										}
										AND = {
											is_opposite_sex = ROOT
											NOT = { ROOT = { trait = homosexual } }
										}
									}
									is_pregnant = no
									is_abroad_trigger = no
									prisoner = no
									opinion = { who = ROOT value = 20 }
									NOT = {
										character = ROOT
										is_close_relative = ROOT
										age = 40
										trait = celibate
										trait = eunuch
										trait = chaste
										any_spouse = { character = ROOT }
										any_lover = { character = ROOT }
									}
								}
							}
						}
					}
				}
				#save possible targets
				random_vassal = {
					limit = {
						is_adult = yes
						has_character_flag = guest_feast_started
						opinion = { who = ROOT value = 20 }
						is_married = yes
						OR = {
							AND = {
								same_sex = ROOT
								ROOT = { trait = homosexual }
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { ROOT = { trait = homosexual } }
							}
						}
						is_pregnant = no
						NOT = {
							age = 30
							trait = celibate
							trait = chaste
							trait = eunuch
							is_close_relative = ROOT
							any_spouse = { character = ROOT }
							any_lover = { character = ROOT }
						}
					}
					save_event_target_as = pretty_married_vassal
				}
				random_vassal = {
					limit = {
						is_adult = yes
						has_character_flag = guest_feast_started
						opinion = { who = ROOT value = 20 }
						is_married = no
						OR = {
							AND = {
								same_sex = ROOT
								ROOT = { trait = homosexual }
							}
							AND = {
								is_opposite_sex = ROOT
								NOT = { ROOT = { trait = homosexual } }
							}
						}
						is_pregnant = no
						NOT = {
							age = 30
							trait = celibate
							trait = chaste
							trait = eunuch
							is_close_relative = ROOT
							any_spouse = { character = ROOT }
							any_lover = { character = ROOT }
						}
					}
					save_event_target_as = pretty_single_vassal
				}
				random_vassal = {
					limit = {
						has_character_flag = guest_feast_started
						is_married = yes
						any_spouse = {
							is_adult = yes
							OR = {
								AND = {
									same_sex = ROOT
									ROOT = { trait = homosexual }
								}
								AND = {
									is_opposite_sex = ROOT
									NOT = { ROOT = { trait = homosexual } }
								}
							}
							is_pregnant = no
							is_abroad_trigger = no
							prisoner = no
							opinion = { who = ROOT value = 20 }
							NOT = {
								character = ROOT
								is_close_relative = ROOT
								age = 40
								trait = celibate
								trait = eunuch
								trait = chaste
							}
						}
					}
					random_spouse = {
						limit = {
							is_adult = yes
							OR = {
								AND = {
									same_sex = ROOT
									ROOT = { trait = homosexual }
								}
								AND = {
									is_opposite_sex = ROOT
									NOT = { ROOT = { trait = homosexual } }
								}
							}
							is_pregnant = no
							is_abroad_trigger = no
							prisoner = no
							opinion = { who = ROOT value = 20 }
							NOT = {
								character = ROOT
								is_close_relative = ROOT
								age = 40
								trait = celibate
								trait = eunuch
								trait = chaste
							}
						}
						save_event_target_as = pretty_vassal_spouse
					}
				}
				character_event = { id = 72075 } #Friendly with another guest's spouse
			}
			5 = {
				modifier = {
					factor = 0
					religion = cathar
				}
				modifier = {
					factor = 2
					trait = gregarious
				}
				modifier = {
					factor = 2
					trait = trusting
				}
				modifier = {
					factor = 0.5
					trait = shy
				}
				modifier = {
					factor = 0.5
					trait = paranoid
				}
				modifier = {
					factor = 0
					num_of_friends = 3
				}
				modifier = {
					factor = 0
					NOT = {
						any_vassal = {
							has_character_flag = guest_feast_started
							NOT = {
								num_of_friends = 3
								is_friend = ROOT
								is_rival = ROOT
							}
						}
					}
				}
				character_event = { id = 72080 } #Late night talk: First person
			}
			10 = {
				modifier = {
					factor = 0
					has_character_flag = guest_claim_event
				}
				modifier = {
					factor = 0
					NOT = {
						any_claim = {
							ROOT = { has_strong_claim = PREV }
							can_be_given_away = yes
							holder_scope = {
								has_character_flag = guest_feast_started
								vassal_of = ROOT
							}
						}
					}
				}
				character_event = { id = 72085 } #Claim on visitor's title
			}
			10 = {
				modifier = {
					factor = 2
					trait = gregarious
				}
				modifier = {
					factor = 0.1
					trait = paranoid
				}
				modifier = {
					factor = 0
					has_character_flag = guest_daughter_event
				}
				modifier = {
					factor = 0
					NOT = {
						AND = {
							NOT = { num_of_children = 1 }
							is_married = no
							OR = {
								religion_group = christian
								religion_group = jewish_group
							}
							has_lover = no
							NOT = { trait = shy }
							fertility = 0.4
						}
						any_child = {
							is_female = no
							is_adult = yes
							NOT = { age = 26 }
							same_realm = ROOT
							OR = {
								AND = {
									is_betrothed = no
									is_married = no
								}
								NOT = { trait = chaste }
							}
							OR = {
								religion_group = christian
								religion_group = jewish_group
							}
							has_lover = no
							NOT = { trait = shy }
							fertility = 0.4
						}
					}
				}
				modifier = {
					factor = 0
					NOT = {
						any_vassal = {
							has_character_flag = guest_feast_started
							any_child = {
								is_female = yes
								is_married = no
								is_betrothed = no
								has_lover = no
								fertility = 0.4
								NOT = { is_close_relative = ROOT }
								is_adult = yes
								NOT = { age = 26 }
								is_abroad_trigger = no
								opinion = { who = ROOT value = 20 }
							}
						}
					}
				}
				set_character_flag = guest_daughter_event
				if = {
					limit = {
						NOT = { num_of_children = 1 }
						is_married = no
						OR = {
							religion_group = christian
							religion_group = jewish_group
						}
						has_lover = no
						NOT = { trait = shy }
						fertility = 0.4
					}
					character_event = { id = 72090 } #Host or Host's son "falls in love" with unmarried daughter of vassal
				}
				if = {
					limit = {
						OR = {
							num_of_children = 1
							is_married = yes
							NOT = {
								religion_group = christian
								religion_group = jewish_group
							}
							has_lover = yes
							trait = shy
							NOT = { fertility = 0.4 }
						}
					}
					random_child = {
						limit = {
							is_female = no
							is_adult = yes
							NOT = { age = 26 }
							same_realm = ROOT
							OR = {
								AND = {
									is_betrothed = no
									is_married = no
								}
								NOT = { trait = chaste }
							}
							OR = {
								religion_group = christian
								religion_group = jewish_group
							}
							has_lover = no
							NOT = { trait = shy }
							fertility = 0.4
						}
						character_event = { id = 72090 } #Host or Host's son "falls in love" with unmarried daughter of vassal
					}
				}
			}
			100 = {
				#no event
			}
		}
		repeat_event = { id = 72995 days = 5 random = 5 }
	}
}

#Main trigger for guest's feast events
character_event = {
	id = 72996

	hide_window = yes
	is_triggered_only = yes

	war = no
	only_rulers = yes
	prisoner = no
	has_character_flag = guest_feast_started

	trigger = {
		NOT = { trait = incapable }
		liege = {
			war = no
			is_ruler = yes
			prisoner = no
			NOT = { trait = incapable }
			has_character_flag = host_feast_started
			has_character_modifier = holding_large_feast
		}
	}

	immediate = {
		random_list = {
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 2
					liege = { trait = gluttonous }
				}
				modifier = {
					factor = 0
					liege = {
						NOT = { has_character_flag = lavishly_food }
					}
				}
				modifier = {
					factor = 0
					liege = {
						OR = {
							has_character_modifier = complain_food_timer
							has_character_modifier = compliment_food_timer
							has_opinion_modifier = { who = ROOT modifier = opinion_happy }
							has_opinion_modifier = { who = ROOT modifier = opinion_irritated }
						}
					}
				}
				character_event = { id = 72020 } #Lavish Food
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					liege = {
						NOT = { has_character_flag = medium_food }
					}
				}
				modifier = {
					factor = 0
					liege = {
						OR = {
							has_character_modifier = complain_food_timer
							has_character_modifier = compliment_food_timer
							has_opinion_modifier = { who = ROOT modifier = opinion_happy }
							has_opinion_modifier = { who = ROOT modifier = opinion_irritated }
						}
					}
				}
				character_event = { id = 72021 } #Medium Food
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 2
					liege = { trait = temperate }
				}
				modifier = {
					factor = 0
					liege = {
						NOT = { has_character_flag = low_food }
					}
				}
				modifier = {
					factor = 0
					liege = {
						OR = {
							has_character_modifier = complain_food_timer
							has_character_modifier = compliment_food_timer
							has_opinion_modifier = { who = ROOT modifier = opinion_happy }
							has_opinion_modifier = { who = ROOT modifier = opinion_irritated }
						}
					}
				}
				character_event = { id = 72022 } #Low Food
			}
			5 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					religion = cathar
				}
				modifier = {
					factor = 2
					trait = gregarious
				}
				modifier = {
					factor = 2
					trait = trusting
				}
				modifier = {
					factor = 0.5
					trait = shy
				}
				modifier = {
					factor = 0.5
					trait = paranoid
				}
				modifier = {
					factor = 0
					num_of_friends = 3
				}
				modifier = {
					factor = 0
					NOT = {
						liege = {
							any_vassal = {
								is_adult = yes
								NOT = { num_of_friends = 3 }
								has_character_flag = guest_feast_started
								NOT = {
									character = ROOT
									is_friend = ROOT
									is_rival = ROOT
									any_claim = { holder_scope = { character = ROOT } }
									ROOT = { any_claim = { holder_scope = { character = PREVPREVPREV } } }
								}
							}
						}
					}
				}
				character_event = { id = 72025 } #Late night talk
			}
			5 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					religion = cathar
				}
				modifier = {
					factor = 2
					trait = brave
				}
				modifier = {
					factor = 3
					has_focus = focus_war
				}
				modifier = {
					factor = 0
					liege = { has_character_flag = feast_duel }
				}
				modifier = {
					factor = 0
					OR = {
						NOT = {
							is_female = no
							trait = martial_lady
							trait = martial_lady_tengri
							trait = martial_lady_pagan
						}
						trait = wounded
						is_maimed_trigger = yes
						trait = craven
						NOT = { martial = 9 }
					}
				}
				modifier = {
					factor = 0
					NOT = {
						trait = duelist
						trait = brave
						trait = wroth
						trait = cruel
					}
				}
				modifier = {
					factor = 0
					NOT = {
						liege = {
							any_vassal = {
								is_adult = yes
								OR = {
									is_female = no
									trait = martial_lady
									trait = martial_lady_tengri
									trait = martial_lady_pagan
								}
								has_character_flag = guest_feast_started
								can_be_maimed_trigger = yes
								NOT = {
									character = ROOT
									trait = wounded
									reverse_opinion = { who = ROOT value = -50 }
									opinion = { who = ROOT value = -50 }
								}
							}
						}
					}
				}
				character_event = { id = 72030 } #Duel
			}
			5 = {
				modifier = {
					factor = 0
					religion = cathar
				}
				modifier = {
					factor = 4
					trait = lustful
				}
				modifier = {
					factor = 3
					has_focus = focus_seduction
				}
				modifier = {
					factor = 2
					trait = hedonist
				}
				modifier = {
					factor = 0.1
					trait = chaste
				}
				modifier = {
					factor = 0
					OR = {
						is_pregnant = yes
						AND = {
							OR = {
								has_lover = yes
								is_married = yes
							}
							NOT = {
								ai = no
								trait = lustful
								trait = hedonist
								trait = deceitful
								trait = seducer
								trait = seductress
								any_spouse = {
									NOT = { reverse_opinion = { who = ROOT value = 0 } }
								}
							}
						}
						NOT = { fertility = 0.4 }
						age = 60
					}
				}
				modifier = {
					factor = 0
					NOT = {
						liege = {
							any_vassal = {
								has_character_flag = guest_feast_started
								NOT = { character = ROOT }
								OR = {
									AND = {
										prisoner = no
										is_adult = yes
										is_pregnant = no
										is_abroad_trigger = no
										opinion = { who = ROOT value = 20 }
										OR = {
											AND = {
												same_sex = ROOT
												ROOT = { trait = homosexual }
											}
											AND = {
												is_opposite_sex = ROOT
												NOT = { ROOT = { trait = homosexual } }
											}
										}
										NOT = {
											is_close_relative = ROOT
											trait = celibate
											trait = eunuch
											age = 30
											any_spouse = { character = ROOT }
											any_lover = { character = ROOT }
										}
									}
									any_spouse = {
										prisoner = no
										is_adult = yes
										is_pregnant = no
										is_abroad_trigger = no
										opinion = { who = ROOT value = 20 }
										OR = {
											AND = {
												same_sex = ROOT
												ROOT = { trait = homosexual }
											}
											AND = {
												is_opposite_sex = ROOT
												NOT = { ROOT = { trait = homosexual } }
											}
										}
										NOT = {
											is_close_relative = ROOT
											trait = celibate
											trait = eunuch
											age = 30
											any_spouse = { character = ROOT }
											any_lover = { character = ROOT }
										}
									}
								}
							}
						}
					}
				}

				liege = {
					random_vassal = {
						limit = {
							has_character_flag = guest_feast_started
							NOT = { character = ROOT }
							any_spouse = {
								prisoner = no
								is_adult = yes
								is_pregnant = no
								is_abroad_trigger = no
								opinion = { who = ROOT value = 20 }
								OR = {
									AND = {
										same_sex = ROOT
										ROOT = { trait = homosexual }
									}
									AND = {
										is_opposite_sex = ROOT
										NOT = { ROOT = { trait = homosexual } }
									}
								}
								NOT = {
									is_close_relative = ROOT
									trait = celibate
									trait = eunuch
									age = 30
								}
							}
						}
						random_spouse = {
							limit = {
								prisoner = no
								is_adult = yes
								is_pregnant = no
								is_abroad_trigger = no
								opinion = { who = ROOT value = 20 }
								OR = {
									AND = {
										same_sex = ROOT
										ROOT = { trait = homosexual }
									}
									AND = {
										is_opposite_sex = ROOT
										NOT = { ROOT = { trait = homosexual } }
									}
								}
								NOT = {
									is_close_relative = ROOT
									trait = celibate
									trait = eunuch
									age = 30
								}
							}
							save_event_target_as = target_pretty_guest_spouse
						}
					}
					random_vassal = {
						limit = {
							has_character_flag = guest_feast_started
							NOT = { character = ROOT }
							prisoner = no
							is_adult = yes
							is_pregnant = no
							is_abroad_trigger = no
							opinion = { who = ROOT value = 20 }
							OR = {
								AND = {
									same_sex = ROOT
									ROOT = { trait = homosexual }
								}
								AND = {
									is_opposite_sex = ROOT
									NOT = { ROOT = { trait = homosexual } }
								}
							}
							NOT = {
								is_close_relative = ROOT
								trait = celibate
								trait = eunuch
								age = 30
							}
						}
						save_event_target_as = target_pretty_guest
					}
				}
				character_event = { id = 72040 } #Friendly with another guest's spouse
			}
			30 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					liege = { has_character_flag = feast_drunkard_guest }
				}
				modifier = {
					factor = 0
					trait = drunkard
				}
				character_event = { id = 72045 } #Drink too much wine: become drunkard or insult host
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					liege = { has_character_flag = feast_drunkard_guest }
				}
				modifier = {
					factor = 0
					NOT = { trait = drunkard }
				}
				character_event = { id = 72046 } #Drink too much wine: embarass yourself
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					liege = { has_character_flag = feast_drunkard_guest }
				}
				modifier = {
					factor = 0
					NOT = { trait = drunkard }
				}
				character_event = { id = 72048 } #Drink too much wine: fall asleep
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					liege = { location = { NOT = { has_province_modifier = highway_robber_band } } }
				}
				modifier = {
					factor = 0
					liege = { reverse_has_opinion_modifier = { who = ROOT modifier = opinion_dislike } }
				}
				character_event = { id = 72050 } #Highway Robber Band: Guest Complains
			}
			10 = {
				modifier = {
					factor = 0
					liege = { has_character_modifier = feast_event_timer }
				}
				modifier = {
					factor = 0
					NOT = {
						trait = wroth
						trait = cruel
						trait = impaler
					}
				}
				modifier = {
					factor = 0
					OR = {
						trait = just
						higher_tier_than = COUNT
					}
				}
				modifier = {
					factor = 0
					liege = {
						OR = {
							personality_traits = 6
							location = { has_province_modifier = peasants_upset }
						}
					}
				}
				character_event = { id = 72055 } #Guest kills Host's servant
			}
			100 = {
				modifier = {
					factor = 0.1
					ai = no
				}
				repeat_event = { id = 72996 days = 5 random = 10 }
			}
		}
	}
}

#Lavish Food
character_event = {
	id = 72020
	desc = "EVTDESC72020"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72020" #Approve publicly
		trigger = {
			NOT = { trait = temperate }
		}
		ai_chance = {
			factor = 40
			modifier = {
				factor = 5
				trait = gluttonous
			}
		}
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = compliment_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72023
				tooltip = "EVTTOOLTIP72023" #Liege is glad you liked it
			}
		}
	}
	option = {
		name = "EVTOPTB72020" #Disapprove
		trigger = {
			NOT = { trait = gluttonous }
		}
		ai_chance = {
			factor = 20
			modifier = {
				factor = 5
				trait = temperate
			}
		}
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = complain_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72024
				tooltip = "EVTTOOLTIP72024" #Liege dislike you complaining about the food
			}
		}
	}
	option = {
		name = "EVTOPTC72020"
		prestige = -10
	}
}

#Medium Food
character_event = {
	id = 72021
	desc = "EVTDESC72021"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72021" #Approve publicly
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = compliment_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72023
				tooltip = "EVTTOOLTIP72023" #Liege is glad you liked it
			}
		}
	}
	option = {
		name = "EVTOPTB72021" #Disapprove
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = complain_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72024
				tooltip = "EVTTOOLTIP72024" #Liege dislike you complaining about the food
			}
		}
	}
	option = {
		name = "EVTOPTC72021"
		prestige = -10
	}
}

#Low Food
character_event = {
	id = 72022
	desc = "EVTDESC72022"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72022" #Approve publicly
		trigger = {
			NOT = { trait = gluttonous }
		}
		ai_chance = {
			factor = 20
			modifier = {
				factor = 5
				trait = temperate
			}
		}
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = compliment_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72023
				tooltip = "EVTTOOLTIP72023" #Liege is glad you liked it
			}
		}
	}
	option = {
		name = "EVTOPTB72022" #Disapprove
		trigger = {
			NOT = { trait = temperate }
		}
		ai_chance = {
			factor = 40
			modifier = {
				factor = 5
				trait = gluttonous
			}
		}
		liege = {
			hidden_tooltip = {
				add_character_modifier = {
					name = complain_food_timer
					duration = 14
					hidden = yes
				}
			}
			character_event = {
				id = 72024
				tooltip = "EVTTOOLTIP72024" #Liege dislike you complaining about the food
			}
		}
	}
	option = {
		name = "EVTOPTC72022"
		prestige = -10
	}
}

#Liege is glad you liked the food at the feast
character_event = {
	id = 72023
	desc = "EVTDESC72023"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72023"
		opinion = {
			modifier = opinion_happy
			who = FROM
			years = 10
		}
		reverse_opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Liege dislikes you complaining about the food at the feast
character_event = {
	id = 72024
	desc = "EVTDESC72024"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72024"
		opinion = {
			modifier = opinion_irritated
			who = FROM
			years = 10
		}
		reverse_opinion = {
			modifier = opinion_disapprove
			who = FROM
			years = 10
		}
	}
}

#Late night talk: First person
character_event = {
	id = 72025
	desc = "EVTDESC72025"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72025"
		liege = {
			random_vassal = {
				limit = {
					is_adult = yes
					NOT = { num_of_friends = 3 }
					has_character_flag = guest_feast_started
					NOT = {
						character = ROOT
						is_friend = ROOT
						is_rival = ROOT
						any_claim = { holder_scope = { character = ROOT } }
						ROOT = { any_claim = { holder_scope = { character = PREVPREVPREV } } }
					}
				}
				add_friend = ROOT
				character_event = {
					id = 72026
					tooltip = "EVTTOOLTIP72026"
				}
			}
		}
	}
}

#Late night talk: Second person
character_event = {
	id = 72026
	desc = "EVTDESC72026"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72026"
		tooltip = {
			add_friend = FROM
		}
	}
}

#Duel: Start
character_event = {
	id = 72030
	desc = "EVTDESC72030"
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72030"
		save_event_target_as = duel_challenger
		liege = {
			save_event_target_as = feast_duel_host
			set_character_flag = feast_duel
			random_vassal = {
				limit = {
					is_adult = yes
					OR = {
						is_female = no
						trait = martial_lady
						trait = martial_lady_tengri
						trait = martial_lady_pagan
					}
					has_character_flag = guest_feast_started
					can_be_maimed_trigger = yes
					NOT = {
						character = ROOT
						trait = wounded
						reverse_opinion = { who = ROOT value = -50 }
						opinion = { who = ROOT value = -50 }
					}
				}
				save_event_target_as = duel_challenged
				character_event = {
					id = 72031
					tooltip = "EVTTOOLTIP72031"
				}
			}
		}
	}
	option = {
		name = "EVTOPTB72030" #Decline
		prestige = -10
	}
}

#Duel: Accept or Decline
character_event = {
	id = 72031
	desc = "EVTDESC72031"
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		hidden_tooltip = {
			FROM = {
				event_target:feast_duel_host = {
					character_event = {
						id = 72038
					}
				}
			}
		}
	}
	option = {
		name = EVTOPTA72031 #Accept

		set_character_flag = feast_duelist
		FROM = { set_character_flag = feast_duelist }

		# Begin duel
		hidden_tooltip = { e_rebels = { holder_scope = { character_event = { id = DuelEngine.0 } } } }
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = poor_warrior
			}
			modifier = {
				factor = 3
				trait = trained_warrior
			}
			modifier = {
				factor = 4
				trait = skilled_warrior
			}
			modifier = {
				factor = 5
				trait = master_warrior
			}
			modifier = {
				factor = 5
				trait = duelist
			}
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 1.5
				is_strong_trigger = yes
			}
		}
	}
	option = {
		name = EVTOPTB72031 #Decline
		prestige = -10
		if = {
			limit = { NOT = { trait = craven } }
			random = {
				chance = 25
				add_trait = craven
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				FROM = { trait = poor_warrior }
			}
			modifier = {
				factor = 3
				FROM = { trait = trained_warrior }
			}
			modifier = {
				factor = 4
				FROM = { trait = skilled_warrior }
			}
			modifier = {
				factor = 5
				FROM = { trait = master_warrior }
			}
			modifier = {
				factor = 5
				FROM = { trait = duelist }
			}
			modifier = {
				factor = 2
				FROM = { is_strong_trigger = yes }
			}
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 2
				trait = paranoid
			}
			modifier = {
				factor = 2
				is_weak_trigger = yes
			}
			modifier = {
				factor = 2
				trait = dwarf
			}
			modifier = {
				factor = 2
				trait = hunchback
			}
			modifier = {
				factor = 2
				trait = leper
			}
			modifier = {
				factor = 2
				trait = wounded
			}
			modifier = {
				factor = 4
				is_maimed_trigger = yes
			}
		}

		hidden_tooltip = {
			event_target:feast_duel_host = {
					character_event = {
						id = 72039
						days = 1
					}
				}
			}
		clear_event_target = duel_challenger
		clear_event_target = duel_challenged
		clear_event_target = feast_duel_host
	}
}

#Duel
character_event = {
	id = 72033
	desc = "EVTDESC72033"
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72033"
		trigger = {
			has_character_flag = wounded_opponent
		}
		clr_character_flag = wounded_opponent
		clr_character_flag = maimed_opponent
		clr_character_flag = killed_opponent
		event_target:feast_duel_host = {
			character_event = {
				id = 72036
				tooltip = "EVTTOOLTIP72036"
			}
		}
		change_martial = 1
	}

	option = {
		name = "EVTOPTB72033"
		trigger = {
			has_character_flag = maimed_opponent
		}
		clr_character_flag = maimed_opponent
		event_target:feast_duel_host = {
			character_event = {
				id = 72037
				tooltip = "EVTTOOLTIP72037"
			}
		}
		change_martial = 2
	}

	option = {
		name = "EVTOPTC72033"
		trigger = {
			has_character_flag = killed_opponent
		}
		clr_character_flag = killed_opponent
		change_martial = 3
		event_target:feast_duel_host = {
			character_event = {
				id = 72035
				tooltip = "EVTTOOLTIP72035"
			}
		}
		hidden_tooltip = {
			if = {
				limit = {
					has_focus = focus_war
					has_dlc = "Way of Life"
				}
				character_event = { id = WoL.11200 days = 3 } # fire focus success
			}
		}
	}
}

#Duel: The End (No harm)
character_event = {
	id = 72034
	desc = "EVTDESC72034"
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72034"
		opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		reverse_opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
}

#Duel: The End (loser killed)
character_event = {
	id = 72035
	desc = "EVTDESC72035"
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72035"
		opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
	option = {
		name = "EVTOPTB72035"
		opinion = {
			modifier = opinion_satisfied
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
	option = {
		name = "EVTOPTC72035"
		reverse_opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
}

#Duel: Liege is notified about wounded opponent
character_event = {
	id = 72036
	desc = "EVTDESC72036"
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72036"
		opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
	option = {
		name = "EVTOPTB72036"
		opinion = {
			modifier = opinion_satisfied
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
	option = {
		name = "EVTOPTC72036"
		reverse_opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
		clear_event_target = round_winner
		clear_event_target = round_loser
		clear_event_target = feast_duel_host
	}
}

#Duel: Liege is notified about maimed opponent
character_event = {
	id = 72037
	desc = "EVTDESC72037"
	picture = GFX_evt_melee

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72037"
		opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
	}
	option = {
		name = "EVTOPTB72037"
		opinion = {
			modifier = opinion_satisfied
			who = event_target:round_winner
			years = 10
		}
	}
	option = {
		name = "EVTOPTC72037"
		reverse_opinion = {
			modifier = opinion_dislike
			who = event_target:round_winner
			years = 10
		}
	}
}

#Liege is notified
character_event = {
	id = 72038
	desc = EVTDESC72038
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = EVTOPTA72038
	}
}

#Liege is notified - nothing happened
character_event = {
	id = 72039
	desc = EVTDESC72039
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = EVTOPTA72039
	}
}

#Friendly with another guest's spouse
character_event = {
	id = 72040
	desc = "EVTDESC72040"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72040" #both married
		trigger = {
			OR = {
				event_target:target_pretty_guest_spouse = {
					always = yes
				}
				event_target:target_pretty_guest = {
					is_married = yes
				}
			}
			is_married = yes
			NOT = {
				ai = no
				trait = lustful
				trait = hedonist
				trait = deceitful
				trait = seducer
				trait = seductress
			}
		}
		prestige = -5
	}

	option = {
		name = "EVTOPTC72040" #target married
		trigger = {
			OR = {
				event_target:target_pretty_guest_spouse = {
					always = yes
				}
				event_target:target_pretty_guest = {
					is_married = yes
				}
			}
			is_married = no
			NOT = {
				ai = no
				trait = lustful
				trait = hedonist
				trait = deceitful
				trait = seducer
				trait = seductress
			}
		}
		prestige = -5
	}

	option = {
		name = "EVTOPTD72040" #both single, bad idea anyway
		trigger = {
			event_target:target_pretty_guest = {
				is_married = no
			}
			is_married = no
			NOT = {
				ai = no
				trait = lustful
				trait = hedonist
				trait = deceitful
				trait = seducer
				trait = seductress
			}
		}
		prestige = -5
	}

	option = {
		name = "EVTOPTB72040"
		trigger = {
			event_target:target_pretty_guest_spouse = {
				always = yes
			}
		}
		event_target:target_pretty_guest_spouse = {
			character_event = {
				id = 72041
				tooltip = "EVTTOOLTIP72041"
			}
		}
	}

	option = {
		name = "EVTOPTB72040"
		trigger = {
			event_target:target_pretty_guest = {
				always = yes
			}
		}
		event_target:target_pretty_guest = {
			character_event = {
				id = 72041
				tooltip = "EVTTOOLTIP72041"
			}
		}
	}
}

#Spouse answers the 'invitation'
character_event = {
	id = 72041
	desc = "EVTDESC72041"
	picture = GFX_evt_lovers

	is_triggered_only = yes

	immediate = {
		clear_event_target = target_pretty_guest_spouse
		clear_event_target = target_pretty_guest
	}
	option = {
		name = "EVTOPTA72041" #tumble
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 12 }
			}
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 15 }
			}
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 18 }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 8 } }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 6 } }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 4 } }
			}
			modifier = {
				factor = 0.5
				FROM = { NOT = { diplomacy = 2 } }
			}
			modifier = {
				factor = 0.5
				NOT = { trait = homosexual }
				same_sex = FROM
			}
			modifier = {
				factor = 0.75
				NOT = { religion = FROM }
			}
			modifier = {
				factor = 0.75
				NOT = { culture = FROM }
			}
			modifier = {
				factor = 0.75
				NOT = { culture_group = FROM }
			}
			modifier = {
				factor = 2.0
				OR = {
					is_female = no
					age = 45
				}
			}
			modifier = {
				factor = 0
				NOT = {
					is_married = no
					any_spouse = {
						reverse_opinion = { who = ROOT value = 0 }
					}
					trait = lustful
					trait = deceitful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0.25
				NOT = {
					has_lover = no
					any_lover = {
						ROOT = {
							likes_better_than = { who = FROM than = PREV }
						}
					}
					trait = lustful
					trait = deceitful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0.25
				NOT = {
					personal_opinion = {
						who = FROM
						value = 20
					}
				}
			}
			modifier = {
				factor = 1.5
				personal_opinion = {
					who = FROM
					value = 40
				}
			}
			modifier = {
				factor = 2.0
				personal_opinion = {
					who = FROM
					value = 60
				}
			}
			modifier = {
				factor = 1.5
				FROM = { has_character_modifier = wol_seducer_1 }
			}
			modifier = {
				factor = 1.5
				FROM = { trait = fair }
			}
			modifier = {
				factor = 2.25
				FROM = { has_character_modifier = wol_seducer_2 }
			}
			modifier = {
				factor = 5.0
				FROM = {
					OR = {
						trait = seducer
						trait = seductress
					}
				}
			}
		}

		if = {
			limit = {
				same_sex = FROM
				NOT = { trait = homosexual }
			}
			random = {
				chance = 10
				add_trait = homosexual
			}
		}

		#break up with an existing lover unless hedonist/etc.
		if = {
			limit = {
				ai = yes
				has_lover = yes
				any_lover = {
					NOT = { character = FROM }
					NOT = { any_spouse = { character = ROOT } }
					NOT = { any_consort = { character = ROOT } }
					ROOT = {
						likes_better_than = { who = FROM than = PREV }
					}
				}
				NOT = {
					trait = lustful
					trait = hedonist
					trait = deceitful
					trait = seducer
					trait = seductress
				}
			}
			random_lover = {
				limit = {
					NOT = { character = FROM }
					NOT = { any_spouse = { character = ROOT } }
					NOT = { any_consort = { character = ROOT } }
					ROOT = {
						likes_better_than = { who = FROM than = PREV }
					}
				}
				character_event = { id = WoL.1103 days = 1 }
			}
		}

		FROM = {
			#possibility to become lovers
			FROM = { character_event = { id = 72042 } }
			#also advance WoL traits if applicable
			if = {
				limit = { has_dlc = "Way of Life"}
				character_event = { id = WoL.96 }
			}
			#borrow WoL's "chance of pregnancy" code because it sanity checks gender/age/fertility
			if = {
				limit = { ROOT = { is_female = yes } }
				character_event = { id = WoL.97 }
			}
			if = {
				limit = { ROOT = { is_female = no } }
				character_event = { id = WoL.98 }
			}
		}
		hidden_tooltip = {
			random = {
				chance = 50
				venereal_disease_effect = yes
			}
		}
	}
	option = {
		name = "EVTOPTC72041"
		ai_chance = {
			factor = 150
			modifier = {
				factor = 0
				OR = {
					trait = lustful
					trait = hedonist
				}
			}
		}
		piety = 5
	}
}

#Become lovers?
#old 72042 is obsolete (husband should find out through normal mechanics for cuckoo pregnancy. Or not.)
character_event = {
	id = 72042
	desc = "EVTDESC72077"
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WOL_306 # Love and leave
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0.1
				NOT = { num_of_lovers = 1 }
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 10
				num_of_lovers = 3
			}
			modifier = {
				factor = 10
				num_of_lovers = 5
			}
			modifier = {
				factor = 10
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
			modifier = {
				factor = 2
				same_sex = FROM
			}
			modifier = {
				factor = 2
				OR = {
					is_married = yes
					FROM = { is_married = yes }
				}
			}
		}
		custom_tooltip = { text = EVTOPTA_WOL_306_CUSTOM }
	}

	option = {
		name = EVTOPTB_WOL_306 # love must grow
		trigger = {
			OR = {
				AND = {
					FROM = { trait = homosexual }
					trait = homosexual
					same_sex = FROM
				}
				AND = {
					FROM = { NOT = { trait = homosexual } }
					NOT = { trait = homosexual }
					is_opposite_sex = FROM
				}
			}
		}
		ai_chance = {
			factor = 100
		}
		add_lover = FROM
	}
}

#Drink too much wine: become drunkard or insult host
character_event = {
	id = 72045
	desc = "EVTDESC72045"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72045"
		random = {
			chance = 25
			add_trait = drunkard
			hidden_tooltip = {
				character_event = {
					id = 38286 #Notify Drunkard
				}
			}
		}
	}
	option = {
		name = "EVTOPTB72045"
		liege = {
			set_character_flag = feast_drunkard_guest
			character_event = {
				id = 72052
				tooltip = "EVTTOOLTIP72052"
			}
		}
	}
}

#Liege is insulted when guest refuses more wine
character_event = {
	id = 72052
	desc = "EVTDESC72052"
	picture = GFX_evt_drunk

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72052"
		opinion = {
			modifier = opinion_insulted
			who = FROM
			years = 10
		}
	}
}

#Drink too much wine: Embarass yourself
character_event = {
	id = 72046
	desc = "EVTDESC72046"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72046"
		liege = {
			set_character_flag = feast_drunkard_guest
			character_event = {
				id = 72047
				tooltip = "EVTTOOLTIP72047"
			}
			random_courtier = {
				limit = {
					has_job_title = job_treasurer
					NOT = { trait = drunkard }
				}
				opinion = {
					modifier = opinion_dislike
					who = ROOT
					years = 10
				}
			}
		}
	}
}

#Host is not happy about drunkard falling asleep
character_event = {
	id = 72047
	desc = "EVTDESC72047"
	picture = GFX_evt_drunk

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72047"
		opinion = {
			modifier = opinion_disgusted
			who = FROM
			years = 10
		}
	}
}

#Drink too much wine: Fall asleep
character_event = {
	id = 72048
	desc = "EVTDESC72048"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72048"
		prestige = -10
		liege = {
			set_character_flag = feast_drunkard_guest
			character_event = {
				id = 72049
				tooltip = "EVTTOOLTIP72049"
			}
		}
	}
}

#Host is not happy about drunkard falling asleep
character_event = {
	id = 72049
	desc = "EVTDESC72049"
	picture = GFX_evt_drunk

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72049"
		opinion = {
			modifier = opinion_disgusted
			who = FROM
			years = 10
		}
	}
}

#Highway Robber Band: Guest Complains
character_event = {
	id = 72050
	desc = "EVTDESC72050"
	picture = GFX_evt_bandits

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72050"
		liege = {
			character_event = {
				id = 72051
				tooltip = "EVTTOOLTIP72051"
			}
		}
	}
}

#Highway Robber Band: The End
character_event = {
	id = 72051
	desc = "EVTDESC72051"
	picture = GFX_evt_bandits

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72051"
		FROM = {
			opinion = {
				modifier = opinion_dislike
				who = ROOT
				years = 10
			}
		}
	}
}

#Guest kills Host's servant
character_event = {
	id = 72055
	desc = "EVTDESC72055"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72055"
		liege = {
			character_event = {
				id = 72056
				tooltip = "EVTTOOLTIP72056"
			}
		}
	}
}

#Guest kills Host's servant: Imprison?
character_event = {
	id = 72056
	desc = "EVTDESC72056"
	picture = GFX_evt_scandal

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { ai = no }
			add_character_modifier = {
				name = feast_event_timer
				duration = 3
				hidden = yes
			}
		}
	}

	option = {
		name = "EVTOPTA72056"
		FROM = {
			imprison = ROOT
			opinion = {
				who = ROOT
				modifier = opinion_arrest_attempt
				months = 240
			}
			hidden_tooltip = {
				character_event = {
					id = 72057
				}
			}
		}
		if = {
			limit = { NOT = { trait = just } }
			add_trait = just
		}
	}
	option = {
		name = "EVTOPTC72056"
		trigger = {
			OR = {
				intrigue = 12
				diplomacy = 12
			}
		}
		scaled_wealth = -0.20
	}
	option = {
		name = "EVTOPTB72056"
		if = {
			limit = { NOT = { trait = arbitrary } }
			add_trait = arbitrary
		}
		location = {
			add_province_modifier = {
				name = peasants_upset
				duration = 90
			}
		}
	}
}

#Guest kills Host's servant: The end
character_event = {
	id = 72057
	desc = "EVTDESC72057"
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72057"
		opinion = {
			modifier = opinion_angry
			who = FROM
			years = 20
		}
		clr_character_flag = coming_to_feast
		clr_character_flag = guest_feast_started
		clr_character_flag = wounded_opponent
		clr_character_flag = maimed_opponent
		clr_character_flag = killed_opponent
		clr_character_flag = passionated_guest
	}
}

#Jester jokes about your rule
character_event = {
	id = 72060
	desc = "EVTDESC72060"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72060"
		if = {
			limit = {
				trait = arbitrary
				NOT = { trait = cruel }
			}
			random = {
				chance = 20
				add_trait = cruel
				hidden_tooltip = {
					character_event = {
						id = 38259 #Notify Cruel
					}
				}
			}
		}
		if = {
			limit = {
				trait = cruel
				NOT = { trait = arbitrary }
			}
			random = {
				chance = 20
				add_trait = arbitrary
				hidden_tooltip = {
					character_event = {
						id = 38266 #Notify Arbitrary
					}
				}
			}
		}
		random_courtier = {
			limit = { has_minor_title = title_court_jester }
			opinion = {
				who = ROOT
				modifier = opinion_arrest_attempt
				months = 240
			}
			imprison = ROOT
		}
		any_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72061
				tooltip = "EVTTOOLTIP72061"
			}
		}
	}
	option = {
		name = "EVTOPTB72060"
		prestige = -10
		any_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72062
				tooltip = "EVTTOOLTIP72062"
			}
		}
	}
}

#Jester is thrown into dungeon: Guests react
character_event = {
	id = 72061
	desc = "EVTDESC72061"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72061"
		opinion = {
			modifier = opinion_disappointed
			who = FROM
			years = 10
		}
	}
}

#Jester is ignored: Guests react
character_event = {
	id = 72062
	desc = "EVTDESC72062"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72062"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Jongleurs entertain the guests
character_event = {
	id = 72063
	desc = "EVTDESC72063"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_jongleur
	}

	option = {
		name = "EVTOPTA72063"
		prestige = 10
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = gregarious
				hidden_tooltip = {
					character_event = {
						id = 38265 #Notify Gregarious
					}
				}
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = charitable
				hidden_tooltip = {
					character_event = {
						id = 38273 #Notify Charitable
					}
				}
			}
		}
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72064
				tooltip = "EVTTOOLTIP72064"
			}
		}
	}
}

#Visitor likes jongleurs
character_event = {
	id = 72064
	desc = "EVTDESC72064"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72064"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Minstrel entertain the guests
character_event = {
	id = 72065
	desc = "EVTDESC72065"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_minstrel
	}

	option = {
		name = "EVTOPTA72065"
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = gregarious
				hidden_tooltip = {
					character_event = {
						id = 38265 #Notify Gregarious
					}
				}
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = charitable
				hidden_tooltip = {
					character_event = {
						id = 38273 #Notify Charitable
					}
				}
			}
		}
		prestige = 10
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72066
				tooltip = "EVTTOOLTIP72066"
			}
		}
	}
}

#Visitor likes minstrel
character_event = {
	id = 72066
	desc = "EVTDESC72066"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72066"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Musicians entertain the guests
character_event = {
	id = 72067
	desc = "EVTDESC72067"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_musicians
	}

	option = {
		name = "EVTOPTA72067"
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = gregarious
				hidden_tooltip = {
					character_event = {
						id = 38265 #Notify Gregarious
					}
				}
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = charitable
				hidden_tooltip = {
					character_event = {
						id = 38273 #Notify Charitable
					}
				}
			}
		}
		prestige = 10
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72068
				tooltip = "EVTTOOLTIP72068"
			}
		}
	}
}

#Visitor likes musicians
character_event = {
	id = 72068
	desc = "EVTDESC72068"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72068"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Fire-eaters entertain the guests
character_event = {
	id = 72069
	desc = "EVTDESC72069"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_fireeaters
	}

	option = {
		name = "EVTOPTA72069"
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = gregarious
				hidden_tooltip = {
					character_event = {
						id = 38265 #Notify Gregarious
					}
				}
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = charitable
				hidden_tooltip = {
					character_event = {
						id = 38273 #Notify Charitable
					}
				}
			}
		}
		prestige = 10
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72070
				tooltip = "EVTTOOLTIP72070"
			}
		}
	}
}

#Visitor likes fire-eaters
character_event = {
	id = 72070
	desc = "EVTDESC72070"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72070"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Conjurer entertain the guests
character_event = {
	id = 72071
	desc = "EVTDESC72071"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_conjurer
	}

	option = {
		name = "EVTOPTA72071"
		if = {
			limit = {
				NOT = { trait = gregarious }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = gregarious
			}
		}
		if = {
			limit = {
				NOT = { trait = charitable }
				NOT = { num_of_traits = 5 }
			}
			random = {
				chance = 25
				add_trait = charitable
			}
		}
		prestige = 10
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72072
				tooltip = "EVTTOOLTIP72072"
			}
		}
	}
}

#Visitor likes Conjurer
character_event = {
	id = 72072
	desc = "EVTDESC72072"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72072"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Travelling Acrobats
character_event = {
	id = 4160
	desc = "EVTDESC4160"
	picture = "GFX_evt_jugglers"

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_acrobats
		random_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = { id = 72115 }
		}
	}

	option = {
		name = "EVTOPTD4160"
		prestige = 10
	}
}

#Visitor likes acrobats
character_event = {
	id = 72115
	desc = "EVTDESC72115"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72115"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
		hidden_tooltip = {
			FROM = {
				character_event = { id = 72116 }
			}
		}
	}
}

#Liege likes that visitor likes acrobats
character_event = {
	id = 72116
	desc = "EVTDESC72116"
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72116"
		opinion = {
			modifier = opinion_approves
			who = FROM
			years = 10
		}
	}
}

#Travelling Dancers
character_event = {
	id = 4165
	desc = EVTDESC4165
	picture = GFX_evt_jugglers

	is_triggered_only = yes

	immediate = {
		clr_character_flag = feast_dancers
	}

	option = {
		name = EVTOPTA4165
		prestige = 15
	}
}

#Friendly with another guest's spouse
character_event = {
	id = 72075
	picture = GFX_evt_feast

	desc = {
		text = EVTDESC72075
		trigger = {
			OR = {
				AND = {
					is_female = no
					NOT = { trait = homosexual }
				}
				AND = {
					is_female = yes
					trait = homosexual
				}
			}
		}
	}
	desc = {
		text = EVTDESC72075_male
		trigger = {
			OR = {
				AND = {
					is_female = no
					trait = homosexual
				}
				AND = {
					is_female = yes
					NOT = { trait = homosexual }
				}
			}
		}
	}

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72075"
		prestige = -5
	}

	option = {
		name = "EVTOPTB72075"
		trigger = {
			event_target:pretty_vassal_spouse = {
				always = yes
			}
		}
		event_target:pretty_vassal_spouse = {
			character_event = {
				id = 72076
				tooltip = "EVTTOOLTIP72076"
			}
		}
	}

	option = {
		name = "EVTOPTB72075"
		trigger = {
			event_target:pretty_single_vassal = {
				always = yes
			}
		}
		event_target:pretty_single_vassal = {
			character_event = {
				id = 72076
				tooltip = "EVTTOOLTIP72076"
			}
		}
	}

	option = {
		name = "EVTOPTB72075"
		trigger = {
			event_target:pretty_married_vassal = {
				always = yes
			}
		}
		event_target:pretty_married_vassal = {
			character_event = {
				id = 72076
				tooltip = "EVTTOOLTIP72076"
			}
		}
	}
}

#Spouse answers the 'invitation'
character_event = {
	id = 72076
	desc = "EVTDESC72076"
	picture = GFX_evt_lovers

	is_triggered_only = yes

	immediate = {
		clear_event_target = pretty_married_vassal
		clear_event_target = pretty_single_vassal
		clear_event_target = pretty_vassal_spouse
	}

	option = {
		name = "EVTOPTA72076" #tumble
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 12 }
			}
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 15 }
			}
			modifier = {
				factor = 1.2
				FROM = { diplomacy = 18 }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 8 } }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 6 } }
			}
			modifier = {
				factor = 0.8
				FROM = { NOT = { diplomacy = 4 } }
			}
			modifier = {
				factor = 0.5
				FROM = { NOT = { diplomacy = 2 } }
			}
			modifier = {
				factor = 0.5
				NOT = { trait = homosexual }
				same_sex = FROM
			}
			modifier = {
				factor = 0.75
				NOT = { religion = FROM }
			}
			modifier = {
				factor = 0.75
				NOT = { culture = FROM }
			}
			modifier = {
				factor = 0.75
				NOT = { culture_group = FROM }
			}
			modifier = {
				factor = 2.0
				OR = {
					is_female = no
					age = 45
				}
			}
			modifier = {
				factor = 0
				NOT = {
					is_married = no
					any_spouse = {
						reverse_opinion = { who = ROOT value = 0 }
					}
					trait = lustful
					trait = deceitful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0.25
				NOT = {
					has_lover = no
					any_lover = {
						ROOT = {
							likes_better_than = { who = FROM than = PREV }
						}
					}
					trait = lustful
					trait = deceitful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0.25
				NOT = {
					personal_opinion = {
						who = FROM
						value = 20
					}
				}
			}
			modifier = {
				factor = 1.5
				personal_opinion = {
					who = FROM
					value = 40
				}
			}
			modifier = {
				factor = 2.0
				personal_opinion = {
					who = FROM
					value = 60
				}
			}
			modifier = {
				factor = 1.5
				FROM = { has_character_modifier = wol_seducer_1 }
			}
			modifier = {
				factor = 1.5
				FROM = { trait = fair }
			}
			modifier = {
				factor = 2.25
				FROM = { has_character_modifier = wol_seducer_2 }
			}
			modifier = {
				factor = 5.0
				FROM = {
					OR = {
						trait = seducer
						trait = seductress
					}
				}
			}
		}

		if = {
			limit = {
				same_sex = FROM
				NOT = { trait = homosexual }
			}
			random = {
				chance = 10
				add_trait = homosexual
			}
		}

		#break up with an existing lover unless hedonist/etc.
		if = {
			limit = {
				ai = yes
				has_lover = yes
				any_lover = {
					NOT = { character = FROM }
					NOT = { any_spouse = { character = ROOT } }
					NOT = { any_consort = { character = ROOT } }
					ROOT = {
						likes_better_than = { who = FROM than = PREV }
					}
				}
				NOT = {
					trait = lustful
					trait = hedonist
					trait = deceitful
					trait = seducer
					trait = seductress
				}
			}
			random_lover = {
				limit = {
					NOT = { character = FROM }
					NOT = { any_spouse = { character = ROOT } }
					NOT = { any_consort = { character = ROOT } }
					ROOT = {
						likes_better_than = { who = FROM than = PREV }
					}
				}
				character_event = { id = WoL.1103 days = 1 }
			}
		}

		FROM = {
			#chance to become lovers
			character_event = { id = 72077 }
			#also advance WoL traits if applicable
			if = {
				limit = { has_dlc = "Way of Life"}
				character_event = { id = WoL.96 }
			}
			#borrow WoL's "chance of pregnancy" code because it sanity checks gender/age/fertility
			if = {
				limit = { ROOT = { is_female = yes } }
				character_event = { id = WoL.97 }
			}
			if = {
				limit = { ROOT = { is_female = no } }
				character_event = { id = WoL.98 }
			}
		}
	}
	option = {
		name = "EVTOPTB72076"
		ai_chance = {
			factor = 150
			modifier = {
				factor = 0
				trait = lustful
				trait = hedonist
			}
		}
		piety = 5
	}
}

#Become lovers?
#old 72077 is obsolete (husband should find out through normal mechanics for cuckoo pregnancy. Or not.)
character_event = {
	id = 72077
	desc = "EVTDESC72077"
	picture = GFX_evt_lovers

	is_triggered_only = yes

	option = {
		name = EVTOPTA_WOL_306 # Love and leave
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0.1
				NOT = { num_of_lovers = 1 }
			}
			modifier = {
				factor = 0.5
				trait = kind
			}
			modifier = {
				factor = 10
				num_of_lovers = 3
			}
			modifier = {
				factor = 10
				num_of_lovers = 5
			}
			modifier = {
				factor = 10
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = arbitrary
			}
			modifier = {
				factor = 2
				same_sex = FROM
			}
			modifier = {
				factor = 2
				OR = {
					is_married = yes
					FROM = { is_married = yes }
				}
			}
		}
		custom_tooltip = { text = EVTOPTA_WOL_306_CUSTOM }
	}

	option = {
		name = EVTOPTB_WOL_306 # love must grow
		trigger = {
			OR = {
				AND = {
					FROM = { trait = homosexual }
					trait = homosexual
					same_sex = FROM
				}
				AND = {
					FROM = { NOT = { trait = homosexual } }
					NOT = { trait = homosexual }
					is_opposite_sex = FROM
				}
			}
		}
		ai_chance = {
			factor = 100
		}
		add_lover = FROM
	}
}

#Late night talk: First person
character_event = {
	id = 72080
	desc = "EVTDESC72080"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72080"
		random_vassal = {
			limit = {
				has_character_flag = guest_feast_started
				NOT = {
					num_of_friends = 3
					is_friend = ROOT
					is_rival = ROOT
				}
			}
			add_friend = ROOT
			character_event = {
				id = 72081
				tooltip = "EVTTOOLTIP72081"
			}
		}
	}
}

#Late night talk: Second person
character_event = {
	id = 72081
	desc = "EVTDESC72081"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72081"
		tooltip = { add_friend = FROM }
	}
}

#Claim on visitor's title
character_event = {
	id = 72085
	desc = "EVTDESC72085"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		set_character_flag = guest_claim_event
		random_claim = {
			limit = {
				ROOT = { has_strong_claim = PREV }
				can_be_given_away = yes
				holder_scope = {
					has_character_flag = guest_feast_started
					vassal_of = ROOT
				}
			}
			holder_scope = {
				save_event_target_as = claimant_guest
			}
		}
	}

	option = {
		name = "EVTOPTA72085"
		prestige = -10
		event_target:claimant_guest = {
			opinion = {
				who = ROOT
				modifier = opinion_arrest_attempt
				months = 240
			}
			imprison = ROOT
			hidden_tooltip = {
				character_event = {
					id = 72089
				}
			}
		}
		any_vassal = {
			limit = {
				NOT = { character = event_target:claimant_guest }
				has_character_flag = guest_feast_started
			}
			opinion = {
				modifier = opinion_angry
				who = ROOT
				years = 10
			}
		}
	}
	option = {
		name = "EVTOPTB72085"
		event_target:claimant_guest = {
			character_event = {
				id = 72086
				tooltip = "EVTTOOLTIP72086"
			}
		}
	}
	option = {
		name = "EVTOPTC72085"
		prestige = -10
		random_claim = {
			limit = {
				ROOT = { has_strong_claim = PREV }
				can_be_given_away = yes
				holder_scope = { character = event_target:claimant_guest }
			}
			remove_claim = ROOT
		}
	}
}

#Vassal decides if any_liege gets title
character_event = {
	id = 72086
	desc = "EVTDESC72086"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72086" #Grant any_liege title
		character_event = {
			id = 72087
			tooltip = "EVTTOOLTIP72087"
		}
	}
	option = {
		name = "EVTOPTB72086" #Refuse
		character_event = {
			id = 72088
			tooltip = "EVTTOOLTIP72088"
		}
	}
}

#Liege gets title
character_event = {
	id = 72087
	desc = "EVTDESC72087"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72087"
		random_claim = {
			limit = {
				ROOT = { has_strong_claim = PREV }
				can_be_given_away = yes
				holder = FROM
			}
			grant_title = ROOT
		}
	}
}

#Liege does not get title
character_event = {
	id = 72088
	desc = "EVTDESC72088"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72088"
		opinion = {
			modifier = opinion_disappointed
			who = FROM
			years = 20
		}
	}
}

#Imprisoned by liege who wants title
character_event = {
	id = 72089
	desc = "EVTDESC72089"
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72089"
		tooltip = {
			imprison = FROM
		}
	}

	option = {
		name = "EVTOPTB72089"
		FROM = {
			random_claim = {
				limit = {
					FROM = { has_strong_claim = PREV }
					can_be_given_away = yes
					holder = ROOT
				}
				grant_title = FROM
			}
		}
		prisoner = no
	}
}

#Host or Host's son "falls in love" with unmarried daughter of vassal
character_event = {
	id = 72090
	desc = "EVTDESC72090"
	picture = GFX_evt_feast

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
			random_vassal = {
				limit = {
					has_character_flag = guest_feast_started
					any_child = {
						is_female = yes
						is_married = no
						is_betrothed = no
						has_lover = no
						fertility = 0.4
						NOT = { is_close_relative = ROOT }
						is_adult = yes
						NOT = { age = 26 }
						is_abroad_trigger = no
						opinion = { who = ROOT value = 20 }
					}
				}
				save_event_target_as = guest_father
				random_child = {
					limit = {
						is_female = yes
						is_married = no
						is_betrothed = no
						has_lover = no
						fertility = 0.4
						NOT = { is_close_relative = ROOT }
						is_adult = yes
						NOT = { age = 26 }
						is_abroad_trigger = no
						opinion = { who = ROOT value = 20 }
					}
					save_event_target_as = guest_daughter
				}
			}
			break = yes
		}
		father = {
			random_vassal = {
				limit = {
					has_character_flag = guest_feast_started
					any_child = {
						is_female = yes
						is_married = no
						is_betrothed = no
						has_lover = no
						fertility = 0.4
						NOT = { is_close_relative = ROOT }
						is_adult = yes
						NOT = { age = 26 }
						is_abroad_trigger = no
						opinion = { who = ROOT value = 20 }
					}
				}
				save_event_target_as = guest_father
				random_child = {
					limit = {
						is_female = yes
						is_married = no
						is_betrothed = no
						has_lover = no
						fertility = 0.4
						NOT = { is_close_relative = ROOT }
						is_adult = yes
						NOT = { age = 26 }
						is_abroad_trigger = no
						opinion = { who = ROOT value = 20 }
					}
					save_event_target_as = guest_daughter
				}
			}
		}
	}

	option = {
		name = "EVTOPTA72090" #Flirt
		trigger = {
			NOT = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
			father = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
		}
		event_target:guest_daughter = {
			opinion = {
				modifier = opinion_flattered
				who = ROOT
				years = 10
			}
		}
		event_target:guest_father = {
			character_event = {
				id = 72091
				tooltip = "EVTTOOLTIP72091"
			}
		}
	}
	option = {
		name = "EVTOPTB72090" #Tumble
		trigger = {
			NOT = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
			father = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
		}
		prestige = 15
		event_target:guest_daughter = {
			random = {
				chance = 25
				impregnate = ROOT
				set_character_flag = impregnated_by_root
				ROOT = { set_character_flag = impregnated_vassal_daughter }
			}
			add_lover = ROOT
		}
		event_target:guest_father = {
			character_event = {
				id = 72092
				tooltip = "EVTTOOLTIP72092"
			}
		}
	}
	option = {
		name = "EVTOPTA72090" #Flirt
		trigger = {
			has_character_flag = host_feast_started
			has_character_modifier = holding_large_feast
		}
		event_target:guest_daughter = {
			opinion = {
				modifier = opinion_flattered
				who = ROOT
				years = 10
			}
		}
		event_target:guest_father = {
			character_event = {
				id = 72091
				tooltip = "EVTTOOLTIP72091"
			}
		}
	}
	option = {
		name = "EVTOPTB72090" #Tumble
		trigger = {
			has_character_flag = host_feast_started
			has_character_modifier = holding_large_feast
		}
		prestige = 15
		event_target:guest_daughter = {
			random = {
				chance = 25
				impregnate = ROOT
				set_character_flag = impregnated_by_root
				ROOT = { set_character_flag = impregnated_vassal_daughter }
			}
			add_lover = ROOT
		}
		event_target:guest_father = {
			character_event = {
				id = 72092
				tooltip = "EVTTOOLTIP72092"
			}
		}
	}
}

#Liege or liege's son flirted with my daughter! I'm so proud!
character_event = {
	id = 72091
	desc = "EVTDESC72091"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72091"
		prestige = 10
	}
}

#Liege or liege's son seduced my daughter!
character_event = {
	id = 72092
	desc = "EVTDESC72092"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72092"
		trigger = {
			FROM = {
				NOT = {
					has_character_flag = host_feast_started
					has_character_modifier = holding_large_feast
				}
				father = {
					has_character_flag = host_feast_started
					has_character_modifier = holding_large_feast
				}
			}
		}
		prestige = -10
		FROM = {
			father = {
				character_event = {
					id = 72093
					tooltip = "EVTTOOLTIP72093"
				}
			}
		}
	}
	option = {
		name = "EVTOPTB72092"
		trigger = {
			FROM = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
		}
		prestige = -10
		FROM = {
			character_event = {
				id = 72094
				tooltip = "EVTTOOLTIP72094"
			}
		}
	}
	option = {
		name = "EVTOPTC72092" #Grovel
		trigger = {
			FROM = {
				NOT = {
					has_character_flag = host_feast_started
					has_character_modifier = holding_large_feast
				}
				father = {
					has_character_flag = host_feast_started
					has_character_modifier = holding_large_feast
				}
			}
		}
		prestige = -10
		FROM = {
			father = {
				character_event = {
					id = 72095
					tooltip = "EVTTOOLTIP72095"
				}
			}
		}
	}
	option = {
		name = "EVTOPTD72092" #Grovel
		trigger = {
			FROM = {
				has_character_flag = host_feast_started
				has_character_modifier = holding_large_feast
			}
		}
		prestige = -10
		FROM = {
			character_event = {
				id = 72096
				tooltip = "EVTTOOLTIP72096"
			}
		}
	}
}

#My son seduced a vassal's daughter and now he's angry
character_event = {
	id = 72093
	desc = "EVTDESC72093"
	picture = GFX_evt_pregnancy

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72093"
		opinion = {
			modifier = opinion_angry
			who = FROM
			years = 10
		}
		reverse_opinion = {
			modifier = opinion_angry
			who = FROM
			years = 10
		}
	}
}

#I seduced a vassal's daughter and now he's angry
character_event = {
	id = 72094
	desc = "EVTDESC72094"
	picture = GFX_evt_pregnancy

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72094"
		opinion = {
			modifier = opinion_angry
			who = FROM
			years = 10
		}
		reverse_opinion = {
			modifier = opinion_angry
			who = FROM
			years = 10
		}
	}
}

#My son seduced a vassal's daughter and he is upset
character_event = {
	id = 72095
	desc = "EVTDESC72095"
	picture = GFX_evt_pregnancy

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72095"
		reverse_opinion = {
			modifier = opinion_upset
			who = FROM
			years = 10
		}
	}
}

#I seduced a vassal's daughter and he is upset
character_event = {
	id = 72096
	desc = "EVTDESC72096"
	picture = GFX_evt_pregnancy

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72096"
		reverse_opinion = {
			modifier = opinion_upset
			who = FROM
			years = 10
		}
	}
}

#Two months later...
character_event = {
	id = 72097
	desc = "EVTDESC72097"
	picture = GFX_evt_pregnancy

	capable_only = yes
	prisoner = no
	war = no

	trigger = {
		any_child = {
			is_female = yes
			is_pregnant = yes
			had_character_flag = {
				flag = impregnated_by_root
				days = 60
			}
		}
		OR = {
			any_liege = {
				had_character_flag = {
					flag = impregnated_vassal_daughter
					days = 60
				}
			}
			any_liege = {
				any_child = {
					is_female = no
					had_character_flag = {
						flag = impregnated_vassal_daughter
						days = 60
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	option = {
		name = "EVTOPTA72097"
		trigger = {
			any_liege = {
				is_married = no
				is_betrothed = no
				had_character_flag = {
					flag = impregnated_vassal_daughter
					days = 60
				}
			}
		}
		any_liege = {
			limit = {
				has_character_flag = impregnated_vassal_daughter
			}
			character_event = {
				id = 72098
				tooltip = "EVTTOOLTIP72098"
			}
		}
	}
	option = {
		name = "EVTOPTB72097"
		trigger = {
			any_liege = {
				any_child = {
					is_married = no
					is_betrothed = no
					is_female = no
					had_character_flag = {
						flag = impregnated_vassal_daughter
						days = 60
					}
				}
			}
		}
		any_liege = {
			limit = {
				any_child = {
					is_female = no
					had_character_flag = {
						flag = impregnated_vassal_daughter
						days = 60
					}
				}
			}
			character_event = {
				id = 72099
				tooltip = "EVTTOOLTIP72099"
			}
		}
	}

	option = {
		name = "EVTOPTC72097" #Hold my anger
		prestige = 10
	}
}

#FROM demands ROOT to marry pregnant daughter
character_event = {
	id = 72098
	desc = "EVTDESC72098"
	picture = GFX_evt_marriage

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72098" #Accept
		FROM = {
			random_child = {
				limit = {
					has_character_flag = impregnated_by_root
				}
				add_spouse = ROOT
				clr_character_flag = impregnated_by_root
			}
		}
	}
	option = {
		name = "EVTOPTB72098" #Refuse
		reverse_opinion = {
			modifier = grievously_offended
			who = FROM
			years = 20
		}
		FROM = {
			random_child = {
				limit = {
					has_character_flag = impregnated_by_root
				}
				clr_character_flag = impregnated_by_root
			}
		}
	}
}

#FROM demands ROOT to marry pregnant daughter with his son
character_event = {
	id = 72099
	desc = "EVTDESC72099"
	picture = GFX_evt_marriage

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72099" #Accept
		any_child = {
			limit = {
				has_character_flag = impregnated_vassal_daughter
			}
			character_event = {
				id = 72100
				tooltip = "EVTTOOLTIP72100"
			}
		}
	}
	option = {
		name = "EVTOPTB72099" #Refuse
		reverse_opinion = {
			modifier = grievously_offended
			who = FROM
			years = 20
		}
	}
}

#Liege's son marries vassal's pregnant daughter
character_event = {
	id = 72100
	desc = "EVTDESC72100"
	picture = GFX_evt_marriage

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72100" #Accept
		FROM = {
			any_vassal = {
				random_child = {
					limit = {
						has_character_flag = impregnated_by_root
					}
					add_spouse = ROOT
				}
			}
		}
	}
}

###################################
# Events to end the Feast
###################################

#The feast has ended
character_event = {
	id = 72110
	desc = "EVTDESC72110"
	picture = GFX_evt_feast

	is_triggered_only = yes

	war = no

	trigger = {
		has_character_modifier = holding_large_feast
	}

	immediate = {
		if = {
			limit = { has_character_flag = nerthus_feast }
			clr_character_flag = nerthus_feast
			narrative_event = { id = Plus.2352 days = 10 random = 20 }
		}
	}

	option = {
		name = "EVTOPTA72110"
		hidden_tooltip = { change_variable = { which = "lifestyle_hedonist" value = 1 } }
		prestige = 10
		if = {
			limit = {
				OR = {
					NOT = { has_character_flag = feast_mood_boost }
					had_character_flag = { flag = feast_mood_boost days = 1825 }
				}
			}
			if = {
				limit = { any_vassal = { leads_faction = faction_court } }
				custom_tooltip = { text = COURTFACTIONMOODPLUS }
				hidden_tooltip = {
					random_vassal = { limit = { leads_faction = faction_court } set_variable = { which = "faction_mood_increase" value = 1 } }
					character_event = { id = PlusFaction.200 days = 1 }
				}
			}
			set_character_flag = feast_mood_boost
		}
		hidden_tooltip = {
			remove_character_modifier = holding_large_feast
			remove_do_not_disturb_effect = yes
			clr_character_flag = sent_invitations
			clr_character_flag = host_feast_started
			clr_character_flag = feast_jongleur
			clr_character_flag = feast_musicians
			clr_character_flag = dealt_with_robber_band
			clr_character_flag = guest_daughter_event
			clr_character_flag = guest_claim_event
			clr_character_flag = feast_minstrel
			clr_character_flag = feast_fireeaters
			clr_character_flag = feast_conjurer
			clr_character_flag = lavishly_food
			clr_character_flag = medium_food
			clr_character_flag = low_food
			clr_character_flag = castle_problems
			clr_character_flag = feast_jester
			clr_character_flag = feast_drunkard_guest
			clr_character_flag = feast_duel
			clr_character_flag = feast_boar_hunt
		}
		any_vassal = {
			limit = { has_character_flag = guest_feast_started }
			character_event = {
				id = 72111
				tooltip = "EVTTOOLTIP72111"
			}
			hidden_tooltip = {
				remove_opinion = {
					modifier = opinion_enjoyed_feast
					who = ROOT
				}
			}
			opinion = {
				modifier = opinion_enjoyed_feast
				who = ROOT
				years = 2
			}
			hidden_tooltip = {
				remove_do_not_disturb_effect = yes
				clr_character_flag = coming_to_feast
				clr_character_flag = guest_feast_started
				clr_character_flag = wounded_opponent
				clr_character_flag = maimed_opponent
				clr_character_flag = killed_opponent
				clr_character_flag = passionated_guest
			}
		}
	}
}

#Vassal: Feast ended
character_event = {
	id = 72111
	desc = "EVTDESC72111"
	picture = GFX_evt_feast

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72111"
		prestige = 5
	}
}

#The feast is cancelled
character_event = {
	id = 72112
	desc = "EVTDESC72112"
	picture = GFX_evt_feast

	only_rulers = yes
	war = yes

	trigger = {
		OR = {
			has_character_modifier = holding_large_feast
			has_character_flag = planning_feast
			has_character_flag = celebrating_nowruz
		}
	}

	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = "EVTOPTA72112"
		if = {
			limit = { has_character_flag = nerthus_feast }
			piety = -100
		}
		if = {
			limit = { has_character_flag = planning_feast }
			clr_character_flag = planning_feast
			scaled_wealth = 0.25
		}
		if = {
			limit = { has_character_flag = celebrating_nowruz }
			hidden_tooltip = { add_character_modifier = { name = feast_event_timer days = 30 } }
			piety = -5
		}
		hidden_tooltip = {
			remove_character_modifier = holding_large_feast
			remove_do_not_disturb_effect = yes
			clr_character_flag = sent_invitations
			clr_character_flag = host_feast_started
			clr_character_flag = feast_jongleur
			clr_character_flag = feast_musicians
			clr_character_flag = dealt_with_robber_band
			clr_character_flag = guest_daughter_event
			clr_character_flag = guest_claim_event
			clr_character_flag = feast_minstrel
			clr_character_flag = feast_fireeaters
			clr_character_flag = feast_conjurer
			clr_character_flag = lavishly_food
			clr_character_flag = medium_food
			clr_character_flag = low_food
			clr_character_flag = castle_problems
			clr_character_flag = feast_jester
			clr_character_flag = feast_drunkard_guest
			clr_character_flag = feast_duel
			clr_character_flag = feast_boar_hunt
			clr_character_flag = celebrating_nowruz
		}
		any_vassal = {
			limit = {
				OR = {
					has_character_flag = guest_feast_started
					has_character_flag = coming_to_feast
				}
			}
			letter_event = {
				id = 72113
				tooltip = "EVTTOOLTIP72113"
			}
			hidden_tooltip = {
				remove_do_not_disturb_effect = yes
				clr_character_flag = coming_to_feast
				clr_character_flag = guest_feast_started
				clr_character_flag = wounded_opponent
				clr_character_flag = maimed_opponent
				clr_character_flag = killed_opponent
				clr_character_flag = passionated_guest
			}
		}
	}
}

#Feast cancelled: notify invited vassals
letter_event = {
	id = 72113
	desc = "EVTDESC72113"

	is_triggered_only = yes

	option = {
		name = "EVTOPTA72113"
	}
}

###########################################
# Flag management                         #
###########################################

# Safety catch for guests - clears character flags and modifiers
character_event = {
	id = 72998

	hide_window = yes

	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				independent = no
				liege = { has_character_modifier = holding_large_feast }
			}
			character_event = { id = 72998 days = 30 } # resend the clearing event
		}
		if = {
			limit = {
				OR = {
					independent = yes
					liege = { NOT = { has_character_modifier = holding_large_feast } }
				}
			}
			clr_character_flag = coming_to_feast
			clr_character_flag = guest_feast_started
			clr_character_flag = wounded_opponent
			clr_character_flag = maimed_opponent
			clr_character_flag = killed_opponent
			clr_character_flag = passionated_guest
		}
	}
}

# Safety catch for host - clears character flags and modifiers
character_event = {
	id = 72999

	hide_window = yes

	is_triggered_only = yes

	immediate = {
		remove_character_modifier = holding_large_feast
		clr_character_flag = nerthus_feast
		clr_character_flag = planning_feast
		clr_character_flag = sent_invitations
		clr_character_flag = host_feast_started
		clr_character_flag = feast_jongleur
		clr_character_flag = feast_musicians
		clr_character_flag = dealt_with_robber_band
		clr_character_flag = guest_daughter_event
		clr_character_flag = guest_claim_event
		clr_character_flag = feast_minstrel
		clr_character_flag = feast_fireeaters
		clr_character_flag = feast_conjurer
		clr_character_flag = lavishly_food
		clr_character_flag = medium_food
		clr_character_flag = low_food
		clr_character_flag = castle_problems
		clr_character_flag = feast_jester
		clr_character_flag = feast_drunkard_guest
		clr_character_flag = feast_duel
		clr_character_flag = feast_boar_hunt
		any_vassal = {
			limit = {
				has_character_flag = guest_feast_started
			}
			clr_character_flag = coming_to_feast
			clr_character_flag = guest_feast_started
			clr_character_flag = wounded_opponent
			clr_character_flag = maimed_opponent
			clr_character_flag = killed_opponent
		}
	}
}
