#############################################
#
# Events for Hunting
#
# Event ID 36000-36999 is reserved
#
# Deer Park ID: 4075
#
#############################################
# Written by Johan Andersson, Chris King & Sara Wendel-rtqvist
# Reworked by Rylock

# Tombola
character_event = {
	id = 36085

	hide_window = yes
	is_triggered_only = yes

	only_capable = yes
	prisoner = no

	trigger = {
		has_character_modifier = holding_grand_hunt
		health_traits < 1
	}

	fail_trigger_effect = {
		if = {
			limit = { has_character_modifier = holding_grand_hunt }

			repeat_event = {
				id = 36085
				days = 7
				random = 14
			}
		}
	}

	immediate = {
		random_list = {
			265 = { # No event
				mult_modifier = {
					factor = 0.33
					NOT = { has_character_flag = hunt_event_happened }
				}
				mult_modifier = {
					factor = 1.5
					has_character_flag = hunt_event_happened
				}
			}
			 55 = { # A Majestic Stag
				mult_modifier = {
					factor = 1.25
					trait = hunter
				}
				mult_modifier = {
					factor = 0.8
					trait = craven
				}
				mult_modifier = {
					factor = 0.67
					trait = content
				}
				mult_modifier = {
					factor = 0.5
					trait = slothful
				}
				mult_modifier = {
					factor = 0.2
					martial >= 15
				}
				mult_modifier = {
					factor = 2
					has_character_flag = hunt_good_hounds
				}

				character_event = { id = 36000 }
			}
			 32 = { # Paranoia in the hunt
				trigger = {
					# trait = paranoid
					NOT = { has_character_flag = hunt_paranoia }

					any_courtier_or_vassal = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}
				}

				character_event = { id = 36001 }
			}
			 80 = { # Deer Hunter, The White Hart
				mult_modifier = {
					factor = 1.33
					trait = hunter
				}
				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.8
					trait = slothful
				}
				mult_modifier = {
					factor = 2
					has_character_flag = hunt_good_hounds
				}

				character_event = { id = 36010 }
			}
			 44 = { # Boars
				mult_modifier = {
					factor = 1.33
					trait = hunter
				}
				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.8
					trait = slothful
				}
				mult_modifier = {
					factor = 2
					has_character_flag = hunt_good_hounds
				}

				character_event = { id = 36015 }
			}
			 32 = { # Bears
				trigger = {
					religion_openly_finnish_or_reformed_trigger = no

					trigger_if = {
						limit = { is_female = yes }

						OR = {
							trait = martial_lady
							trait = martial_lady_pagan
							trait = martial_lady_tengri
						}
					}
				}

				mult_modifier = {
					factor = 1.33
					trait = hunter
				}
				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.8
					trait = slothful
				}
				mult_modifier = {
					factor = 0.2
					martial >= 15
				}

				character_event = { id = 36020 }
			}
			 12 = { # Hound
				trigger = {
					NOR = {
						has_character_flag = hunt_good_hounds
						trait = craven
						trait = content
					}
				}

				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.8
					trait = slothful
				}

				character_event = { id = 36025 }
			}
			 24 = { # Horse
				trigger = {
					trigger_if = {
						limit = { is_female = yes }

						OR = {
							trait = martial_lady
							trait = martial_lady_pagan
							trait = martial_lady_tengri
						}
					}
				}

				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 0.5
					has_character_flag = hunt_good_hounds
				}

				character_event = { id = 36030 }
			}
			 24 = { # Hare
				mult_modifier = {
					factor = 1.33
					trait = brave
				}
				mult_modifier = {
					factor = 0.67
					trait = craven
				}
				mult_modifier = {
					factor = 1.1
					trait = ambitious
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.8
					trait = slothful
				}

				character_event = { id = 36035 }
			}
			  5 = { # Low martial guy, inability to kill something # CleanSlate: Essentially a player-only event, as the AI only starts hunting if martial >= 10
				trigger = {
					martial < 8

					NOR = {
						trait = hunter
						has_character_flag = hunt_killed_something
					}
				}

				mult_modifier = {
					factor = 1.25
					trait = craven
				}
				mult_modifier = {
					factor = 1.25
					trait = content
				}
				mult_modifier = {
					factor = 1.25
					trait = slothful
				}
				mult_modifier = {
					factor = 1.25
					trait = poet
				}
				mult_modifier = {
					factor = 1.25
					martial < 6
				}
				mult_modifier = {
					factor = 1.25
					martial < 4
				}

				character_event = { id = 36040 }
			}
			  3 = { # High Martial, Overconfidence
				trigger = {
					martial >= 10
					NOT = { has_character_flag = hunt_killed_something }

					trigger_if = {
						limit = { is_female = yes }

						OR = {
							trait = martial_lady
							trait = martial_lady_pagan
							trait = martial_lady_tengri
						}
					}
				}

				mult_modifier = {
					factor = 1.33
					trait = hunter
				}
				mult_modifier = {
					factor = 1.25
					trait = brave
				}
				mult_modifier = {
					factor = 1.25
					trait = ambitious
				}
				mult_modifier = {
					factor = 1.25
					trait = diligent
				}

				character_event = { id = 36045 }
			}
			 24 = { # Courtier/vassal with hunter trait kills something
				trigger = {
					NOT = { has_character_flag = hunt_killed_something }

					any_courtier_or_vassal = {
						OR = {
							trait = hunter
							martial >= 15
						}

						is_adult = yes
						health_traits < 1
						in_command_trigger = no
						is_incapable = no
						prisoner = no
						war = no
						is_abroad = no

						trigger_if = {
							limit = { is_female = yes }

							OR = {
								trait = martial_lady
								trait = martial_lady_pagan
								trait = martial_lady_tengri
							}
						}

						trigger_if = {
							limit = { is_inaccessible_trigger = yes }
							has_character_flag = hunt_begin
						}
					}
				}

				# CleanSlate: An issue with porting this event from MTTH is that the MTTH modifiers are on the vassal

				random_courtier_or_vassal = {
					limit = {
						OR = {
							trait = hunter
							martial >= 15
						}

						is_adult = yes
						health_traits < 1
						in_command_trigger = no
						is_incapable = no
						prisoner = no
						war = no
						is_abroad = no

						trigger_if = {
							limit = { is_female = yes }

							OR = {
								trait = martial_lady
								trait = martial_lady_pagan
								trait = martial_lady_tengri
							}
						}

						trigger_if = {
							limit = { is_inaccessible_trigger = yes }
							has_character_flag = hunt_begin
						}
					}

					preferred_limit = {
						OR = {
							trait = brave
							trait = ambitious
							trait = diligent
						}
					}

					character_event = { id = 36050 }
				}
			}
			  8 = { # Deer Park
				trigger = {
					NOT = { has_character_flag = hunt_killed_something }

					job_treasurer = {
						NOR = {
							trait = greedy
							trait = deceitful
						}
					}

					any_vassal = {
						is_adult = yes
						prisoner = no
						is_incapable = no
						war = no
						in_command_trigger = no

						trigger_if = {
							limit = { is_abroad = yes }
							at_location = ROOT
						}

						trigger_if = {
							limit = { trait = slothful }
							trait = ambitious
						}
					}
				}

				character_event = { id = 4075 }
			}
			  4 = { # WoL: During normal hunt, gets glimpse of legendary animal
				trigger = {
					has_dlc = "Way of Life"
					NOT = { has_character_flag = epic_hunt }
				}

				narrative_event = { id = WoL.5007 }
			}
			 24 = { # Wolves appear and run beside you
				character_event = { id = HL.1100 }
			}

			# CK2Plus
			 80 = { # Female version of 'The Hunt Begins'
				trigger = {
					is_female = yes

					NOR = {
						has_character_flag = female_hunt_begin
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}

				character_event = { id = FemRule.150 }
			}

			 8 = { # Female rulers makes a friend on the hunt
				trigger = {
					is_female = yes
					num_of_friends < 2

					NOR = {
						has_character_flag = female_hunt_begin
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}

					any_courtier = {
						religion = ROOT
						is_female = yes
						prisoner = no
						is_adult = yes
						is_abroad = no
						num_of_friends < 2
						health_traits == 0
						is_incapable = no

						NOR = {
							is_friend = ROOT
							is_rival = ROOT
							trait = martial_lady
							trait = martial_lady_pagan
							trait = martial_lady_tengri
						}
					}
				}

				mult_modifier = {
					factor = 1.33
					trait = kind
				}
				mult_modifier = {
					factor = 1.33
					trait = gregarious
				}
				mult_modifier = {
					factor = 0.8
					trait = cruel
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 0.67
					trait = shy
				}

				character_event = { id = FemRule.151 }
			}

			 8 = { # Female rulers makes a rival on the hunt
				trigger = {
					is_female = yes
					num_of_rivals < 2

					NOR = {
						has_character_flag = female_hunt_begin
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}

					any_courtier = {
						religion = ROOT
						is_female = yes
						prisoner = no
						is_adult = yes
						is_abroad = no
						num_of_rivals < 2
						health_traits == 0
						is_incapable = no

						NOR = {
							is_friend = ROOT
							is_rival = ROOT
							trait = martial_lady
							trait = martial_lady_pagan
							trait = martial_lady_tengri
						}
					}
				}

				mult_modifier = {
					factor = 0.67
					trait = kind
				}
				mult_modifier = {
					factor = 0.67
					trait = gregarious
				}
				mult_modifier = {
					factor = 1.33
					trait = cruel
				}
				mult_modifier = {
					factor = 0.8
					trait = content
				}
				mult_modifier = {
					factor = 2
					trait = envious
				}

				character_event = { id = FemRule.152 }
			}
		}

		repeat_event = {
			id = 36085
			days = 7
			random = 14
		}
	}
}

