﻿# Events for handling the Hunt activity

namespace = hunt

#######################
#	Show off your falconry skills to your lover
#	by James Beaumont
#######################

hunt.8000 = {
	type = activity_event
	title = hunt.8000.t
	desc = hunt.8000.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = hunting_falcon
	}
	right_portrait = {
		character = scope:swooning_attendee
		animation = hunting_falcon
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
			any_attending_character = {
				is_attracted_to_gender_of = root
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					is_attracted_to_gender_of = root
				}
				weight = {
					base = 1
					modifier = {
						factor = 0.5
						root = {
							NOT = { is_attracted_to_gender_of = prev }
						}
					}
					modifier = {
						factor = 2
						root = {
							is_attracted_to_gender_of = prev
						}
					}
					modifier = {
						factor = 100
						root = {
							has_activity_intent = woo_attendee_intent
							intent_target = prev
						}
					}
				}
				save_scope_as = swooning_attendee
			}
		}
	}

	option = { # Fly my pretty! Fly! Fly!
		name = hunt.8000.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fish_impress_key
				score = 25
				tags = { random good social }
				character = root
				target = scope:swooning_attendee

				#Effect
				root = {
					hunter_progress_point_gain_effect = { CHANGE = 1 RANDOM_CHANGE = 1 } #Gives points towards ranking up the Hunter Lifestyle
					duel = {
						skills = { learning stewardship }
						value = decent_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8000.falcon_success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								if = {
									limit = {
										root = {
											has_activity_intent = woo_attendee_intent
											intent_target = scope:swooning_attendee
										}
									}
									progress_towards_lover_effect = {
										CHARACTER = scope:swooning_attendee
										REASON = lover_impressed_hunt
										OPINION = default_lover_opinion
									}
								}
								else = {
									reverse_add_opinion = {
										target = scope:swooning_attendee
										modifier = impressed_opinion
										opinion = 20
									}
								}
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8000.falcon_failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						lifestyle_hunter = minor_stress_impact_loss
						impatient = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	option = { # I'll grab the fish with my bare hands!
		name = hunt.8000.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fish_hands_key
				score = 25
				tags = { random good social }
				character = root
				target = scope:swooning_attendee

				#Effect
				root = {
					duel = {
						skill = prowess
						value = very_high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8000.fist_success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards ranking up the Hunter Lifestyle
								if = {
									limit = {
										root = {
											has_activity_intent = woo_attendee_intent
											intent_target = scope:swooning_attendee
										}
									}
									progress_towards_lover_effect = {
										CHARACTER = scope:swooning_attendee
										REASON = lover_impressed_hunt
										OPINION = default_lover_opinion
									}
								}
								else = {
									reverse_add_opinion = {
										target = scope:swooning_attendee
										modifier = impressed_opinion
										opinion = 20
									}
								}
								add_prestige = major_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8000.fist_failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						arrogant = minor_stress_impact_loss
						patient = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}
}

#######################
#	Show off your falconry skills generally
#	by James Beaumont
#######################

hunt.8010 = {
	type = activity_event
	title = hunt.8010.t
	desc = hunt.8010.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = hunting_falcon
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	weight_multiplier = {
		base = 1
	}

	option = { # Send the bird out to catch some small prey
		name = hunt.8010.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_small_key
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					hunter_progress_point_gain_effect = { CHANGE = 1 RANDOM_CHANGE = 1 } #Gives points towards ranking up the Hunter Lifestyle
					duel = {
						skills = { learning stewardship }
						value = decent_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8010.falcon_success
								left_icon = root
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8010.falcon_failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
							}
						}
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			lifestyle_hunter = minor_stress_impact_loss
			impatient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	option = { # Focus on the hunt
		name = hunt.8010.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_focus_key
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_medium }
				}
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_loss
			lifestyle_hunter = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.5
			}
		}
	}
}

#######################
#	Your falcon shows up with some coins!
#	by James Beaumont
#######################

hunt.8020 = {
	type = activity_event
	title = hunt.8020.t
	desc = hunt.8020.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = hunting_falcon
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait_xp = { # You're good at falcons and stuff
				trait = lifestyle_hunter
				track = falconer
				value >= 5
			}
		}
	}

	option = { # Nice, thanks bird!
		name = hunt.8020.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_take_cash_key
				score = 25
				tags = { random good }
				character = root

				#Effect
				root = {
					add_gold = 50
					stress_impact = {
						base = minor_stress_impact_loss
						greedy = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	option = { # This money belongs to God
		name = hunt.8020.b
		trigger = {
			has_trait = improvident
		}
		trait = improvident
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_gift_cash_key
				score = 25
				tags = { random good }
				character = root

				#Effect
				root = {
					add_piety = medium_piety_gain
					stress_impact = {
						base = minor_stress_impact_loss
						improvident = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 0.5
				ai_greed = -0.5
			}
		}
	}
}

#######################
#	Your falcon finds some tracking material!
#	by James Beaumont
#######################

hunt.8030 = {
	type = activity_event
	title = hunt.8030.t
	desc = hunt.8030.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = hunting_falcon
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait_xp = { # You're good at falcons and stuff
				trait = lifestyle_hunter
				track = falconer
				value >= 25
			}
		}
	}

	option = { # Follow that bird!
		name = hunt.8030.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_follow_key
				score = 25
				tags = { random good }
				character = root

				#Effect
				root = {
					hunter_progress_point_gain_effect = { CHANGE = 1 RANDOM_CHANGE = 1 } #Gives points towards ranking up the Hunter Lifestyle
					duel = {
						skills = { learning stewardship }
						value = decent_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8030.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8030.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						lazy = minor_stress_impact_gain
						impatient = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_energy = 0.5
			}
		}
	}

	option = { # You guys follow the bird! I'm gonna nap.
		name = hunt.8030.b
		trigger = {
			has_trait = lazy
		}
		trait = lazy
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_lazy_key
				score = 25
				tags = { random good }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_minor }
					stress_impact = {
						base = medium_stress_impact_loss
						impatient = minor_stress_impact_loss
						patient = minor_stress_impact_gain
						lifestyle_hunter = minor_stress_impact_gain
						ambitious = minor_stress_impact_gain
					}
					
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}
}

#######################
#	Someone is showing off their falcon glove
#	by James Beaumont
#######################

