namespace = fp1_yearly

##################################################
# #Standard Yearlies
# 2000 - 2004	A Child wants to run away to marry their beloved
# 2100 - 2101	Two lovers duel for your love
# 2200 - 2204	Berserker rampages though court
# 2300 - 2300	Convince a group of soldiers to join you
# 2400 - 2400	Invest in something that'll aid in your hunts
# 2500 - 2500	What's that deviant up to this time!?
# 2600 - 2601	Become a Berserker
##################################################

# A Child wants to run away to marry their beloved

scripted_trigger suitable_child_to_leave = {
	is_physically_able_adult = yes
	has_personality_introverted_trigger = no
	is_courtier_of = root
	age <= 40
	is_concubine = no
	NOR = {
		has_trait = celibate
		has_trait = chaste
		has_sexuality = asexual
		has_character_modifier = mellowed_spirit
		root = {
			has_strong_hook = prev
		}
	}
	can_be_knight_trigger = {
		ARMY_OWNER = root
	}
}

scripted_trigger suitable_lover_for_child = {
	is_physically_able_adult = yes
	allowed_to_marry_character_gender_trigger = { CHARACTER = scope:child_to_leave }
	scope:child_to_leave = { allowed_to_marry_character_gender_trigger = { CHARACTER = prev } }
	is_physically_able_adult = yes
	age <= 35
	is_married = no
	can_marry_trigger = yes
	is_concubine = no
	is_attracted_to_gender_of = scope:child_to_leave
	OR = {
		can_set_relation_lover_trigger = { CHARACTER = scope:child_to_leave }
		has_relation_lover = scope:child_to_leave
	}
}

scripted_effect child_leaves_effect = {
	hidden_effect = {
		if = {
			limit = {
				is_betrothed = yes
			}
			break_betrothal = betrothed
		}
		scope:lover_of_child = {
			if = {
				limit = {
					is_betrothed = yes
				}
				break_betrothal = scope:lover_of_child.betrothed
			}
		}
	}
	if = {
		limit = {
			scope:lover_of_child = {
				is_alive = yes
			}
			is_married = yes
			exists = scope:child_to_leave.primary_spouse
			NOT = {
				is_spouse_of = scope:lover_of_child
			}
		}
		scope:child_to_leave.primary_spouse = {
			save_scope_as = child_to_leave_divorcee
		}
		less_verbose_divorce_effect = {
			DIVORCER = scope:child_to_leave
			DIVORCEE = scope:child_to_leave_divorcee
		}
	}
	if = {
		limit = {
			scope:child_to_leave = {
				is_alive = yes
			}
			scope:lover_of_child = {
				is_alive = yes
				is_married = yes
				exists = scope:lover_of_child.primary_spouse
				NOT = {
					is_spouse_of = scope:child_to_leave
				}
			}
		}
		hidden_effect = {
			scope:lover_of_child.primary_spouse = {
				save_scope_as = lover_of_child_divorcee
			}
			scope:lover_of_child = {
				less_verbose_divorce_effect = {
					DIVORCER = scope:lover_of_child
					DIVORCEE = scope:lover_of_child_divorcee
				}
			}
		}
	}
	if = {
		limit = {
			is_female = yes
			is_lowborn = no
			scope:lover_of_child = {
				is_lowborn = yes
			}
		}
		marry_matrilineal = scope:lover_of_child
	}
	else_if = {
		limit = {
			is_male = yes
			is_lowborn = yes
			scope:lover_of_child = {
				is_lowborn = no
			}
		}
		marry_matrilineal = scope:lover_of_child
	}
	else = {
		marry = scope:lover_of_child
	}
	move_to_pool_at = scope:somewhere_else
	hidden_effect = {
		scope:lover_of_child = {
			move_to_pool_at = scope:somewhere_else
		}
	}
	scope:parent = {
		if = {
			limit = {
				has_hook = scope:child_to_leave
			}
			remove_hook = {
				target = scope:child_to_leave
			}
		}
	}
	add_character_modifier = {
		modifier = lust_for_adventure
		years = 20
	}
}