# A Majestic Stag
character_event = {
	id = 36000
	desc = EVTDESC36000
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36000

		trigger = {
			NOT = { trait = craven }
		}

		prestige = 5
	}

	option = {
		name = EVTOPTB36000
		tooltip_info = craven

		trigger = { trait = craven }

		prestige = -10
	}

	option = {
		name = EVTOPTC36000

		trigger = {
			NOR = {
				trait = greedy
				trait = arbitrary
				trait = envious
				trait = craven
				trait = cruel
			}
		}

		add_trait_silently_kind_effect = yes
	}

	option = {
		name = EVTOPTD36000

		trigger = {
			NOR = {
				trait = craven
				trait = humble
				trait = content
			}
		}

		if = {
			limit = { martial < 10 }

			random_list = {
				25 = { }

				15 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				30 = { change_martial = 1 }
				20 = { add_trait_wounded_effect = yes }
				8 = { add_maimed_trait_effect = yes }
				2 = { death = { death_reason = death_accident } }
			}
		}

		else_if = {
			limit = { martial < 20 }

			random_list = {
				50 = { }

				10 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				20 = { change_martial = 1 }
				15 = { add_trait_wounded_effect = yes }
				4 = { add_maimed_trait_effect = yes }
				1 = { death = { death_reason = death_accident } }
			}
		}

		else = {
			random_list = {
				80 = { }

				13 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				5 = { add_trait_wounded_effect = yes }
				2 = { add_maimed_trait_effect = yes }
			}
		}

		custom_tooltip = { text = hunt_killed_stag }

		set_character_flag = hunt_killed_something
		prestige = 20
	}
}