hunt.8040 = {
	type = activity_event
	title = hunt.8040.t
	desc = hunt.8040.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:glove_salesman
		animation = hunting_falcon
	}
	artifact = {
	    target = scope:newly_created_artifact
	    position = lower_right_portrait
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
			any_attending_character = {
				this != root
				has_trait = lifestyle_hunter
				is_adult = yes
				is_ai = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					this != root
					has_trait = lifestyle_hunter
					is_adult = yes
					is_ai = yes
				}
				weight = {
					base = 1
					modifier = {
						add = ai_greed
					}
					modifier = {
						add = 10
						has_trait_xp = {
							trait = lifestyle_hunter
							track = falconer
							value >= 15
						}
					}
				}
				save_scope_as = glove_salesman
				hidden_effect_new_object = {
					create_artifact = {
						name = lucky_falconry_glove
						description = lucky_falconry_glove_desc
						modifier = artifact_monthly_martial_lifestyle_xp_2_modifier
						modifier = artifact_attraction_opinion_1_modifier
						modifier = artifact_stress_gain_2_modifier
						type = miscellaneous
						visuals = falconry_glove
						save_scope_as = newly_created_artifact
					}
				}
			}
		}
	}

	option = { # You must sell it to me!
		name = hunt.8040.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_buy_glove_key
				score = 25
				tags = { random good }
				character = root
				target = scope:glove_salesman
				artifact = scope:newly_created_artifact

				#Effect
				root = {
					pay_short_term_gold = {
						target = scope:glove_salesman
						gold = minor_gold_value
					}
					scope:newly_created_artifact = {
						set_owner = root
					}
					stress_impact = {
						ambitious = minor_stress_impact_loss
						greedy = minor_stress_impact_gain
						paranoid = minor_stress_impact_gain # You're trying to trick me!
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_greed = -0.5
			}
			modifier = {
				factor = 0
				gold < minor_gold_value
			}
		}
	}

	option = { # Hard pass, *MY* glove is perfectly adequate
		name = hunt.8040.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_pass_glove_key
				score = 25
				tags = { random good }
				character = root
				target = scope:glove_salesman

				# Effect
				root = {
					stress_impact = {
						eccentric = minor_stress_impact_gain
						arrogant = minor_stress_impact_loss
						greedy = miniscule_stress_impact_loss
					}
				}
			}
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -0.5
				ai_greed = 0.5
			}
		}
	}

	option = { # You must sell it to me, at a discounted price ;)
		name = hunt.8040.c
		trigger = {
			has_trait = avaricious
		}
		trait = avaricious
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_buy_glove_key
				score = 25
				tags = { random good }
				character = root
				target = scope:glove_salesman
				artifact = scope:newly_created_artifact

				#Effect
				root = {
					pay_short_term_gold = {
						target = scope:glove_salesman
						gold = tiny_gold_value
					}
					scope:newly_created_artifact = {
						set_owner = root
					}
					stress_impact = {
						ambitious = minor_stress_impact_loss
						greedy = minor_stress_impact_loss
						paranoid = minor_stress_impact_gain # You're trying to trick me!
					}
				}
			}
		}
		ai_chance = {
			base = 1000
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_greed = 0.5
			}
			modifier = {
				factor = 0
				gold < tiny_gold_value
			}
		}
	}
}

#############################################################################
#    /)/)/) /).-')															#
#    ////((.'_.--'   .(\(\(\                   n/(/.')_         .			#
#   ((((_/ .'      .-`)))))))                  `-._ ('.'        \`(\		#
#  (_._ ` (         `.   (/ |                      \ (           `-.\		#
#      `-. \          `-.  /                        `.`.           \ \		#
#         `.`.          | /                /)         \ \           | L		#
#           `.`._.      ||_               (()          `.\          ) F		#
#   (`._      `. <    .'.-'                \`-._____    ||        .' /		#
#    `(\`._.._(\(\)_.'.'-------------.___   `-.(`._ `-./ /     _.' .'		#
#      (.-.| \_`.__.-<     `.    . .-'   `-.   _> `-._((`.__.-'_.-'			#
#          (.--'   ' |    \ \     /| \.-./ |\ `-.   _.'>.___,-'`.			#
#             (  o  <      |     |  `o   o'  |  /(`'.-'   --.    \			#
#           .'     /      .'   _ |   |   |   |  ( .'/  o .-'   \  |			#
#           (__.-.`-._  -'    '   \  \   /  /    ' /    _/      | J			#
#                 \_  `.      _.__.L |   | J      (  .'\`.    _/-./			#
#                   `-<  .-L|'`-|  ||\\V/ ||       `'   L \  /   /			#
#                      |J  ||    \ ||||  |||            |  |_|  )			#
#                      ||  ||     )||||  |||            || / ||J			#
#                      (|  (|    / |||)  (||            |||  |||			#
#                      ||  ||   / /||||  |||            |(|  |||			#
#                      ||  ||  / / ||||  |||            |||  |||			#
#_______.------.______/ |_/ |_/_|_/// |__| \\__________// |--( \\---------	#
############################## Legendary Hunt ###############################

#######################
#	You see tracks, could it be the legendary animal? :O
#	by James Beaumont
#######################