# A Child wants to run away to marry their beloved
fp1_yearly.2000 = {
	type = character_event
	title = fp1_yearly.2000.t
	desc = fp1_yearly.2000.desc
	theme = family
	left_portrait = {
		character = scope:child_to_leave
		animation = personality_bold
	}
	right_portrait = {
		character = scope:lover_of_child
		animation = flirtation
	}
	override_background = { reference = market }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2000 }
		is_landed_or_landless_administrative = yes

		any_child = {
			suitable_child_to_leave = yes
			save_temporary_scope_as = child_to_leave
		}
		any_pool_character = {
			province = root.capital_province
			suitable_lover_for_child = yes
		}

	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_2000
			days = 1825
		}
		random_child = {
			limit = {
				suitable_child_to_leave = yes
				has_personality_dominant_trigger = yes
				is_primary_heir_of = root
			}
			alternative_limit = {
				suitable_child_to_leave = yes
				has_personality_dominant_trigger = yes
			}
			alternative_limit = {
				suitable_child_to_leave = yes
			}
			save_scope_as = child_to_leave
		}
		random_pool_character = {
			province = root.capital_province
			limit = {
				suitable_lover_for_child = yes
			}
			if = {
				limit = {
					NOT = {
						has_relation_lover = scope:child_to_leave
					}
				}
				hidden_effect = {
					set_random_lover_reason = { TARGET = scope:child_to_leave }
				}
			}
			save_scope_as = lover_of_child
		}
		random_independent_ruler = {
			limit = {
				is_landed_or_landless_administrative = yes
				in_diplomatic_range = root
			}
			capital_province = {
				save_scope_as = somewhere_else
			}
		}
		save_scope_as = parent
	}

	option = { # Fight them to make them stay
		name = fp1_yearly.2000.a
		
		trigger = {
			can_start_single_combat_trigger = yes
			scope:child_to_leave = {
				can_start_single_combat_trigger = yes
			}
		}
		custom_tooltip = fp1_yearly.2000.a.tt
		
		configure_start_single_combat_effect = {
			SC_INITIATOR = scope:parent
			SC_ATTACKER = scope:parent
			SC_DEFENDER = scope:child_to_leave
			FATALITY = no
			FIXED = no
			LOCALE = terrain_scope
			OUTPUT_EVENT = fp1_yearly.2001
			INVALIDATION_EVENT = fp1_yearly.2002
		}

		stress_impact = {
			craven = major_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			temperate = minor_stress_impact_gain
			generous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 2
				prowess > scope:child_to_leave.prowess
			}
			
			modifier = {
				factor = 0.1
				ai_compassion >= medium_positive_ai_value
			}
			
			modifier = {
				factor = 0
				OR = {
					has_trait = craven
					has_trait = forgiving
					has_trait = calm
				}
			}
		}
	}

	option = { # Remind them of their duties
		name = fp1_yearly.2000.b

		stress_impact = {
			impatient = major_stress_impact_gain
			wrathful = major_stress_impact_gain
			arrogant = medium_stress_impact_gain
			fickle = medium_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		
		duel = {
			skill = diplomacy
			value = scope:child_to_leave.diplomacy

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = fp1_yearly.2000.b.success
				send_interface_toast = {
					title = fp1_yearly.2000.b.success
					left_icon = scope:child_to_leave


					add_prestige = medium_prestige_gain
					
					scope:child_to_leave = {
						custom_tooltip = fp1_yearly.2000.b.tt
						add_character_modifier = {
							modifier = mellowed_spirit
							years = 20
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = fp1_yearly.2000.b.failure
				send_interface_toast = {
					title = fp1_yearly.2000.b.failure
					left_icon = scope:child_to_leave

					add_prestige = major_prestige_loss
					
					scope:child_to_leave = {
						child_leaves_effect = yes
					}
				}
			}
		}
		
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 2
				diplomacy > scope:child_to_leave.diplomacy
			}
			
			modifier = {
				factor = 0
				OR = {
					has_trait = craven
					has_trait = forgiving
					has_trait = calm
				}
			}
		}
	}

	option = { # Bribe them
		name = fp1_yearly.2000.c

		stress_impact = {
			greedy = major_stress_impact_gain
			wrathful = major_stress_impact_gain
			arrogant = medium_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
			
		custom_tooltip = fp1_yearly.2000.c.tt
		pay_short_term_gold = {
			target = scope:child_to_leave
			gold = minor_gold_value
		}
		
		add_prestige = minor_prestige_loss
		
		
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 0
				has_trait = greedy
			}
		}
	}

	option = { # Let them go, the fool...
		name = fp1_yearly.2000.d

		stress_impact = {
			arrogant = medium_stress_impact_gain
			stubborn = major_stress_impact_gain
			wrathful = major_stress_impact_gain
			vengeful = medium_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
		custom_tooltip = fp1_yearly.2000.d.tt
		
		add_prestige = medium_prestige_loss
		
		scope:child_to_leave = {
			child_leaves_effect = yes
		}
		
		ai_chance = {
			base = 100
			
			modifier = {
				factor = 2
				ai_compassion >= medium_positive_ai_value
			}
			
			modifier = {
				factor = 0
				OR = {
					has_trait = stubborn
					has_trait = wrathful
				}
			}
		}
	}
}

fp1_yearly.2001 = {
	hidden = yes

	immediate = {
		if = {
			limit = {
				scope:parent = scope:sc_victor
			}
			trigger_event = { id = fp1_yearly.2003 days = 1 }
		}
		else = {
			trigger_event = { id = fp1_yearly.2004 days = 1 }
		}
	}
}

#	Bout has invalidated, inform affected parties.
fp1_yearly.2002 = {
	hidden = yes

	immediate = {
		# Inform both parties that the duel has invalidated.
		scope:parent = {
			send_interface_toast = {	
				title = fp1_yearly.2000.trigger_failure
				left_icon = scope:child_to_leave
			}
		}
	}
}