# Paranoia in the hunt
character_event = {
	id = 36001
	desc = EVTDESC36001
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
		set_character_flag = hunt_paranoia
	}

	option = {
		name = EVTOPTA36001

		random_list = {
			75 = { }

			20 = {
				add_trait_wounded_effect = yes

				random_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					character_event = {
						id = 36003
						days = 1
					}
				}

				character_event = {
					id = 36003
					days = 1
				}
			}

			4 = {
				add_maimed_trait_effect = yes

				random_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					character_event = {
						id = 36003
						days = 1
					}
				}
			}

			1 = {
				random_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					save_event_target_as = killer_target
				}

				death = {
					death_reason = death_murder_unknown_arrow
					killer = event_target:killer_target
				}

				any_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					character_event = {
						id = 36002
						days = 1
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTB36001

		trigger = { trait = patient }

		random_list = {
			85 = { }

			5 = {
				custom_tooltip = {
					text = hunt_bystander_dies

					random_courtier = {
						limit = {
							is_adult = yes
							NOT = { character = ROOT }

							trigger_if = {
								limit = { has_plot = plot_kill_character }

								plot_target_char = {
									NOT = { character = ROOT }
								}
							}
						}

						character_event = {
							id = 36005
							days = 1
							# tooltip = EVTTOOLTIP36004
						}
					}
				}
			}

			5 = {
				custom_tooltip = {
					text = hunt_plotter_dies

					random_courtier = {
						limit = {
							has_plot = plot_kill_character

							plot_target_char = {
								character = ROOT
							}
						}

						character_event = {
							id = 36004
							days = 1
							# tooltip = EVTTOOLTIP36004
						}
					}
				}
			}

			5 = {
				# TODO: Add better custom_tooltip?
				random_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					save_event_target_as = killer_target
				}

				death = {
					death_reason = death_murder_unknown_arrow
					killer = event_target:killer_target
				}

				any_courtier = {
					limit = {
						has_plot = plot_kill_character

						plot_target_char = {
							character = ROOT
						}
					}

					character_event = {
						id = 36002
						days = 1
					}
				}
			}
		}
	}
}

character_event = {
	id = 36002
	desc = EVTDESC36002
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36002

		prestige = 250
	}
}

character_event = {
	id = 36003
	desc = EVTDESC36003
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36003

		prestige = 25
	}
}

character_event = {
	id = 36004
	desc = EVTDESC36004
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36004

		death = {
			death_reason = death_murder_unknown_arrow
			killer = FROM
		}
	}
}

character_event = {
	id = 36005
	desc = EVTDESC36005
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36005

		death = {
			death_reason = death_murder_unknown_arrow
			killer = FROM
		}
	}
}