hunt.8050 = {
	type = activity_event
	title = hunt.8050.t
	desc = hunt.8050.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = personality_irrational
	}
	right_portrait = {
		character = scope:m_hunt
		animation = worry
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
	}

	immediate = {
		hunt_save_master_or_hunter_courtier_effect = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = paranoid
		}
	}

	option = { # I don't care if it leads me nowhere, I will find it!
		name = hunt.8050.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_legendary_stubborn_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:m_hunt

				#Effect
				root = {
					random_list = {
						30 = {
							modifier = {
								add = {
									value = 0
									subtract = 10
								}
								has_trait = paranoid
							}
							desc = legendary_animal_close_tt
							send_interface_toast = {
								title = legendary_animal_close_tt
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_major }
							}
						}
						70 = {
							modifier = {
								add = 10
								has_trait = paranoid
							}
							desc = legendary_animal_no_trace_tt
							send_interface_toast = {
								title = legendary_animal_no_trace_tt
								left_icon = root
								add_stress = major_stress_gain
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						eccentric = minor_stress_impact_loss
						ambitious = minor_stress_impact_loss
						paranoid = minor_stress_impact_loss
						fickle = miniscule_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}

	option = { # Fine, we'll redouble our efforts later
		name = hunt.8050.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_legendary_relent_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:m_hunt

				#Effect
				root = {
					progress_towards_friend_effect = {
						REASON = friend_listened_to_advice
						CHARACTER = scope:m_hunt
						OPINION = default_friend_opinion
					}
					stress_impact = {
						base = minor_stress_impact_loss
						ambitious = medium_stress_impact_gain
						paranoid = medium_stress_impact_gain
						stubborn = minor_stress_impact_gain
						eccentric = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

#######################
#	Beware, the beast!
#	by James Beaumont
#######################
scripted_trigger hunt_8060_is_an_eccentric = {
	OR = { # They're some kind of eccentric
		has_trait = lunatic
		has_trait = paranoid
		has_trait = lifestyle_mystic
		has_trait = eccentric
		is_witch_trigger = yes
	}
}

hunt.8060 = {
	type = activity_event
	title = hunt.8060.t
	desc = hunt.8060.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = paranoia
	}
	right_portrait = {
		character = scope:eccentric_hunter_scope
		animation = lantern
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
	}

	immediate = {
		if = {
			limit = {
				any_pool_character = {
					province = root.location
					hunt_8060_is_an_eccentric = yes
				}
			}
			random_pool_character = {
				province = root.location
				limit = {
					hunt_8060_is_an_eccentric = yes
				}
				weight = {
					base = 1
					modifier = {
						add = {
							value = 0
							subtract = ai_rationality
						}
					}
				}
				save_scope_as = eccentric_hunter_scope

			}
		}
		else = {
			create_character = {
				template = generic_peasant_character
				culture = root.location.county.culture
				faith = root.location.county.faith
				location = root.location
				trait = lifestyle_hunter
				trait = paranoid
				save_scope_as = eccentric_hunter_scope
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = paranoid
		}
	}

	option = { # Tell me everything you know!
		name = hunt.8060.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_eccentric_learn_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:eccentric_hunter_scope

				#Effect
				root = {
					duel = {
						skills = { diplomacy prowess }
						target = scope:eccentric_hunter_scope
						# Success.
						50 = {
							desc = hunt.8060.success
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8060.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_major }
							}
						}
						# Failure.
						50 = {
							desc = hunt.8060.failure
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8060.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								add_stress = medium_stress_impact_gain
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						ambitious = minor_stress_impact_loss
						paranoid = minor_stress_impact_loss
						eccentric = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_boldness = 1
				ai_energy = 0.5
			}
		}
	}

	option = { # You seem like you know these woods, become my hunt master!
		name = hunt.8060.b
		trigger = {
			OR = {
				employs_court_position = master_of_hunt_court_position
				can_employ_court_position_type = master_of_hunt_court_position
			}
			scope:activity = {
				any_attending_character = {
					count < 20 #Max is 20
				}
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_eccentric_hire_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:eccentric_hunter_scope

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_medium }
					court_position:master_of_hunt_court_position ?= {
						add_opinion = {
							target = root
							modifier = revoked_court_position_opinion
							opinion = -30
						}
					}
					scope:activity = {
						every_attending_character = {
							custom = custom.every_attending_character
							limit = {
								this != root
							}
							add_opinion = {
								target = root
								modifier = angry_opinion
								opinion = -30 
							}
						}
					}
					root.current_travel_plan = {
						add_companion = scope:eccentric_hunter_scope
					}
					scope:eccentric_hunter_scope = {
						add_to_activity_without_travel = scope:activity
					}
					court_position_grant_effect = {
						CANDIDATE = scope:eccentric_hunter_scope
						POS = master_of_hunt
						EMPLOYER = root
					}
					stress_impact = {
						base = minor_stress_impact_gain
						ambitious = medium_stress_impact_loss
						gregarious = medium_stress_impact_loss
						eccentric = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_boldness = 1
				ai_energy = 0.5
				ai_sociability = 0.5
			}
		}
	}

	option = { # I have no interest in this
		name = hunt.8060.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_eccentric_dismiss_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:eccentric_hunter_scope

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_minor }
					stress_impact = {
						ambitious = medium_stress_impact_gain
						gregarious = medium_stress_impact_gain
						eccentric = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

#######################
#	The legendary animal appears! Is it real?
#	by James Beaumont
#######################

hunt.8070 = {
	type = activity_event
	title = hunt.8070.t
	desc = {
		desc = hunt.8070.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = lunatic
				}
				desc = hunt.8070.desc.mid.lunatic
			}
			triggered_desc = {
				trigger = {
					has_trait = paranoid
				}
				desc = hunt.8070.desc.mid.paranoid
			}
			desc = hunt.8070.desc.mid.fallback
		}
		desc = hunt.8070.desc.outro
	}
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = paranoia
	}

	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
		OR = {
			has_trait = lunatic
			stress_level >= 1
			scope:activity = { var:hunt_success_chance <= 20 }
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			has_trait = paranoid
		}
		# You're likely to see things that aren't there
		modifier = {
			add = 1
			has_trait = lunatic
		}
		# Add 1 for each level of stress you have
		modifier = {
			add = 1
			stress_level >= 1
		}
		modifier = {
			add = 1
			stress_level >= 2
		}
		modifier = {
			add = 1
			stress_level >= 3
		}
	}

	option = { # Shoot!
		name = hunt.8070.a
		custom_tooltip = unforseen_consequences_tt
		hidden_effect = {
			random_list = {
				10 = { # You shot it!
					trigger_event = hunt.8071
				}
				10 = { # You shot a random entourage member
					trigger_event = hunt.8072
				}
				10 = { # It was never there at all
					trigger_event = hunt.8073
				}
				10 = { # You shot a regular animal
					trigger_event = hunt.8074
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
			paranoid = minor_stress_impact_gain
			patient = minor_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}

	option = { # Just wait
		name = hunt.8070.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_shoot_wait_key
				score = 25
				tags = { random legendary good }
				character = root

				#Effect
				root = {
					stress_impact = {
						ambitious = minor_stress_impact_gain
						arrogant = minor_stress_impact_gain
						impatient = minor_stress_impact_gain
						paranoid = minor_stress_impact_loss
						patient = minor_stress_impact_loss
						humble = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

# You shot the animal!
hunt.8071 = {
	type = activity_event
	title = hunt.8071.t
	desc = {
		desc = hunt.8071.desc.intro
		desc = hunt.8071.desc.outro
	}
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = ecstasy
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_arrow_impact_miss"
	}

	option = { # I'm so cool.
		name = hunt.8071.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_shoot_hit_key
				score = 25
				tags = { random legendary good }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_major }
					stress_impact = {
						base = medium_stress_impact_loss
					}
				}
			}
		}
	}
}

# You shot a bloody entourage member
hunt.8072 = {
	type = activity_event
	title = hunt.8071.t
	desc = {
		desc = hunt.8071.desc.intro
		desc = hunt.8072.desc.outro
	}
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:murder_target
		animation = shock
	}

	immediate = {
		scope:activity = {
			random_attending_character = {
				limit = {
					this != root
				}
				weight = {
					base = 1
					modifier = {
						add = {
							value = 0
							subtract = prowess
						}
					}
				}
				save_scope_as = murder_target
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_shoot_murder_key
				score = 25
				tags = { random legendary good }
				character = root
				target = scope:murder_target

				# Effect
				root = {
					scope:murder_target = {
						death = {
							death_reason = death_hunting_mistakenly_shot
							killer = root
						}
						every_close_or_extended_family_member = {
							limit = {
								this != root
							}
							custom = hunter_accident_victim_family_tt
							add_opinion = {
								modifier = accidentally_killed_family_opinion
								target = root
							}
						}
					}
					stress_impact = {
						base = medium_stress_impact_gain
						callous = medium_stress_impact_loss
						sadistic = medium_stress_impact_loss
					}
				}
			}
		}
	}

	option = { # Oopsie
		name = hunt.8072.a
	}
}

# You shot... nothing?
hunt.8073 = {
	type = activity_event
	title = hunt.8071.t
	desc = {
		desc = hunt.8071.desc.intro
		desc = hunt.8073.desc.outro
	}
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = shame
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_arrow_impact_miss"
	}

	option = { # Am I going mad?
		name = hunt.8073.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_shoot_nothing_key
				score = 25
				tags = { random legendary good }
				character = root

				# Effect
				root = {
					stress_impact = {
						base = medium_stress_impact_gain
						calm = minor_stress_impact_loss
						humble = minor_stress_impact_loss
					}
				}
			}
		}
	}
}