# Beat child in combat
fp1_yearly.2003 = {
	type = character_event
	title = fp1_yearly.2003.t
	desc = fp1_yearly.2003.desc
	theme = family
	left_portrait = {
		character = scope:child_to_leave
		animation = pain
	}
	right_portrait = {
		character = scope:lover_of_child
		animation = disapproval
	}
	override_background = { reference = market_tribal }

	trigger = {

	}

	immediate = {
		
	}

	option = { # Father/Mother knows best!
		name = fp1_yearly.2003.a
		
		add_prestige = medium_prestige_gain
		scope:child_to_leave = {
			add_character_modifier = {
				modifier = mellowed_spirit
				years = 20
			}
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = { # Break it off!
		name = fp1_yearly.2003.b
		
		add_prestige = medium_prestige_gain
		
		scope:child_to_leave = {
			add_character_modifier = {
				modifier = mellowed_spirit
				years = 20
			}
			remove_relation_lover = scope:lover_of_child
		}
		
		ai_chance = {
			base = 100
		}
	}
}

# Beaten by child in combat
fp1_yearly.2004 = {
	type = character_event
	title = fp1_yearly.2004.t
	desc = fp1_yearly.2004.desc
	theme = family
	left_portrait = {
		character = scope:child_to_leave
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:lover_of_child
		animation = ecstasy
	}
	override_background = { reference = market_tribal }

	trigger = {

	}

	immediate = {
		
	}

	option = { # Ouch...
		name = fp1_yearly.2004.a
		
		pay_short_term_gold = {
			target = scope:child_to_leave
			gold = minor_gold_value
		}
		
		add_prestige = medium_prestige_loss
		
		scope:child_to_leave = {
			child_leaves_effect = yes
		}
		
		ai_chance = {
			base = 100
		}
	}
}

scripted_trigger fighting_lover_trigger = {
	is_ai = yes
	has_personality_introverted_trigger = no
	is_physically_able_adult = yes
	NOT = {
		any_consort = {
			is_ai = no
			this != root
		}
	}
	OR = {
		is_ruler = no
		top_liege = root.top_liege
	}
}

# Two lovers duel for your love
fp1_yearly.2100 = {
	type = character_event
	title = fp1_yearly.2100.t
	desc = fp1_yearly.2100.desc
	theme = seduction
	left_portrait = {
		character = scope:lover_2
		animation = aggressive_sword
	}
	right_portrait = {
		character = scope:lover_1
		animation = rage
	}
	override_background = { reference = market }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2100 }
		is_playable_character = yes
		
		# You need two lovers
		any_relation = {
			type = lover
			fighting_lover_trigger = yes
			count >= 2
		}
		
		# Only one needs to be of a fighty culture
		any_relation = {
			type = lover
			fighting_lover_trigger = yes
			basic_can_have_trial_by_combat_trigger = yes
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_2100
			days = 1825
		}
		
		random_relation = {
			type = lover
			limit = {
				fighting_lover_trigger = yes
			}
			save_scope_as = lover_2
			set_signature_weapon_effect = yes
		}
		
		random_relation = {
			type = lover
			limit = {
				fighting_lover_trigger = yes
				this != scope:lover_2
			}
			save_scope_as = lover_1
			set_signature_weapon_effect = yes
		}
		
		save_scope_as = lover_quarrel_target
			
		hidden_effect = {
			scope:lover_1 = {
				if = {
					limit = {
						any_known_secret = {
							secret_type = secret_lover
							secret_target = scope:lover_quarrel_target
							NOT = { is_known_by = scope:lover_2 }
						}
					}
					
					random_known_secret = {
						limit = {
							secret_type = secret_lover
							secret_target = scope:lover_quarrel_target
							NOT = { is_known_by = scope:lover_2 }
						}
						save_scope_as = secret
						reveal_to_without_events_effect = {
							CHARACTER = scope:lover_2
						}
					}
				}
			}
			
			scope:lover_2 = {
				if = {
					limit = {
						any_known_secret = {
							secret_type = secret_lover
							secret_target = scope:lover_quarrel_target
							NOT = { is_known_by = scope:lover_1 }
						}
					}
					
					random_known_secret = {
						limit = {
							secret_type = secret_lover
							secret_target = scope:lover_quarrel_target
							NOT = { is_known_by = scope:lover_1 }
						}
						save_scope_as = secret
						reveal_to_without_events_effect = {
							CHARACTER = scope:lover_1
						}
					}
				}
				if = {
					limit = {
						has_relation_friend = scope:lover_1
					}
					remove_relation_friend = scope:lover_1
				}
				else_if = {
					limit = {
						has_relation_best_friend = scope:lover_1
					}
					remove_relation_best_friend = scope:lover_1
				}
				if = {
					limit = {
						NOR = {
							has_relation_rival = scope:lover_1
							has_relation_nemesis = scope:lover_1
						}
					}
					if = {
						limit = {
							can_set_relation_nemesis_trigger = { CHARACTER = scope:lover_1 }
						}
						set_relation_nemesis = {
							target = scope:lover_1
							reason = rival_competing_lovers
						}
					}
					else = {
						set_relation_rival = {
							target = scope:lover_1
							reason = rival_competing_lovers
						}
					}
				}
			}
		}
	}

	option = {
		name = fp1_yearly.2100.a
		
		custom_tooltip = fp1_yearly.2100.a.tt
		
		configure_start_single_combat_effect = {
			SC_INITIATOR = scope:lover_quarrel_target
			SC_ATTACKER = scope:lover_1
			SC_DEFENDER = scope:lover_2
			FATALITY = always
			FIXED = no
			LOCALE = terrain_scope
			INVALIDATION_EVENT = fp1_yearly.2002
			OUTPUT_EVENT = fp1_yearly.2101
		}

		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
			calm = medium_stress_impact_gain
			content = medium_stress_impact_gain
			just = medium_stress_impact_gain
			humble = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -1
			}
		}
	}

	option = {
		name = fp1_yearly.2100.b
		
		duel = {
			skill = diplomacy
			value = 12

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = fp1_yearly.2100.b.success
				send_interface_toast = {
					title = fp1_yearly.2100.b.success
					left_icon = scope:child_to_leave
					
					custom_tooltip = fp1_yearly.2100.b.tt
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = fp1_yearly.2100.b.failure
				send_interface_toast = {
					title = fp1_yearly.2100.b.failure
					left_icon = scope:lover_1
					right_icon = scope:lover_2

					custom_tooltip = fp1_yearly.2100.a.tt
		
					configure_start_single_combat_effect = {
						SC_INITIATOR = scope:lover_quarrel_target
						SC_ATTACKER = scope:lover_1
						SC_DEFENDER = scope:lover_2
						FATALITY = always
						FIXED = no
						LOCALE = terrain_scope
						INVALIDATION_EVENT = fp1_yearly.2002
						OUTPUT_EVENT = fp1_yearly.2101
					}
				}
			}
		}

		stress_impact = {
			arrogant = major_stress_impact_gain
			sadistic = major_stress_impact_gain
			callous = medium_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			fickle = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
				ai_rationality = 0.5
			}
		}
	}

	option = {
		name = fp1_yearly.2100.c
		
		duel = {
			skill = prowess
			value = {
				add = scope:lover_1.prowess
				add = scope:lover_2.prowess
				divide = 2
			}

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				desc = fp1_yearly.2100.c.success
				send_interface_toast = {
					title = fp1_yearly.2100.c.success
					left_icon = scope:child_to_leave
					
					custom_tooltip = fp1_yearly.2100.c.tt
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = fp1_yearly.2100.c.failure
				send_interface_toast = {
					title = fp1_yearly.2100.c.failure
					left_icon = scope:lover_1
					right_icon = scope:lover_2

					custom_tooltip = fp1_yearly.2100.a.tt
		
					configure_start_single_combat_effect = {
						SC_INITIATOR = scope:lover_quarrel_target
						SC_ATTACKER = scope:lover_1
						SC_DEFENDER = scope:lover_2
						FATALITY = always
						FIXED = no
						LOCALE = terrain_scope
						INVALIDATION_EVENT = fp1_yearly.2002
						OUTPUT_EVENT = fp1_yearly.2101
					}
				}
			}
		}

		stress_impact = {
			craven = major_stress_impact_gain
			arrogant = minor_stress_impact_gain
			sadistic = major_stress_impact_gain
			callous = medium_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			fickle = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
				ai_rationality = 0.5
			}
		}
	}
}