# Deer Hunter, The White Hart
character_event = {
	id = 36010
	desc = EVTDESC36010
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36010

		trigger = {
			NOR = {
				trait = greedy
				trait = cruel
			}
		}

		any_courtier = {
			show_scope_change = no

			limit = {
				trait = brave
				is_adult = yes

				trigger_if = {
					limit = { is_female = yes }

					OR = {
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}

				war = no
				prisoner = no
				in_command_trigger = no
				is_abroad = no
			}

			score_value = {
				value = 10
				interesting_courtier_selection_score = yes
			}

			opinion = {
				name = opinion_disappointed
				who = ROOT
				years = 10
			}
		}

		piety = 25
	}

	option = {
		name = EVTOPTB36010

		trigger = {
			any_courtier = {
				is_adult = yes

				OR = {
					martial >= 10
					trait = hunter
					has_job_title = job_marshal
				}

				trigger_if = {
					limit = { is_female = yes }

					OR = {
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}

				prisoner = no
				in_command_trigger = no
				is_abroad = no
				is_incapable = no
				health_traits == 0
			}
		}

		random_courtier = {
			show_scope_change = no

			limit = {
				is_female = no
				is_adult = yes

				OR = {
					martial >= 10
					trait = hunter
					has_job_title = job_marshal
				}
			}

			opinion = {
				name = opinion_delighted
				who = ROOT
				years = 10
			}

			prestige = 20
		}
	}

	option = {
		name = EVTOPTC36010

		trigger = {
			NOT = {	trait = craven }

			trigger_if = {
				limit = { is_female = yes }

				OR = {
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
		}

		if = {
			limit = { martial < 10 }

			random_list = {
				30 = { }

				20 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				20 = { change_martial = 1 }
				20 = { add_trait_wounded_effect = yes }
				9 = { add_maimed_trait_effect = yes }
				1 = { death = { death_reason = death_accident } }
			}
		}

		else_if = {
			limit = { martial < 20 }

			random_list = {
				65 = { }

				10 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				10 = { change_martial = 1 }
				10 = { add_trait_wounded_effect = yes }
				5 = { add_maimed_trait_effect = yes }
			}
		}

		else = {
			random_list = {
				80 = { }

				13 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				5 = { add_trait_wounded_effect = yes }
				2 = { add_maimed_trait_effect = yes }
			}
		}

		custom_tooltip = { text = hunt_killed_stag }

		prestige = 10
		set_character_flag = hunt_killed_something
	}
}

# Boars
character_event = {
	id = 36015
	desc = EVTDESC36015
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36015

		prestige = 5

		if = {
			limit = {
				trigger_if = {
					limit = { is_female = yes }

					OR = {
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}

				NOT = { trait = berserker }
			}

			random = {
				chance = 30

				tooltip = {
					remove_trait_silently_brave_effect = yes
					add_trait = craven
				}

				hidden_effect = {
					remove_trait_silently_brave_effect = yes
					add_trait_craven_effect = yes
				}
			}
		}

		ai_chance = {
			factor = 1

			trigger = {
				martial < 9

				NOR = {
					trait = brave
					trait = ambitious
					trait = proud
				}
			}
		}
	}

	option = {
		name = EVTOPTB36015

		trigger = {
			NOT = { trait = craven }

			trigger_if = {
				limit = { is_female = yes }

				OR = {
					trait = martial_lady
					trait = martial_lady_pagan
					trait = martial_lady_tengri
				}
			}
		}

		if = {
			limit = { martial < 10 }

			random_list = {
				30 = { }

				20 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				20 = { change_martial = 1 }
				20 = { add_trait_wounded_effect = yes }
				9 = { add_maimed_trait_effect = yes }
				1 = { death = { death_reason = death_accident } }
			}
		}
		else_if = {
			limit = { martial < 20 }

			random_list = {
				65 = { }

				10 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				10 = { change_martial = 1 }
				10 = { add_trait_wounded_effect = yes }
				5 = { add_maimed_trait_effect = yes }
			}
		}
		else = {
			random_list = {
				80 = { }

				13 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				5 = { add_trait_wounded_effect = yes }
				2 = { add_maimed_trait_effect = yes }
			}
		}

		custom_tooltip = { text = hunt_killed_boar }

		prestige = 10
		set_character_flag = hunt_killed_something
	}
}

# Bear
character_event = {
	id = 36020
	desc = EVTDESC36020
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36020

		trigger = {
			NOT = {	trait = craven }
		}

		prestige = 5
	}

	option = {
		name = EVTOPTB36020

		trigger = {
			NOT = {	trait = craven }
		}

		if = {
			limit = { martial < 10 }

			random_list = {
				30 = { }

				20 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				20 = { change_martial = 1 }
				20 = { add_trait_wounded_effect = yes }
				9 = { add_maimed_trait_effect = yes }
				1 = { death = { death_reason = death_accident } }
			}
		}
		else_if = {
			limit = { martial < 20 }

			random_list = {
				65 = { }

				10 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				10 = { change_martial = 1 }
				10 = { add_trait_wounded_effect = yes }
				5 = { add_maimed_trait_effect = yes }
			}
		}
		else = {
			random_list = {
				80 = { }

				13 = {
					if = {
						limit = { trait = diligent }
						prestige = 10
					}
					else = {
						add_trait_fully_diligent_effect = yes
					}
				}

				5 = { add_trait_wounded_effect = yes }
				2 = { add_maimed_trait_effect = yes }
			}
		}

		custom_tooltip = { text = hunt_killed_bear }

		add_blood_splatter_effect = yes
		set_character_flag = hunt_killed_something
		prestige = 10
	}

	option = {
		name = EVTOPTC36020
		tooltip_info = craven

		trigger = { trait = craven }

		random_courtier = {
			show_scope_change = no

			limit = {
				martial >= 10
				is_abroad = no
				prisoner = no
				in_command_trigger = no
				is_incapable = no
				health_traits == 0

				trigger_if = {
					limit = { is_female = yes }

					OR = {
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}
			}

			opinion = {
				name = craven_neg
				who = ROOT
				years = 2
			}
		}
	}
}

# Hound
character_event = {
	id = 36025
	desc = EVTDESC36025
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36025

		set_character_flag = hunt_good_hounds
		prestige = 10

		if = {
			limit = {
				trigger_if = {
					limit = { is_female = yes }

					OR = {
						trait = martial_lady
						trait = martial_lady_pagan
						trait = martial_lady_tengri
					}
				}
			}

			random = {
				chance = 15
				add_trait_wounded_effect = yes
			}
		}
		else = {
			random_courtier = {
				show_scope_change = no

				limit = {
					is_female = no
					prisoner = no
					is_adult = yes
					in_command_trigger = no
					is_abroad = no
					is_incapable = no
					health_traits == 0
				}

				random_list = {
					60 = { prestige = 10 }
					27 = { add_trait_wounded_effect = yes }
					10 = { add_maimed_trait_effect = yes }
					3 = { death = { death_reason = death_accident } }
				}
			}
		}
	}

	option = {
		name = EVTOPTC36025

		set_character_flag = hunt_good_hounds
		prestige = 10

		random = {
			chance = 25

			character_event = {
				id = 36026
				days = 1
				random = 2
				tooltip = EVTTOOLTIP36026
			}
		}
	}

	option = {
		name = EVTOPTD36025

		prestige = -10
	}
}

character_event = {
	id = 36026
	desc = EVTDESC36026
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36026

		wealth = -15
		prestige = -10
	}

	option = {
		name = EVTOPTB36026

		piety = -50
		add_trait_fully_silently_cruel_effect = yes
	}
}

# Horse
character_event = {
	id = 36030
	desc = EVTDESC36030
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36030

		trigger = {
			NOT = { trait = slothful }
		}

		piety = 10
	}

	option = {
		name = EVTOPTB36030
		tooltip_info = slothful

		trigger = { trait = slothful }

		piety = -10
	}
}