# You shot a regular animal
hunt.8074 = {
	type = activity_event
	title = hunt.8071.t
	desc = {
		desc = hunt.8071.desc.intro
		desc = hunt.8074.desc.outro
	}
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = shame
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_arrow_impact_miss"
	}

	option = { # Uhhh... yeah, I meant to do that
		name = hunt.8074.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_shoot_regular_key
				score = 25
				tags = { random legendary good }
				character = root

				# Effect
				root = {
					add_prestige = major_prestige_gain
					hunt_activity_success_change_effect = { CHANGE = increase_minor }
					stress_impact = {
						base = minor_stress_impact_loss
						calm = minor_stress_impact_loss
						humble = minor_stress_impact_loss
					}
				}
			}
		}
	}
}

#############################
### Falconry complication ###
#############################

#######################
#	Falconry complication; falcon stuck in tree
#	by James Beaumont
#######################

hunt.8500 = {
	type = activity_event
	title = hunt.8500.t
	desc = hunt.8500.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = personality_zealous
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ep2_event_grand_hunt_falconry/ep2_event_grand_hunt_falconry_send"
	}

	option = { # Climb up and help them down
		name = hunt.8500.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_tree_climb_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = decent_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8500.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8500.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_no_death_effect = { REASON = snapped_neck_climbing_tree }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						eccentric = minor_stress_impact_loss
						paranoid = minor_stress_impact_gain
						patient = minor_stress_impact_gain
						craven = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}

	option = { # Have faith in your training, call them down
		name = hunt.8500.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_tree_call_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					duel = {
						skills = { learning stewardship }
						value = decent_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8500.falcon_success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8500.falcon_failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
							}
						}
					}
					stress_impact = {
						impatient = minor_stress_impact_gain
						patient = minor_stress_impact_loss
						humble = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

#######################
#	Falconry complication; falcon attacked by a bigger animal
#	by James Beaumont
#######################

hunt.8510 = {
	type = activity_event
	title = hunt.8510.t
	desc = hunt.8510.desc
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = fear
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ep2_event_grand_hunt_falconry/ep2_event_grand_hunt_falconry_send"
		# Get a strong animal
		select_local_animal_effect = { TYPE = prowling } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
	}

	option = { # Beat the animal off yourself
		name = hunt.8510.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_defend_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8510.a.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
								add_prestige = major_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8510.a.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_effect = { REASON = wild_animal }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						paranoid = minor_stress_impact_gain
						patient = minor_stress_impact_gain
						craven = minor_stress_impact_gain
						brave = major_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_boldness = 1
				ai_energy = 0.5
			}
		}
	}

	option = { # Cross your fingers and *hope* your bird comes out on top
		name = hunt.8510.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_hope_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					random_list = {
						# Your birb escapes, birds are very squishy so low chance
						25 = {
							desc = hunt.8510.b.success
							send_interface_toast = {
								title = hunt.8510.b.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards
							}
						}
						# Failure.
						75 = {
							desc = hunt.8510.b.failure
							send_interface_toast = {
								title = hunt.8510.b.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								remove_short_term_gold = {
									value = minor_gold_value
								}
							}
						}
					}
					stress_impact = {
						brave = minor_stress_impact_gain
						arrogant = minor_stress_impact_gain
						lazy = minor_stress_impact_loss
						craven = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -1
				ai_energy = -0.5
			}
		}
	}

	option = { # I'll just buy another, better bird.
		name = hunt.8510.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_dismiss_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					remove_short_term_gold = {
						value = medium_gold_value
					}
					hunt_activity_success_change_effect = { CHANGE = increase_minor }
					stress_impact = {
						brave = minor_stress_impact_gain
						arrogant = minor_stress_impact_gain
						lazy = minor_stress_impact_loss
						craven = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				gold < medium_gold_value
			}
			ai_value_modifier = {
				ai_boldness = -1
				ai_energy = -1
				ai_greed = -0.5
			}
		}
	}

	option = { # Oh I read all about this animal in a book!
		name = hunt.8510.d
		trigger = {
			has_trait = scholar
		}
		trait = scholar
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_falcon_scholar_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_medium }
					add_prestige = medium_prestige_gain
					stress_impact = {
						base = minor_stress_impact_loss
						brave = minor_stress_impact_gain
						arrogant = minor_stress_impact_gain
						lazy = minor_stress_impact_loss
						craven = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = { # This is only good, the AI should basically always pick it
			base = 1000
			modifier = { # Unless they're an idiot
				factor = 0.01
				has_trait = brave
				has_trait = arrogant
			}
		}
	}
}

#######################
#	Legendary complication; someone you hate has a good point
#	by James Beaumont
#######################

hunt.8520 = {
	type = activity_event
	title = hunt.8520.t
	desc = {
		desc = hunt.8520.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = lunatic
						has_trait = paranoid
					}
				}
				desc = hunt.8520.desc.outro.obsessed
			}
			desc = hunt.8520.desc.outro.fallback
		}
	}
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = paranoia
	}
	right_portrait = {
		character = scope:m_hunt
		animation = fear
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
	}

	immediate = {
		hunt_save_master_or_hunter_courtier_effect = yes
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_dogs_bark"
	}

	option = { # Shut up damn you! Try to track the beast yourself
		name = hunt.8520.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fork_self_log
				score = 25
				tags = { random neutral legendary }
				character = root

				#Effect
				root = {
					reverse_add_opinion = {
						modifier = insult_opinion
						target = scope:m_hunt
						opinion = -25
					}
					duel = {
						skill = martial
						value = high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8520.a.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8520.a.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						trusting = minor_stress_impact_gain
						patient = minor_stress_impact_gain
						forgiving = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}

	option = { # Let your master of the hunt be a master of the hunt
		name = hunt.8520.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fork_moh_log
				score = 25
				tags = { random legendary neutral }
				character = root
				target = scope:m_hunt

				#Effect
				root = {
					progress_towards_friend_effect = {
						REASON = friend_listened_to_advice
						CHARACTER = scope:m_hunt
						OPINION = default_friend_opinion
					}
					scope:m_hunt = {
						duel = {
							skill = martial
							value = high_skill_rating
							# Success.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = 3.5
									min = -49
								}
								send_interface_toast = {
									title = hunt.8520.b.success
									left_icon = root
									hunt_activity_success_change_effect = { CHANGE = increase_minor }
								}
							}
							# Failure.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = -3.5
									min = -49
								}
								send_interface_toast = {
									title = hunt.8520.b.failure
									left_icon = root
									hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								}
							}
						}
					}
					stress_impact = {
						arrogant = minor_stress_impact_gain
						stubborn = minor_stress_impact_gain
						lazy = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_sociability = 1
			}
		}
	}
}