fp1_yearly.2101 = {
	type = character_event
	title = fp1_yearly.2101.t
	desc = fp1_yearly.2101.desc
	theme = seduction
	left_portrait = {
		character = scope:lover_1
		triggered_animation = {
			trigger = { is_alive = yes }
			animation = flirtation
		}
		triggered_animation = {
			trigger = { is_alive = no }
			animation = shock
		}
	}
	right_portrait = {
		character = scope:lover_2
		triggered_animation = {
			trigger = { is_alive = yes }
			animation = flirtation
		}
		triggered_animation = {
			trigger = { is_alive = no }
			animation = shock
		}
	}
	override_background = { reference = market_tribal }

	immediate = {
		if = {
			limit = {
				scope:lover_1 = {
					is_alive = yes
				}
			}
			scope:lover_1 = {
				save_scope_as = winning_lover
			}
			scope:lover_2 = {
				save_scope_as = losing_lover
			}
		}
		else = {
			scope:lover_2 = {
				save_scope_as = winning_lover
			}
			scope:lover_1 = {
				save_scope_as = losing_lover
			}
		}
	}

	option = {
		name = fp1_yearly.2101.a
		
		if = {
			limit = {
				num_of_relation_soulmate <= 0
			}
			hidden_effect = {
				scope:winning_lover = {
					every_relation = {
						type = soulmate
						remove_relation_soulmate = scope:winning_lover
					}
				}
			}
			set_relation_soulmate = { reason = soulmate_won_love_in_duel_2 copy_reason = lover target = scope:winning_lover }
		}
		else = {
			scope:winning_lover = {
				add_opinion = {
					target = scope:lover_quarrel_target
					modifier = love_opinion
					opinion = 30
				}
			}
		}
		
		had_sex_with_effect = {
			CHARACTER = scope:winning_lover
			PREGNANCY_CHANCE = pregnancy_chance
		}
		
		stress_impact = {
			forgiving = major_stress_impact_gain
			compassionate = major_stress_impact_gain
			humble = major_stress_impact_gain
			just = medium_stress_impact_gain
			chaste = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2101.b
		
		remove_relation_lover = scope:winning_lover
		
		scope:winning_lover = {
			add_opinion = {
				target = scope:lover_quarrel_target
				modifier = lover_hurt_me_opinion
				years = 30
			}
		}
		
		add_opinion = {
			target = scope:winning_lover
			modifier = murdered_someone_close_to_me_crime
			years = 30
		}
		
		stress_impact = {
			forgiving = major_stress_impact_gain
			vengeful = major_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
			lustful = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2101.c
		
		scope:winning_lover = {
			add_opinion = {
				target = scope:lover_quarrel_target
				modifier = pleased_opinion
				opinion = 10
			}
		}
		
		stress_impact = {
			forgiving = major_stress_impact_gain
			compassionate = major_stress_impact_gain
			humble = major_stress_impact_gain
			just = medium_stress_impact_gain
			chaste = major_stress_impact_gain
		}
		
		had_sex_with_effect = {
			CHARACTER = scope:winning_lover
			PREGNANCY_CHANCE = pregnancy_chance
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2101.d
		
		scope:winning_lover = {
			add_opinion = {
				target = scope:lover_quarrel_target
				modifier = lover_being_mean_opinion
				years = 10
			}
		}
		
		stress_impact = {
			vengeful = major_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
			lustful = major_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}
}

scripted_effect court_berserkergang_effect = {
	custom_tooltip = fp1_yearly.2200.fail.tt
	hidden_effect = {
		scope:potential_victim = {
			increase_wounds_effect = { REASON = duel }
		}
	}
	add_opinion = {
		target = scope:new_berserker
		modifier = hurt_someone_close_to_me_crime
		years = 30
	}
}

# Berserker rampages though court
fp1_yearly.2200 = {
	type = character_event
	title = fp1_yearly.2200.t
	desc = fp1_yearly.2200.desc
	theme = battle
	left_portrait = {
		character = scope:new_berserker
		animation = rage
	}
	override_background = { reference = market_tribal }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2200 }
		
		is_landed_or_landless_administrative = yes
		
		faith = {
			has_doctrine = tenet_warmonger
		}
		
		OR = {
			culture = { has_cultural_pillar = heritage_north_germanic }
			religion = religion:viaeinherjar
		}
		
		OR = {
			is_ai = no
			number_of_knights < max_number_of_knights
		}
		
		any_courtier = {
			is_of_major_interest_to_root_trigger = yes
			age > 12
		}
	}

	immediate = {
		hidden_effect = {
			add_character_flag = {
				flag = had_event_fp1_yearly_2200
				days = 1825
			}
			
			create_character = {
				gender_female_chance = root_soldier_female_chance
				template = new_berserker_character
				faith = root.faith
				culture = root.culture
				dynasty = none
				location = root.location
				save_scope_as = new_berserker
			}
			
			scope:new_berserker = {
				set_favorite_treat_effect = yes
				random_list = {
					10 = {
						change_current_weight = 150
					}
					10 = {
						change_current_weight = 100
					}
					10 = {
						change_current_weight = 50
					}
				}
				if = {
					limit = {
						has_sexuality = asexual
					}
					random_list = {
						10 = {
							set_sexuality = heterosexual
						}
						10 = {
							set_sexuality = bisexual
						}
						10 = {
							set_sexuality = homosexual
						}
					}
				}
			}
		}
		random_courtier = {
			limit = {
				is_of_major_interest_to_root_trigger = yes
				age > 12
				prowess < scope:new_berserker.prowess
			}
			alternative_limit = {
				is_of_major_interest_to_root_trigger = yes
				age > 12
			}
			save_scope_as = potential_victim
		}
		save_scope_as = potential_employer
	}

	option = {
		name = fp1_yearly.2200.a
		
		trigger = {
			can_start_single_combat_trigger = yes
			scope:new_berserker = {
				can_start_single_combat_trigger = yes
			}
		}
		custom_tooltip = fp1_yearly.2200.a.tt
		
		configure_start_single_combat_effect = {
			SC_INITIATOR = root
			SC_ATTACKER = scope:new_berserker
			SC_DEFENDER = root
			FATALITY = no
			FIXED = no
			LOCALE = market
			OUTPUT_EVENT = fp1_yearly.2201
			INVALIDATION_EVENT = fp1_yearly.2202
		}

		stress_impact = {
			forgiving = medium_stress_impact_gain
			calm = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			humble = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = fp1_yearly.2200.b

		stress_impact = {
			brave = major_stress_impact_gain
			arrogant = medium_stress_impact_gain
			greedy = major_stress_impact_gain
			gluttonous = minor_stress_impact_gain
		}
		
		pay_short_term_gold = {
			target = scope:new_berserker
			gold = minor_gold_value
		}
		
		add_courtier = scope:new_berserker
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_greed = -1
			}
		}
	}

	option = {
		name = fp1_yearly.2200.c
		
		duel = {
			skill = diplomacy
			value = 10

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				

				desc = fp1_yearly.2200.c.success
				send_interface_toast = {
					title = fp1_yearly.2200.c.success
					left_icon = scope:new_berserker

					add_courtier = scope:new_berserker
					add_prestige = minor_prestige_gain
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = fp1_yearly.2200.c.failure
				send_interface_toast = {
					title = fp1_yearly.2200.c.failure
					left_icon = scope:new_berserker
					right_icon = scope:potential_victim

					court_berserkergang_effect = yes
				}
			}
		}

		stress_impact = {
			brave = major_stress_impact_gain
			wrathful = major_stress_impact_gain
			impatient = major_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = fp1_yearly.2200.d
		
		duel = {
			skill = martial
			value = scope:new_berserker.martial

			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				

				desc = fp1_yearly.2200.d.success
				send_interface_toast = {
					title = fp1_yearly.2200.d.success
					left_icon = scope:new_berserker

					scope:new_berserker = {
						death = { death_reason = death_attacked }
					}
					add_prestige = major_prestige_gain
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				desc = fp1_yearly.2200.c.failure
				send_interface_toast = {
					title = fp1_yearly.2200.c.failure
					left_icon = scope:new_berserker
					right_icon = scope:potential_victim

					court_berserkergang_effect = yes
				}
			}
		}

		stress_impact = {
			brave = major_stress_impact_gain
			trusting = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			calm = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
		}
	}
}

fp1_yearly.2201 = {
	hidden = yes

	immediate = {
		if = {
			limit = {
				scope:potential_employer = scope:sc_victor
			}
			trigger_event = { id = fp1_yearly.2203 days = 1 }
		}
		else = {
			trigger_event = { id = fp1_yearly.2204 days = 1 }
		}
	}
}

#	Bout has invalidated, inform affected parties.
fp1_yearly.2202 = {
	hidden = yes

	immediate = {
		# Inform both parties that the duel has invalidated.
		scope:potential_employer = {
			send_interface_toast = {	
				title = fp1_yearly.2200.trigger_failure
				left_icon = scope:new_berserker
			}
		}
	}
}

fp1_yearly.2203 = {
	type = character_event
	title = fp1_yearly.2203.t
	desc = fp1_yearly.2203.desc
	theme = battle
	left_portrait = {
		character = scope:new_berserker
		animation = fear
	}
	override_background = { reference = market_tribal }

	trigger = {
		scope:new_berserker = {
			is_alive = yes
		}
	}

	option = {
		name = fp1_yearly.2203.a
		
		add_dread = major_dread_gain
		add_prestige = medium_prestige_gain
		add_prowess_skill = 2
		
		scope:new_berserker = {
			death = {
				death_reason = death_duel
				killer = scope:potential_employer
			}
		}

		stress_impact = {
			trusting = major_stress_impact_gain
			forgiving = medium_stress_impact_gain
			compassionate = major_stress_impact_gain
			calm = medium_stress_impact_gain
			content = medium_stress_impact_gain
			just = medium_stress_impact_gain
			humble = major_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_honor = -1
			}
			modifier = {
				factor = 0
				prowess < scope:new_berserker.prowess
			}
		}
	}

	option = {
		name = fp1_yearly.2203.b

		stress_impact = {
			arrogant = major_stress_impact_gain
			vengeful = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		
		add_prestige = medium_prestige_gain
		add_prowess_skill = 2
		add_courtier = scope:new_berserker
		set_relation_potential_friend = scope:new_berserker
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2203.c

		stress_impact = {
			arrogant = major_stress_impact_gain
			vengeful = major_stress_impact_gain
			trusting = major_stress_impact_gain
		}
		
		add_prestige = medium_prestige_gain
		add_prowess_skill = 2
		
		ai_chance = {
			base = 0
		}
	}
}

fp1_yearly.2204 = {
	type = character_event
	title = fp1_yearly.2204.t
	desc = fp1_yearly.2204.desc
	theme = battle
	left_portrait = {
		character = scope:new_berserker
		animation = worry
	}
	override_background = { reference = market_tribal }

	trigger = {
		scope:new_berserker = {
			is_alive = yes
		}
	}

	option = {
		name = fp1_yearly.2204.a
		
		add_prestige = medium_prestige_loss
		add_courtier = scope:new_berserker
		set_relation_friend = { reason = friend_rousing_fight target = scope:new_berserker }

		stress_impact = {
			arrogant = major_stress_impact_gain
			vengeful = major_stress_impact_gain
			cynical = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_honor = 1
			}
		}
	}

	option = {
		name = fp1_yearly.2204.b

		stress_impact = {
			trusting = major_stress_impact_gain
			forgiving = major_stress_impact_gain
			humble = major_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		
		add_prestige = medium_prestige_loss
		
		ai_chance = {
			base = 0
		}
	}
}

# Convince a group of soldiers to join you
fp1_yearly.2300 = {
	type = character_event
	title = fp1_yearly.2300.t
	desc = fp1_yearly.2300.desc
	theme = feast_activity
	left_portrait = {
		character = scope:recruiting_character
		animation = personality_rational
	}
	override_background = { reference = tavern }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2300 }
		
		is_landed_or_landless_administrative = yes
		
		any_sub_realm_barony = {
			title_province = {
				is_coastal = yes
			}
		}
	}
	
	weight_multiplier = {
		base = 1
		
		modifier = {
			add = 0.5
			prestige_level > 2
		}
		
		modifier = {
			add = 0.5
			prestige_level > 4
		}
		
		modifier = {
			add = -1
			prestige_level < 0
		}
	}

	immediate = {
		hidden_effect = {
			add_character_flag = {
				flag = had_event_fp1_yearly_2300
				days = 1825
			}
		}
		
		random_sub_realm_barony = {
			limit = {
				title_province = {
					is_coastal = yes
				}
			}
			save_scope_as = tavern_location
		}
		save_scope_as = recruiting_character
	}

	option = {
		name = fp1_yearly.2300.a
		
		flavor = huscarls_tt
		
		remove_short_term_gold = huscarls_gold_value
		
		spawn_army = {
			levies = 25
			men_at_arms = {
				type = huscarl
				men = number_of_huscarls
			}
			location = scope:recruiting_character.capital_province
			inheritable = no
			name = grizzled_veterans
		}
		
		custom_tooltip = MILITARY_VIEW_EVENT_TROOPS_NOT_INHERITABLE

		stress_impact = {
			humble = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
		}
	}

	option = {
		name = fp1_yearly.2300.b
		
		flavor = bondi_tt
		
		remove_short_term_gold = bondi_gold_value
		
		spawn_army = {
			levies = 50
			men_at_arms = {
				type = bondi
				men = number_of_bondi
			}
			location = scope:recruiting_character.capital_province
			inheritable = no
			name = glory_seekers
		}
		
		custom_tooltip = MILITARY_VIEW_EVENT_TROOPS_NOT_INHERITABLE

		stress_impact = {
			humble = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2300.c
		
		add_gold = medium_gold_value

		stress_impact = {
			generous = major_stress_impact_gain
			ambitious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	option = {
		name = fp1_yearly.2300.d
		
		trigger = {
			has_trait = viking
		}
		trait = viking
		
		spawn_army = {
			levies = 25
			men_at_arms = {
				type = huscarl
				men = number_of_huscarls
			}
			location = scope:recruiting_character.capital_province
			inheritable = no
			name = grizzled_veterans
		}
		
		spawn_army = {
			levies = 50
			men_at_arms = {
				type = bondi
				men = number_of_bondi
			}
			location = scope:recruiting_character.capital_province
			inheritable = no
			name = glory_seekers
		}
		
		custom_tooltip = MILITARY_VIEW_EVENT_TROOPS_NOT_INHERITABLE

		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}
}

# Invest in something that'll aid in your hunts
fp1_yearly.2400 = {
	type = character_event
	title = fp1_yearly.2400.t
	desc = fp1_yearly.2400.desc
	theme = hunt_activity
	left_portrait = {
		character = root
		animation = personality_rational 
	}
	override_background = { reference = fp1_runestone }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2400 }
		
		is_landed_or_landless_administrative = yes
		
		NOR = {
			has_trait = lazy
		}
	}

	immediate = {
		hidden_effect = {
			add_character_flag = {
				flag = had_event_fp1_yearly_2400
				days = 1825
			}
		}
		
		select_local_animal_effect = { TYPE = any } # Save scope to limit possible animals: any/big/small/dangerous/harmless/prowling
		
		capital_province = {
			save_scope_as = hunting_province
		}
	}

	option = {
		name = fp1_yearly.2400.a
		trigger = {
			NOT = { location = { geographical_region = world_steppe } }
			NOT = {
				any_owned_story = {
					story_type = story_cycle_pet_dog
				}
			}
		}
		
		start_dog_story_cycle_effect = yes
		remove_short_term_gold = minor_gold_value

		stress_impact = {
			greedy = major_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = {
		name = fp1_yearly.2400.eagle
		trigger = {
			location = { geographical_region = world_steppe }
			NOT = {
				any_owned_story = {
					story_type = story_cycle_pet_eagle
				}
			}
		}

		start_eagle_story_cycle_effect = yes
		remove_short_term_gold = minor_gold_value

		stress_impact = {
			greedy = major_stress_impact_gain
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = {
		name = fp1_yearly.2400.b
		
		add_character_modifier = {
			modifier = brand_new_hunting_tools
			years = 25
		}
		remove_short_term_gold = minor_gold_value

		stress_impact = {
			greedy = major_stress_impact_gain
			temperate = medium_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
			}
		}
	}

	option = {
		name = fp1_yearly.2400.c
		
		custom_tooltip = fp1_yearly.2400.free_hunt
		hidden_effect = {
			add_character_flag = {
				flag = free_hunt
			}
		}

		stress_impact = {
			impatient = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	after = { remove_variable = animal_type }
}

scripted_trigger fp1_yearly_2500_guest_trigger = {
	is_available_ai_adult = yes
	is_pool_guest = yes
	NOR = {
		has_trait = deviant
		any_secret = {
			type = secret_deviant
			is_known_by = root
		}
	}
	save_temporary_scope_as = deviant_guest
	trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:deviant_guest.faith GENDER_CHARACTER = scope:deviant_guest }
}

scripted_trigger fp1_yearly_2500_court_target_trigger = {
	exists = capital_province
	OR = {
		any_targeting_scheme = {
			OR = {
				scheme_type = murder
				scheme_type = abduct
			}
			scheme_owner = root
		}
		has_relation_rival = root
	}
}

# What's that deviant up to this time!?
fp1_yearly.2500 = {
	type = character_event
	title = fp1_yearly.2500.t
	desc = fp1_yearly.2500.desc
	theme = seduction
	left_portrait = {
		character = scope:deviant_guest
		animation = shock
	}
	override_background = { reference = fp1_runestone }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_landed = yes
		is_available_at_peace_adult = yes
		
		NOT = { has_character_flag = had_event_fp1_yearly_2500 }
		is_capable_adult = yes
		
		any_courtier_or_guest = {
			fp1_yearly_2500_guest_trigger = yes
		}
		
		trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = root.faith GENDER_CHARACTER = scope:deviant_guest }
		
		any_held_title = {
			title_tier = county
			OR = {
				has_county_modifier = fp1_stele_ancestors_strong
				has_county_modifier = fp1_stele_ancestors_weak
				has_county_modifier = fp1_stele_conquest_strong
				has_county_modifier = fp1_stele_conquest_weak
				has_county_modifier = fp1_stele_promotion_strong
				has_county_modifier = fp1_stele_promotion_weak
			}
		}
	}

	weight_multiplier = {
		base = 1
	}
	
	immediate = {
		add_character_flag = {
			flag = had_event_fp1_yearly_2500
		}
		random_held_title = {
			title_tier = county
			limit = {
				OR = {
					has_county_modifier = fp1_stele_ancestors_strong
					has_county_modifier = fp1_stele_ancestors_weak
					has_county_modifier = fp1_stele_conquest_strong
					has_county_modifier = fp1_stele_conquest_weak
					has_county_modifier = fp1_stele_promotion_strong
					has_county_modifier = fp1_stele_promotion_weak
				}
			}
			save_scope_as = runestone_location
		}
		hidden_effect = {
			random_courtier_or_guest = {
				limit = {
					fp1_yearly_2500_guest_trigger = yes
				}
				if = {
					limit = {
						NOT = {
							any_secret = {
								type = secret_deviant
							}
						}
					}
					give_deviant_secret_or_trait_effect = yes
				}
				save_scope_as = deviant_guest
				random_secret = {
					type = secret_deviant
					limit = {
						NOT = { is_known_by = root }
					}
					save_scope_as = deviant_guest_secret
				}
				if = {
					limit = {
						root = { is_ai = no }
					}
					add_character_flag = is_naked
				}
			}
		}
		
		if = {
			limit = {
				is_ai = no
			}
			if = {
				limit = {
					any_ruler = {
						fp1_yearly_2500_court_target_trigger = yes
					}
				}
				random_ruler = {
					limit = {
						fp1_yearly_2500_court_target_trigger = yes
					}
					save_scope_as = appropriate_court_target_owner
				}
			}
		}
		create_character_memory = {
			type = deviant_defiled_my_object
			participants = { deviant = scope:deviant_guest }
		}
	}

	option = { # Learn of the secret and force them to leave
		name = {
			trigger = { NOT = { exists = scope:appropriate_court_target_owner } }
			text = yearly.8400.a
		}
		name = {
			trigger = { exists = scope:appropriate_court_target_owner }
			text = yearly.8400.special
		}
		
		scope:deviant_guest_secret = {
			reveal_to = root
		}

		scope:deviant_guest = {
			if = {
				limit = {
					exists = scope:appropriate_court_target_owner
				}
				hidden_effect = {
					visit_court_of = scope:appropriate_court_target_owner
				}
				custom_tooltip = yearly.8400.a.tt
			}
			else = {
				select_and_move_to_pool_effect = yes
			}
		}
		
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = generous
					has_trait = compassionate
					has_trait = just
				}
			}
		}

		stress_impact = {
			forgiving = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
	}
	
	option = { # Expose and throw them in jail
		name = yearly.8400.b
		
		add_piety = major_piety_gain
		
		scope:deviant_guest_secret = {
			expose_secret = root
		}

		rightfully_imprison_character_effect = {
			TARGET = scope:deviant_guest
			IMPRISONER = root
		}

		ai_chance = {
			base = 25
			
			modifier = {
				factor = 0
				ai_zeal < 0
			}
			
			modifier = {
				factor = 0
				has_trait = forgiving
			}
			
			modifier = {
				factor = 5
				ai_zeal >= medium_positive_ai_value
			}
		}

		stress_impact = {
			forgiving = major_stress_impact_gain
			deviant = massive_stress_impact_gain
		}
	}
	
	option = { # Learn of the secret and let them stay
		name = yearly.8400.c
		
		scope:deviant_guest_secret = {
			reveal_to = root
		}
		
		scope:deviant_guest = {
			add_opinion = {
				modifier = kindness_opinion
				target = root
				opinion = 25
			}
		}
			
		ai_chance = {
			base = 100
		}

		stress_impact = {
			zealous = major_stress_impact_gain
			just = medium_stress_impact_gain
		}
	}
	
	option = { # Learn of the secret, and... join in on the fun
		name = yearly.8400.d
		
		scope:deviant_guest_secret = {
			reveal_to = root
		}
		
		give_deviant_secret_or_trait_effect = yes
		
		if = {
			limit = {
				stress > 0
			}
			add_stress = monumental_stress_loss
		}
		
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:deviant_guest }
			}
			set_relation_friend = { reason = friend_deviant_fun target = scope:deviant_guest }
		}
		
		ai_chance = {
			base = 5
			modifier = {
				add = 995
				has_trait = lustful
			}
		}

		stress_impact = {
			chaste = major_stress_impact_gain
			temperate = major_stress_impact_gain
		}
	}
	
	after = {
		scope:deviant_guest = {
			if = {
				limit = { has_character_flag = is_naked }
				remove_character_flag = is_naked
			}
		}
	}
}

