@weight_up_ai_select_province_small = 10
@weight_up_ai_select_province_medium = 50
@weight_up_ai_select_province_large = 250
@weight_up_ai_select_province_massive = 500

@feast_cost_gold_low = tiny_gold_value
@feast_cost_gold_medium = medium_gold_value
@feast_cost_gold_high = major_gold_value

activity_feast = {
	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			has_government = landless_minority_government
		}
		highest_held_title_tier > tier_barony
		trigger_if = {
			limit = {
				is_ai = yes
				NOT = { has_character_flag = feast_ai_override }
			}
			years_from_game_start >= 3
			ai_should_focus_on_building_in_their_capital = no
			is_at_war = no
			OR = {
				has_character_flag = feasts_a_lot
				short_term_gold >= feast_activity_cost
				AND = {
					house ?= { has_house_power_parameter = feasts_costs_treasury }
					short_term_treasury >= feast_activity_cost
				}
			}
			trigger_if = { # Throttle Counts
				limit = {
					highest_held_title_tier = tier_county
					NOR = {
						has_government = japan_administrative_government
						has_government = japan_feudal_government
					}
				}
				ai_sociability >= 100
			}
		}
		#Every other activity must be blocked until an uncrowned AI crowns themselves
		trigger_if = {
			limit = {
				is_ai = yes
			}
			NOT = {
				has_realm_law = uncrowned
			}
		}
	}

	can_start_showing_failures_only = {
		NOT = { is_activity_type_on_cooldown = activity_feast }
		trigger_if = {
			limit = {
				OR = {
					is_ai = no
					NOT = { has_character_flag = feast_ai_override }
				}
			}
			is_available_adult = yes
		}
	}

	is_valid = {
		scope:host = {
			is_alive = yes
			is_capable_adult = yes
			is_imprisoned = no
			OR = {
				is_landed_or_landless_administrative = yes
				has_government = landless_minority_government
			}
			NOT = { is_incapable = yes }
		}
		# If no one shows up
		trigger_if = {
			limit = {
				is_current_phase_active = yes
			}
			has_attending_activity_guests = yes
		}
	}

	on_host_death = {
		every_attending_character = {
			limit = { is_alive = yes }
			trigger_event = {
				id = feast.5003
				days = 1 # So you don't get spammed
			}
		}
		# Code sends your entourage home on invalidated
		scope:activity.var:host_var = {
			# Saving the title for loc
			primary_title = { save_scope_as = host_title }
			# Inform your heir if you have one
			player_heir ?= {
				trigger_event = {
					id = feast.0800
					days = 1
				}
			}
		}
	}

	on_invalidated = {
		if = {
			limit = {
				scope:host = { is_imprisoned = yes }
			}
			#Host has been imprisoned
			every_attending_character = {
				limit = {
					this != scope:host
				}
				trigger_event = feast.5005
			}
			scope:host = { trigger_event = feast.5004 }
		}
		else_if = { #Invalidation for your Murder Target not showing up
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = feast_type_murder
					}
					exists = special_guest:honorary_guest
				}
				scope:activity = { #theyre not attending
					any_attending_character = {
						this != scope:activity.special_guest:honorary_guest
					}
				}
				scope:activity.special_guest:honorary_guest = { is_alive = yes } #but they're alive
				scope:host = { #and you didn't back down/fail
					NOR = {
						has_variable = murder_feast_murder_back_down
						has_variable = murder_feast_murder_failure_var
					}
				}
			}
			activity_host = { trigger_event = feast.2020 }
			every_attending_character = {
				limit = {
					this != scope:host
				}
				trigger_event = feast.2021
			}
		}
		else_if = { #Invalidation for your Murder Target dying before you kill them
			limit = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = feast_type_murder
					}
				}
				scope:activity.special_guest:honorary_guest = {
					is_alive = no
					scope:host = { has_variable = murder_feast_killed_var }
				}
			}
			activity_host = { trigger_event = feast.2010 }
			every_attending_character = {
				limit = {
					this != scope:host
				}
				trigger_event = feast.2011
			}
		}
		if = {
			limit = {
				scope:host = { is_incapable = yes }
			}
			scope:activity = {
				activity_type = { save_scope_as = activity_type }
			}
			scope:host = {
				trigger_event = activity_system.0330
			}
			every_attending_character = {
				limit = { this != scope:host }
				trigger_event = activity_system.0331
			}
		}
		if = { # No one shows up
			limit = {
				has_attending_activity_guests = no
			}
			scope:activity = {
				activity_type = { save_scope_as = activity_type }
				activity_location = { save_scope_as = location }
			}
			scope:host = { trigger_event = feast.2003 }
		}
		# Accolade stuff
		if = {
			limit = {
				any_attending_character = {
					has_character_modifier = accolade_charmer_party_modifier
				}
			}
			every_attending_character = {
				limit = {
					has_character_modifier = accolade_charmer_party_modifier
				}
				remove_character_modifier = accolade_charmer_party_modifier
			}
		}
		if = {
			limit = {
				any_attending_character = {
					has_character_modifier = accolade_charmer_party_high_modifier
				}
			}
			every_attending_character = {
				limit = {
					has_character_modifier = accolade_charmer_party_high_modifier
				}
				remove_character_modifier = accolade_charmer_party_high_modifier
			}
		}
		# Host becomes unlanded
		if = {
			limit = {
				scope:host = {
					is_landed_or_landless_administrative = no
				}
			}
			scope:activity = {
				activity_type = { save_scope_as = activity_type }
			}
			every_attending_character = {
				trigger_event = activity_system.0320
			}
		}
	}

	###################
	# PARAMETERS
	###################

	is_single_location = yes

	province_filter = domicile_domain
	ai_province_filter = capital

	max_route_deviation_mult = 2.0

	is_location_valid = {
		has_holding = yes
	}

	province_description = {
		desc = activity_feast_province_desc
		# +++ / triple plus good
		triggered_desc = {
			trigger = { has_building_or_higher = citadel_of_aleppo_01 }
			desc = activity_feast_province_desc_citadel_of_aleppo
		}
		triggered_desc = {
			trigger = { has_building_or_higher = palace_of_aachen_01 }
			desc = activity_feast_province_desc_palace_of_aachen
		}
		triggered_desc = {
			trigger = { has_building_or_higher = doges_palace_01 }
			desc = activity_feast_province_desc_doges_palace
		}
		triggered_desc = {
			trigger = { has_building_or_higher = ghana_palace_01 }
			desc = activity_feast_province_desc_ghana_palace_01
		}
		triggered_desc = {
			trigger = { has_building_or_higher = kyz_kala_01 }
			desc = activity_feast_province_desc_kyz_kala_01
		}
		triggered_desc = {
			trigger = { has_building_or_higher = leisure_palace_01 }
			desc = activity_feast_province_desc_leisure_palace
		}
		triggered_desc = {
			trigger = { has_building_or_higher = alhambra_01 }
			desc = activity_feast_province_desc_alhambra
		}
		# ++ / double plus good
		triggered_desc = {
			trigger = { has_building_or_higher = paddy_fields_01 }
			desc = activity_feast_province_desc_paddy_fields
		}
		# + / plus good
		triggered_desc = {
			trigger = { has_building_or_higher = longhouses_01 }
			desc = activity_feast_province_desc_longhouses
		}
		triggered_desc = {
			trigger = { has_building_or_higher = orchards_01 }
			desc = activity_feast_province_desc_orchards
		}
		triggered_desc = {
			trigger = { has_building_or_higher = cereal_fields_01 }
			desc = activity_feast_province_desc_cereal_fields
		}
		triggered_desc = {
			trigger = { has_building_or_higher = plantations_01 }
			desc = activity_feast_province_desc_plantations
		}
		triggered_desc = {
			trigger = { has_building_or_higher = pleasure_dome }
			desc = activity_feast_province_desc_pleasure_dome
		}
	}

	max_province_icons = 5

	province_score = {
		value = 0
		# BUILDINGS
		# Triple good / +++
		if = {
			limit = { has_building_or_higher = citadel_of_aleppo_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = palace_of_aachen_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = doges_palace_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = ghana_palace_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = kyz_kala_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = leisure_palace_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = alhambra_01 }
			add = 100
		}
		if = {
			limit = { has_building_or_higher = pleasure_dome }
			add = 100
		}
		# Double good / ++
		if = {
			limit = { has_building_or_higher = farm_estates_01 }
			add = 50
		}
		if = {
			limit = { has_building_or_higher = paddy_fields_01 }
			add = 50
		}
		# Good / +
		if = {
			limit = { has_building_or_higher = longhouses_01 }
			add = 25
		}
		if = {
			limit = { has_building_or_higher = orchards_01 }
			add = 25
		}
		if = {
			limit = { has_building_or_higher = cereal_fields_01 }
			add = 25
		}
		if = {
			limit = { has_building_or_higher = plantations_01 }
			add = 25
		}
	}

	cooldown = { years = standard_feast_cooldown_time }

	# desc is only shown in debug AI watch window
	ai_will_do = {
		add = {
			value = 30
			desc = "Base"
		}
		add = {
			value = ai_greed
			multiply = -0.25
			desc = "ai_greed"
		}
		add = {
			value = ai_sociability
			multiply = 0.5
			desc = "ai_sociability"
		}
		if = {
			limit = {
				ai_energy < 0
			}
			add = {
				add = ai_energy
				desc = "ai_energy"
			}
		}
		if = {
			limit = { has_trait = gregarious }
			add = {
				value = 10
				desc = "Is gregarious"
			}
		}
		if = {
			limit = { has_trait = shy }
			add = {
				value = -30
				desc = "Is shy"
			}
		}
		if = {
			limit = { has_trait = inappetetic }
			add = {
				value = -30
				desc = "Is inappetetic"
			}
		}
		if = {
			limit = { has_trait = reclusive }
			add = {
				value = -30
				desc = "Is reclusive"
			}
		}
		if = {
			limit = {
				short_term_gold >= feast_activity_cost
				short_term_gold >= major_gold_value
			}
			add = {
				value = 30
				desc = "Got gold to burn"
			}
		}
		if = {
			limit = {
				house ?= { has_house_power_parameter = feasts_costs_treasury }
				short_term_treasury >= hunt_activity_base_cost
				short_term_treasury >= major_gold_value
			}
			add = {
				value = 30
				desc = "Got treasury to burn"
			}
		}
		if = {
			limit = { has_trait = lifestyle_reveler }
			add = {
				value = 20
				desc = "Is Reveler"
			}
		}
		if = {
			limit = {
				has_royal_court = yes
				has_court_type = court_intrigue
			}
			add = {
				value = 10
				desc = "Intrigue court trait"
			}
		}
		if = {
			limit = { has_trait = comfort_eater }
			add = {
				value = 10
				desc = "Is Comfort Eater"
			}
		}
		if = {
			limit = { has_trait = drunkard }
			add = {
				value = 10
				desc = "Is Drunkard"
			}
		}
		if = {
			limit = { has_trait = gluttonous }
			add = {
				value = 10
				desc = "Is Gluttonous"
			}
		}
		if = {
			limit = { has_trait = hashishiyah }
			add = {
				value = 10
				desc = "Has Munchies"
			}
		}
		# Stress
		if = { # Low Stress
			limit = {
				stress >= lower_than_baseline_stress
				NOT = { has_trait = shy }
			}
			add = {
				value = 20
				desc = "lower_than_baseline_stress"
			}
		}
		if = { # High Stress
			limit = {
				stress >= higher_than_baseline_stress
				NOT = { has_trait = shy }
			}
			add = {
				value = 20
				desc = "higher_than_baseline_stress"
			}
		}
		if = { # Very High Stress
			limit = {
				stress >= high_stress
				NOT = { has_trait = shy }
			}
			add = {
				value = 20
				desc = "high_stress"
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_tradition = tradition_culinary_art
				}
			}
			add = {
				value = 20
				desc = "Host culture has Culinary Artists Cultural Tradition"
			}
		}
		if = {
			limit = {
				faith = { has_doctrine = tenet_ritual_celebrations }
			}
			add = {
				value = 35
				desc = "Host culture has Ritual Celebrations Cultural Tradition"
			}
		}
		if = {
			limit = {
				faith = { has_doctrine = tenet_hedonistic }
			}
			add = {
				value = 35
				desc = "Host faith has Hedonistic Tenet"
			}
		}
		if = {
			limit = {
				host.faith = {
					has_doctrine = tenet_asceticism
				}
			}
			add = {
				value = -20
				desc = "Host faith has Asceticism tenet"
			}
		}
		if = {
			limit = { has_character_flag = feasts_a_lot }
			add = {
				value = 500
				desc = "feasts a lot"
			}
		}
		if = {
			limit = {
				top_liege != this
				has_vassal_stance = courtly
			}
			add = {
				value = 10
				desc = courtly
			}
		}
		if = {
			limit = { ai_has_warlike_personality = yes }
			add = {
				value = -30
				desc = "Warlike"
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_nomadic
				gold > prestige
				gold > 200
				prestige < 600
			}
			add = {
				value = 70
				desc = "Nomad searching for prestige"
			}
		}
		# Struggles.
		if = {
			limit = {
				any_character_struggle = {
					involvement = involved
					phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast
				}
			}
			# Escalating.
			if = {
				limit = { has_character_flag = agenda_towards_escalation }
				add = {
					value = -25
					desc = debug_gui.activity_weight.struggle.wants_to_escalate
				}
			}
			# Deescalating.
			if = {
				limit = { has_character_flag = agenda_towards_deescalation }
				add = {
					value = 50
					desc = debug_gui.activity_weight.struggle.wants_to_deescalate
				}
			}
		}
		if = {
			limit = {
				ai_has_warlike_personality = yes
				war_chest_gold < war_chest_gold_maximum
			}
			multiply = {
				value = 0.25
				desc = "Warlike"
			}
		}
		# Economic Archetype
		if = { # Too busy booming the economy
			limit = {
				OR = {
					ai_has_economical_boom_personality = yes
					has_character_flag = ai_boom
				}
			}
			add = {
				value = -200
				desc = "Builder"
			}
		}
		if = { # Should probably spend their gold elsewhere
			limit = { 
				ai_has_pious_builder_personality = yes
			}
			if = { # Unless...
				limit = {
					faith = { has_doctrine = tenet_ritual_celebrations }
				}
				add = {
					value = 100
					desc = "Pious Builder with Ritual Celebrations"
				}
			}
			else = {
				add = {
					value = -100
					desc = "Pious Builder"
				}
			}
		}
		if = {
			limit = {
				has_variable = conqueror
				OR = {
					AND = {
						prestige_level < 4
						can_use_conquest_cbs_trigger = yes
					}
					prestige < 1000
				}
			}
			add = {
				value = 1000
				desc = "conqueror looking for prestige"
			}
		}
		if = {
			limit = {
				has_variable = conqueror
				trigger_if = {
					limit = {
						prestige_level >= 4
						can_use_conquest_cbs_trigger = yes
					}
					prestige_level >= 4
				}
				prestige >= 1000
			}
			add = {
				value = -5000
				desc = "conqueror sated for prestige"
			}
		}
		# Legitimacy
		if = {
			limit = {
				is_valid_for_legitimacy_change = yes
			}
			if = { # Low Legitimacy
				limit = {
					OR = {
						legitimacy_level = 1
						legitimacy_level = 2
					}
				}
				add = {
					value = 10
					desc = "low_legitimacy"
				}
			}
			if = { # Very Low Legitimacy
				limit = {
					legitimacy_level = 0
				}
				add = {
					value = 20
					desc = "low_legitimacy"
				}
			}
		}
		# Plague
		if = {
        	limit = {
        	    any_held_title = {
					title_tier = county
        	        has_province_with_epidemic = { intensity < apocalyptic }
        	    }
        	    would_follow_social_distancing_value >= -1
        	}
        	add = {
        	    value = -60
        	    desc = "Plague in Domain"
        	}
    	}
    	else_if = {
    	    limit = {
    	        any_realm_county = {
    	            has_province_with_epidemic = { intensity < apocalyptic }
    	        }
    	        would_follow_social_distancing_value >= -1
    	    }
    	    add = {
    	        value = -20
    	        desc = "Plague in Top Realm"
    	    }
    	}
    	if = {
    	    limit = {
    	        any_held_title = {
					title_tier = county
    	            has_province_with_epidemic = { intensity = apocalyptic }
    	        }
    	    }
    	    add = {
    	        value = -200
    	        desc = "Apocalyptic Plague in Domain"
    	    }
    	}
    	else_if = {
    	    limit = {
    	        any_held_title = {
					title_tier = county
    	            has_province_with_epidemic = { intensity = apocalyptic }
    	        }
    	    }
    	    add = {
    	        value = -40
    	        desc = "Apocalyptic Plague in Top Realm"
    	    }
    	}
		if = {
			limit = {
				is_ai = yes
				has_character_flag = feast_ai_override
			}
			add = 10000
		}
	}

	###################
	# GUEST HANDLING
	###################

	max_guests = 40

	guest_invite_rules = {
		rules = {
			# Relations.
			2 = activity_invite_rule_rivals_if_appropriate

			# Family.
			3 = activity_invite_rule_extended_family

			# Magnates.
			4 = activity_invite_neighbouring_rulers

			# Misc landless.
			5 = activity_invite_rule_knights

			# MP
			6 = activity_invite_mp
		}
		defaults = {
			1 = activity_invite_rule_friends
			1 = activity_invite_rule_potential_friends
			2 = activity_invite_rule_lovers
			2 = activity_invite_rule_potential_lovers
			1 = activity_invite_rule_close_family
			1 = activity_invite_rule_liege
			1 = activity_invite_rule_suzerain
			1 = activity_invite_rule_tributaries
			1 = activity_invite_rule_confederates
			1 = activity_invite_rule_vassals
			2 = activity_invite_rule_fellow_vassals
			3 = activity_invite_rule_courtiers
			4 = activity_invite_rule_guests
			1 = activity_invite_spouses
			1 = activity_invite_rule_landless_adventurers_restricted_range_opinion
		}
	}

	can_be_activity_guest = {
		is_adult = yes
		is_healthy = yes
		in_diplomatic_range = scope:host
	}

	host_intents = {
		intents = { reduce_stress_intent murder_attendee_intent woo_attendee_intent befriend_attendee_intent spread_legend_intent legitimacy_intent }
		default = reduce_stress_intent
	}

	guest_intents = {
		intents = { reduce_stress_intent murder_attendee_intent woo_attendee_intent befriend_attendee_intent banquet_mischief_intent spread_legend_intent legitimacy_intent }
		default = reduce_stress_intent
	}

	guest_join_chance = {
		base = 10
		base_activity_modifier = yes

		# Scripted Modifiers
		activity_guest_shared_ai_accept_modifier = yes
		activity_guest_feast_ai_accept_modifier = yes

		# If the Host has hosted a Murder Feast recently people are sus
		modifier = {
			scope:host = { has_variable = recent_murder_feast_var }
			add = {
				value = -15
				desc = "Recent $feast_type_murder$"
			}
		}

		# Master of Revels Accolade increasing invite acceptance
		modifier = {
   		   scope:host = {
   		   		any_active_accolade = {
					accolade_parameter = acclaimed_knight_feast_wedding_invite_acceptance_bonus
				}
   		   }
   		   add = accolade_feast_wedding_invite_acceptance_value
   		}
	}

	special_guests = {
		honorary_guest_regular = {
			is_required = no

			is_shown = {
				scope:special_option = flag:feast_type_generic
			}

			can_pick = {
				this != scope:host
				is_healthy = yes
				is_adult = yes
				trigger_if = { # Pick adventurers first!
					limit = {
						scope:host = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
					}
					reverse_has_opinion_modifier = {
						modifier = laamp_used_contact_opinion_special
						target = scope:host
					}
				}
				trigger_if = {
					limit = {
						scope:host = {
							is_ai = yes
							NOT = { has_character_flag = feast_ai_override }
						}
					}
					OR = {
						is_vassal_of = scope:host
						target_is_vassal_or_below = scope:host
						has_relation_friend = scope:host
						has_relation_lover = scope:host
					}
				}
			}

			ai_will_do = {
				value = 10
			}
		}

		honorary_guest = { #Murder guest, localization changes for host
			is_required = yes

			is_shown = {
				scope:special_option = flag:feast_type_murder
			}

			can_pick = {
				this != scope:host
				is_healthy = yes
				is_adult = yes
				NOT = { is_spouse_of = scope:host }
				trigger_if = {
					limit = {
						scope:host = { is_ai = yes }
					}
					has_relation_rival = scope:host #AI only picks rivals
					this != scope:host.liege #AI doesnt pick their liege
					this != scope:host.faith.religious_head #AI doesnt pick their HoF
				}
			}

			ai_will_do = {
				value = 10
			}
		}
	}

	travel_entourage_selection = {
		weight = {
			value = standard_travel_entourage_additions
			if = {
				limit = {
					OR = {
						has_trait = gregarious
						has_trait = drunkard
						has_trait = hashishiyah
						has_trait = gluttonous
						has_trait = comfort_eater
					}
				}
				add = 10
			}
		}
		max = 18
		invite_rule_order = 3
	}

	cost = {
		gold = {
			if = {
				limit = {
					OR = {
						AND = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
						government_has_flag = government_is_mandala
						AND = {
							house ?= { has_house_power_parameter = feasts_costs_treasury }
							has_treasury = yes
						}
						government_allows = barter
					}	
				}
				value = 0
			}
			else = {
				add = base_feast_cost_value
			}
			if = {
				limit = {
					has_title = title:e_minister_of_revenue
				}
				multiply = 0.85
			}	
		}
		treasury = {
			if = {
				limit = {
					OR = {
						NAND = {
							house ?= { has_house_power_parameter = feasts_costs_treasury }
							has_treasury = yes
						}
						AND = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
					}
				}
				value = 0
			}
			else = {
				value = base_feast_cost_value
				if = {
					limit = {
						has_title = title:e_minister_of_revenue
					}
					multiply = 0.85
				}
			}
		}
		piety = {
			if = {
				limit = {
					OR = {
						NOT = { government_has_flag = government_is_mandala }
						AND = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
					}
				}
				value = 0
			}
			else = {
				add = base_feast_cost_value
			}
		}
		barter_goods = {
			if = {
				limit = {
					NOT = { government_allows = barter }	
				}
				value = 0
			}
			else = {
				add = base_feast_cost_value
			}
		}
	}

	ui_predicted_cost = {
		# All costs are balanced on County/Early Era starting point
		gold = {
			if = {
				limit = {
					OR = {
						government_has_flag = government_is_mandala
						AND = {
							house ?= { has_house_power_parameter = feasts_costs_treasury }
							has_treasury = yes
						}
						government_allows = barter
					}
				}
				value = 0
			}
			else = {
				value = base_feast_ui_cost_value
			}

			if = {
				limit = { has_variable = mpo_nerge_1060_free_feast }
				multiply = {
					value =  0 # Free
					desc = mpo_nerge_1060_free_feast_desc
				}
			}
		}
		treasury = { # Make sure this matches the gold cost above
			if = {
				limit = {
					NAND = {
						house ?= { has_house_power_parameter = feasts_costs_treasury }
						has_treasury = yes
					}
				}
				value = 0
			}
			else = {
				value = base_feast_cost_value
			}

			if = {
				limit = { has_variable = mpo_nerge_1060_free_feast }
				multiply = {
					value =  0 # Free
					desc = mpo_nerge_1060_free_feast_desc
				}
			}
		}

		piety = {
			if = {
				limit = {
					NOT = { government_has_flag = government_is_mandala }
				}
				value = 0
			}
			else = {
				value = base_feast_ui_cost_value
			}

			if = {
				limit = { has_variable = mpo_nerge_1060_free_feast }
				multiply = {
					value =  0 # Free
					desc = mpo_nerge_1060_free_feast_desc
				}
			}
		}

		barter_goods = {
			if = {
				limit = {
					NOT = { government_allows = barter }
				}
				value = 0
			}
			else = {
				value = base_feast_ui_cost_value
			}

			if = {
				limit = { has_variable = mpo_nerge_1060_free_feast }
				multiply = {
					value =  0 # Free
					desc = mpo_nerge_1060_free_feast_desc
				}
			}
		}
	}

	###################
	# GRAPHICS
	###################

	map_entity = {
		trigger = {
			activity_location.culture = {
				OR = {
					has_graphical_iranian_culture_group_trigger = yes
					has_graphical_mena_culture_group_trigger = yes
					has_graphical_steppe_culture_group_trigger = yes
					has_graphical_african_culture_group_trigger = yes
				}
			}
		}
		reference = "building_mena_feast_01_entity"
	}

	map_entity = {
		trigger = {
			activity_location.culture = {
				has_graphical_india_culture_group_trigger = yes
			}
		}
		reference = "building_indian_feast_01_entity"
	}

	map_entity = "building_western_feast_01_entity"

	# Travel
	background = { # Bridge
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				is_riverside_province = yes
				geographical_region = world_europe
				OR = {
					terrain = farmlands
					terrain = plains
					terrain = mountains
					terrain = hills
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_bridge.dds"
		environment = "environment_travel_bridge"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}

	background = { #Rice Fields - If we have Paddy fields AND/or terraced hills
	#This goes before other terrain since it can override in many different terrains if built
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				terrain = farmlands
				OR = {
					terrain = terraced_hills
					has_building_or_higher = paddy_fields_01
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/tgp_rice_fields.dds"
		environment = "environment_tgp_rice_fields"
		ambience = "event:/DLC/EP4/SFX/Events/Event_Backgrounds/tgp_rice_fields"
	}

	background = { #Farmlands - East Asia
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				terrain = farmlands
				culture = { has_graphical_east_asia_culture_group_trigger = yes }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/tgp_farm_asia.dds"
		environment = "environment_tgp_farm_asia"
		ambience = "event:/DLC/EP4/SFX/Events/Event_Backgrounds/tgp_farm_asia"
	}

	background = { # Farmland, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				terrain = farmlands
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_farm.dds"
		environment = "environment_travel_farmlands"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { # Farmland, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				terrain = farmlands
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/farms.dds"
		environment = "environment_event_farms"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #Desert, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_desert_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_desert.dds"
		environment = "environment_travel_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}
	background = { #Desert, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_desert_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/desert.dds"
		environment = "environment_event_bp1_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}

	background = { #forest snowy
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location ?= { hunt_snowy_forest_trigger = yes }
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_hunt_snowy_forest.dds"
		environment = "environment_hunt_snowy_forest"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}

	background = { #forest_pine
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_forest_pine_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/forest_pine.dds"
		environment = "environment_event_forest_pine"
		ambience = "event:/SFX/Events/Backgrounds/coniferous_forest_day"
	}

	background = { #forest
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_forest_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/forest.dds"
		environment = "environment_event_forest"
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #mountains, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_mountains_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_mountains.dds"
		environment = "environment_travel_mountain_settlement"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}
	background = { #mountains, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_mountains_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/mountains.dds"
		environment = "environment_event_mountains"
		ambience = "event:/SFX/Events/Backgrounds/mountains_day"
	}

	background = { #steppe, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_steppe_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_steppe.dds"
		environment = "environment_travel_steppe_settlement"
		ambience = "event:/SFX/Events/Backgrounds/steppe_day"
	}
	background = { #steppe, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_steppe_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/steppe.dds"
		environment = "environment_event_steppe"
		ambience = "event:/SFX/Events/Backgrounds/steppe_day"
	}

	background = { #drylands (formerly desert)
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_drylands_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/drylands.dds"
		environment = "environment_event_desert"
		ambience = "event:/SFX/Events/Backgrounds/desert_day"
	}

	background = { #wetlands
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_wetlands_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_wetlands.dds"
		environment = "environment_event_bp1_wetlands"
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #jungle
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_wilderness_jungle_trigger = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_jungle.dds"
		environment = "environment_event_bp1_jungle"
		ambience = "event:/SFX/Events/Backgrounds/deciduous_forest_day"
	}

	background = { #plains, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_plains_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_hills.dds"
		environment = "environment_travel_hills_settlement"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { #plains, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_plains_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_plains.dds"
		environment = "environment_event_bp1_plains"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #hills, settled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_hills_trigger = yes
				exists = province_owner
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_travel_hills.dds"
		environment = "environment_travel_hills_settlement"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}
	background = { #hills, unsettled
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				graphical_hills_trigger = yes
				NOT = { exists = province_owner }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/bp1_hills.dds"
		environment = "environment_event_bp1_hills"
		ambience = "event:/SFX/Events/Backgrounds/fields_farms_day"
	}

	background = { #sea
		trigger = {
			OR = {
				scope:host.location != scope:activity.activity_location
				AND = {
					exists = scope:activity.special_guest:honorary_guest.location
					NOT = {
						scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
					}
				}
				AND = {
					exists = scope:activity.special_guest:honorary_guest_regular.location
					NOT = {
						scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
					}
				}
			}
			scope:host.location = {
				is_sea_province = yes
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/fp1_ocean.dds"
		environment = "environment_event_fp1_ocean"
		ambience = "event:/DLC/FP1/SFX/Events/event_ocean_longship"
	}
	# End Travel

	background = {
		trigger = {
			OR = {
				scope:host = { government_has_flag = government_is_nomadic }
				AND = {
					scope:host = { government_has_flag = government_is_tribal }
					activity_location.culture ?= { has_graphical_steppe_culture_group_trigger = yes }
				}
				scope:host = {
					is_landless_adventurer = yes
					culture ?= { has_graphical_steppe_culture_group_trigger = yes }
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_feast_steppe.dds"
		environment = "environment_steppe_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
	}
	background = {	# EP3
		trigger = {
			activity_location.culture = {
				OR = {
					has_building_gfx = byzantine_building_gfx
					has_building_gfx = caucasian_building_gfx
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep3_feast_byzantine.dds"
		environment = "environment_ep3_byzantine_feast"
		ambience = "event:/SFX/Events/Backgrounds/corner_of_tavern"
	}
	background = {	# FP1
		trigger = {
			activity_location.culture = { has_building_gfx = norse_building_gfx }
		}
		texture = "gfx/interface/illustrations/event_scenes/fp1_viking_feast.dds"
		environment = "environment_event_fp1_viking_feast"
		ambience = "event:/DLC/FP1/SFX/Events/event_viking_feast"
	}
	background = {
		trigger = {
			activity_location ?= {
				OR = {
					culture = { has_graphical_india_culture_group_trigger = yes }
					steppe_building_gfx_use_indian_trigger = yes
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_feast_indian.dds"
		environment = "environment_indian_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
	}
	background = {
		trigger = {
			OR = {
				activity_location.culture = { has_building_gfx = arabic_group_building_gfx }
				activity_location.culture = { has_building_gfx = berber_group_building_gfx }
				activity_location.culture = { has_building_gfx = iberian_building_gfx }
				activity_location.culture = { has_building_gfx = iranian_building_gfx }
				activity_location = { steppe_building_gfx_use_mena_trigger = yes }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_feast_mena.dds"
		environment = "environment_mena_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
	}
	background = {
		trigger = {
			activity_location ?= {
				OR = {
					culture = { has_graphical_east_asia_culture_group_trigger = yes }
					steppe_building_gfx_use_east_asian_trigger = yes
				}
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/tgp_feast_asia.dds"
		environment = "environment_tgp_feast_asia"
		ambience = "event:/DLC/EP4/SFX/Events/Event_Backgrounds/tgp_feast_asia"	
	}
	background = {
		trigger = {
			activity_location.culture = { has_building_gfx = african_building_gfx }
		}
		texture = "gfx/interface/illustrations/event_scenes/ep2_feast_sub_saharan.dds"
		environment = "environment_sub-saharan_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
	}
	background = {
		trigger = {
			OR = {
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = feast_type_generic
					}
				}
				scope:activity = {
					has_activity_option = {
						category = special_type
						option = feast_type_legendary
					}
				}
				scope:activity.special_guest:honorary_guest ?= { is_alive = yes }
			}
		}
		texture = "gfx/interface/illustrations/event_scenes/feast.dds"
		environment = "environment_event_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
		music = "grandfeast_cue"
	}
	background = {
		trigger = {
			scope:activity = {
				has_activity_option = {
					category = special_type
					option = feast_type_murder
				}
			}
			scope:activity.special_guest:honorary_guest ?= { is_alive = no }
		}
		texture = "gfx/interface/illustrations/event_scenes/feast.dds"
		environment = "environment_event_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
		music = "murderfest_cue"
	}
	background = {
		trigger = {
			scope:activity = {
				has_activity_option = {
					category = special_type
					option = feast_type_tsagaan_sar
				}
			}
			scope:activity.special_guest:honorary_guest ?= { is_alive = no }
		}
		texture = "gfx/interface/illustrations/event_scenes/feast.dds"
		environment = "environment_event_feast"
		ambience = "event:/SFX/Events/Backgrounds/feasthall"
		music = "grandfeast_cue"
	}

	window_characters = {

		guest = {
			camera = camera_body_right

			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						exists = scope:player
						scope:player = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
						}
					}
					scope:player ?= { add_to_list = characters }
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						exists = scope:host.intent_target
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							this = scope:host.intent_target
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							this = scope:host.intent_target
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								has_relation_lover = scope:host
								has_relation_friend = scope:host
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								has_relation_lover = scope:host
								has_relation_friend = scope:host
							}
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_consort_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_consort_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
						}
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = yes }
					}
					animation = { worry stress boredom fear disbelief paranoia eyeroll drink drink_goblet }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							has_activity_intent = woo_attendee_intent
						}
						scope:character = scope:host.intent_target
					}
					animation = { love flirtation }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							has_activity_intent = murder_attendee_intent
						}
						scope:character = scope:host.intent_target
					}
					animation = { dismissal worry paranoia }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
						scope:character = { has_trait = shy }
					}
					animation = { sadness worry }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
					}
					animation = { drink_goblet happiness flirtation throne_room_conversation_3 throne_room_conversation_1 }
				}
				#Fallback
				animation = toast
			}
		}

		host = {
			camera = camera_body

			effect = {
				if = {
					limit = {
						OR = {
							scope:host.location = scope:activity.activity_location
							scope:host.location = { is_sea_province = yes }
						}
					}
					scope:host = {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:host.location = { is_sea_province = yes }
					}
					animation = { survey }
				}
				triggered_animation = {
					trigger = {
						OR = {
							AND = {
								exists = scope:activity.special_guest:honorary_guest.location
								NOT = {
									scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
								}
							}
							AND = {
								exists = scope:activity.special_guest:honorary_guest_regular.location
								NOT = {
									scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
								}
							}
						}
					}
					animation = { boredom }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = yes }
					}
					animation = { schadenfreude personality_vengeful }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							is_male = yes
							has_activity_intent = befriend_attendee_intent
						}
						scope:host.intent_target.location = scope:activity.activity_location
					}
					animation = { personality_forgiving personality_compassionate }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							is_male = yes
							has_activity_intent = murder_attendee_intent
						}
						scope:host.intent_target.location = scope:activity.activity_location
					}
					animation = { hunting_knife_start }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							is_male = yes
							has_activity_intent = woo_attendee_intent
						}
						scope:host.intent_target.location = scope:activity.activity_location
					}
					animation = { wedding_groom_right }
				}
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host = {
							is_female = yes
							has_activity_intent = woo_attendee_intent
						}
						scope:host.intent_target.location = scope:activity.activity_location
					}
					animation = { reception_bride_right }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
					}
					animation = { toast_goblet }
				}
			}
		}

		travel_host = {
			camera = camera_event_horse_left

			effect = {
				if = {
					limit = {
						NOR = {
							scope:host.location = scope:activity.activity_location
							scope:host.location = { is_sea_province = yes }
						}
					}
					scope:host = {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = { scope:character = { has_trait = impatient } }
					animation = { jockey_gallop }
				}
				animation = jockey_walk
			}
		}

		honorary_guest_traveling_murder = {
			camera = camera_event_horse_left

			effect = {
				if = {
					limit = {
						scope:activity.special_guest:honorary_guest.involved_activity ?= scope:activity
						NOR = {
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
							scope:activity.special_guest:honorary_guest.location ?= { is_sea_province = yes }
						}
					}
					special_guest:honorary_guest ?= {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = { scope:character = { has_trait = impatient } }
					animation = { jockey_gallop }
				}
				animation = jockey_walk
			}
		}

		honorary_guest_murder = { # Both regular and murder
			camera = camera_body

			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
							scope:activity.special_guest:honorary_guest.location ?= { is_sea_province = yes }
						}
					}
					special_guest:honorary_guest ?= {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:activity.special_guest:honorary_guest_regular = { is_travelling = yes }
					}
					animation = { idle }
				}
				triggered_animation = {
					trigger = {
						always = yes
					}
					animation = { ecstasy wedding_priest chaplain personality_honorable personality_bold }
				}
			}
		}

		honorary_guest_regular_traveling = {
			camera = camera_event_horse_left

			effect = {
				if = {
					limit = {
						scope:activity.special_guest:honorary_guest_regular.involved_activity ?= scope:activity
						NOR = {
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
							scope:activity.special_guest:honorary_guest_regular.location = { is_sea_province = yes }
						}
					}
					special_guest:honorary_guest_regular ?= {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = { scope:character = { has_trait = impatient } }
					animation = { jockey_gallop }
				}
				animation = jockey_walk
			}
		}

		honorary_guest_regular = {
			camera = camera_body

			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
							scope:activity.special_guest:honorary_guest_regular.location ?= { is_sea_province = yes }
						}
					}
					special_guest:honorary_guest_regular ?= {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:activity.special_guest:honorary_guest_regular = { is_travelling = yes }
					}
					animation = { idle }
				}
				triggered_animation = {
					trigger = {
						always = yes
					}
					animation = { ecstasy wedding_priest chaplain personality_honorable personality_bold dancing }
				}
			}
		}

		guest = {
			camera = camera_body

			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 2
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 2
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 2
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 2
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
						}
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = yes }
					}
					animation = { worry stress boredom fear disbelief paranoia eyeroll drink drink_goblet }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
						scope:character = { has_trait = shy }
					}
					animation = { stress }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
					}
					animation = { dancing laugh toast flirtation_left throne_room_conversation_2 }
				}
				#Fallback
				animation = toast
			}
		}

		guest = {
			camera = camera_body_left

			effect = {
				if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 3
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							is_councillor_of = scope:host
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 3
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_duchy
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 3
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							highest_held_title_tier >= tier_county
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
						any_attending_character = {
							count >= 3
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
							OR = {
								is_parent_of = scope:host
								is_close_or_extended_family_of = scope:host
							}
						}
						add_to_list = characters
					}
				}
				else_if = {
					limit = {
						scope:host.location = scope:activity.activity_location
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest }
							scope:activity.special_guest:honorary_guest.location ?= scope:activity.activity_location
						}
						OR = {
							NOT = { exists = scope:activity.special_guest:honorary_guest_regular }
							scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
						}
					}
					every_attending_character = {
						limit = {
							location = scope:activity.activity_location
							NOR = {
								this = scope:host
								scope:activity.special_guest:honorary_guest ?= this
								scope:activity.special_guest:honorary_guest_regular ?= this
							}
						}
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = yes }
					}
					animation = { worry stress boredom fear disbelief paranoia eyeroll drink drink_goblet dancing }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
						scope:character = { has_trait = shy }
					}
					animation = { paranoia }
				}
				triggered_animation = {
					trigger = {
						scope:activity = { is_murder_feast = no }
					}
					animation = { drink eavesdrop wedding_drunk dancing }
				}
				#Fallback
				animation = toast
			}
		}
	}

	###################
	# OPTIONS
	###################

	options = {
		#Feast types
		special_type = {
			# Revel feast.
			## Generic feast for when you've got no specific reason.
			feast_type_generic = {
				default = yes

				ai_will_do = {
					value = 50
					if = {
						limit = {
							OR = {
								has_trait = gregarious
								has_trait = arrogant
								has_trait = arbitrary
								has_trait = brave
								has_trait = just
							}
						}
						add = 50
					}
					if = {
						limit = {
							OR = {
								has_trait = shy
								has_trait = humble
								has_trait = callous
								has_trait = sadistic
							}
						}
						subtract = 50
					}
					if = {
						limit = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
						add = 100
					}
				}
			}
			# Legendary feast.
			## Spread your legend.
			feast_type_legendary = {

				is_shown = {
					has_dlc_feature = legends_of_the_dead
				}

				is_valid = {
					custom_tooltip = {
						text = legendary_feast_valid_tt
						exists = promoted_legend #you need to have a legend to promote
					}
				}

				ai_will_do = {
					value = 50
					if = {
						limit = {
							OR = {
								has_trait = arrogant
								has_trait = ambitious
								has_trait = lifestyle_poet
								has_trait = journaller
							}
						}
						add = 50
					}
					if = {
						limit = {
							OR = {
								has_trait = shy
								has_trait = humble
							}
						}
						subtract = 50
					}
					if = {
						limit = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
						add = 100
					}
				}
			}
			# Murder feast.
			## You're trying to kill. _Everyone_. Kind of.
			feast_type_murder = {
				cost = {
					gold = {
						if = {
							limit = {
								OR = {
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
									AND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_type_murder_value
							if = {
								limit = { has_variable = mpo_nerge_1060_free_feast }
								multiply = {
									value =  0 # Free
									desc = mpo_nerge_1060_free_feast_desc
								}
							}
						}
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								OR = {
									NAND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_type_murder_value
							if = {
								limit = { has_variable = mpo_nerge_1060_free_feast }
								multiply = {
									value =  0 # Free
									desc = mpo_nerge_1060_free_feast_desc
								}
							}
						}
					}
				}

				is_shown = {
					has_dlc_feature = tours_and_tournaments
				}

				is_valid = {
					has_perk = forever_infamous_perk
					custom_tooltip = {
						text = feast_type_murder_valid_tt
						NOT = { has_variable = recent_murder_feast_var } #15 years cooldown
					}
				}

				blocked_intents = { murder_attendee_intent befriend_attendee_intent woo_attendee_intent }  #you can only relax mate

				ai_will_do = {
					value = 0
					if = {
						limit = {
							OR = {
								has_trait = callous
								has_trait = sadistic
								has_trait = arbitrary
								has_trait = vengeful
								has_trait = torturer
							}
						}
						add = 50
					}
					if = {
						limit = {
							OR = {
								has_trait = just
								has_trait = honest
								has_trait = compassionate
								has_trait = generous
								has_trait = forgiving
							}
						}
						subtract = 50
					}
					if = {
						limit = {
							this = faith.religious_head
							NOT = { has_trait = torturer }
							faith = {
								NOR = {
									has_doctrine_parameter = gruesome_festivals_active
									has_doctrine_parameter = human_sacrifice_active
								}
							}
						}
						add = -100
					}
					if = {
						limit = {
							this = faith.religious_head
							NOT = { has_trait = compassionate }
							faith = {
								OR = {
									has_doctrine_parameter = gruesome_festivals_active
									has_doctrine_parameter = human_sacrifice_active
								}
							}
						}
						add = 50
					}
				}
			}
			# Tsagaan Sar
			## Special feast for nomads
			feast_type_tsagaan_sar = {
				cost = {
					gold = {
						add = {
							add = {
								value = feast_activity_cost
								multiply = 2.5
								desc = feast_type_tsagaan_sar
							}
							add = {
								value = feast_activity_cost
								multiply = 2.5
								multiply = activity_cost_scale_by_era
								subtract = {
									value = feast_activity_cost
									multiply = 2.5
								}
								desc = activity_cost_scale_by_era_desc
							}
						}
						if = {
							limit = {
								dynasty ?= {
									has_dynasty_perk = law_legacy_1
								}
							}
							subtract = {
								value = feast_activity_cost
								multiply = 2.5
								multiply = activity_cost_scale_by_era
								multiply = law_legacy_cost_reduction_mult
								desc = law_legacy_1_name
							}
						}
						if = {
							limit = {
								has_character_modifier = mpo_bountiful_sheep_modifier
							}
							multiply = {
								value = 0.8
								desc = mpo_bountiful_sheep_modifier
							}
						}
						if = {
							limit = {
								has_character_modifier = mpo_si_slaughtered_animals
							}
							multiply = {
								value = 0.5
								desc = mpo_si_slaughtered_animals
							}
						}
						if = {
							limit = {
								has_character_modifier = mpo_nerge_feast_discount
							}
							multiply = {
								value = 0.5
								desc = mpo_nerge_feast_discount
							}
						}

						if = {
							limit = { has_variable = mpo_nerge_1060_free_feast }
							multiply = {
								value =  0 # Free
								desc = mpo_nerge_1060_free_feast_desc
							}
						}
						
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
				}

				is_shown = {
					has_mpo_dlc_trigger = yes
					government_has_flag = government_is_nomadic
					culture = {
						OR = {
							has_cultural_pillar = heritage_mongolic
							has_cultural_pillar = heritage_turkic
						}
					}
				}

				is_valid = {
					custom_tooltip = {
						text = feast_type_tsagaan_sar_valid_tt
						NOT = { has_variable = recent_tsagaan_sar_feast_var } #3 years cooldown
					}
					custom_tooltip = {
						text = feast_type_tsagaan_sar_valid_tt_time
						AND = {
							current_month >= 1
							current_month <= 3
						}
					}
				}

				ai_will_do = {
					value = 50
					if = {
						limit = {
							OR = {
								has_trait = gregarious
								has_trait = arrogant
								has_trait = arbitrary
								has_trait = brave
								has_trait = just
							}
						}
						add = 50
					}
					if = {
						limit = {
							OR = {
								has_trait = shy
								has_trait = humble
								has_trait = callous
								has_trait = sadistic
							}
						}
						subtract = 50
					}
					if = {
						limit = {
							is_ai = yes
							has_character_flag = feast_ai_override
						}
						add = 100
					}
					if = {
						limit = {
							government_has_flag = government_is_nomadic
						}
						add = 100
					}
				}
			}
		}

		# How fancy do you make your dishes?
		feast_option_food = {
			feast_food_bad = {
				is_shown = { has_dlc_feature = advanced_activities }

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
					# Fanciness preference.
					add = activity_option_likes_functional_food_option_value
				}
			}
			feast_food_normal = {
				default = yes
				cost = {
					gold = {
						if = {
							limit = {
								OR = {
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
									government_has_flag = government_is_mandala
									AND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									government_allows = barter
								}
							}
							value = 0
						}
						else = {
							value = feast_food_normal_value
						}	
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								OR = {
									NAND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_normal_value
						}
					}
					piety = {
						if = {
							limit = {
								OR = {
									NOT = { government_has_flag = government_is_mandala }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_normal_value
						}
					}
					barter_goods = {
						if = {
							limit = {
								OR = {
									NOT = { government_allows = barter }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_normal_value
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
					# Fanciness preference.
					## We just use slightly reduced fanciness prefs here.
					add = {
						value = activity_option_likes_ostentatious_food_option_value
						multiply = 0.5
					}
				}
			}
			feast_food_good = {
				is_shown = { has_dlc_feature = advanced_activities }

				cost = {
					gold = {
						if = {
							limit = {
								OR = {
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
									government_has_flag = government_is_mandala
									AND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									government_allows = barter
								}
							}
							value = 0
						}
						else = {
							value = feast_food_good_value
						}
					}
					treasury = {
						if = {
							limit = {
								OR = {
									NAND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_good_value
						}
					}
					piety = {
						if = {
							limit = {
								OR = {
									NOT = { government_has_flag = government_is_mandala }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_good_value
						}
					}
					barter_goods = {
						if = {
							limit = {
								OR = {
									NOT = { government_allows = barter }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_food_good_value
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
					# Fanciness preference.
					add = activity_option_likes_ostentatious_food_option_value
				}
			}
		}

		# How many courses do you have?
		feast_option_courses = {
			feast_courses_bad = {
				is_shown = { has_dlc_feature = advanced_activities }

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
					# Quantity preference.
					add = activity_option_food_prefers_small_volume_value
				}
			}
			feast_courses_normal = {
				default = yes

				cost = {
					gold = {
						if = {
							limit = {
								OR = {
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
									government_has_flag = government_is_mandala
									AND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									government_allows = barter
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_normal_value
						}
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								OR = {
									NAND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_normal_value
						}
					}

					piety = {
						if = {
							limit = {
								OR = {
									NOT = { government_has_flag = government_is_mandala }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_normal_value

							if = {
								limit = { has_variable = mpo_nerge_1060_free_feast }
								multiply = {
									value =  0 # Free
									desc = mpo_nerge_1060_free_feast_desc
								}
							}
						}
					}

					barter_goods = {
						if = {
							limit = {
								OR = {
									NOT = { government_allows = barter }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_normal_value

							if = {
								limit = { has_variable = mpo_nerge_1060_free_feast }
								multiply = {
									value =  0 # Free
									desc = mpo_nerge_1060_free_feast_desc
								}
							}
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
					# Quantity preference.
					## We just use slightly reduced quantity prefs here.
					add = {
						value = activity_option_prefers_large_volume_value
						multiply = 0.5
					}
				}
			}
			feast_courses_good = {
				is_shown = { has_dlc_feature = advanced_activities }

				cost = {
					gold = {
						if = {
							limit = {
								OR = {
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
									government_has_flag = government_is_mandala
									AND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									government_allows = barter
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_good_value
						}
					}
					treasury = {
						if = {
							limit = {
								OR = {
									NAND = {
										house ?= { has_house_power_parameter = feasts_costs_treasury }
										has_treasury = yes
									}
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_good_value
						}
					}
					piety = {
						if = {
							limit = {
								OR = {
									NOT = { government_has_flag = government_is_mandala }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_good_value
						}
					}

					barter_goods = {
						if = {
							limit = {
								OR = {
									NOT = { government_allows = barter }
									AND = {
										is_ai = yes
										has_character_flag = feast_ai_override
									}
								}
							}
							value = 0
						}
						else = {
							value = feast_courses_good_value
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
					# Quantity preference.
					add = activity_option_prefers_large_volume_value
				}
			}
		}

		# Estate Unlock - Wine Selection, how much do you spend on wine and other exotic drinks?
		feast_option_wine = {
			feast_wine_none = {
				is_shown = {
					has_dlc_feature = advanced_activities
					domicile ?= {
						OR = {
							has_domicile_parameter = estate_unlock_feast_influence_option_1
							has_domicile_parameter = estate_unlock_feast_influence_option_2
							has_domicile_parameter = estate_unlock_feast_influence_option_3
						}
					}
				}

				default = yes

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_cheap_expense_value
					# Quantity preference.
					add = activity_option_food_prefers_small_volume_value
				}
			}
			feast_wine_limited = {
				is_shown = {
					has_dlc_feature = advanced_activities
					domicile ?= {
						OR = {
							has_domicile_parameter = estate_unlock_feast_influence_option_1
							has_domicile_parameter = estate_unlock_feast_influence_option_2
							has_domicile_parameter = estate_unlock_feast_influence_option_3
						}
					}
				}

				cost = {
					gold = {
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							value = 0
						}
						else = {
							add = {
								desc = feast_wine_limited
								add = {
									value = 10
									desc = feast_wine_limited
								}
								add = {
									value = 10
									multiply = activity_cost_scale_by_tier
									subtract = 10
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 10
									multiply = activity_cost_scale_by_era
									subtract = 10
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 10
										add = {
											value = 10
											multiply = activity_cost_scale_by_tier
											subtract = 10
										}
										add = {
											value = 10
											multiply = activity_cost_scale_by_era
											subtract = 10
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							add = {
								desc = feast_wine_limited
								add = {
									value = 10
									desc = feast_wine_limited
								}
								add = {
									value = 10
									multiply = activity_cost_scale_by_tier
									subtract = 10
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 10
									multiply = activity_cost_scale_by_era
									subtract = 10
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 10
										add = {
											value = 10
											multiply = activity_cost_scale_by_tier
											subtract = 10
										}
										add = {
											value = 10
											multiply = activity_cost_scale_by_era
											subtract = 10
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						else = {
							value = 0
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
					# Quantity preference.
					## We just use slightly reduced quantity prefs here.
					add = {
						value = activity_option_prefers_large_volume_value
						multiply = 0.3
					}
				}
			}
			feast_wine_normal = {
				is_shown = {
					has_dlc_feature = advanced_activities
					domicile ?= {
						OR = {
							has_domicile_parameter = estate_unlock_feast_influence_option_2
							has_domicile_parameter = estate_unlock_feast_influence_option_3
						}
					}
				}

				cost = {
					gold = {
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							value = 0
						}
						else = {
							add = {
								desc = feast_wine_normal
								add = {
									value = 35
									desc = feast_wine_normal
								}
								add = {
									value = 35
									multiply = activity_cost_scale_by_tier
									subtract = 35
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 35
									multiply = activity_cost_scale_by_era
									subtract = 35
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 35
										add = {
											value = 35
											multiply = activity_cost_scale_by_tier
											subtract = 35
										}
										add = {
											value = 35
											multiply = activity_cost_scale_by_era
											subtract = 35
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							add = {
								desc = feast_wine_normal
								add = {
									value = 35
									desc = feast_wine_normal
								}
								add = {
									value = 35
									multiply = activity_cost_scale_by_tier
									subtract = 35
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 35
									multiply = activity_cost_scale_by_era
									subtract = 35
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 35
										add = {
											value = 35
											multiply = activity_cost_scale_by_tier
											subtract = 35
										}
										add = {
											value = 35
											multiply = activity_cost_scale_by_era
											subtract = 35
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						else = {
							value = 0
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_middling_expense_value
					# Quantity preference.
					## We just use slightly reduced quantity prefs here.
					add = {
						value = activity_option_prefers_large_volume_value
						multiply = 0.6
					}
				}
			}
			feast_wine_extensive = {
				is_shown = {
					has_dlc_feature = advanced_activities
					domicile ?= { has_domicile_parameter = estate_unlock_feast_influence_option_3 }
				}

				cost = {
					gold = {
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							value = 0
						}
						else = {
							add = {
								desc = feast_wine_extensive
								add = {
									value = 90
									desc = feast_wine_extensive
								}
								add = {
									value = 90
									multiply = activity_cost_scale_by_tier
									subtract = 90
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 90
									multiply = activity_cost_scale_by_era
									subtract = 90
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 90
										add = {
											value = 90
											multiply = activity_cost_scale_by_tier
											subtract = 90
										}
										add = {
											value = 90
											multiply = activity_cost_scale_by_era
											subtract = 90
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
					treasury = { # Make sure this matches the gold cost above
						if = {
							limit = {
								house ?= { has_house_power_parameter = feasts_costs_treasury }
								has_treasury = yes
							}
							add = {
								desc = feast_wine_extensive
								add = {
									value = 90
									desc = feast_wine_extensive
								}
								add = {
									value = 90
									multiply = activity_cost_scale_by_tier
									subtract = 90
									desc = activity_cost_scale_by_tier_desc
								}
								add = {
									value = 90
									multiply = activity_cost_scale_by_era
									subtract = 90
									desc = activity_cost_scale_by_era_desc
								}
								if = {
									limit = {
										dynasty ?= {
											has_dynasty_perk = law_legacy_1
										}
									}
									subtract = {
										value = 90
										add = {
											value = 90
											multiply = activity_cost_scale_by_tier
											subtract = 90
										}
										add = {
											value = 90
											multiply = activity_cost_scale_by_era
											subtract = 90
										}
										multiply = law_legacy_cost_reduction_mult
										desc = law_legacy_1_name
									}
								}
								min = 0
							}
						}
						else = {
							value = 0
						}
						if = {
							limit = {
								is_ai = yes
								has_character_flag = feast_ai_override
							}
							multiply = 0
						}
					}
				}

				ai_will_do = {
					value = 0
					# Financial preference.
					add = activity_option_likes_heavy_expense_value
					# Quantity preference.
					add = activity_option_prefers_large_volume_value
				}
			}
		}
	}

	special_option_category = special_type

	###################
	# PHASES
	###################

	max_guest_arrival_delay_time = { months = 8 }

	phases = {
		# Meal.
		feast_phase_meal = {
			order = 1
			is_predefined = yes

			is_shown = { always = yes }
			is_valid = {
				trigger_if = {
					limit = {
						scope:activity = {
							has_activity_option = {
								category = special_type
								option = feast_type_murder
							}
						}
					}
					scope:activity.special_guest:honorary_guest = {
						OR = {
							AND = { #is alive and attending/invited
								is_alive = yes
								OR = {
									is_participant_in_activity = scope:activity
									scope:activity = {
										any_invited_character = { this = scope:activity.special_guest:honorary_guest }
									}
								}
							}
							AND = { #is dead but you killed them
								is_alive = no
								scope:host = { has_variable = murder_feast_killed_var }
							}
						}
					}
				}
			}

			on_phase_active = {
				# Sort some stuff on the host.
				if = {
					limit = { this = scope:host }

					scope:activity = { progress_activity_phase_after = { months = 1 } }

					# Misc. old content variable.
					## Reduce alcohol stores if appropriate.
					if = {
						limit = { exists = var:protected_alcohol_stores }
						set_variable = {
							name = protected_alcohol_stores
							value = 0
						}
					}
					## Look for a target you're trying to befriend
					if = {
						limit = {
							any_scheme = {
								type = befriend
								scheme_target_character = {
									involved_activity ?= scope:activity
								}
							}
						}
						random_scheme = {
							type = befriend
							limit = {
								scheme_target_character = {
									involved_activity ?= scope:activity
								}
							}
							scheme_target_character = {
								save_scope_as = potential_friend
								scope:activity = {
									set_variable = {
										name = potential_friend
										value = scope:potential_friend
									}
								}
							}
							scheme_freeze = {
								reason = "BEFRIENDING_AT_FEAST"
								days = 10
							}
						}
					}
					# And now, the main event!
					## Check that there are guests apart from the feast host.
					if = {
						limit = {
							scope:activity = {
								any_attending_character = {
									count = 0
									this != scope:host
								}
							}
						}
						# If there are no other guests, throw this event.
						## [sad period-appropriate trombone noises]
						trigger_event = feast.2003
					}
					## Otherwise, there are guests present.
					### The key event is chosen for the host, and fires other events from there to every participant.
					else = {
						trigger_event = feast.2001
						# Struggle Catalysts
						## We trigger this here to make sure that someone else actually turned up to the party before having it affect regional relations.
						if = {
							limit = {
								# At least one participant is involved and  of a different faith or culture
								scope:activity = {
									any_attending_character = {
										any_character_struggle = {
											involvement = involved
											phase_has_catalyst = catalyst_invite_diff_faith_culture_to_feast
										}
										is_diff_faith_or_culture_trigger = {
											CHAR = scope:host
											STATUS = involved
										}
									}
								}
							}
							every_character_struggle = {
								involvement = involved
								activate_struggle_catalyst = {
									catalyst = catalyst_invite_diff_faith_culture_to_feast
									character = scope:activity.activity_host
								}
							}
						}
					}
					# Accolade stuff
					if = {
						limit = {
							any_active_accolade = {
								accolade_parameter = accolade_party_fertility
							}
						}
						add_character_modifier = {
							modifier = accolade_charmer_party_modifier
						}
					}
					if = {
						limit = {
							any_active_accolade = {
								accolade_parameter = accolade_party_fertility_high
							}
						}
						add_character_modifier = {
							modifier = accolade_charmer_party_high_modifier
						}
					}
					if = {
						limit = { is_tsagaan_sar = yes }
						set_variable = {
							name = recent_tsagaan_sar_feast_var
							years = 5
						}
						trigger_event = feast_tsagaan_sar_events.0001 # Determine who should give gifts, and who will
					}
				}
				# And for everyone else.
				else = {
					# You're busy at another party! (invites were sent the same day, but you agreed to another party after this one )
					if = {
						limit = {
							exists = var:booked_for_a_party
							var:booked_for_a_party = {
								this != scope:activity.activity_host
							}
						}
						trigger_event = feast.0010
					}
					else = {
						random_list = {
							0 = { #they don't join
								modifier = {
									add = 100
									scope:host = { has_variable = murder_feast_perpetrator_var } #if you have hosted a murder feast
								}
							}
							100 = {
								trigger_event = feast.7051
							}
						}
						# Take care of reveller stuff for everyone else.
						if = {
							limit = {
								NOT = { has_trait = temperate }
							}
							# Reveler lifestyle tracking:
							reveler_points_gain_effect = {
								CHANGE = 1
								RANDOM_CHANGE = 1
							}
							# Remove blocker for invitations to feasts (the feast is now active and will work as a blocker)
							remove_variable = booked_for_a_party
						}
					}
				}
			}

			on_weekly_pulse = {
				if = { #host
					limit = {
						this = scope:host
					}
					trigger_event = { on_action = feast_new_event_selection_tombola }
				}
				else_if = { #guest
					limit = {
						this != scope:host
					}
					trigger_event = { on_action = feast_default_event_selection }
				}
			}
		}

		# Toast.
		feast_phase_toast = {
			order = 2
			is_predefined = yes

			on_enter_phase = {
				if = {
					limit = { this = scope:host }

					# No passive state for the toast, just jump right into it
					scope:activity = { progress_activity_phase_after = { days = 1 } }
				}
			}

			on_phase_active = {
				if = {
					limit = { this = scope:host }

					if = { # Regular feast
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = feast_type_generic
								}
							}
						}

						# Save the GoH for the sake of my sanity.
						scope:activity.special_guest:honorary_guest_regular ?= { save_scope_as = goh }

						# EP3 Dynasty Legacy Domicile Building Buff
						ep3_dynasty_legacy_add_legitimacy_effect = yes

						# Trigger summary event, also handles guest events
						trigger_event = feast.7201
					}
					else_if = { # Legendary feast
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = feast_type_legendary
								}
							}
						}
						# Trigger summary event, also handles guest events
						trigger_event = feast.7204
					}
					else_if = { # Murder feast
						limit = {
							scope:activity = {
								has_activity_option = {
									category = special_type
									option = feast_type_murder
								}
							}
							scope:host = { NOT = { has_variable = murder_feast_murder_back_down } }
						}

						trigger_event = { on_action = feast_murder_feast_event_selection } #KILL event, also handles the guest events
					}

					scope:activity = { progress_activity_phase_after = { weeks = 1 } }
				}

				if = { # Tsagaan Sar
					limit = {
						scope:activity = {
							has_activity_option = {
								category = special_type
								option = feast_type_tsagaan_sar
							}
						}
					}

					trigger_event = { id = feast_tsagaan_sar_events.0290 }

					if = {
						limit = { this = scope:host }

						trigger_event = {
							id = feast_tsagaan_sar_events.0010
							days = 2
						}
					}
				}
			}

			on_end = {
				# Adjust everyone's waistlines.
				target_weight_modifier_effect = {
					VALUE = feast_weight_modifier_value
				}
			}
		}
	}

	ai_check_interval_by_tier = {
		barony = 0
		county = 60
		duchy = 60
		kingdom = 60
		empire = 60
		hegemony = 60
	}

	ai_will_select_province = {
		# Base
		value = 1
		# Buildings
		## Tribal
		### Gathering Halls
		if = {
			limit = { has_building_or_higher = longhouses_01 }
			add = {
				value = @weight_up_ai_select_province_small
				desc = activity_feast_province_desc_longhouses
			}
		}
		## Terrain
		### Manor Houses
		if = {
			limit = { has_building_or_higher = farm_estates_01 }
			add = {
				value = @weight_up_ai_select_province_medium
				desc = activity_feast_province_desc_farm_estates
			}
		}
		### Paddy Fields
		if = {
			limit = { has_building_or_higher = paddy_fields_01 }
			add = {
				value = @weight_up_ai_select_province_medium
				desc = activity_feast_province_desc_paddy_fields
			}
		}
		### Orchards
		if = {
			limit = { has_building_or_higher = orchards_01 }
			add = {
				value = @weight_up_ai_select_province_small
				desc = activity_feast_province_desc_orchards
			}
		}
		### Farms & Fields
		if = {
			limit = { has_building_or_higher = cereal_fields_01 }
			add = {
				value = @weight_up_ai_select_province_small
				desc = activity_feast_province_desc_cereal_fields
			}
		}
		### Hill Farms
		if = {
			limit = { has_building_or_higher = hill_farms_01 }
			add = {
				value = @weight_up_ai_select_province_small
				desc = debug_gui.location_weight.building.hill_farms
			}
		}
		### Desert Agriculture
		if = {
			limit = { has_building_or_higher = plantations_01 }
			add = {
				value = @weight_up_ai_select_province_small
				desc = activity_feast_province_desc_plantations
			}
		}
		## Duchy
		### Leisure Palaces
		if = {
			limit = { has_building_or_higher = leisure_palace_01 }
			add = {
				value = @weight_up_ai_select_province_large
				desc = activity_feast_province_desc_leisure_palace
			}
		}
		## Special
		### Doge's Palace
		if = {
			limit = { has_building_or_higher = doges_palace_01 }
			add = {
				value = @weight_up_ai_select_province_massive
				desc = activity_feast_province_desc_doges_palace
			}
		}
		### Ghana Palace
		if = {
			limit = { has_building_or_higher = ghana_palace_01 }
			add = {
				value = @weight_up_ai_select_province_massive
				desc = activity_feast_province_desc_ghana_palace_01
			}
		}
		### Palace of Aachen
		if = {
			limit = { has_building_or_higher = palace_of_aachen_01 }
			add = {
				value = @weight_up_ai_select_province_large
				desc = activity_feast_province_desc_palace_of_aachen
			}
		}
		### Royal Palace of Alhambra
		if = {
			limit = { has_building_or_higher = alhambra_01 }
			add = {
				value = @weight_up_ai_select_province_massive
				desc = activity_feast_province_desc_alhambra
			}
		}
		### Citadel of Aleppo
		if = {
			limit = { has_building_or_higher = citadel_of_aleppo_01 }
			add = {
				value = @weight_up_ai_select_province_massive
				desc = activity_feast_province_desc_citadel_of_aleppo
			}
		}
		### Theodosian Walls
		#### Standing in for "Constantinople's guts" because otherwise we'd use the Hagia Sophia, and that would be weird.
		if = {
			limit = { has_building_or_higher = theodosian_walls_01 }
			add = {
				value = @weight_up_ai_select_province_massive
				desc = activity_feast_province_desc_theodosian_walls
			}
		}
		### Hall of Heroes
		if = {
			limit = { has_building_or_higher = hall_of_heroes_01 }
			add = {
				value = @weight_up_ai_select_province_medium
				desc = activity_feast_province_desc_hall_of_heroes
			}
		}
	}

	###################
	# ACTIVITY-SPECIFIC PULSES
	###################

	pulse_actions = {
		entries = {
			spouse_skill_diplomacy_improves spouse_gives_host_prestige spouse_manages_feast_splendidly spouse_impresses_clergy spouse_gives_hook
			relation_gains_friend children_bonding hook_trusting_guest guest_tells_fantastic_joke
			excellent_food lauded_food guest_impressed_by_court_artifact friend_lauds_efforts courtly_vassals_appeased impressed_courtly_vassal
			impressed_guest_honor guest_of_honor_impressed guest_of_honor_praised
			guest_chokes_on_bone guest_brawl spouse_insults_host ridiculed_food
			host_gains_diplo_xp host_gains_steward_xp host_gains_intrigue_xp
			leftover_food_giveaway virtuous_feast noble_privileges good_kitty good_puppy antiquarian_admires_artifact jester_entertained_guests apa_executioner
		}
		chance_of_no_event = 5
	}

	on_start = {
		#if = {
		#	limit = {
		#		NOT = {
		#			exists = global_var:feasts_worldwide
		#		}
		#	}
		#	set_global_variable = {
		#		name = feasts_worldwide
		#		value = 1
		#	}
		#}
		#else = {
		#	change_global_variable = {
		#		name = feasts_worldwide
		#		add = 1
		#	}
		#}
		scope:host = {
			if = {
				limit = {
					has_character_flag = feast_ai_override
				}
				remove_character_flag = feast_ai_override
			}
			if = {
				limit = {
					has_character_modifier = mpo_nerge_feast_discount
				}
				remove_character_modifier = mpo_nerge_feast_discount
			}
			if = {
				limit = { has_variable = mpo_nerge_1060_free_feast }
				remove_variable = mpo_nerge_1060_free_feast
			}
			#Mandala Serenity tracker
			if = {
				limit = { 
					government_has_flag = government_is_mandala
					scope:activity = {
						has_activity_option = {
							category = feast_option_food
							option = feast_food_good
						}
						has_activity_option = {
							category = feast_option_courses
							option = feast_courses_good
						}
					}
				}
				increment_variable_effect = {
					VAR = num_exorbitant_feasts_hosted
					VAL = 1
				}
			}
		}
		set_variable = {
			name = host_var
			value = scope:host
		}
		add_activity_log_entry = {
			key = feast_start_log
			character = scope:host
			score = 10
		}
		if = {
			limit = { is_murder_feast = yes }
			scope:host = {
				set_variable = {
					name = recent_murder_feast_var
					years = 15
				}
			}
			scope:activity = {
				set_variable = {
					name = murder_guest_var
					value = scope:activity.special_guest:honorary_guest
				}
			}
			scope:host = { #doing this to get the loc for invalidation cases
				set_variable = {
					name = murder_guest_host_var
					value = scope:activity.special_guest:honorary_guest
				}
			}
			if = {
				limit = {
					scope:activity.special_guest:honorary_guest = scope:host.liege
				}
				scope:host = { set_variable = murder_feast_liege_var }
			}
			if = {
				limit = {
					scope:activity.special_guest:honorary_guest = scope:host.faith.religious_head
				}
				scope:host = { set_variable = murder_feast_head_of_faith_var }
			}
		}
		scope:host = {
			if = {
				limit = {
					ai_sociability > 0
					is_ai = yes
				}
				random = {
					chance = {
						value = 0.5 # One in 200 feasts
						if = {
							limit = {
								has_trait = gluttonous
							}
							add = 0.5
						}
						if = {
							limit = {
								has_trait = comfort_eater
							}
							add = 0.5
						}
						if = {
							limit = {
								ai_rationality <= -25
								has_personality_extroverted_trigger = yes
							}
							add = 0.5
						}
					}
					add_character_flag = feasts_a_lot
				}
			}
		}
		#fires hostage reunion event, if hostage giver is also present
		every_attending_character = {
			limit = {
				is_hostage_warden = yes
				has_bp2_dlc_trigger = yes
				this != scope:host
			}
			trigger_event = {
				id = bp2_yearly.6120
				days = 2
			}
		}
	}

	on_enter_passive_state = {
		trigger_event = feast.7002
	}

	on_enter_active_state = {
		surveyor_no_stone_unturned_perk_effect = yes
	}

	# Effects run when the activity completes after its last phase
	# root = character in this phase
	# scope:activity = the activity
	# scope:host = host of the activity
	on_complete = {
		# Run conclusion stuff here
		if = {
			limit = { this = scope:host }
			location = { save_scope_as = activity_location }
			if = {
				limit = {
					is_murder_feast = yes
					scope:host = { NOT = { has_variable = murder_feast_murder_back_down } }
				}
				scope:activity.var:murder_guest_var = { save_scope_as = murder_guest }
				scope:host = {
					save_scope_as = root_scope
					trigger_event = feast.7110
					disburse_murder_feast_activity_rewards = yes
				}
			}
			else_if = {
				limit = { this = scope:host }
				scope:host = {
					save_scope_as = root_scope
					trigger_event = feast.7101
					disburse_feast_activity_rewards = yes
				}
			}
			# Various post-feast effects.
			if = {
				limit = {
					has_character_flag = murdered_someone_during_feast
				}
				remove_character_flag = murdered_someone_during_feast
			}
			## A vassal was promised a feast (vassal.2101)
			if = {
				limit = {
					exists = var:was_promised_a_feast
					var:was_promised_a_feast = { is_alive = yes }
				}
				trigger_event = {
					id = vassal.2110
					days = { 7 14 }
				}
			}
			## Hold Court: A vassal sponsored a feast (vassal.2101)
			if = {
				limit = {
					exists = var:hold_court_sponsored_a_feast
					has_royal_court = yes
					has_dlc_feature = royal_court
				}
				trigger_event = {
					id = hold_court.3001
					days = { 15 20 }
				}
			}
			## Remove strife variable.
			if = {
				limit = { has_variable = strife_loss_total }
				remove_variable = strife_loss_total
			}
			# Accolade stuff
			if = {
				limit = {
					has_character_modifier = accolade_charmer_party_modifier
				}
				remove_character_modifier = accolade_charmer_party_modifier
			}
			if = {
				limit = {
					has_character_modifier = accolade_charmer_party_high_modifier
				}
				remove_character_modifier = accolade_charmer_party_high_modifier
			}
			## mpo_contract_events.0055 feast modifier
			if = {
				limit = { has_character_modifier = mpo_si_slaughtered_animals }
				remove_character_modifier = mpo_si_slaughtered_animals
			}
		}
		# Conclusion event for guests
		else = {
			if = {
				limit = {
					is_alive = yes
					this != scope:host
					is_imprisoned = no
				}
				if = {
					limit = {
						is_murder_feast = yes
						scope:host = { NOT = { has_variable = murder_feast_murder_back_down } }
					}
					scope:activity.var:murder_guest_var = { save_scope_as = murder_guest }
					trigger_event = feast_default.8061
				}
				else = {
					disburse_feast_reveler_rewards = yes
					trigger_event = feast.7151
				}
			}
		}
		# Achievements.
		scope:host = {
			if = {
				limit = {
					exists = global_var:started_black_dinner_achievement
					is_ai = no
					scope:activity = {
						has_activity_option = {
							category = special_type
							option = feast_type_murder
						}
					}
					NOR = {
						has_variable = murder_feast_murder_failure_var
						has_variable = murder_feast_murder_back_down
					}
				}
				set_global_variable = {
					name = finished_black_dinner_achievement
					value = yes
				}
			}
			if = {
				limit = {
					var:tgp_ceremonial_liege_events_0020_discount ?= flag:feast
				}
				remove_variable = tgp_ceremonial_liege_events_0020_discount
			}
		}

		# Struggle Catalysts
		fp3_struggle_catalysts_for_activities_effect = yes
	}
}