#######################
#	Legendary complication; you slip and get one leg stuck in a trap
#	by James Beaumont
#######################

hunt.8530 = {
	type = activity_event
	title = hunt.8530.t
	desc = {
		desc = hunt.8530.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = lunatic
						has_trait = paranoid
					}
				}
				desc = hunt.8530.desc.outro.obsessed
			}
			desc = hunt.8530.desc.outro.fallback
		}
	}
	theme = hunt_activity
	cooldown = { years = 2 }
	left_portrait = {
		character = root
		animation = pain
	}
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
	}

	immediate = {
		increase_wounds_no_death_effect = { REASON = fall_in_hole }
		hidden_effect = {
			scope:activity = {
				random_attending_character = {
					limit = {
						this != root
						is_ai = yes
						is_adult = yes
					}
					save_scope_as = rescuer_scope
				}
			}
		}
	}

	option = { # Try to wriggle free and limp after them
		name = hunt.8530.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_leg_wriggle_log
				score = 25
				tags = { random legendary bad }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = very_high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8530.a.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8530.a.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_major }
								increase_wounds_effect = { REASON = fall_in_hole }
							}
						}
					}
					stress_impact = {
						base = medium_stress_impact_gain
						trusting = minor_stress_impact_gain
						patient = minor_stress_impact_gain
						forgiving = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}

	option = { # Call for help!
		name = hunt.8530.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_leg_help_log
				score = 25
				tags = { random legendary bad }
				character = root
				target = scope:rescuer_scope

				#Effect
				root = {
					scope:rescuer_scope = {
						add_hook = {
							type = favor_hook
							target = root
						}
					}
					hunt_activity_success_change_effect = { CHANGE = decrease_minor }
					stress_impact = {
						arrogant = minor_stress_impact_gain
						stubborn = minor_stress_impact_gain
						craven = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	option = { # I didn't need this leg anyway! Chop! Chop! Chop!
		name = hunt.8530.c
		trigger = {
			OR = {
				has_trait = lunatic
				stress_level >= 2
			}
		}
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_leg_chop_log
				score = 25
				tags = { random legendary bad }
				character = root

				#Effect
				root = {
					add_trait = one_legged
					change_trait_rank = {
						trait = wounded
						rank = 2
						max = 2
					}
					add_prestige = massive_prestige_gain
					hunt_activity_success_change_effect = { CHANGE = increase_massive }
					if = {
						limit = {
							OR = {
								has_any_nickname = no
								has_bad_nickname = yes
							}
						}
						give_nickname = nick_bloody_hand
					}
					else = {
						random = {
							chance = 5
							give_nickname = nick_bloody_hand
						}
					}
					stress_impact = {
						base = massive_stress_impact_loss
						arrogant = major_stress_impact_loss
						eccentric = major_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_rationality = -2
				ai_boldness = 0.5
			}
		}
	}
}

#######################
#	Legendary complication; you see some kind of omen
#	by James Beaumont
#######################

hunt.8540 = {
	type = activity_event
	title = hunt.8540.t
	desc = {
		desc = hunt.8540.desc.intro
		random_valid = {
			triggered_desc = {
				trigger = {
					is_witch_trigger = yes
				}
				desc = hunt.8540.desc.mid.witch
			}
			desc = hunt.8540.desc.mid.orion
			desc = hunt.8540.desc.mid.ursa_major
			desc = hunt.8540.desc.mid.lights
			desc = hunt.8540.desc.mid.comet
		}
		desc = hunt.8540.desc.outro
	}
	theme = hunt_activity_camp
	cooldown = { years = 10 }
	left_portrait = {
		character = root
		animation = paranoia
		triggered_outfit = {
			remove_default_outfit = no
			outfit_tags = { nightgown }
		}
	}
	
	trigger = {
		has_activity_state = passive
		any_owned_story = {
			type = story_cycle_hunt_mystical_animal
			NOT = { exists = scope:story.var:had_event_hunt_8540 }
		}
	}

	immediate = {
		random_owned_story = {
			type = story_cycle_hunt_mystical_animal
			save_scope_as = story
			set_variable = had_event_hunt_8540
			if = {
				limit = { exists = var:encounters }
				change_variable = {
					name = encounters
					add = 1
				}
			}
			else = {
				set_variable = {
					name = encounters
					value = 1
				}
			}
		}
	}

	option = { # It's a sign!
		name = hunt.8540.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_omen_sign_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					show_as_tooltip = { # You *think* it's being determined by your ability to interpret signs
						duel = {
							skill = learning
							value = low_skill_rating
							# Success.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = 3.5
									min = -49
								}
								send_interface_toast = {
									title = hunt.8540.a.success
									left_icon = root
									hunt_activity_success_change_effect = { CHANGE = increase_medium }
								}
							}
							# Failure.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = -3.5
									min = -49
								}
								send_interface_toast = {
									title = hunt.8540.a.failure
									left_icon = root
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						cynical = minor_stress_impact_gain
						zealous = minor_stress_impact_gain
						lunatic_1 = minor_stress_impact_loss
						lunatic_genetic = minor_stress_impact_loss
						paranoid = minor_stress_impact_loss
						eccentric = minor_stress_impact_loss
					}
				}
			}
		}
		hidden_effect = { # But really it's just random
			random_list = {
				40 = {
					send_interface_toast = {
						title = hunt.8540.a.success
						left_icon = root
						hunt_activity_success_change_effect = { CHANGE = increase_medium }
					}
				}
				60 = {
					send_interface_toast = {
						title = hunt.8540.a.failure
						left_icon = root
					}
				}
			}
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_zeal = -1
			}
		}
	}

	option = { # Pah, this is stuff and nonsense. But I'm awake now so I'll focus on some tracking.
		name = hunt.8540.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_omen_track_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					duel = {
						skill = martial
						value = high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8540.b.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8540.b.failure
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								left_icon = root
							}
						}
					}
					add_character_modifier = {
						modifier = sleep_deprived_modifier
						years = 5
					}
					stress_impact = {
						base = minor_stress_impact_gain
						lazy = minor_stress_impact_gain
						zealous = minor_stress_impact_gain
						eccentric = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_honor = 0.5
				ai_energy = 1
			}
		}
	}

	option = { # Clearly this is a sign that *God* blesses our hunt
		name = hunt.8540.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_omen_god_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					add_piety = medium_piety_gain
					stress_impact = {
						base = minor_stress_impact_loss
						arrogant = minor_stress_impact_gain
						stubborn = minor_stress_impact_gain
						zealous = minor_stress_impact_loss
						eccentric = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_zeal = 1
			}
		}
	}

	option = { # A beautiful night, eh scheme target?
		name = hunt.8540.d
		trigger = {
			OR = {
				has_activity_intent = woo_attendee_intent
				has_activity_intent = befriend_attendee_intent
			}
			intent_target.location ?= root.location
		}
		custom_tooltip = available_because_intent_tt
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_omen_intent_log
				score = 25
				tags = { random legendary }
				character = root
				target = root.intent_target

				#Effect
				root = {
					if = {
						limit = { has_activity_intent = woo_attendee_intent }
						progress_towards_lover_effect = {
							CHARACTER = intent_target
							REASON = lover_written_in_stars
							OPINION = default_lover_opinion
						}
					}
					else = {
						progress_towards_friend_effect = {
							CHARACTER = intent_target
							REASON = friend_bonded_during_hunt
							OPINION = default_friend_opinion
						}
					}
					stress_impact = {
						base = minor_stress_impact_loss
						shy = minor_stress_impact_gain
						eccentric = minor_stress_impact_gain
						gregarious = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_sociability = 1
				ai_rationality = 0.5
			}
		}
	}
}