# Hare
character_event = {
	id = 36035
	desc = EVTDESC36035
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36035

		prestige = 5
	}
}

# Low martial guy, inability to kill something
character_event = {
	id = 36040
	desc = EVTDESC36040
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36040

		trigger = {
			NOT = { trait = proud }
		}

		prestige = -20
	}

	option = {
		name = EVTOPTB36040

		set_character_flag = hunt_killed_something

		any_courtier = {
			show_scope_change = no

			limit = {
				is_adult = yes
				is_female = no
				martial >= 8
				is_abroad = no
				is_incapable = no
				health_traits == 0
				in_command_trigger = no
			}

			score_value = {
				value = 10
				interesting_courtier_selection_score = yes
			}

			opinion = {
				name = opinion_disgruntled
				who = ROOT
				years = 10
			}
		}

		prestige = -10
	}
}

# High Martial, Overconfidence
character_event = {
	id = 36045
	desc = EVTDESC36045
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36045

		random_list = {
			50 = { }

			10 = {
				if = {
					limit = { trait = diligent }
					prestige = 10
				}
				else = {
					add_trait_fully_diligent_effect = yes
				}
			}

			25 = { add_trait_wounded_effect = yes }
			10 = { add_maimed_trait_effect = yes }
			5 = { death = { death_reason = death_accident } }
		}

		custom_tooltip = { text = hunt_killed_wolf }

		set_character_flag = hunt_killed_something
		prestige = 20

		ai_chance = {
			factor = 50

			mult_modifier = {
				factor = 0.1
				trait = craven
			}
		}
	}

	option = {
		name = EVTOPTB36045

		add_trait_fully_craven_effect = yes

		ai_chance = {
			factor = 50

			trigger = {
				is_dumb_trigger = no

				NOR = {
					trait = brave
					trait = proud
				}
			}
		}
	}
}

# Courtier/vassal with hunter trait kills something
character_event = {
	id = 36050
	desc = EVTDESC36050
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA36050

		ai_chance = {
			factor = 20

			trigger = {
				NOR = {
					trait = content
					trait = humble
				}
			}
		}

		prestige = 5

		random = {
			chance = 20

			liege = {
				character_event = { id = 36051 }
			}
		}
	}

	option = {
		name = EVTOPTB36050

		ai_chance = {
			factor = 20

			trigger = {
				NOR = {
					trait = ambitious
					trait = proud
				}
			}
		}

		liege = {
			character_event = { id = 36052 }
		}
	}
}

character_event = {
	id = 36051
	desc = EVTDESC36051
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36051

		FROM = {
			show_scope_change = no

			imprison = ROOT
		}

		prestige = -5
	}

	option = {
		name = EVTOPTB36051

		piety = 5
	}
}

character_event = {
	id = 36052
	desc = EVTDESC36052
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA36052

		set_character_flag = hunt_killed_something
		prestige = 5

		FROM = {
			show_scope_change = no

			opinion = {
				name = opinion_proud
				who = ROOT
				years = 10
			}
		}
	}
}

