﻿activity_regula_orgy = {
	is_shown = {
		highest_held_title_tier > tier_barony
		is_landed = yes
		has_trait = magister_trait_group
	}

	can_start_showing_failures_only = {
		is_available_adult = yes
	}

	is_valid = {
		scope:host = {
			is_alive = yes
			is_capable_adult = yes
			is_imprisoned = no
			is_landed = yes
			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 = regula_orgy.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 = regula_orgy.0800
					days = 1
				}
			}
		}
	}

	on_invalidated = {
		if = {
			limit = {
				scope:host = { is_imprisoned = yes }
			}
			#Host has been imprisoned
			scope:host = { trigger_event = regula_orgy.5004 }
		}
		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 = { NOT = { 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 = regula_orgy.2003 }
		}
		# Host becomes unlanded
		if = {
			limit = {
				scope:host = { is_landed = 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 = domain
	ai_province_filter = capital

	max_route_deviation_mult = 2.0

	is_location_valid = {
		has_holding = yes
	}

	province_description = {
		desc = activity_orgy_province_desc
		# +++ / triple plus good
		triggered_desc = {
			trigger = { has_building_or_higher = palace_01 }
			desc = activity_orgy_province_desc_palace
		}
	}

	max_province_icons = 5

	province_score = {
		value = 0
		if = {
			limit = { has_building_or_higher = palace_01 }
			add = 100
		}
	}

	cooldown = { years = standard_orgy_cooldown_time }

	ai_will_do = 0

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

	max_guests = 30

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

			# Family.
			3 = activity_invite_rule_extended_family

			# Nearby Rulers
			4 = activity_invite_neighbouring_rulers
			4 = activity_invite_neighbouring_rulers_wives
			4 = activity_invite_neighbouring_rulers_sisters
			4 = activity_invite_neighbouring_rulers_daughters

			# Misc landless.
			5 = activity_invite_rule_knights
		}
		defaults = {
			1 = activity_invite_rule_harem
			1 = activity_invite_rule_close_family
			1 = activity_invite_rule_liege
			1 = activity_invite_rule_vassals
			2 = activity_invite_rule_fellow_vassals
			3 = activity_invite_rule_court_positions
			3 = activity_invite_rule_courtiers
			4 = activity_invite_rule_guests
		}
	}

	can_be_activity_guest = {
		is_adult = yes
		is_female = yes
		is_healthy = yes
		in_diplomatic_range = scope:host
		NOT = { has_character_modifier = rejected_from_marriage_bed_modifier }

		# They must either be fertile or a leader devoted trait
		# This way we ensure that important members of the Harem are always available (even if they are to old for more kids!)
		OR = {
			is_visibly_fertile = yes
			is_regula_leader_devoted_trigger = yes
		}

		# Check consanguinity doctrine
		NOT = {
			relation_with_character_is_incestuous_in_faith_trigger = {
				FAITH = scope:host.faith
				CHARACTER = scope:host
			}
		}

		trigger_if = {
			limit = {
				scope:special_option = flag:orgy_type_private
			}
			# Only faithful or charmed (who may be practicing in secret) allowed, or known secret practitioners
			OR = {
				is_regula_devoted_trigger = yes
				faith = scope:host.faith
				AND = {
					secret_faith ?= scope:host.faith
					any_secret = {
						OR = {
							secret_type = secret_crypto_religionist
							secret_type = regula_crypto_religionist_secret
						}
						is_known_by = scope:host
					}
				}
			}
		}

	}

	# We always assume the player is Host and is the Magister
	host_intents = {
		intents = { reduce_stress_intent regula_heal_intent regula_charm_attendee_intent regula_impregnate_attendee_intent regula_beguile_attendee_intent regula_recruit_intent }
		# WIP regula_ritual_intent
		default = reduce_stress_intent
	}

	# Assume that these are adult AI female guests
	guest_intents = {
		intents = { reduce_stress_intent }
		default = reduce_stress_intent
	}

	guest_join_chance = {
		base = 10
		base_activity_modifier = yes

		# Scripted Modifiers
		activity_guest_shared_ai_accept_modifier = yes

		# Dynasty perk bonus - Compedita Chains
		modifier = {
			scope:host.dynasty = {
				has_dynasty_perk = regula_legacy_2
			}
			desc = ACTIVITY_GUEST_WILLING_FAMULI_REASON
			add = 25
		}

		modifier = {
			is_regula_leader_devoted_trigger = yes
			desc = ACTIVITY_GUEST_DEVOTED_REASON
			add = 1000
		}

		modifier = {
			has_trait = tropaeum
			desc = ACTIVITY_GUEST_CHARMED_REASON
			add = 200
		}

		modifier = {
			has_trait = mulsa
			desc = ACTIVITY_GUEST_CHARMED_REASON
			add = 50
		}

		modifier = {
			OR = {
				faith = scope:host.faith
				secret_faith ?= scope:host.faith
			}
			desc = ACTIVITY_GUEST_FOLLOWER_REASON
			add = 25
		}

		modifier = {
			NOR = {
				has_trait = devoted_trait_group
				faith = scope:host.faith
				secret_faith ?= scope:host.faith
			}
			scope:orgy_option_invite_appeal = flag:orgy_appeal_normal
			desc = ACTIVITY_GUEST_CONVINCED_REASON
			add = 25
		}

		modifier = {
			NOR = {
				has_trait = devoted_trait_group
				faith = scope:host.faith
				secret_faith ?= scope:host.faith
			}
			scope:orgy_option_invite_appeal = flag:orgy_appeal_high
			desc = ACTIVITY_GUEST_CONVINCED_REASON
			add = 50
		}
	}

	# Removed as currently doesn't do anything
	# special_guests = {
	# 	honorary_guest_regula_wife = {
	# 		is_required = no

	# 		is_shown = {
	# 			always = yes
	# 		}

	# 		can_pick = {
	# 			is_healthy = yes
	# 			is_adult = yes
	# 			is_spouse_of = scope:host
	# 			is_regula_leader_devoted_trigger = yes
	# 		}

	# 		ai_will_do = 0
	# 	}
	# }

	travel_entourage_selection = {
		weight = {
			value = standard_travel_entourage_additions
			if = {
				limit = {
					OR = {
						has_trait = gregarious
						has_trait = lustful
						has_trait = rakish
					}
				}
				add = 10
			}
		}
		max = 10
		invite_rule_order = 3
	}

	cost = {
		gold = {
			add = {
				add = {
					value = orgy_activity_cost
					desc = orgy_activity_cost_desc
				}
				add = {
					value = orgy_activity_cost
					multiply = activity_cost_scale_by_era
					subtract = orgy_activity_cost
					desc = activity_cost_scale_by_era_desc
				}
				if = {
					limit = {
						scope:province ?= {	has_building_or_higher = palace_01 }
					}
					add = {
						value = 0
						add = {
							value = orgy_activity_cost
							add = {
								value = orgy_activity_cost
								multiply = activity_cost_scale_by_era
								subtract = orgy_activity_cost
							}
						}
						multiply = orgy_activity_cost_discount_max_value
						desc = orgy_cost_discount_palace
					}
				}
				min = 0
			}
		}
	}

	ui_predicted_cost = {
		# All costs are balanced on County/Early Era starting point
		gold = {
			add = { # Base Cost, scaled by era
				value = orgy_activity_cost
				multiply = activity_cost_scale_by_era
			}

			# Options
			add = { # Servants
				value = 0 # Bad Option Cost
				add = 10 # Normal Option Cost
				add = 35 # Good Option Cost
				# Scale the sum of the options by era and tier
				add = {
					value = 45
					multiply = activity_cost_scale_by_tier
				}
				add = {
					value = 45
					multiply = activity_cost_scale_by_era
				}
				# Divide by 3 (num of levels for this option) so we get the average option cost
				divide = 3
			}

			# Make it a multiple of 5 (rounded up)
			divide = 5
			ceiling = yes
			multiply = 5
		}
	}

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

	map_entity = {
		trigger = {
			activity_location.culture = {
				OR = {
					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 = {
				NOT = {
					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 = { # Farmland, settled
		trigger = {
			OR = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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 = {
				NOT = {
					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
	# At Orgy Event
	background = {
		texture = "gfx/interface/illustrations/event_scenes/regula_orgy.dds"
		environment = "environment_event_temple"
		ambience = "event:/SFX/Events/Backgrounds/temple_generic"
	}

	window_characters = {

		# We can have upto 5 characters (I think)
		# 1. Magister
		magister = {
			camera = camera_body

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

			scripted_animation = {
				triggered_animation = {
					trigger = {
						exists = scope:host.intent_target
						scope:host.intent_target.location = scope:activity.activity_location
					}
					animation = flirtation
				}
				animation = thinking
			}
		}

		# 1. Magister (Travelling)
		travel_magister = {
			camera = camera_body

			effect = {
				if = {
					limit = {
						NOT = {
							scope:host.location = scope:activity.activity_location
						}
					}
					scope:host = {
						add_to_list = characters
					}
				}
			}

			scripted_animation = {
				triggered_animation = {
					trigger = {
						scope:character.location = { is_sea_province = yes }
					}
					animation = { idle }
				}
				triggered_animation = {
					trigger = { scope:character = { has_trait = impatient } }
					animation = { jockey_gallop }
				}
				animation = jockey_walk
			}
		}

		# guest = {
		# 	camera = camera_body_right

		# 	effect = {
		# 		if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				exists = scope:player
		# 				scope:player = {
		# 					location = scope:activity.activity_location
		# 				}
		# 			}
		# 			scope:player ?= { add_to_list = characters }
		# 		}
		# 		if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				exists = scope:host.intent_target
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					this = scope:host.intent_target
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					this = scope:host.intent_target
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 		else_if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					OR = {
		# 						has_relation_lover = scope:host
		# 						has_relation_friend = scope:host
		# 					}
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					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
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					is_consort_of = scope:host
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					is_consort_of = scope:host
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 		else_if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					is_councillor_of = scope:host
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					is_councillor_of = scope:host
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 		else_if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					highest_held_title_tier >= tier_duchy
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					highest_held_title_tier >= tier_duchy
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 		else_if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					highest_held_title_tier >= tier_county
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					highest_held_title_tier >= tier_county
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 		else_if = {
		# 			limit = {
		# 				scope:host.location = scope:activity.activity_location
		# 				any_attending_character = {
		# 					location = scope:activity.activity_location
		# 					OR = {
		# 						is_parent_of = scope:host
		# 						is_close_or_extended_family_of = scope:host
		# 					}
		# 				}
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 					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
		# 			}
		# 			every_attending_character = {
		# 				limit = {
		# 					location = scope:activity.activity_location
		# 				}
		# 				add_to_list = characters
		# 			}
		# 		}
		# 	}

		# 	scripted_animation = {
		# 		triggered_animation = {
		# 			trigger = {
		# 				exists = scope:host.intent_target
		# 				has_trait = devoted_trait_group
		# 				scope:host = {
		# 					OR = {
		# 						has_activity_intent = regula_charm_attendee_intent
		# 						has_activity_intent = regula_impregnate_attendee_intent
		# 						has_activity_intent = regula_beguile_attendee_intent
		# 					}
		# 				}
		# 				scope:character = scope:host.intent_target
		# 			}
		# 			animation = { love flirtation }
		# 		}
		# 		triggered_animation = {
		# 			trigger = {
		# 				exists = scope:host.intent_target
		# 				NOT = { has_trait = devoted_trait_group }
		# 				scope:host = {
		# 					OR = {
		# 						has_activity_intent = regula_charm_attendee_intent
		# 						has_activity_intent = regula_impregnate_attendee_intent
		# 						has_activity_intent = regula_beguile_attendee_intent
		# 					}
		# 				}
		# 				scope:character = scope:host.intent_target
		# 			}
		# 			animation = { dismissal worry paranoia }
		# 		}
		# 		triggered_animation = {
		# 			trigger = {
		# 				scope:character = { has_trait = shy }
		# 			}
		# 			animation = { sadness worry }
		# 		}
		# 		# triggered_animation = {
		# 		# 	animation = { happiness flirtation throne_room_conversation_3 throne_room_conversation_1 }
		# 		# }
		# 		#Fallback
		# 		animation = throne_room_conversation_3
		# 	}
		# }

		# honorary_guest_regular_traveling = {
		# 	camera = camera_body

		# 	effect = {
		# 		if = {
		# 			limit = {
		# 				scope:activity.special_guest:honorary_guest_regular.involved_activity ?= scope:activity
		# 				NOT = {
		# 					scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
		# 				}
		# 			}
		# 			special_guest:honorary_guest_regular ?= {
		# 				add_to_list = characters
		# 			}
		# 		}
		# 	}

		# 	scripted_animation = {
		# 		triggered_animation = {
		# 			trigger = {
		# 				scope:character.location = { is_sea_province = yes }
		# 			}
		# 			animation = { idle }
		# 		}
		# 		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
		# 				scope:activity.special_guest:honorary_guest_regular.location ?= scope:activity.activity_location
		# 			}
		# 			special_guest:honorary_guest_regular ?= {
		# 				add_to_list = characters
		# 			}
		# 		}
		# 	}

		# 	scripted_animation = {
		# 		triggered_animation = {
		# 			trigger = {
		# 				always = yes
		# 			}
		# 			animation = { ecstasy wedding_priest chaplain personality_honorable personality_bold }
		# 		}
		# 	}
		# }

		# 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 lunatic 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 = { 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
		# 			}
		# 		}
		# 	}
	}

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

	options = {
		# Orgy types
		special_type = {
			# Private Orgy
			## You only want to bring along charmed female guests for yourself as Magister
			orgy_type_private = {
				default = yes
				ai_will_do = 0
			}

			# Affair Orgy
			## You can invite non-charmed guests
			orgy_type_affair = {
				ai_will_do = 0
			}
		}

		# Spend gold to make your invite more appealing to non-devoted
		orgy_option_invite_appeal = {
			orgy_appeal_low = {
				ai_will_do = 0
				is_shown = {
					scope:special_option = flag:orgy_type_affair
				}
			}
			orgy_appeal_normal = {
				ai_will_do = 0
				is_shown = {
					scope:special_option = flag:orgy_type_affair
				}
				cost = {
					gold = {
						add = {
							add = {
								value = 10
								desc = orgy_appeal_normal
							}
							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
						}
					}
				}
			}
			orgy_appeal_high = {
				is_shown = {
					scope:special_option = flag:orgy_type_affair
				}
				ai_will_do = 0
				cost = {
					gold = {
						add = {
							add = {
								value = 20
								desc = orgy_appeal_high
							}
							add = {
								value = 20
								multiply = activity_cost_scale_by_tier
								subtract = 20
								desc = activity_cost_scale_by_tier_desc
							}
							add = {
								value = 20
								multiply = activity_cost_scale_by_era
								subtract = 20
								desc = activity_cost_scale_by_era_desc
							}
							if = {
								limit = {
									dynasty ?= {
										has_dynasty_perk = law_legacy_1
									}
								}
								subtract = {
									value = 20
									add = {
										value = 20
										multiply = activity_cost_scale_by_tier
										subtract = 20
									}
									add = {
										value = 20
										multiply = activity_cost_scale_by_era
										subtract = 20
									}
									multiply = law_legacy_cost_reduction_mult
									desc = law_legacy_1_name
								}
							}
							min = 0
						}
					}
				}
			}
		}

		# Servants
		## Increases rewards on completion
		orgy_option_servant = {
			orgy_servants_few = {
				ai_will_do = 0
			}
			orgy_servants_normal = {
				default = {
					character_has_regula_holy_effect_female_offspring = no
				}
				cost = {
					gold = {
						add = {
							add = {
								value = 10
								desc = orgy_servants_normal
							}
							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
						}
					}
				}

				ai_will_do = 0
			}
			orgy_servants_many = {

				cost = {
					gold = {
						add = {
							add = {
								value = 35
								desc = orgy_servants_many
							}
							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
						}
					}
				}

				ai_will_do = 0
			}
			orgy_servants_charmed = {
				default = yes
				is_shown = {
					character_has_regula_holy_effect_female_offspring = yes
				}
				cost = {
					gold = {
						add = {
							add = {
								value = 5
								desc = orgy_servants_charmed
							}
							add = {
								value = 5
								multiply = activity_cost_scale_by_tier
								subtract = 5
								desc = activity_cost_scale_by_tier_desc
							}
							add = {
								value = 5
								multiply = activity_cost_scale_by_era
								subtract = 5
								desc = activity_cost_scale_by_era_desc
							}
							if = {
								limit = {
									dynasty ?= {
										has_dynasty_perk = law_legacy_1
									}
								}
								subtract = {
									value = 5
									add = {
										value = 5
										multiply = activity_cost_scale_by_tier
										subtract = 5
									}
									add = {
										value = 5
										multiply = activity_cost_scale_by_era
										subtract = 5
									}
									multiply = law_legacy_cost_reduction_mult
									desc = law_legacy_1_name
								}
							}
							min = 0
						}
					}
				}

				ai_will_do = 0
			}
		}

		# Ritual goods WIP
		# orgy_option_ritual_setup = {
		# 	orgy_ritual_none = {
		# 		ai_will_do = 0
		# 	}
		# 	orgy_ritual_small = {
		# 		default = yes
		# 		cost = {
		# 			gold = {
		# 				add = {
		# 					add = {
		# 						value = 5
		# 						desc = feast_courses_normal
		# 					}
		# 					add = {
		# 						value = 5
		# 						multiply = activity_cost_scale_by_tier
		# 						subtract = 5
		# 						desc = activity_cost_scale_by_tier_desc
		# 					}
		# 					add = {
		# 						value = 5
		# 						multiply = activity_cost_scale_by_era
		# 						subtract = 5
		# 						desc = activity_cost_scale_by_era_desc
		# 					}
		# 					if = {
		# 						limit = {
		# 							dynasty ?= {
		# 								has_dynasty_perk = law_legacy_1
		# 							}
		# 						}
		# 						subtract = {
		# 							value = 5
		# 							add = {
		# 								value = 5
		# 								multiply = activity_cost_scale_by_tier
		# 								subtract = 5
		# 							}
		# 							add = {
		# 								value = 5
		# 								multiply = activity_cost_scale_by_era
		# 								subtract = 5
		# 							}
		# 							multiply = law_legacy_cost_reduction_mult
		# 							desc = law_legacy_1_name
		# 						}
		# 					}
		# 					min = 0
		# 				}
		# 			}
		# 		}

		# 		ai_will_do = 0
		# 	}
		# 	orgy_ritual_medium = {

		# 		cost = {
		# 			gold = {
		# 				add = {
		# 					add = {
		# 						value = 10
		# 						desc = feast_courses_good
		# 					}
		# 					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
		# 				}
		# 			}
		# 		}

		# 		ai_will_do = 0
		# 	}
		# 	orgy_ritual_large = {

		# 		cost = {
		# 			gold = {
		# 				add = {
		# 					add = {
		# 						value = 35
		# 						desc = feast_courses_good
		# 					}
		# 					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
		# 				}
		# 			}
		# 		}

		# 		ai_will_do = 0
		# 	}
		# }
	}

	special_option_category = special_type

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

	max_guest_arrival_delay_time = { months = 8 }

	phases = {

		# Sexy times
		orgy_phase_sex = {
			order = 1
			is_predefined = yes

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

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

					# And now, the main event!
					## Check that there are guests apart from the orgy host.
					if = {
						limit = {
							scope:activity = {
								any_attending_character = {
									count = 0
									NOT = {	this = scope:host }
								}
							}
						}
						# If there are no other guests, throw this event.
						## [sad period-appropriate trombone noises]
						trigger_event = regula_orgy.2003 # TODO
					}
					## 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 = regula_orgy.2001
					}
				}
			}

			on_weekly_pulse = {
				if = { #host
					limit = {
						this = scope:host
					}
					trigger_event = { on_action = orgy_event_selection_tombola }
				}
				else_if = { #guest
					limit = {
						NOT = { this = scope:host }
					}
					trigger_event = { on_action = orgy_guest_event_selection }
				}
			}
		}

		# Ritual
		orgy_phase_ritual = {
			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 }

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

					scope:activity = { progress_activity_phase_after = { days = 3 } }
				}
			}
		}
	}

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

	pulse_actions = {
		entries = {
			regula_spouse_gives_host_prestige regula_spouse_manages_orgy_splendidly regula_spouse_impresses_clergy regula_spouse_gives_hook
			regula_domina_charms_guest regula_devoted_befriends_devoted
			host_gains_diplo_xp host_gains_steward_xp host_gains_intrigue_xp regula_host_gains_martial_xp regula_host_gains_learning_xp
			regula_host_extracts_piety
			regula_ridiculed_servants regula_lauded_servants

			# TODO
			# regula_host_is_caught_by_non_regula
		}

		chance_of_no_event = 0
	}

	on_start = {
		set_variable = {
			name = host_var
			value = scope:host
		}
		add_activity_log_entry = {
			key = regula_orgy_start_log
			character = scope:host
			score = 10
		}
	}

	on_enter_passive_state = {
		trigger_event = regula_orgy.7002
	}

	# 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 }
			scope:host = {
				save_scope_as = root_scope
				trigger_event = regula_orgy.7101
				disburse_orgy_activity_rewards = yes
			}
		}
		# Conclusion event for guests
		# else = {
		# 	if = {
		# 		limit = {
		# 			is_alive = yes
		# 			NOT = { this = scope:host }
		# 			is_imprisoned = no
		# 		}
		# 		trigger_event = feast.7151
		# 	}
		# }
	}
}