#######################
#	Legendary complication; you find droppings of the legendary color
#	by James Beaumont
#######################

hunt.8550 = {
	type = activity_event
	title = hunt.8550.t
	desc = hunt.8550.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = paranoia
	}
	artifact = {
		target = scope:newly_created_artifact
		position = lower_right_portrait
	}
	cooldown = { years = 2 }
	
	trigger = {
		scope:activity = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_dogs_bark"
		hidden_effect = {
			random = { # Determine if the poop actually belongs to the animal or not
				chance = 25
				set_variable = {
					name = poo_belongs_to_animal
					years = 1
				}
			}
			random = {
				chance = 25
				create_artifact = {
					name = legendary_fumes
					description = legendary_fumes_desc
					modifier = artifact_hunt_lifestyle_xp_gain_mult_modifier
					modifier = artifact_attraction_opinion_negative_2_modifier
					type = miscellaneous
					visuals = small_box
					save_scope_as = newly_created_artifact
				}
			}
		}
	}

	option = { # This *must* belong to the legendary beast
		name = hunt.8550.a
		show_as_tooltip = {
			duel = {
				skill = martial
				value = high_skill_rating
				# Success.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					send_interface_toast = {
						title = hunt.8550.a.success
						left_icon = root
						hunt_activity_success_change_effect = { CHANGE = increase_medium }
						add_prestige = medium_prestige_gain
					}
				}
				# Failure.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					send_interface_toast = {
						title = hunt.8550.a.failure
						left_icon = root
						hunt_activity_success_change_effect = { CHANGE = decrease_medium }
					}
				}
			}
		}
		hidden_effect = {
			scope:activity = {
				add_activity_log_entry = {
					key = hunt_fume_follow_log
					score = 25
					tags = { random legendary }
					character = root

					#Effect
					root = {
						duel = {
							skill = martial
							value = high_skill_rating
							# Success.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = 3.5
									min = -49
								}
								send_interface_toast = {
									title = hunt.8550.a.success
									left_icon = root
									hunt_activity_success_change_effect = { CHANGE = increase_medium }
									add_prestige = medium_prestige_gain
								}
							}
							# Failure.
							50 = {
								compare_modifier = {
									value = scope:duel_value
									multiplier = -3.5
									min = -49
								}
								modifier = {
									factor = 0
									NOT = { exists = var:poo_belongs_to_animal }
								}
								send_interface_toast = {
									title = hunt.8550.a.failure
									left_icon = root
									hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								}
							}
						}
					}
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_gain
			lunatic_1 = minor_stress_impact_loss
			lunatic_genetic = minor_stress_impact_loss
			eccentric = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
		}
		if = {
			limit = { exists = scope:newly_created_artifact }
			hidden_effect = { destroy_artifact = scope:newly_created_artifact }
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_energy = -0.5
			}
		}
	}

	option = { # Attempt to identify the poop
		name = hunt.8550.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fume_identify_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					hunter_progress_point_gain_effect = { CHANGE = 1 RANDOM_CHANGE = 1 }
					duel = {
						skill = learning
						value = medium_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8550.b.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8550.b.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						lunatic_1 = minor_stress_impact_gain
						lunatic_genetic = minor_stress_impact_gain
						eccentric = minor_stress_impact_gain
						impatient = minor_stress_impact_gain
					}
				}
			}
		}
		if = {
			limit = { exists = scope:newly_created_artifact }
			hidden_effect = { destroy_artifact = scope:newly_created_artifact }
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = -1
			}
		}
	}

	option = { # Take them
		name = hunt.8550.d
		trigger = { exists = scope:newly_created_artifact }
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fume_take_log
				score = 25
				tags = { random legendary }
				character = root
				artifact = scope:newly_created_artifact

				#Effect
				root = {
					add_prestige = minor_prestige_loss
					show_as_tooltip = {
						scope:newly_created_artifact = { set_owner = root }
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_honor = 0.5
				ai_energy = -1
			}
		}
	}

	option = { # No, this is nothing. I'll just keep going
		name = hunt.8550.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_fume_dismiss_log
				score = 25
				tags = { random legendary }
				character = root

				#Effect
				root = {
					stress_impact = {
						base = medium_stress_impact_loss
						lazy = minor_stress_impact_loss
						diligent = minor_stress_impact_gain
						lunatic_1 = minor_stress_impact_gain
						lunatic_genetic = minor_stress_impact_gain
						paranoid = minor_stress_impact_gain
					}
				}
			}
		}
		if = {
			limit = { exists = scope:newly_created_artifact }
			hidden_effect = { destroy_artifact = scope:newly_created_artifact }
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_honor = 0.5
				ai_energy = -1
			}
		}
	}
}