# Hunt begins
character_event = {
	id = 36080
	desc = EVTDESC36080
	picture = GFX_evt_hunt

	is_triggered_only = yes # hold_grand_hunt, minor_decisions.txt

	only_playable = yes
	has_character_flag = planning_grand_hunt
	prisoner = no
	min_age = 16
	only_capable = yes
	war = no

	trigger = {
		month >= 8
		month < 10
	}

	fail_trigger_effect = {
		if = {
			limit = {
				is_playable = yes
				has_character_flag = planning_grand_hunt
			}

			# Try again later
			repeat_event = {
				id = 36080
				days = 30
			}
		}
	}

	immediate = {
		add_character_modifier = {
			name = holding_grand_hunt
			duration = -1
		}

		add_character_modifier = {
			name = do_not_disturb
			days = 60
			hidden = yes
		}

		set_character_flag = hunt_begin
		set_character_flag = held_recent_hunt
		clr_character_flag = planning_grand_hunt

		character_event = {
			id = 36999 # Safety catch flag clearing
			days = 150
		}

		character_event = {
			id = 36090 # Hunt begins
			days = 60
			random = 10
		}

		if = {
			limit = { has_character_flag = epic_hunt }

			if = {
				limit = {
					capital_scope = {
						OR = {
							region = world_europe_south
							region = world_europe_west
							region = world_asia_minor
						}
					}
				}
				set_character_flag = white_stag
			}

			else_if = {
				limit = {
					capital_scope = {
						OR = {
							region = world_europe_north
							region = world_europe_east
							region = world_steppe
						}
					}
				}
				set_character_flag = white_bear
			}

			else_if = {
				limit = {
					capital_scope = {
						OR = {
							region = world_india
							region = world_persia
						}
					}
				}
				set_character_flag = white_tiger
			}

			else_if = {
				limit = {
					capital_scope = {
						OR = {
							region = world_middle_east
							region = world_africa
						}
					}
				}
				set_character_flag = white_lion
			}
		}
	}

	option = {
		name = EVTOPTA36080

		if = {
			limit = { NOT = { has_character_flag = epic_hunt } }

			clr_character_flag = white_stag
			clr_character_flag = white_bear
			clr_character_flag = white_tiger
			clr_character_flag = white_lion
		}

		any_vassal = {
			limit = { num_of_rivals > 0 }

			random = {
				chance = 10

				character_event = {
					id = 100510 # THIS tries to wound rival during hunt
					days = 10
					random = 40
				}
			}
		}
	}
}

character_event = {
	id = 36088

	is_triggered_only = yes # on_war_started
	hide_window = yes

	immediate = {
		ROOT = {
			if = {
				limit = {
					OR = {
						has_character_modifier = holding_grand_hunt
						has_character_flag = planning_grand_hunt
					}
				}

				character_event = { id = 36089 }
			}
		}

		FROM = {
			if = {
				limit = {
					OR = {
						has_character_modifier = holding_grand_hunt
						has_character_flag = planning_grand_hunt
					}
				}

				character_event = { id = 36089 }
			}
		}
	}
}

# End if we go to war
character_event = {
	id = 36089
	desc = EVTDESC36089
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		remove_do_not_disturb_effect = yes
		remove_character_modifier = holding_grand_hunt
		clr_character_flag = planning_grand_hunt
		clr_character_flag = hunt_paranoia
		clr_character_flag = hunt_good_hounds
		clr_character_flag = hunt_killed_something
		clr_character_flag = hunt_event_happened
		clr_character_flag = hunt_begin
		clr_character_flag = female_hunt_begin
		clr_character_flag = made_hunt_friend
		clr_character_flag = made_hunt_rival
	}

	option = {
		name = EVTOPTA36089
	}
}

# Normal end
character_event = {
	id = 36090
	desc = EVTDESC36090
	picture = GFX_evt_hunt

	is_triggered_only = yes

	trigger = {
		has_character_modifier = holding_grand_hunt
	}

	immediate = {
		remove_do_not_disturb_effect = yes
		remove_character_modifier = holding_grand_hunt
		clr_character_flag = hunt_paranoia
		clr_character_flag = hunt_good_hounds
		clr_character_flag = hunt_killed_something
		clr_character_flag = do_not_disturb
		clr_character_flag = hunt_event_happened
		clr_character_flag = hunt_begin
		clr_character_flag = female_hunt_begin
		clr_character_flag = made_hunt_friend
		clr_character_flag = made_hunt_rival

		change_variable = {
			which = lifestyle_martial
			value = 1
		}
	}

	option = {
		name = EVTOPTA36090

		prestige = 10
	}
}

# Deer Park
character_event = {
	id = 4075
	desc = EVTDESC4075
	picture = GFX_evt_hunt

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened

		any_vassal = {
			limit = {
				is_adult = yes

				trigger_if = {
					limit = { is_abroad = yes }
					at_location = ROOT
				}

				trigger_if = {
					limit = { trait = slothful }
					trait = ambitious
				}

				prisoner = no
				is_incapable = no
				war = no
				in_command_trigger = no
			}

			score_value = {
				value = 10
				interesting_courtier_selection_score = yes
			}

			save_event_target_as = target_vassal
		}
	}

	option = {
		name = EVTOPTA4075

		trigger = {
			NOR = {
				trait = greedy
				trait = content
			}
		}

		event_target:target_vassal = {
			show_scope_change = no

			opinion = {
				name = opinion_irritated
				who = ROOT
				years = 10
			}
		}
	}

	option = {
		name = EVTOPTB4075

		trigger = {
			NOR = {
				trait = greedy
				trait = content
			}
		}

		wealth = -10

		event_target:target_vassal = {
			show_scope_change = no

			opinion = {
				name = opinion_happy
				who = ROOT
				years = 10
			}
		}
	}

	option = {
		name = EVTOPTC4075

		trigger = {
			OR = {
				trait = greedy
				trait = content
			}
		}

		event_target:target_vassal = {
			show_scope_change = no

			opinion = {
				name = content_neg
				who = ROOT
				years = 10
			}
		}
	}
}

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