# Become a Berserker
fp1_yearly.2600 = {
	type = character_event
	title = fp1_yearly.2600.t
	desc = fp1_yearly.2600.desc
	theme = war
	left_portrait = {
		character = scope:berserker_teacher
		animation = marshal 
	}
	override_background = { reference = fp1_tribal_temple }

	trigger = {
		#DLC check.
		has_fp1_dlc_trigger = yes
		
		#Standard checks.
		is_available_at_peace_adult = yes
		NOT = { has_character_flag = had_event_fp1_yearly_2600 }
		
		OR = {
			culture = { has_cultural_pillar = heritage_north_germanic }
			religion = religion:germanic_religion
		}
		
		faith = {
			has_doctrine = tenet_warmonger
		}
		
		NOR = {
			has_trait = craven
			has_trait = berserker
		}
		
		prowess >= 8
		
		any_knight = {
			is_ai = yes
			is_physically_able_adult = yes
			has_trait = berserker
			NOT = {
				has_relation_rival = root
			}
		}
	}

	weight_multiplier = {
		base = 1
		
		modifier = {
			add = 0.5
			has_trait = impatient
		}
		modifier = {
			add = 0.5
			has_trait = wrathful
		}
		modifier = {
			add = 0.5
			prowess >= 12
		}
	}

	immediate = {
		hidden_effect = {
			add_character_flag = {
				flag = had_event_fp1_yearly_2600
				days = 1825
			}
		}
		
		random_knight = {
			limit = {
				is_ai = yes
				is_physically_able_adult = yes
				has_trait = berserker
				NOT = {
					has_relation_rival = root
				}
			}
			save_scope_as = berserker_teacher
		}
	}

	option = {
		name = fp1_yearly.2600.a
		
		custom_tooltip = fp1_yearly.2600.a.tt
		
		hidden_effect = {
			random_list = {
				10 = { # Succeed, no one harmed
					set_variable = {
						name = success_no_one_harmed
						value = yes
					}
				}
				5 = { # Succeed, harm someone close to you
					trigger = {
						any_courtier = {
							is_of_major_interest_to_root_trigger = yes
							is_ai = yes
							age > 12
							this != scope:berserker_teacher
						}
					}
					set_variable = {
						name = success_harm_close_one
						value = yes
					}
				}
				3 = { # Succeed, kill the berserker who taught you
					set_variable = {
						name = success_kill_berserker
						value = yes
					}
				}
				1 = { # Succeed, kill everyone at court
					trigger = {
						is_ai = no
						any_courtier = {
							is_of_major_interest_to_root_trigger = yes
							is_ai = yes
							age > 12
						}
					}
					set_variable = {
						name = success_kill_everyone
						value = yes
					}
				}
				3 = { # Fail, fall asleep
					set_variable = {
						name = fail_fall_asleep
						value = yes
					}
					modifier = {
						add = 10
						has_trait = lazy
					}
				}
			}
			trigger_event = fp1_yearly.2601
		}

		stress_impact = {
			calm = massive_stress_impact_gain
			lazy = massive_stress_impact_gain
			patient = major_stress_impact_gain
			temperate = major_stress_impact_gain
		}
		ai_chance = {
			base = 90
			modifier = {
				factor = 0
				OR = {
					has_trait = calm
					has_trait = patient
					has_trait = lazy
				}
			}
		}
	}

	option = {
		name = fp1_yearly.2600.b
		
		custom_tooltip = fp1_yearly.2600.b.tt

		stress_impact = {
			impatient = massive_stress_impact_gain
			wrathful = massive_stress_impact_gain
			sadistic = medium_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
		}
	}
}