# Unique animal complication events
# Big cat complication: you find a big cat cub abandoned in the wild
hunt.8560 = {
	type = activity_event
	title = hunt.8560.t
	desc = hunt.8560.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:hunt_participant
		animation = personality_compassionate
	}
	cooldown = { years = 2 }

	trigger = {
		exists = scope:activity.var:animal_type
		scope:activity = {
			hunt_activity_big_cat_game_trigger = { VAR = var:animal_type }
			any_attending_character = {
				is_adult = yes
				is_ai = yes
				this != root
			}
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_dogs_bark"
		scope:activity = {
			random_attending_character = {
				limit = {
					is_adult = yes
					is_ai = yes
					this != root
				}
				weight = {
					base = 10
					modifier = {
						factor = ai_compassion
					}
				}
				save_scope_as = hunt_participant
			}
		}
	}

	option = { # We'll make the little bugger scream to lure out the main beasty!
		name = hunt.8560.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_cub_scream_log
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = increase_minor }
					progress_towards_rival_effect = {
						REASON = friend_cruelty_to_animals
						CHARACTER = scope:hunt_participant
						OPINION = default_friend_opinion
					}
					stress_impact = {
						callous = minor_stress_impact_loss
						sadistic = medium_stress_impact_loss
						compassionate = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_compassion = -1
			}
		}
	}

	option = { # Tend for the little beast until it can fend for itself
		name = hunt.8560.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_cub_adopt_log
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					hunt_activity_success_change_effect = { CHANGE = decrease_minor }
					add_piety = medium_piety_gain
					add_prestige = medium_prestige_gain
					add_character_modifier = {
						modifier = tiger_king_modifier
						years = 3 # Most big cats seem to stop depending on their parents at 3-5 years old
					}
					progress_towards_friend_effect = {
						REASON = friend_compassion_for_animals
						CHARACTER = scope:hunt_participant
						OPINION = default_friend_opinion
					}
					stress_impact = {
						compassionate = medium_stress_impact_loss
						callous = minor_stress_impact_gain
						sadistic = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_compassion = 1
			}
		}
	}

	option = { # It's none of my business
		name = hunt.8560.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_cub_dismiss_log
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					stress_impact = {
						compassionate = minor_stress_impact_gain
						callous = minor_stress_impact_gain
						sadistic = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

# Herd animal complication: a hunt participant is caught in a stampede!
hunt.8570 = {
	type = activity_event
	title = hunt.8570.t
	desc = hunt.8570.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:stampede_victim
		animation = fear
	}
	cooldown = { years = 2 }

	trigger = {
		exists = scope:activity.var:animal_type
		scope:activity = {
			hunt_activity_herd_game_trigger = { VAR = var:animal_type }
			any_attending_character = {
				is_ai = yes
				this != root
			}
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_dogs_bark"
		scope:activity = {
			random_attending_character = {
				limit = {
					is_ai = yes
					this != root
				}
				weight = {
					base = 10
					modifier = {
						add = 10
						is_adult = no # Children are stupid
					}
					modifier = {
						add = 10
						has_trait = dull
					}
					modifier = {
						add = 10
						any_scheme = { # They were tricked into being there by someone
							type = murder
							scheme_target_character = prev
						}
					}
					modifier = { # Make it someone ROOT cares about
						factor = 5
						is_close_family_of = root
					}
				}
				save_scope_as = stampede_victim
				save_scope_as = murder_target
			}
		}
	}

	option = { # I must save them!
		name = hunt.8570.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_mufasa_save_log
				score = 25
				tags = { random bad }
				character = root
				target = scope:stampede_victim

				#Effect
				root = {
					duel = {
						skill = prowess
						value = very_high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.success
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards
								add_prestige = massive_prestige_gain
								add_hook = {
									type = saved_my_life_hook
									target = scope:stampede_victim
								}
							}
						}
						# Failure.
						20 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.failure
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_effect = { REASON = stampede }
								scope:stampede_victim = { increase_wounds_effect = { REASON = stampede } }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure, and they die
						20 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.failure
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_effect = { REASON = stampede }
								scope:stampede_victim = { death = { death_reason = death_stampede } }
								add_prestige = medium_prestige_loss
							}
						}
						# Failure, and you both die
						10 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.crit_failure
								left_icon = root
								right_icon = scope:stampede_victim
								add_prestige = medium_prestige_loss
								scope:stampede_victim = { death = { death_reason = death_stampede } }
								death = { death_reason = death_stampede }
							}
						}
					}
					if = {
						limit = { is_alive = yes }
						stress_impact = {
							callous = medium_stress_impact_gain
							craven = medium_stress_impact_gain
							sadistic = medium_stress_impact_gain
							compassionate = medium_stress_impact_loss
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_compassion = 1
				ai_boldness = 1
			}
		}
	}

	option = { # Attempt to redirect the herd
		name = hunt.8570.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_mufasa_redirect_log
				score = 25
				tags = { random bad }
				character = root
				target = scope:stampede_victim

				#Effect
				root = {
					duel = {
						skills = { learning prowess }
						value = very_high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.b.success
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards
								add_prestige = massive_prestige_gain
								add_hook = {
									type = saved_my_life_hook
									target = scope:stampede_victim
								}
							}
						}
						# Failure.
						20 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.b.failure
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_effect = { REASON = stampede }
								scope:stampede_victim = { increase_wounds_effect = { REASON = stampede } }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure, and they die
						20 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.failure
								left_icon = root
								right_icon = scope:stampede_victim
								hunt_activity_success_change_effect = { CHANGE = decrease_medium }
								increase_wounds_effect = { REASON = stampede }
								scope:stampede_victim = { death = { death_reason = death_stampede } }
								add_prestige = medium_prestige_loss
							}
						}
						# Failure, and you both die
						10 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.a.crit_failure
								left_icon = root
								right_icon = scope:stampede_victim
								add_prestige = medium_prestige_loss
								scope:stampede_victim = { death = { death_reason = death_stampede } }
								death = { death_reason = death_stampede }
							}
						}
					}
					if = {
					 	limit = { is_alive = yes }
					 	stress_impact = {
							callous = medium_stress_impact_gain
							craven = medium_stress_impact_gain
							sadistic = medium_stress_impact_gain
							compassionate = medium_stress_impact_loss
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				learning > high_skill_rating
			}
			ai_value_modifier = {
				ai_honor = 0.5
				ai_compassion = 1
				ai_boldness = 1
			}
		}
	}

	option = { # Use the opportunity to pick off some of the stragglers
		name = hunt.8570.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_mufasa_hunt_log
				score = 25
				tags = { random bad }
				character = root
				target = scope:stampede_victim

				#Effect
				root = {
					duel = {
						skill = prowess
						value = high_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.c.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								hunter_progress_point_gain_effect = { CHANGE = 2 RANDOM_CHANGE = 1 } #Gives points towards
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8570.c.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								add_prestige = minor_prestige_loss
							}
						}
					}
					random_list = {
						75 = { # The victim dies
							send_interface_toast = {
								title = hunt.8570.c.death
								left_icon = root
								right_icon = scope:stampede_victim
								scope:stampede_victim = {
									save_scope_as = murder_target
									death = { death_reason = death_stampede }
									every_close_or_extended_family_member = {
										limit = {
											this != root
										}
										custom = hunter_accident_victim_family_tt
										add_opinion = {
											modifier = left_family_for_dead_opinion
											target = root
										}
									}
								}
							}
						}
						25 = { # The victim dies
							send_interface_toast = {
								title = hunt.8570.c.survives
								left_icon = root
								right_icon = scope:stampede_victim
								scope:stampede_victim = { increase_wounds_no_death_effect = { REASON = stampede } }
								set_relation_rival = {
									target = scope:stampede_victim
									reason = rival_left_for_dead
								}
							}
						}
					}
					stress_impact = {
						base = minor_stress_impact_gain
						callous = minor_stress_impact_loss
						sadistic = minor_stress_impact_loss
						craven = minor_stress_impact_loss
						ambitious = minor_stress_impact_loss
						compassionate = minor_stress_impact_gain
						brave = minor_stress_impact_gain
						gallant = minor_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_compassion = -1
				ai_boldness = -1
			}
		}
	}

	option = { # Leave Simba to be trampled by the wildebeast for a laugh
		name = hunt.8570.d
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_mufasa_trampled_log
				score = 25
				tags = { random bad }
				character = root
				target = scope:stampede_victim

				#Effect
				root = {
					random_list = {
						90 = { # The victim dies
							send_interface_toast = {
								title = hunt.8570.c.death
								left_icon = root
								right_icon = scope:stampede_victim
								scope:stampede_victim = {
									death = { death_reason = death_stampede }
									every_close_or_extended_family_member = {
										limit = {
											this != root
										}
										custom = hunter_accident_victim_family_tt
										add_opinion = {
											modifier = left_family_for_dead_opinion
											target = root
										}
									}
								}
							}
						}
						10 = { # The victim dies
							send_interface_toast = {
								title = hunt.8570.c.survives
								left_icon = root
								right_icon = scope:stampede_victim
								scope:stampede_victim = { increase_wounds_no_death_effect = { REASON = stampede } }
								set_relation_rival = {
									target = scope:stampede_victim
									reason = rival_left_for_dead
								}
							}
						}
					}
					stress_impact = {
						base = medium_stress_impact_gain
						callous = minor_stress_impact_loss
						sadistic = minor_stress_impact_loss
						craven = minor_stress_impact_loss
						compassionate = medium_stress_impact_gain
						brave = medium_stress_impact_gain
						gallant = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_honor = -0.5
				ai_compassion = -1
				ai_boldness = -1
			}
		}
	}
}