# Safety catch - clears character flags and modifiers
character_event = {
	id = 36999

	hide_window = yes
	is_triggered_only = yes

	immediate = {
		remove_character_modifier = holding_grand_hunt
		clr_character_flag = hunt_paranoia
		clr_character_flag = hunt_good_hounds
		clr_character_flag = hunt_killed_something
		clr_character_flag = do_not_disturb
		clr_character_flag = hunt_event_happened
		clr_character_flag = hunt_begin
		clr_character_flag = female_hunt_begin
		clr_character_flag = made_hunt_friend
		clr_character_flag = made_hunt_rival
	}
}

namespace = WoL

# During normal hunt, gets glimpse of legendary animal
narrative_event = {
	id = WoL.5007
	title = EVTTITLE_WoL_5001
	picture = GFX_evt_mysterious_forest
	border = GFX_event_narrative_frame_war


	desc = {
		text = EVTDESC_WoL_5007_fearsome
		trigger = {
			OR = {
				has_character_flag = white_bear
				has_character_flag = white_tiger
			}
		}
	}

	desc = {
		text = EVTDESC_WoL_5007_majestic
		trigger = {
			OR = {
				has_character_flag = white_lion
				has_character_flag = white_stag
			}
		}
	}

	is_triggered_only = yes

	has_dlc = "Way of Life"

	immediate = {
		set_character_flag = hunt_event_happened
		set_character_flag = epic_hunt

		if = {
			limit = {
				capital_scope = {
					OR = {
						region = world_europe_south
						region = world_europe_west
						region = world_asia_minor
					}
				}
			}
			set_character_flag = white_stag
		}
		else_if = {
			limit = {
				capital_scope = {
					OR = {
						region = world_europe_north
						region = world_europe_east
						region = world_steppe
						region = world_himalayas
					}
				}
			}
			set_character_flag = white_bear
		}
		else_if = {
			limit = {
				capital_scope = {
					OR = {
						region = world_india
						region = world_persia
					}
				}
			}
			set_character_flag = white_tiger
		}
		else_if = {
			limit = {
				capital_scope = {
					OR = {
						region = world_middle_east
						region = world_africa
					}
				}
			}
			set_character_flag = white_lion
		}
	}

	option = {
		name = EVTOPTA_WoL_5001

		character_event = {
			id = WoL.5004 # Investigate
			days = 50
			random = 150
		}
	}

	option = {
		name = EVTOPTB_WoL_5001

		trigger = {
			NOT = { trait = hunter }
		}

		clr_character_flag = epic_hunt # Not interested
	}
}

namespace = HL

# Wolves appear and run beside you
character_event = {
	id = HL.1100
	title = EVTTITLE_HL_1100
	desc = EVTDESC_HL_1100
	picture = GFX_evt_wolf
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	immediate = {
		set_character_flag = hunt_event_happened
	}

	option = {
		name = EVTOPTA_HL_1100

		add_character_modifier = {
			name = good_times
			years = 2
		}
	}
}

### ROOT tries to wound rival during hunt ###
# CleanSlate: Moved here from base_friends_rivals_events.txt. No longer fires on_yearly_pulse
character_event = {
	id = 100510
	desc = EVTDESC100510
	picture = GFX_evt_hunt

	is_triggered_only = yes

	only_rulers = yes
	rivals = yes
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		independent = no
		in_command_trigger = no
		is_inaccessible_trigger = no

		NOR = {
			has_character_modifier = holding_grand_hunt
			has_character_modifier = hunting_rival_timer
		}

		liege = {
			has_character_modifier = holding_grand_hunt
			war = no
			in_command_trigger = no
			is_abroad = no
		}

		any_rival = {
			same_liege = ROOT
			independent = no
			can_be_maimed_trigger = yes
			war = no
			in_command_trigger = no
			block_general_event_trigger = no

			NOR = {
				trait = wounded
				has_character_modifier = holding_grand_hunt
			}
		}
	}

	immediate = {
		add_character_modifier = {
			name = hunting_rival_timer
			days = 2000
			hidden = yes
		}

		random_rival = {
			limit = {
				same_liege = ROOT
				independent = no
				can_be_maimed_trigger = yes
				war = no
				in_command_trigger = no
				block_general_event_trigger = no

				NOR = {
					trait = wounded
					has_character_modifier = holding_grand_hunt
				}
			}

			save_event_target_as = target_rival
		}
	}

	option = {
		name = EVTOPTA100510

		event_target:target_rival = {
			show_scope_change = no

			random_list = {
				65 = {
					character_event = {
						id = 100511
						days = 7
						random = 7
					}
				}

				20 = {
					add_trait = wounded
					character_event = { id = 100511 }
				}

				10 = {
					add_maimed_trait_effect = yes
					character_event = { id = 100511 }
				}

				5 = {
					set_character_flag = rival_killed_me

					tooltip = {
						death = { death_reason = death_accident_arrow }
					}

					character_event = { id = 100511 }
				}
			}
		}
	}

	option = {
		name = EVTOPTB100510

		trigger = {
			martial < 10
			scaled_wealth = 0.5

			any_courtier = {
				martial >= 15
				is_female = no
				war = no
				in_command_trigger = no
				is_abroad = no
			}
		}

		random_courtier = {
			show_scope_change = no

			limit = {
				martial >= 15
				is_female = no
				war = no
				in_command_trigger = no
				is_abroad = no
			}

			transfer_scaled_wealth = {
				from = ROOT
				value = 0.25
			}

			custom_tooltip = { text = EVTTOOLTIP100511 }
		}

		event_target:target_rival = {
			show_scope_change = no

			random_list = {
				40 = { }
				30 = { add_trait = wounded }
				20 = { add_maimed_trait_effect = yes }

				10 = {
					set_character_flag = rival_killed_me

					tooltip = {
						death = { death_reason = death_accident_arrow }
					}
				}
			}

			character_event = { id = 100511 }
		}
	}

	option = {
		name = EVTOPTC100510

		random = {
			chance = 10

			character_event = {
				id = 36010 # Deer Hunter, The White Hart, hunting_events.txt
				days = 2
				random = 8
				tooltip = EVTTOOLTIP36010
			}
		}
	}
}