scripted_effect berserker_killing_spree_effect = {
	random_list = {
		10 = {
			death = {
				death_reason = death_head_ripped_off
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_cloven_in_half
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_viciously_dismembered
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_ripped_apart_limb_by_limb
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_chopped_to_pieces
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_heart_ripped_out
				killer = root
			}
		}
		1 = {
			trigger = {
				NOT = {
					has_trait = brave
				}
			}
			death = {
				death_reason = death_fear
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_skull_cracked_open
				killer = root
			}
		}
		10 = {
			death = {
				death_reason = death_strangled_with_own_intestines
				killer = root
			}
		}
	}
}

fp1_yearly.2601 = {
	type = character_event
	title = fp1_yearly.2600.t
	desc = {
		desc = fp1_yearly.2601.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = var:success_no_one_harmed
				}
				desc = fp1_yearly.2601.success_no_one_harmed
			}
			triggered_desc = {
				trigger = {
					exists = var:success_harm_close_one
				}
				desc = fp1_yearly.2601.success_harm_close_one
			}
			triggered_desc = {
				trigger = {
					exists = var:success_kill_berserker
				}
				desc = fp1_yearly.2601.success_kill_berserker
			}
			triggered_desc = {
				trigger = {
					exists = var:success_kill_everyone
				}
				desc = fp1_yearly.2601.success_kill_everyone
			}
			triggered_desc = {
				trigger = {
					exists = var:fail_fall_asleep
				}
				desc = fp1_yearly.2601.fail_fall_asleep
			}
		}
	}
	theme = war
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				exists = var:success_no_one_harmed
			}
			animation = rage
		}
		triggered_animation = {
			trigger = {
				OR = {
					exists = var:success_harm_close_one
					exists = var:success_kill_berserker
					exists = var:success_kill_everyone
				}
			}
			animation = shock
		}
		triggered_animation = {
			trigger = {
				exists = var:fail_fall_asleep
			}
			animation = personality_irrational
		}
	}
	right_portrait = {
		character = scope:harmed_victim
		triggered_animation = {
			trigger = {
				root = {
					exists = var:success_no_one_harmed
				}
			}
			animation = happiness
		}
		triggered_animation = {
			trigger = {
				root = {
					OR = {
						exists = var:success_harm_close_one
						exists = var:success_kill_berserker
						exists = var:success_kill_everyone
					}
				}
			}
			animation = fear
		}
		triggered_animation = {
			trigger = {
				root = {
					exists = var:fail_fall_asleep
				}
			}
			animation = disapproval
		}
	}
	override_background = { reference = fp1_tribal_temple }

	trigger = {
		
	}

	immediate = {
		scope:berserker_teacher = {
			save_scope_as = harmed_victim
		}
		if = {
			limit = {
				exists = var:success_no_one_harmed
			}
			add_trait = berserker
		}
		else_if = {
			limit = {
				exists = var:success_harm_close_one
			}
			random_courtier = {
				limit = {
					is_of_major_interest_to_root_trigger = yes
					is_ai = yes
					age > 12
					this != scope:berserker_teacher
				}
				increase_wounds_effect = { REASON = duel }
				add_opinion = {
					modifier = cruelty_opinion
					target = root
					opinion = -20
				}
				save_scope_as = harmed_victim
			}
			add_trait = berserker
			add_dread = minor_dread_gain
		
			create_character_memory = {
				type = hurt_someone_close_to_me
				participants = { close_relation = scope:harmed_victim }
			}
		}
		else_if = {
			limit = {
				exists = var:success_kill_berserker
			}
			scope:berserker_teacher = {
				berserker_killing_spree_effect = yes
			}
			add_trait = berserker
			add_dread = minor_dread_gain
		
			create_character_memory = {
				type = hurt_someone_close_to_me
				participants = { close_relation = scope:berserker_teacher }
			}
		}
		else_if = {
			limit = {
				exists = var:success_kill_everyone
			}
			every_courtier = {
				limit = {
					is_ai = yes
				}
				berserker_killing_spree_effect = yes
			}
			add_trait = berserker
			add_dread = 100
		
			create_character_memory = {
				type = killed_everyone
			}
		}
	}

	option = {
		name = fp1_yearly.2601.a
		
		trigger = {
			exists = var:success_no_one_harmed
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2601.b
		
		trigger = {
			OR = {
				exists = var:success_harm_close_one
				exists = var:success_kill_berserker
				exists = var:success_kill_everyone
			}
		}
		
		if = {
			limit = {
				NOT = {
					has_trait = sadistic
				}
			}
			add_stress = massive_stress_impact_gain
		}
		
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = fp1_yearly.2601.c
		
		trigger = {
			exists = var:fail_fall_asleep
		}
		
		add_prestige = minor_prestige_loss
		add_stress = minor_stress_loss

		ai_chance = {
			base = 100
		}
	}
	
	after = {
		remove_variable = success_no_one_harmed
		remove_variable = success_harm_close_one
		remove_variable = success_kill_berserker
		remove_variable = success_kill_everyone
		remove_variable = fail_fall_asleep
	}
}