# Predator complication: you find your prey but you're alone! Stare down the wolf
hunt.8580 = {
	type = activity_event
	title = hunt.8580.t
	desc = hunt.8580.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = fear
	}
	cooldown = { years = 2 }

	trigger = {
		exists = scope:activity.var:animal_type
		scope:activity = {
			hunt_animal_type_predator_trigger = { VAR = var:animal_type }
		}
	}

	option = { # Stare the beast down
		name = hunt.8580.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_wolf_stare_log
				score = 25
				tags = { random bad }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = medium_skill_rating
						# Success.
						50 = {
							modifier = { # Craven characters have a hard time resisting the urge to run
								add = -10
								has_trait = craven
							}
							modifier = {
								add = 10
								OR = {
									has_trait = calm
									has_trait = brave
								}
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.a.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_minor }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							modifier = {
								add = -10
								OR = {
									has_trait = calm
									has_trait = brave
								}
							}
							modifier = {
								add = 10
								has_trait = craven
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.a.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								increase_wounds_effect = { REASON = wild_animal }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						impatient = medium_stress_impact_gain
						craven = medium_stress_impact_gain
						brave = medium_stress_impact_gain
						arrogant = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
				ai_rationality = 0.5
			}
		}
	}

	option = { # Try to just fucking shoot the thing
		name = hunt.8580.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_wolf_shoot_log
				score = 25
				tags = { random bad }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = high_skill_rating
						# Success.
						50 = {
							modifier = {
								add = -10
								has_trait = craven
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.b.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_major }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							modifier = {
								add = 10
								has_trait = craven
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.b.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								increase_wounds_effect = { REASON = wild_animal }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						base = medium_stress_impact_gain
						craven = medium_stress_impact_gain
						brave = medium_stress_impact_loss
						stubborn = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
				ai_rationality = -1
			}
		}
	}

	option = { # Run and scream
		name = hunt.8580.c
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_wolf_flee_log
				score = 25
				tags = { random bad }
				character = root

				#Effect
				root = {
					duel = {
						skill = prowess
						value = medium_skill_rating
						# Success.
						50 = {
							modifier = { # I imagine you run much like Shaggy
								add = 10
								has_trait = craven
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.c.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_major }
								add_prestige = minor_prestige_loss
							}
						}
						# Failure.
						50 = {
							modifier = {
								add = -10
								has_trait = craven
							}
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8580.c.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								increase_wounds_effect = { REASON = wild_animal }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						base = medium_stress_impact_gain
						craven = medium_stress_impact_loss
						brave = medium_stress_impact_gain
						stubborn = medium_stress_impact_gain
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -1
				ai_boldness = -1
				ai_rationality = -1
			}
		}
	}
}

# Predator complication: you find their cave
hunt.8590 = {
	type = activity_event
	title = hunt.8590.t
	desc = hunt.8590.desc
	theme = hunt_activity
	override_background = {
		trigger = {
			scope:activity.activity_location = { hunt_snowy_forest_trigger = no }
		}
		reference = ep2_hunt_forest_cave
	}
	left_portrait = {
		character = root
		animation = fear
	}
	cooldown = { years = 2 }

	trigger = {
		exists = scope:activity.var:animal_type
		scope:activity = {
			hunt_animal_type_lives_in_caves_trigger = { VAR = var:animal_type }
		}
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP2/SFX/Events/Grand_Activities/Hunts/ConstructionKits/ep2_event_grand_hunt_ck_dogs_bark"
	}

	option = { # Wait for the beast to come back and attempt an ambush
		name = hunt.8590.a
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_cave_ambush_log
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					random_list = {
						# Success.
						50 = {
							show_chance = no
							desc = hunt.8590.a.success
							send_interface_toast = {
								title = hunt.8590.a.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
							}
						}
						# Failure.
						50 = {
							show_chance = no
							desc = hunt.8590.a.failure
							send_interface_toast = {
								title = hunt.8590.a.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						impatient = medium_stress_impact_gain
						brave = medium_stress_impact_gain
						calm = medium_stress_impact_loss
						patient = medium_stress_impact_loss
						lazy = medium_stress_impact_loss # I love sitting around in caves \o/
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
				ai_rationality = 0.5
			}
		}
	}

	option = { # Try to track the beast based on what you find
		name = hunt.8590.b
		scope:activity = {
			add_activity_log_entry = {
				key = hunt_cave_track_log
				score = 25
				tags = { random neutral }
				character = root

				#Effect
				root = {
					duel = {
						skill = learning
						value = medium_skill_rating
						# Success.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = 3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8590.b.success
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = increase_medium }
								add_prestige = medium_prestige_gain
							}
						}
						# Failure.
						50 = {
							compare_modifier = {
								value = scope:duel_value
								multiplier = -3.5
								min = -49
							}
							send_interface_toast = {
								title = hunt.8590.b.failure
								left_icon = root
								hunt_activity_success_change_effect = { CHANGE = decrease_minor }
								add_prestige = medium_prestige_loss
							}
						}
					}
					stress_impact = {
						calm = medium_stress_impact_gain
						patient = medium_stress_impact_gain
						eccentric = minor_stress_impact_loss
						brave = medium_stress_impact_loss
						diligent = medium_stress_impact_loss
						stubborn = medium_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 0.5
				ai_rationality = -1
			}
		}
	}
}