# Rival is wounded/maimed/killed
character_event = {
	id = 100511
	desc = EVTDESC100511
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA100511
		tooltip_info = wounded

		trigger = { trait = wounded }

		if = {
			limit = { intrigue >= 10 }

			opinion = {
				name = opinion_revenge_seeker
				who = FROM
				years = 10
			}

			custom_tooltip = { text = EVTTOOLTIPA100512 }
		}

		FROM = {
			character_event = {
				id = 100512
				days = 7
				random = 7
			}
		}
	}

	option = {
		name = EVTOPTB100511
		tooltip_info = maimed

		trigger = { is_maimed_trigger = yes }

		if = {
			limit = { intrigue >= 10 }

			opinion = {
				name = opinion_revenge_seeker
				who = FROM
				years = 10
			}

			custom_tooltip = { text = EVTTOOLTIPA100512 }
		}

		FROM = {
			character_event = {
				id = 100512
				days = 7
				random = 7
			}
		}
	}

	option = {
		name = EVTOPTC100511

		trigger = { has_character_flag = rival_killed_me }

		death = { death_reason = death_accident_arrow }

		clr_character_flag = rival_killed_me

		FROM = {
			show_scope_change = no

			character_event = {
				id = 100513
				days = 7
				random = 7
				tooltip = EVTTOOLTIPA100512
			}
		}
	}

	option = {
		name = EVTOPTD100511

		trigger = {
			is_maimed_trigger = no

			NOR = {
				trait = wounded
				has_character_flag = rival_killed_me
			}
		}

		if = {
			limit = { intrigue >= 10 }

			opinion = {
				name = opinion_revenge_seeker
				who = FROM
				years = 10
			}

			custom_tooltip = { text = EVTTOOLTIPA100512 }
		}

		FROM = {
			character_event = {
				id = 100512
				days = 7
				random = 7
			}
		}
	}
}

# The arrow missed its target OR wounded/maimed rival
character_event = {
	id = 100512
	desc = EVTDESC100512
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA100512

		trigger = {
			FROM = { trait = wounded }
		}

		prestige = 10
	}

	option = {
		name = EVTOPTB100512

		trigger = {
			FROM = { is_maimed_trigger = yes }
		}

		prestige = 50
	}

	option = {
		name = EVTOPTC100512

		trigger = {
			FROM = {
				is_maimed_trigger = no
				NOT = { trait = wounded }
			}
		}

		prestige = -5
	}
}

# Rival is killed
character_event = {
	id = 100513
	desc = EVTDESC100513
	picture = GFX_evt_hunt

	is_triggered_only = yes

	option = {
		name = EVTOPTA100513

		prestige = 55

		FROM = {
			show_scope_change = no

			random_child = {
				show_scope_change = no

				limit = {
					is_primary_heir = yes
					is_female = no
					practical_age >= 10
					is_abroad = no
				}

				random = {
					chance = 25

					opinion = {
						name = opinion_killed_father
						who = ROOT
						years = 100
					}

					tooltip = {
						add_rival = ROOT
					}

					character_event = {
						id = 100514
						days = 1
						random = 7
						tooltip = EVTTOOLTIP100514
					}
				}
			}
		}
	}
}

# Rival's son swears revenge
character_event = {
	id = 100514
	desc = EVTDESC100514
	picture = GFX_evt_death

	is_triggered_only = yes

	option = {
		name = EVTOPTA100514

		tooltip = {
			opinion = {
				name = opinion_killed_father
				who = FROM
				years = 100
			}
		}

		add_rival = FROM

		opinion = {
			name = grievously_offended
			who = FROM
			years = 10
		}
	}
}