﻿namespace = intrigue_dread
namespace = intrigue_dread_special

# EK NOTE: Changed nickname effect to our own
##################################################

#Intrigue Dread Lifestyle events

	#1501		- Cannibal cook
	#1801		- Poison tasting
	#1901		- Mess with a courtier you don't like
	#2001		- You're scaring a loved one
	#2101		- Shut up rumors about a relative
	#2201		- Councillor is too scared to speak their mind
	#2301		- Your court thinks you're soft
	#2401		- Executions could be better
	#4001-4013	- Mind Break
	#4100 		- Bothersome Hearings, by Flavio Verna
	#4200 		- Forest of Corpses

#Special Intrigue Dread Lifestyle events

	#1101-1104 - Join a touring theater
	#1301		- Retinue members are concerned

##################################################


##################################################
# Special Chain - Join a touring theater company #
##################################################

#Start, do you want to participate in a touring theater?
intrigue_dread_special.1101 = {
	type = character_event
	title = intrigue_dread_special.1101.t
	desc = intrigue_dread_special.1101.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = happiness
	}
	
	trigger = {
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		NOT = { has_character_flag = had_intrigue_dread_1101_this_lifetime }
		NOT = { has_character_flag = is_in_intrigue_special_event }
		exists = capital_county
	}

	weight_multiplier = {
		base = 0.75
		modifier = {
			add = 0.50
			has_trait = sadistic
		}
		modifier = {
			add = 0.25
			has_trait = callous
		}
		modifier = {
			add = 0.25
			has_trait = wrathful
		}
		modifier = {
			add = 0.15
			has_trait = paranoid
		}
		modifier = {
			add = 0.15
			dread >= medium_dread
		}
	}

	immediate = {
		add_character_flag = {
			flag = is_in_intrigue_special_event
			days = 100
		}
		add_character_flag = had_intrigue_dread_1101_this_lifetime
		capital_county = {
			save_scope_as = scoped_capital
		}
	}

	option = { #Yes, participate!
		name = intrigue_dread_special.1101.a.a
		name = intrigue_dread_special.1101.a.b
		name = intrigue_dread_special.1101.a.c
		name = intrigue_dread_special.1101.a.d
		name = intrigue_dread_special.1101.a.e
		custom_tooltip = intrigue_lifestyle_perk_indication
		trigger_event = {
			id = intrigue_dread_special.1102
			days = { 6 12 }
		}
		stress_impact = {
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
		}
	}

	option = { #Nah, I'll watch!
		name = intrigue_dread_special.1101.b
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		if = {
			limit = {
				scope:scoped_capital.holder ?= root
			}
			scope:scoped_capital = {
				add_county_modifier = {
					modifier = intrigue_theatre_troupe_modifier
					years = 5
				}
			}
		}
		stress_impact = {
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 50
				OR = {
					has_trait = lazy
					has_trait = shy
				}
			}
		}
	}

	option = { #No. This is beneath me.
		name = intrigue_dread_special.1101.c
		add_prestige = medium_prestige_gain
		stress_impact = {
			gregarious = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			arrogant = minor_stress_impact_loss
			shy = minor_stress_impact_loss
		}
		trigger = {
			has_trait = arrogant
		}
		trait = arrogant
		ai_chance = {
			base = 0
			modifier = {
				add = 50
				OR = {
					has_trait = arrogant
					has_trait = diligent
				}
			}
		}
	}
}

# You joined. Let the show begin!
intrigue_dread_special.1102 = {
	type = character_event
	title = intrigue_dread_special.1101.t
	desc = intrigue_dread_special.1102.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = personality_bold
	}

	immediate = {
		play_music_cue = "mx_cue_meadandwine"
		set_variable = {
			name = audience_won
			value = 0
			days = 800
		}
	}

	option = {
		name = intrigue_dread_special.1102.a
		duel = {
			skill = stewardship
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread_special.1102.a.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				modifier = {
					add = 5
					has_trait = diligent
				}
				change_variable = {
					name = audience_won
					add = 3
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1102.a.duel_success
					add_prestige = minor_prestige_gain
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
				}
			}
			5 = {
				desc = intrigue_dread_special.1102.a.duel_failure
				modifier = {
					add = 5
					has_trait = lazy
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1102.a.duel_failure
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			lazy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			compare_modifier = {
				target = root
				value = stewardship
				multiplier = 2
			}
		}
	}

	option = {
		name = intrigue_dread_special.1102.b
		duel = {
			skill = diplomacy
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread_special.1102.b.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				modifier = {
					add = 5
					has_trait = gregarious
				}
				modifier = {
					add = 5
					has_trait = lustful
				}
				change_variable = {
					name = audience_won
					add = 3
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1102.b.duel_success
					add_prestige = minor_prestige_gain
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
				}
			}
			5 = {
				desc = intrigue_dread_special.1102.b.duel_failure
				modifier = {
					add = 5
					has_trait = shy
				}
				modifier = {
					add = 5
					has_trait = callous
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1102.b.duel_failure
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				OR = {
					has_trait = gregarious
					has_trait = lustful
				}
			}
		}
	}
	
	option = {
		name = intrigue_dread_special.1102.c
		flavor = intrigue_dread_special.1102.c.flavor
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
		hidden_effect = {
			change_variable = {
				name = audience_won
				add = 1
			}
		}
		stress_impact = {
			brave = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				has_trait = diligent
			}
		}
	}
	after = {
		trigger_event = {
			id = intrigue_dread_special.1103
			days = { 6 12 }
		}
	}
}

intrigue_dread_special.1103 = {
	type = character_event
	title = intrigue_dread_special.1101.t
	desc = intrigue_dread_special.1103.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = happiness
	}

	option = {
		name = intrigue_dread_special.1103.a
		duel = {
			skill = intrigue
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread_special.1103.a.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				modifier = {
					add = 5
					has_trait = gregarious
				}
				modifier = {
					add = 5
					has_trait = deceitful
				}
				change_variable = {
					name = audience_won
					add = 3
				}
				add_character_flag = win_feeling
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1103.a.duel_success
					add_prestige = minor_prestige_gain
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
				}
			}
			5 = {
				desc = intrigue_dread_special.1103.a.duel_failure
				modifier = {
					add = 5
					has_trait = shy
				}
				modifier = {
					add = 5
					has_trait = callous
				}
				add_character_flag = loose_feeling
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1103.a.duel_failure
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			compare_modifier = {
				target = root
				value = diplomacy
				multiplier = 2
			}
		}
	}

	option = {
		name = intrigue_dread_special.1103.b
		duel = {
			skill = learning
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread_special.1103.b.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				modifier = {
					add = 5
					has_trait = patient
				}
				change_variable = {
					name = audience_won
					add = 3
				}
				add_character_flag = win_reading
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1103.a.duel_success
					add_prestige = minor_prestige_gain
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
				}
			}
			5 = {
				desc = intrigue_dread_special.1103.b.duel_failure
				modifier = {
					add = 5
					has_trait = stuttering
				}
				add_character_flag = loose_reading
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread_special.1103.a.duel_failure
					add_prestige = minor_prestige_loss
				}
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			compare_modifier = {
				target = root
				value = learning
				multiplier = 2
			}
		}
	}
	
	option = {
		name = intrigue_dread_special.1103.c
		custom_tooltip = intrigue_dread_special.1102.c.flavor
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
		hidden_effect = {
			change_variable = {
				name = audience_won
				add = 1
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
		}
	}
	after = {
		trigger_event = {
			id = intrigue_dread_special.1199
			days = { 6 12 }
		}
	}
}

# END, did you win the audience?
intrigue_dread_special.1199 = {
	type = character_event
	title = intrigue_dread_special.1101.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = win_feeling
				}
				desc = intrigue_dread_special.1199.desc_win_feeling
			}
			triggered_desc = {
				trigger = {
					has_character_flag = loose_feeling
				}
				desc = intrigue_dread_special.1199.desc_loose_feeling
			}
			triggered_desc = {
				trigger = {
					has_character_flag = win_reading
				}
				desc = intrigue_dread_special.1199.desc_win_reading
			}
			triggered_desc = {
				trigger = {
					has_character_flag = loose_reading
				}
				desc = intrigue_dread_special.1199.desc_loose_reading
			}
			desc = intrigue_dread_special.1199.desc_fallback
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					var:audience_won >= 4
				}
				desc = intrigue_dread_special.1199.desc_win
			}
			triggered_desc = {
				trigger = {
					var:audience_won < 4
				}
				desc = intrigue_dread_special.1199.desc_loose
			}
		}
	}
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = personality_dishonorable
	}

	option = {
		name = intrigue_dread_special.1199.z
		trigger = {
			var:audience_won >= 4
			OR = {
				has_trait = sadistic
				has_trait = lunatic
			}
		}
		trait = sadistic
		trait = lunatic_1
		trait = lunatic_genetic
		add_intrigue_lifestyle_perk_points = 1
		add_dread = medium_dread_gain
		trigger_event = intrigue_dread_special.1198
	}
	option = {
		name = intrigue_dread_special.1199.a
		trigger = {
			var:audience_won >= 4
		}
		add_intrigue_lifestyle_perk_points = 1
		scope:scoped_capital = {
			add_county_modifier = {
				modifier = intrigue_theatre_troupe_modifier
				years = 5
			}
		}
	}
	option = { #You *will* cheer, filthy peasants.
		name = {
			trigger = {
				has_trait = paranoid
			}
			text = intrigue_dread_special.1199.c.a
		}
		name = {
			trigger = {
				NOT = { has_trait = paranoid }
			}
			text = intrigue_dread_special.1199.c.b
		}
		trigger = {
			var:audience_won < 4
			OR = {
				dread >= medium_dread
				has_trait = callous
				has_trait = sadistic
				has_trait = paranoid
				has_trait = wrathful
				has_trait = vengeful
			}
		}
		trait = callous
		trait = sadistic
		trait = paranoid
		trait = wrathful
		trait = vengeful
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_dread = minor_dread_gain
		trigger_event = intrigue_dread_special.1197
		stress_impact = {
			compassionate = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
	}
	option = {
		name = intrigue_dread_special.1199.b
		trigger = {
			var:audience_won < 4
		}
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		scope:scoped_capital = {
			add_county_modifier = {
				modifier = intrigue_theatre_troupe_loss_modifier
				years = 5
			}
		}
		stress_impact = {
			sadistic = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
	}
	after = {
		remove_variable = audience_won
		remove_character_flag = is_in_intrigue_special_event
		remove_character_flag = win_reading
		remove_character_flag = loose_reading
		remove_character_flag = win_feeling
		remove_character_flag = loose_feeling
	}
}

intrigue_dread_special.1197 = {
	type = character_event
	title = intrigue_dread_special.1197.t
	desc = intrigue_dread_special.1197.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = root

	immediate = {
		play_music_cue = "mx_cue_positive_effect"
		show_as_tooltip = {
			add_intrigue_lifestyle_xp = medium_lifestyle_xp
			add_dread = minor_dread_gain
		}
	}

	option = {
		name = intrigue_dread_special.1197.a
	}
}
intrigue_dread_special.1198 = {
	type = character_event
	title = intrigue_dread_special.1197.t
	desc = intrigue_dread_special.1198.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = tavern }
	left_portrait = root

	immediate = {
		play_music_cue = "mx_cue_positive_effect"
		show_as_tooltip = {
			add_intrigue_lifestyle_perk_points = 1
			add_dread = medium_dread_gain
		}
	}

	option = {
		name = intrigue_dread_special.1198.a
		stress_impact = {
			sadistic = medium_stress_impact_loss
		}
	}
}


##################################################
# Retinue members are concerned
# by Linnéa Thimrén
##################################################

scripted_trigger intrigue_dread_1301_potential_courtier_trigger = {
	is_available_healthy_ai_adult = yes
	is_close_family_or_spouse_of_root_trigger = no
	NOR = {
		is_close_or_extended_family_of = root
		has_lifestyle = intrigue_lifestyle
	}
	OR = {
		opinion = {
			target = root
			value <= neutral_opinion
		}
		has_trait = paranoid
		has_relation_rival = root
		is_scheming_against = { target = root }
	}
}

intrigue_dread_special.1301 = {
	type = character_event
	title = intrigue_dread_special.1301.t
	desc = intrigue_dread_special.1301.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = corridor_night }
	left_portrait = {
		character = scope:courtier_first
		animation = disapproval
	}
	right_portrait = {
		character = scope:courtier_second
		animation = worry
	}
	
	trigger = {
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}

		NOT = { has_character_flag = had_intrigue_dread_1301_event }
		any_scheme = {
			count >= 1
			scheme_skill = intrigue
		}
		any_courtier_or_guest = {
			intrigue_dread_1301_potential_courtier_trigger = yes
			save_temporary_scope_as = courtier_check
		}
		any_courtier_or_guest = {
			intrigue_dread_1301_potential_courtier_trigger = yes
			NOT = {
				this = scope:courtier_check
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 0.2
			any_scheme = {
				count = 2
			}
		}
		modifier = {
			add = 0.5
			any_scheme = {
				count >= 3
			}
		}
	}

	immediate = {
		add_character_flag = had_intrigue_dread_1301_event
		random_courtier_or_guest = {
			limit = {
				intrigue_dread_1301_potential_courtier_trigger = yes
			}
			save_scope_as = courtier_first
		}
		random_courtier_or_guest = {
			limit = {
				intrigue_dread_1301_potential_courtier_trigger = yes
				NOT = { this = scope:courtier_first }
			}
			save_scope_as = courtier_second
		}
	}

	
	#Paranoid executes both. (gains dread and xp)
	option = {
		name = intrigue_dread_special.1301.a
		trigger = { has_trait = paranoid }
		trait = paranoid
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_dread = minor_dread_gain
		hard_imprison_character_effect = {
			TARGET = scope:courtier_first
 			IMPRISONER = root
 		}
		hard_imprison_character_effect = {
			TARGET = scope:courtier_second
 			IMPRISONER = root
 		}
		ai_chance = {
			base = 50
			modifier = {
				add = 20
				OR = {
					has_trait = sadistic
					has_trait = lunatic
					has_trait = vengeful
				}
			}
		}
	}
	#Dreaded ruler batters into submission. (gains xp)
	option = {
		name = intrigue_dread_special.1301.b
		trigger = { dread >= medium_dread }
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		ai_chance = {
			base = 50
			modifier = {
				add = 20
				OR = {
					has_trait = sadistic
					has_trait = callous
					has_trait = vengeful
				}
			}
		}
	}
	#Diplomacy duel (success gains xp, loss loses opinion)
	option = {
		name = intrigue_dread_special.1301.c
		duel = {
			skill = diplomacy
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread_special.1301.c.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				send_interface_toast = {
					left_icon = scope:courtier_first
					right_icon = scope:courtier_second
					title = tooltip.intrigue_dread_special.1301.c.duel_success
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
				}
			}
			5 = {
				desc = intrigue_dread_special.1301.c.duel_failure
				send_interface_toast = {
					left_icon = scope:courtier_first
					right_icon = scope:courtier_second
					title = tooltip.intrigue_dread_special.1301.c.duel_failure
					scope:courtier_first = {
						add_opinion = {
							modifier = weak_excuses
							target = root
						}
					}
					scope:courtier_second = {
						add_opinion = {
							modifier = weak_excuses
							target = root
						}
					}
				}
			}
		}
		stress_impact = {
			vengeful = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 20
				OR = {
					has_trait = forgiving
					has_trait = compassionate
					has_trait = calm
				}
			}
		}
	}
	#Default (opinion loss, gain xp)
	option = {
		name = intrigue_dread_special.1301.d
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
		scope:courtier_first = {
			add_opinion = {
				modifier = ignored_concerns
				target = root
			}
		}
		scope:courtier_second = {
			add_opinion = {
				modifier = ignored_concerns
				target = root
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			just = minor_stress_impact_gain
			temperate = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 20
			modifier = {
				add = 20
				OR = {
					has_trait = arrogant
					has_trait = wrathful
				}
			}
		}
	}
}

##################################################
# Cannibal cook
# by Linnéa Thimrén
##################################################

intrigue_dread.1501 = {
	type = character_event
	title = intrigue_dread.1501.t
	desc = intrigue_dread.1501.desc
	
	theme = intrigue_intimidation_focus
 	override_background = { reference = feast }
	left_portrait = {
		character = scope:cannibal_cook
		animation = personality_dishonorable
	}
	
	trigger = {
		NOT = { has_character_flag = intrigue_dread_1501_had_cannibal_cook_event }
		trigger_if = {
			limit = {
				is_landless_adventurer = yes
			}
			domicile.provisions < provisions_threshold_critical_low_value
			employs_court_position = camp_cook_camp_officer
		}
	}

	weight_multiplier = {
		base = 1
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		add_character_flag = {
			flag = intrigue_dread_1501_had_cannibal_cook_event
			days = 3650
		}
		if = {
			limit = {
				is_landless_adventurer = yes
			}
			random_court_position_holder = {
				type = camp_cook_camp_officer
				save_scope_as = cannibal_cook
			}
		}
		else = {
			create_character = {
				template = servant_character
				intrigue = { 15 20 }
				employer = root
				gender_female_chance = root_attraction_based_female_chance
				faith = root.faith
				culture = root.culture
				save_scope_as = cannibal_cook
			}
			#EK EDIT
			scope:cannibal_cook = {
				ek_character_setup_effect = yes
			}
			#EK EDIT END
		}
	}

	option = { # Flesh eating friend!!
		name = intrigue_dread.1501.c
		trigger = {
			OR = {
				any_secret = { secret_type = secret_cannibal }
				has_trait = cannibal
			}
		}
		trait = cannibal
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		if = {
			limit = {
				can_set_relation_friend_trigger = { CHARACTER = scope:cannibal_cook }
			}
			set_relation_friend = { reason = friend_deviant_fun target = scope:cannibal_cook }
		}
		else = {
			scope:cannibal_cook = {
				add_opinion = {
					modifier = also_cannibal
					target = root
				}
			}
		}	
		add_character_modifier = {
			modifier = ate_good_meal
			days = 365
		}
		ai_chance = {
			base = 100
		}
	}

	option = { # Look for the ingredients
		name = intrigue_dread.1501.b
		trigger = {
			NOR = {
				any_secret = { secret_type = secret_cannibal }
				has_trait = cannibal
			}
		}
		flavor = intrigue_dread.1501.b.flavor
		duel = {
			skill = intrigue
			target = scope:cannibal_cook
			12 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				custom_tooltip = intrigue_dread.1501.b.tt1
				add_intrigue_lifestyle_xp = minor_lifestyle_xp
				trigger_event = {
					id = intrigue_dread.1502
					days = { 7 14 }
				}
			}
			12 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				custom_tooltip = intrigue_dread.1501.b.tt2
				trigger_event = {
					id = intrigue_dread.1503
					days = { 7 14 }
				}
			}
		}
		stress_impact = {
			trusting = minor_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 20
				OR = {
					has_trait = diligent
					has_trait = paranoid
				}
			}
		}
	}

	option = { # What you don't know can't hurt you!
		name = intrigue_dread.1501.a
		add_character_modifier = {
			modifier = ate_good_meal
			days = 365
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_loss
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 20
				OR = {
					has_trait = content
					has_trait = trusting
				}
			}
		}
	}

	after = {
		hidden_effect = {
			scope:cannibal_cook = {
				if = { # To make sure the cook can get the secret
					limit = {
						has_trait = cannibal
					}
					remove_trait = cannibal
				}
				if = {
					limit = {
						NOT = {
							any_secret = {
								secret_type = secret_cannibal
							}
						}
					}
					give_cannibal_secret_or_trait_effect = yes
				}
			}
		}
	}
}

# You investigated the stew, you fool!
intrigue_dread.1502 = {
	type = character_event
	title = intrigue_dread.1501.t
	desc = intrigue_dread.1502.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = scope:cannibal_cook
		animation = worry
	}

	immediate = {
		random_secret = {
			limit = {
				secret_type = secret_cannibal
			}
			save_scope_as = cannibal_secret
			reveal_to = root
		}
		show_as_tooltip = {
			add_intrigue_lifestyle_xp = minor_lifestyle_xp
		}
	}

	option = { # Bring me their head!
		name = intrigue_dread.1502.a
		flavor = intrigue_dread.1502.a.flavor
		scope:cannibal_cook = {
			death = {
				killer = root
				death_reason = death_execution
			}
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_trait = wrathful
					has_trait = vengeful
				}
			}
		}
	}

	option = { # Throw them in the dungeons!
		name = intrigue_dread.1502.b
		add_opinion = {
			modifier = horrifying_discovery_cannibalism_opinion
			target = scope:cannibal_cook
		}
		imprison = {
			target = scope:cannibal_cook
			type = dungeon
		}
		ai_chance = {
			base = 50
			modifier = {
				add = 50
				OR = {
					has_trait = just
					has_trait = compassionate
				}
			}
		}
	}

	option = { # You actually really liked the meal
		name = intrigue_dread.1502.c
		give_cannibal_secret_or_trait_effect = yes
		add_character_modifier = {
			modifier = ate_good_meal
			days = 365
		}
		stress_impact = {
			base = major_stress_gain
			trusting = minor_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 70
				OR = {
					has_trait = gluttonous
					has_trait = lunatic
					has_trait = possessed
				}
			}
		}
	}
}

# Follow up in case of failure...
intrigue_dread.1503 = {
	type = character_event
	title = intrigue_dread.1501.t
	desc = intrigue_dread.1503.desc
	
	theme = intrigue_intimidation_focus
	override_background = { reference = feast }
	left_portrait = {
		character = scope:target
		animation = disapproval
	}


	option = {
		name = intrigue_dread.1503.a
	}
}

##################################################
# Poison tasting
# by Petter Vilberg
##################################################

scripted_trigger intrigue_dread.1801.suitable_courtier_trigger = {
	is_adult = yes
	is_ai = yes
	NOT = { is_close_or_extended_family_of = root }
	OR = {
		NOT = { is_spouse_of = root }
		AND = {
			root = { has_trait = sadistic }
			reverse_opinion = {
				target = root
				value < 10
			}
		}
	}
	save_temporary_scope_as = courtier_check
	NOT = {
		root = {
			any_relation = {
				type = intrigue_mentor
				this = scope:courtier_check
			}
		}
	}
}

intrigue_dread.1801 = {
	type = character_event
	title = intrigue_dread.1801.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:intrigue_mentor }
				desc = intrigue_dread.1801.mentor_desc
			}
			desc = intrigue_dread.1801.desc
		}
	}
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:test_subject
		animation = fear
	}
	right_portrait = {
		character = scope:intrigue_mentor
		animation = personality_compassionate
	}
	
	trigger = {
		NOT = { has_character_flag = had_intrigue_dread_1801_event }
		OR = {
			num_of_relation_intrigue_mentor > 0
			has_trait = schemer
			has_trait = torturer
		}
		any_courtier = {
			intrigue_dread.1801.suitable_courtier_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Less likely if the character has the modifier from the event from before.
			add = -0.75
			OR = {
				has_character_modifier = intrigue_poison_experimentation_modifier
				has_character_modifier = intrigue_risky_poison_experimentation_modifier
			}
		}
		upweight_for_focus_modifier = { FOCUS = intrigue_skulduggery_focus }
	}

	immediate = {
		add_character_flag = {
			flag = had_intrigue_dread_1801_event
			days = 1825
		}
		random_relation = {
			type = intrigue_mentor
			limit = { intrigue > 10 }
			save_scope_as = intrigue_mentor
		}
		random_courtier = {
			limit = { intrigue_dread.1801.suitable_courtier_trigger = yes }
			save_scope_as = test_subject
		}
	}

	option = { # This has been a learning experience
		name = intrigue_dread.1801.a
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		reverse_add_opinion = {
			target = scope:test_subject
			modifier = intrigue_used_as_test_subject_opinion
		}
		add_character_modifier = {
			modifier = intrigue_poison_experimentation_modifier
			days = 3650
		}
		stress_impact = {
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}
	}

	option = { # Keep going
		name = intrigue_dread.1801.b
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		random = {
			chance = 15
			scope:test_subject = {
				death = {
					death_reason = death_poison
					killer = root
				}
			}
		}
		if = {
			limit = {
				scope:test_subject = {
					is_alive = yes
				}
			}
			reverse_add_opinion = {
				target = scope:test_subject
				modifier = intrigue_used_as_risky_test_subject_opinion
			}
		}
		add_character_modifier = {
			modifier = intrigue_risky_poison_experimentation_modifier
			days = 3650
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_boldness = 0.5
			}
		}
	}

	option = { # No, this must stop
		name = intrigue_dread.1801.c
		trigger = { exists = scope:intrigue_mentor }
		reverse_add_opinion = {
			target = scope:intrigue_mentor
			modifier = respect_opinion
			opinion = -15
		}
		stress_impact = {
			sadistic = major_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 3
			}
		}
	}
}

##################################################

# Torturing Courtier

##################################################

scripted_trigger intrigue_dread_1901_potential_courtier_trigger = {
	is_available_healthy_ai_adult = yes
	is_close_family_or_spouse_of_root_trigger = no
	reverse_opinion = {
		target = root
		value <= neutral_opinion
	}
	calc_true_if = {
		amount >= 2
		has_trait = gregarious
		has_trait = lustful
		has_trait = greedy
	}
}

# Mess with a courtier you don't like
intrigue_dread.1901 = {
	type = character_event
	title = intrigue_dread.1901.t
	desc = intrigue_dread.1901.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:disliked_courtier
		animation = personality_irrational
	}
	
	trigger = {
		NOT = { has_character_flag = had_intrigue_dread_1901_event }
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		any_courtier_or_guest = {
			intrigue_dread_1901_potential_courtier_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 0.75
			has_trait = sadistic
		}
		modifier = {
			add = 0.75
			has_trait = deceitful
		}
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		add_character_flag = {
			flag = had_intrigue_dread_1901_event
			days = 1825
		}
		random_courtier_or_guest = {
			limit = {
				intrigue_dread_1901_potential_courtier_trigger = yes
				has_trait = gregarious
				has_trait = lustful
				has_trait = greedy
			}
			alternative_limit = {
				intrigue_dread_1901_potential_courtier_trigger = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 25
					has_relation_rival = root
				}
				modifier = {
					add = 25
					reverse_opinion = {
						target = root
						value <= -50
					}
				}
			}
			save_scope_as = disliked_courtier
			if = {
				limit = { root = { is_ai = no }	}
				assign_quirk_effect = yes
			}
		}
	}

	option = {
		name = intrigue_dread.1901.a
		scope:disliked_courtier = {
			random = {
				chance = 50
				increase_wounds_effect = { REASON = fight }
			}
		}
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
	}

	option = {
		name = intrigue_dread.1901.b
		custom_tooltip = intrigue_dread.1901.b.tt
		trigger = {
			scope:disliked_courtier = {
				has_trait = gregarious
			}
		}
		scope:disliked_courtier = {
			add_prestige = medium_prestige_loss
		}
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
	}

	option = {
		name = intrigue_dread.1901.c
		custom_tooltip = intrigue_dread.1901.c.tt
		trigger = {
			scope:disliked_courtier = {
				has_trait = greedy
			}
		}
		add_gold = minor_gold_value
		scope:disliked_courtier = {
			remove_short_term_gold = minor_gold_value
		}
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
	}

	option = {
		name = intrigue_dread.1901.d
		custom_tooltip = intrigue_dread.1901.d.tt
		trigger = {
			scope:disliked_courtier = {
				has_trait = lustful
			}
		}
		scope:disliked_courtier = {
			add_character_modifier = {
				modifier = intrigue_insulted_abilities_as_lover
				days = 365
			}
		}
		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
	}
	after = {
		scope:disliked_courtier = {
			add_opinion = {
				modifier = insulted_courtier
				target = root
			}
		}
	}
}

##################################################
# Mind Break
# by Sean Hughes
# 4001-4013
##################################################

scripted_trigger intrigue_dread_4001_candidate_trigger = {
	# Can only mind-break landless characters (due to balance reasons).
	NOT = {
		has_character_flag = intrigue_dread_4001_was_victim_flag
	}
	is_playable_character = no
	is_landed = no
	is_adult = yes
	is_ai = yes
}

scripted_trigger intrigue_dread_4001_rival_relative = {
	save_temporary_scope_as = candidate
	root = {
		any_relation = {
			type = rival
			is_close_or_extended_family_of = scope:candidate
		}
	}
}
scripted_trigger intrigue_dread_4001_liege_relative = {
	save_temporary_scope_as = candidate
	root = {
		is_in_civil_war = no
		liege = {
			is_close_or_extended_family_of = scope:candidate
		}
	}
}
scripted_trigger intrigue_dread_4001_peer_relative = {
	save_temporary_scope_as = candidate
	root = {
		liege = {
			any_vassal = {
				is_close_or_extended_family_of = scope:candidate
			}
		}
	}
}
scripted_trigger intrigue_dread_4001_vassal_relative = {
	save_temporary_scope_as = candidate
	root = {
		any_vassal = {
			is_in_civil_war = no
			is_close_or_extended_family_of = scope:candidate
		}
	}
}

scripted_trigger intrigue_dread_4001_heir_trigger = {
	any_heir_title = {
		tier >= tier_county
	}
}

scripted_trigger intrigue_dread_4001_victim_is_valid = {
	is_alive = yes
	imprisoner = root
	has_character_flag = intrigue_dread_4001_victim_flag
}

# Step 1: Pick which prisoner you're going to use as your victim.
intrigue_dread.4001 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = {
		desc = intrigue_dread.4001.desc.start
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:prisoner_2
				}
				desc = intrigue_dread.4001.desc.multiple
			}
			desc = intrigue_dread.4001.desc.single
		}
	}
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:prisoner_1
		animation = fear
		override_imprisonment_visuals = yes
	}
	lower_left_portrait = scope:prisoner_2
	lower_center_portrait = scope:prisoner_3
	override_background = { reference = dungeon }
	
	trigger = {
		is_landed = yes # Not adventurers
		NOT = {
			# 5 year cooldown between attempts.
			has_character_flag = had_event_intrigue_dread_4001
			# If successfully completed, cannot do again in this lifetime.
			has_character_flag = completed_event_intrigue_dread_4001
		}
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		any_prisoner = {
			intrigue_dread_4001_candidate_trigger = yes
		}
	}

	weight_multiplier = {
		base = 1
		# If the character got this event before but delayed it, we have a much higher chance to re-appear after the 5 year cooldown is over.
		modifier = {
			has_character_flag = intrigue_dread_4001_delayed
			factor = 5
		}
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_intrigue_dread_4001
			years = 5
		}
		remove_character_flag = intrigue_dread_4001_delayed

		random_prisoner = {
			limit = {
				intrigue_dread_4001_candidate_trigger = yes
			}

			# Weigh heavily toward family members of people you may care about.
			weight = {
				base = 100

				modifier = {
					intrigue_dread_4001_rival_relative = yes
					factor = 10
				}
				modifier = {
					OR = {
						intrigue_dread_4001_liege_relative = yes
						intrigue_dread_4001_peer_relative = yes
						intrigue_dread_4001_vassal_relative = yes
					}
					factor = 5
				}
				modifier = {
					intrigue_dread_4001_heir_trigger = yes
					factor = 10
				}
			}
			save_scope_as = prisoner_1
		}
		random_prisoner = {
			limit = {
				intrigue_dread_4001_candidate_trigger = yes
				NOT = { this = scope:prisoner_1 }
			}

			save_temporary_scope_as = candidate

			# Weigh heavily toward family members of people you may care about.
			weight = {
				base = 100

				modifier = {
					intrigue_dread_4001_rival_relative = yes
					factor = 10
				}
				modifier = {
					OR = {
						intrigue_dread_4001_liege_relative = yes
						intrigue_dread_4001_peer_relative = yes
						intrigue_dread_4001_vassal_relative = yes
					}
					factor = 5
				}
				modifier = {
					intrigue_dread_4001_heir_trigger = yes
					factor = 10
				}
			}

			save_scope_as = prisoner_2
		}
		random_prisoner = {
			limit = {
				intrigue_dread_4001_candidate_trigger = yes
				NOR = {
					this = scope:prisoner_1
					this = scope:prisoner_2
				}
			}

			save_temporary_scope_as = candidate

			# Weigh heavily toward family members of people you may care about.
			weight = {
				base = 100

				modifier = {
					intrigue_dread_4001_rival_relative = yes
					factor = 10
				}
				modifier = {
					OR = {
						intrigue_dread_4001_liege_relative = yes
						intrigue_dread_4001_peer_relative = yes
						intrigue_dread_4001_vassal_relative = yes
					}
					factor = 5
				}
				modifier = {
					intrigue_dread_4001_heir_trigger = yes
					factor = 10
				}
			}

			save_scope_as = prisoner_3
		}
	}

	option = {
		name = {
			trigger = {
				exists = scope:prisoner_2
			}
			text = intrigue_dread.4001.a
		}
		name = {
			trigger = {
				NOT = { exists = scope:prisoner_2}
			}
			text = intrigue_dread.4001.a.single
		}
		play_music_cue = "mx_cue_murder"
		
		intrigue_dread_4001_select_prisoner_effect = {
			PRISONER = scope:prisoner_1
		}
	}

	option = {
		name = intrigue_dread.4001.b
		trigger = {
			exists = scope:prisoner_2
		}
		play_music_cue = "mx_cue_murder"

		intrigue_dread_4001_select_prisoner_effect = {
			PRISONER = scope:prisoner_2
		}
	}
	
	option = {
		name = intrigue_dread.4001.c
		trigger = {
			exists = scope:prisoner_3
		}
		play_music_cue = "mx_cue_murder"

		intrigue_dread_4001_select_prisoner_effect = {
			PRISONER = scope:prisoner_3
		}
	}

	option = {
		name = intrigue_dread.4001.d
		flavor = intrigue_dread.4001.d.flavor
		# Terminates the event chain for now, but gives this a higher chance to re-appear later.
		add_character_flag = intrigue_dread_4001_delayed

		stress_impact = {
			impatient = minor_stress_impact_gain
		}
	}
}

# Step 2: Decide what you will do with your victim.
intrigue_dread.4002 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = intrigue_dread.4002.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = beg
	}
	
	trigger = {
		scope:victim = {
			intrigue_dread_4001_victim_is_valid = yes
		}
	}

	# Option A: Kill the victim and gain a massive amount of dread.
	option = {
		name = intrigue_dread.4002.a
		flavor = intrigue_dread.4002.a.flavor
		add_intrigue_lifestyle_xp = minor_lifestyle_xp

		# Trigger all the standard effects of torturing someone to death.
		scope:victim = {
			remove_character_flag = intrigue_dread_4001_victim_flag
			death = {
				death_reason = death_torture
				killer = root
			}
			execute_opinion_effect = { VICTIM = scope:victim EXECUTIONER = root }
		}

		# Gain reputation among your vassals for the brutal display.
		add_dread = major_dread_gain
		set_nickname_effect = { NICKNAME = nick_the_flayer }
		add_character_flag = {
			flag = completed_event_intrigue_dread_4001
		}

		stress_impact = {
			compassionate = massive_stress_impact_gain
			deceitful = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			humble = minor_stress_impact_gain
		}
	}

	# Option B: Kill the victim and gain a massive amount of stress reduction.
	option = {
		name = intrigue_dread.4002.b
		flavor = intrigue_dread.4002.b.flavor
		add_intrigue_lifestyle_xp = minor_lifestyle_xp

		#Trigger all the standard effects of torturing someone to death.
		scope:victim = {
			remove_character_flag = intrigue_dread_4001_victim_flag
			death = {
				death_reason = death_torture
				killer = root
			}
			execute_opinion_effect = { VICTIM = scope:victim EXECUTIONER = root }
		}

		# Gain a massive amount of stress loss, both immediately and over the long-term.
		add_stress = major_stress_loss
		add_character_modifier = {
			modifier = intrigue_fond_memories_modifier
			years = 5
		}
		add_character_flag = {
			flag = completed_event_intrigue_dread_4001
		}

		stress_impact = {
			compassionate = massive_stress_impact_gain
			gregarious = medium_stress_impact_gain
			impatient = minor_stress_impact_gain
		}
	}

	# Option C: Begin the slow process of breaking & conditioning the victim's mind.
	option = {
		name = intrigue_dread.4002.c
		flavor = intrigue_dread.4002.c.flavor
		if = {
			limit = {
				has_trait_benevolent_trigger = yes
			}
				custom_tooltip = intrigue_dread.4002.c.compassionate.tt
		}
		add_intrigue_lifestyle_xp = minor_lifestyle_xp

		# Initialization for the next event(which can repeat).
		save_scope_value_as = {
			name = last_torture_method
			value = flag:none
		}
		# Set baseline for how difficult it will be to break this character.
		set_variable = {
			name = break_value
			value = 0
		}

		show_as_tooltip = {
			random_list = {
				1 = {
					desc = intrigue_dread.4002.c.success.desc
					show_chance = no
					scope:victim = {
						add_opinion = {
							modifier = intrigue_mind_broken_opinion
							target = root
						}
					}

					set_nickname_effect = { NICKNAME = nick_the_mindbreaker }
				}
				1 = {
					desc = intrigue_dread.4002.c.failure.desc
					show_chance = no
					add_stress = minor_stress_gain
				}
			}
		}

		trigger_event = {
			id = intrigue_dread.4004
			days = { 3 5 }
		}

		
	}

	# Option D: Terminates the event chain for now, but gives this a higher chance to re-appear later.
	option = {
		name = intrigue_dread.4002.d
		flavor = intrigue_dread.4001.d.flavor
		add_character_flag = intrigue_dread_4001_delayed

		scope:victim = {
			remove_character_flag = intrigue_dread_4001_victim_flag
			add_character_flag = intrigue_dread_4001_was_victim_flag
		}

		stress_impact = {
			impatient = minor_stress_impact_gain
		}
	}
}

# Step 3: Decide which method of torture to use on your victim.
intrigue_dread.4004 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { scope:last_torture_method = flag:none }
				}
				desc = intrigue_dread.4004.desc.followup
			}
			desc = intrigue_dread.4004.desc
		}
	}
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = beg
	}
	
	trigger = {
		scope:victim = {
			intrigue_dread_4001_victim_is_valid = yes
		}
	}

	immediate = {
		if = {
			limit = {
				NOT = { var:break_value > 0 }
			}
		
			# Set baseline for how difficult it will be to break this character.
			set_variable = {
				name = break_value
				value = 5
			}

			# Some characters are harder to break than others.
			if = {
				limit = {
					scope:victim = {
						OR = {
							has_trait = stubborn
							has_trait = wrathful
							has_trait = vengeful
							has_trait = patient
							has_trait = brave
							has_trait = ambitious
							has_trait = zealous
						}
					}
				}
				change_variable = {
					name = break_value
					add = 3
				}
			}
		}
	}

	# Pain
	option = {
		name = intrigue_dread.4004.a
		trigger = {
			NOT = { scope:last_torture_method = flag:pain }
		}

		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 3
		}
		# More effective against certain personality types.
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = chaste }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = temperate }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = calm }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = patient }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = humble }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = honest }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = craven }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = shy }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = content }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = arbitrary }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = cynical }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = trusting }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = compassionate }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = fickle }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = forgiving }

		scope:victim = {
			increase_wounds_effect = {
				REASON = torture
			}
		}

		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:pain
		}
	}

	# Deprivation
	option = {
		name = intrigue_dread.4004.b
		trigger = {
			NOT = { scope:last_torture_method = flag:deprivation }
		}
		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 3
		}
		# More effective against certain personality types.
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = lustful }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = gluttonous }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = greedy }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = lazy }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = impatient }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = deceitful }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = brave }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = cynical }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = zealous }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = paranoid }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = trusting }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = callous }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = sadistic }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = vengeful }


		scope:victim = {
			add_character_modifier = {
				modifier = intrigue_starved_and_deprived_modifier
				years = 1
			}
		}

		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:deprivation
		}
	}
	
	# Humiliation
	option = {
		name = intrigue_dread.4004.c
		trigger = {
			NOT = { scope:last_torture_method = flag:humiliation }
		}
		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 3
		}
		# More effective against certain personality types.
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = generous }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = diligent }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = wrathful }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = arrogant }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = shy }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = gregarious }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = ambitious }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = just }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = zealous }
		intrigue_dread_4001_torture_increase_effectiveness_with_trait_effect = { TRAIT = stubborn }

		scope:victim = {
			add_character_modifier = {
				modifier = intrigue_suffered_degredation_modifier
				years = 1
			}
		}

		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:humiliation
		}

	}

	after = {
		# If the torture has broken the victim, move to the next event in the chain.
		if = {
			limit = {
				var:break_value <= 0
			}
			# Reset the break value for the next part in the chain.
			set_variable = {
				name = break_value
				value = 5
			}
			trigger_event = {
				id = intrigue_dread.4005
			days = { 60 90 }
			}
		}
		# Otherwise come back to this event in a few months to continue the torture.
		else = {
			trigger_event = {
				id = intrigue_dread.4004
			days = { 60 90 }
			}
		}

		reverse_add_opinion = {
			modifier = cruelty_opinion
			opinion = -30
			target = scope:victim
		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			forgiving = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}
	}
}

# Step 4: Use confusion to strip your victim of their personality.
intrigue_dread.4005 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						scope:last_torture_method = flag:reassurance
						scope:last_torture_method = flag:guilt
						scope:last_torture_method = flag:reprive
					}
				}
				desc = intrigue_dread.4005.desc.followup
			}
			desc = intrigue_dread.4005.desc
		}
	}
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = paranoia
	}
	
	trigger = {
		scope:victim = {
			intrigue_dread_4001_victim_is_valid = yes
		}
	}

	# Reassurance
	option = {
		name = intrigue_dread.4005.a
		trigger = {
			NOT = { scope:last_torture_method = flag:reassurance }
		}
		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 2
		}

		# More effective against certain personality types, and removes those traits.
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = lustful }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = lazy }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = wrathful }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = impatient }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = humble }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = honest }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = gregarious }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = just }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = cynical }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = trusting }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = compassionate }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = stubborn }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = forgiving }


		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:reassurance
		}

	}

	# Guilt
	option = {
		name = intrigue_dread.4005.b
		trigger = {
			NOT = { scope:last_torture_method = flag:guilt }
		}
		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 2
		}

		# More effective against certain personality types, and removes those traits.
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = chaste }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = temperate }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = generous }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = diligent }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = patient }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = brave }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = content }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = zealous }


		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:guilt
		}
	}

	# Reprive
	option = {
		name = intrigue_dread.4005.c
		trigger = {
			NOT = { scope:last_torture_method = flag:reprive }
		}
		flavor = intrigue_dread.4004.o.flavor
		change_variable = {
			name = break_value
			subtract = 2
		}

		# More effective against certain personality types, and removes those traits.
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = calm }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = arrogant }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = deceitful }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = craven }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = ambitious }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = arbitrary }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = paranoid }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = callous }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = sadistic }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = vengeful }
		intrigue_dread_4001_torture_increase_effectiveness_remove_trait_effect = { TRAIT = forgiving }

		# Flag the method we just used in case we have to do this step again.
		save_scope_value_as = {
			name = last_torture_method
			value = flag:reprive
		}
	}

	after = {
		# If the torture has broken the victim, move to the next event in the chain.
		if = {
			limit = {
				var:break_value <= 0
			}
			trigger_event = {
				id = intrigue_dread.4006
				days = { 60 90 }
			}
		}
		# Otherwise come back to this event in a few months to continue the torture.
		else = {
			trigger_event = {
				id = intrigue_dread.4005
				days = { 60 90 }
			}
		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			just = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
	}
}

# Step 5: Decide to brainwash victim, or simply release them as an empty husk.
intrigue_dread.4006 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = intrigue_dread.4006.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = beg
	}
	
	trigger = {
		scope:victim = {
			intrigue_dread_4001_victim_is_valid = yes
		}
	}

	option = {
		name = intrigue_dread.4006.a
		flavor = intrigue_dread.4006.a.tt

		add_intrigue_lifestyle_xp = miniscule_lifestyle_xp
		scope:victim = {
			add_character_modifier = {
				modifier = intrigue_broken_modifier
			}
			remove_opinion = {
				modifier = cruelty_opinion
				target = root
			}
		}

		trigger_event = {
			id = intrigue_dread.4007
			days = { 3 5 }

		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			just = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			honest = minor_stress_impact_gain
		}

	}

	option = {
		name = intrigue_dread.4006.b

		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		scope:victim = {
			add_trait = incapable
		}
		hidden_effect = {
			remove_variable = break_value
		}

		set_nickname_effect = { NICKNAME = nick_the_mindbreaker }

		# Once per character lifetime.
		add_character_flag = completed_event_intrigue_dread_4001

		scope:victim = {
			remove_character_flag = intrigue_dread_4001_victim_flag
			add_character_flag = intrigue_dread_4001_was_victim_flag
			release_from_prison = yes
		}


		stress_impact = {
			compassionate = major_stress_impact_gain
			just = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
	}
}

# Step 6: Finish brainwashing victim.
intrigue_dread.4007 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = intrigue_dread.4007.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = admiration
	}
	
	trigger = {
		scope:victim = {
			intrigue_dread_4001_victim_is_valid = yes
		}
	}

	immediate = {

	}

	option = {
		name = intrigue_dread.4007.a

		hidden_effect = {
			remove_variable = break_value
			set_variable = {
				name = mind_broken_victim
				value = scope:victim
			}
		}

		# Once per character lifetime.
		add_character_flag = completed_event_intrigue_dread_4001

		scope:victim = {
			remove_trait = brave
			add_trait_force_tooltip = craven

			add_opinion = {
				modifier = intrigue_mind_broken_opinion
				target = root
			}
			remove_character_flag = intrigue_dread_4001_victim_flag
			add_character_flag = intrigue_dread_4001_was_victim_flag
			release_from_prison = yes
		}

		set_nickname_effect = { NICKNAME = nick_the_mindbreaker }

		trigger_event = {
			id = intrigue_dread.4008
			days = { 1095 1825 }
		}
	}
}

intrigue_dread.4008 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = {
		desc = intrigue_dread.4008.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:resolution = flag:loyal
				}
				desc = intrigue_dread.4008.desc.success
			}
			triggered_desc = {
				trigger = {
					scope:resolution = flag:healed
				}
				desc = intrigue_dread.4008.desc.failure
			}
			triggered_desc = {
				trigger = {
					scope:resolution = flag:insane
				}
				desc = intrigue_dread.4008.desc.lunatic
			}
		}
	}
	
	theme = intrigue_intimidation_focus
	override_background = { reference = throne_room }
	left_portrait = {
		character = scope:victim
		animation = paranoia
	}
	
	trigger = {
		scope:victim = {
			is_alive = yes
			is_imprisoned = no
		}
	}

	immediate = {
		scope:victim = {
			every_relation = {
				type = friend
				add_to_temporary_list = potential_caretakers
			}
			every_close_family_member = {
				limit = {
					is_in_the_same_court_as = scope:victim
					opinion = {
						target = scope:victim
						value >= 50
					}
				}
				add_to_temporary_list = potential_caretakers
			}
			every_spouse = {
				limit = {
					is_in_the_same_court_as = scope:victim
					opinion = {
						target = scope:victim
						value >= 50
					}
				}
				add_to_temporary_list = potential_caretakers
			}
			every_relation = {
				type = lover
				limit = {
					is_in_the_same_court_as = scope:victim
					opinion = {
						target = scope:victim
						value >= 50
					}
				}
				add_to_temporary_list = potential_caretakers
			}
		}

		hidden_effect = {
			random_list = {
				# Victim remains loyal to me.
				100 = {
					modifier = {
						scope:victim = {
							court_owner = root
						}
						factor = 10
					}
					save_scope_value_as = {
						name = resolution
						value = flag:loyal
					}
				}
				# Victim has gone insane.
				50 = {
					modifier = {
						scope:victim = {
							stress > medium_stress
						}
						add = 100
					}
					modifier = {
						scope:victim = {
							stress > high_stress
						}
						add = 200
					}
					save_scope_value_as = {
						name = resolution
						value = flag:insane
					}
				}
				# Victim has healed and rejected me!
				0 = {
					modifier = {
						any_in_list = {
							list = potential_caretakers
							learning >= extremely_high_skill_rating
						}
						add = 100
					}
					modifier = {
						any_in_list = {
							list = potential_caretakers
							intrigue >= extremely_high_skill_rating
						}
						add = 100
					}
					modifier = {
						any_in_list = {
							list = potential_caretakers
							has_trait = compassionate
						}
						add = 100
					}
					save_scope_value_as = {
						name = resolution
						value = flag:healed
					}
				}
			}
		}
	}

	option = {
		name = intrigue_dread.4008.a.success
		trigger = {
			scope:resolution = flag:loyal
		}
		exclusive = yes
		scope:victim = {
			remove_character_modifier = intrigue_broken_modifier
		}
	}

	option = {
		name = intrigue_dread.4008.a.success

		trigger = {
			scope:resolution = flag:healed
		}

		exclusive = yes
		scope:victim = {
			remove_opinion = {
				modifier = intrigue_mind_broken_opinion
				target = root
			}
			add_opinion = {
				target = root
				modifier = hate_opinion
				opinion = medium_negative_opinion
			}
			remove_character_modifier = intrigue_broken_modifier
		}
	}

	option = {
		name = intrigue_dread.4008.a.lunatic
		scope:victim = {
			remove_opinion = {
				modifier = intrigue_mind_broken_opinion
				target = root
			}
			remove_character_modifier = intrigue_broken_modifier
			add_trait = lunatic_1
		}
	}
	after = {
		if = {
			limit = {
				scope:resolution = flag:loyal
			}
			add_intrigue_lifestyle_xp = massive_lifestyle_xp
		}
		else_if = {
			limit = {
				scope:resolution = flag:healed
			}
			add_intrigue_lifestyle_xp = major_lifestyle_xp
		}
		else_if = {
			limit = {
				scope:resolution = flag:insane
			}
			add_intrigue_lifestyle_xp = medium_lifestyle_xp
		}
	}
}


# Ping event for the following:
intrigue_dread.4010 = {
	hidden = yes

	trigger = {
		has_character_flag = intrigue_dread_4001_victim_flag
	}

	option = {
		remove_character_flag = intrigue_dread_4001_victim_flag
		add_character_flag = intrigue_dread_4001_was_victim_flag
		save_scope_as = victim
		scope:imprisoner = {
			trigger_event = intrigue_dread.4011
		}
	}
}

# Inform the player that their victim is no longer in jail.
intrigue_dread.4011 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = intrigue_dread.4011.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = scope:victim
		animation = rage
	}

	option = {
		name = intrigue_dread.4011.a
		add_stress = minor_stress_gain
	}
}

# Ping event for the following
intrigue_dread.4012 = {
	hidden = yes

	trigger = {
		has_character_flag = intrigue_dread_4001_victim_flag
	}

	immediate = {
		remove_character_flag = intrigue_dread_4001_victim_flag
		add_character_flag = intrigue_dread_4001_was_victim_flag
		save_scope_as = victim
		imprisoner = {
			trigger_event = intrigue_dread.4013
		}
	}
}

# Inform the player that their victim has died.
intrigue_dread.4013 = {
	type = character_event
	title = intrigue_dread.4001.t
	desc = intrigue_dread.4013.desc
	
	theme = intrigue_intimidation_focus
	left_portrait = {
		character = root
		animation = disappointed
	}
	right_portrait = {
		character = scope:victim
		animation = pain
	}

	option = {
		name = intrigue_dread.4013.a
		add_stress = minor_stress_gain
	}
}

##################################################
# Bothersome Hearings
# by Flavio Verna
# 4100 - 4102
##################################################

scripted_trigger intrigue_dread_4100_petitioner_trigger = {
	is_available_adult = yes
	is_ai = yes
	is_close_family_or_spouse_of_root_trigger = no
	reverse_opinion = {
		target = root
		value < low_positive_opinion
	}
	NOR = {
		has_relation_friend = root
		has_relation_lover = root
	}
	OR = {
		NOT = { is_councillor_of = root }
		has_council_position = councillor_chancellor
		has_council_position = councillor_marshal
		has_council_position = councillor_steward
	}
}

# Petitioners bring frivolous matter to the court.
intrigue_dread.4100 = {
	type = character_event
	title = intrigue_dread.4100.t
	desc = {
		desc = intrigue_dread.4100.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = lazy
				}
				desc = intrigue_dread.4100.desc.lazy
			}
			triggered_desc = {
				trigger = {
					OR = {
						scope:petitioner_1 = {
							is_councillor_of = root
						}
						scope:petitioner_2 = {
							is_councillor_of = root
						}
					}
				}
				desc = intrigue_dread.4100.desc.councillors
			}
			desc = intrigue_dread.4100.desc.fallback
		}
	}
	
	theme = intrigue_intimidation_focus
	override_background = { reference = throne_room }
	left_portrait = {
		character = scope:petitioner_1
		animation = anger
	}
	right_portrait = {
		character = scope:petitioner_2
		animation = disgust
	}
	lower_right_portrait = scope:scoped_chancellor

	trigger = {
		is_landed_or_landless_administrative = yes
		is_available = yes
		NOT = { has_character_flag = had_event_intrigue_dread_4100 }
		any_vassal = {
			intrigue_dread_4100_petitioner_trigger = yes
			count >= 2
		}
	}

	weight_multiplier = {
		base = 0.75
		modifier = {
			add = 0.50
			has_trait = sadistic
		}
		modifier = {
			add = 0.25
			has_trait = callous
		}
		modifier = {
			add = 0.25
			has_trait = wrathful
		}
		modifier = {
			add = 0.15
			has_trait = paranoid
		}
		modifier = {
			add = 0.5
			dread <= medium_dread
		}
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_intrigue_dread_4100
			years = 15
		}
		random_vassal = {
			limit = {
				intrigue_dread_4100_petitioner_trigger = yes
				any_claim = { useful_courtier_or_guest_claim_trigger = { RULER = root } }
			}
			alternative_limit = {
				intrigue_dread_4100_petitioner_trigger = yes
				OR = {
					has_council_position = councillor_chancellor
					has_council_position = councillor_marshal
					has_council_position = councillor_steward
					is_knight = yes
				}
			}
			alternative_limit = {
				intrigue_dread_4100_petitioner_trigger = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					has_relation_rival = root
				}
				modifier = {
					add = 10
					reverse_opinion = {
						target = root
						value < medium_positive_opinion
					}
				}
				modifier = {
					add = 10
					exists = dynasty
					dynasty = { dynasty_prestige_level >= 1 }
				}
				modifier = {
					add = 5
					has_hook = root
				}
				modifier = {
					add = 5
					any_known_secret = {
						secret_owner = root
					}
				}
				modifier = {
					add = 5
					any_consort = {
						is_close_family_or_spouse_of_root_trigger = yes
					}
				}
			}
			save_scope_as = petitioner_1
		}
		random_vassal = {
			limit = {
				NOT = { this = scope:petitioner_1 }
				intrigue_dread_4100_petitioner_trigger = yes
				any_claim = { useful_courtier_or_guest_claim_trigger = { RULER = root } }
			}
			alternative_limit = {
				NOT = { this = scope:petitioner_1 }
				intrigue_dread_4100_petitioner_trigger = yes
				OR = {
					has_council_position = councillor_chancellor
					has_council_position = councillor_marshal
					has_council_position = councillor_steward
					is_knight = yes
				}
			}
			alternative_limit = {
				NOT = { this = scope:petitioner_1 }
				intrigue_dread_4100_petitioner_trigger = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					has_relation_rival = root
				}
				modifier = {
					add = 10
					reverse_opinion = {
						target = root
						value < medium_positive_opinion
					}
				}
				modifier = {
					add = 10
					exists = dynasty
					dynasty = { dynasty_prestige_level >= 1 }
				}
				modifier = {
					add = 5
					has_hook = root
				}
				modifier = {
					add = 5
					any_known_secret = {
						secret_owner = root
					}
				}
				modifier = {
					add = 5
					any_consort = {
						is_close_family_or_spouse_of_root_trigger = yes
					}
				}
			}
			save_scope_as = petitioner_2
		}
		if = {
			limit = {
				has_trait = lazy
				exists = cp:councillor_chancellor
				NOR = {
					cp:councillor_chancellor = scope:petitioner_1
					cp:councillor_chancellor = scope:petitioner_2
				}
			}
			cp:councillor_chancellor = {
				save_scope_as = scoped_chancellor
			}
		}
	}

	# (Sadistic) Execute Option
	# Thrown Out Option
	# Threaten Option
	# Conciliatory Option
	# (Lazy) Let Chancellor handle it Option

	option = { # Execute
		name = intrigue_dread.4100.z
		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_dread = minor_dread_gain
		add_intrigue_lifestyle_xp = major_lifestyle_xp
		execute_prisoner_effect = { VICTIM = scope:petitioner_1 EXECUTIONER = root }
		execute_prisoner_effect = { VICTIM = scope:petitioner_2 EXECUTIONER = root }
		if = {
			limit = { exists = root.capital_county }
			root.capital_county = {
				change_county_control = medium_county_control_gain
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}
	}

	option = { # Thrown Out
		name = intrigue_dread.4100.a
		trigger = {
			NOT = { has_trait = sadistic }
		}
		scope:petitioner_1 = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -30
			}
		}
		scope:petitioner_2 = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = -30
			}
		}
		stress_impact = {
			honest = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}
	}

	option = { # Threaten
		name = intrigue_dread.4100.b
		trigger = {
			can_add_hook = {
				type = threat_hook
				target = scope:petitioner_1
			}
			can_add_hook = {
				type = threat_hook
				target = scope:petitioner_2
			}
		}
		duel = {
			skill = intrigue
			value = decent_skill_rating
			10 = {
				desc = intrigue_dread.4100.b.duel_success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 1
					}
				modifier = {
					add = 5
					has_trait = diligent
				}
				modifier = {
					add = 5
					has_trait = deceitful
				}
				send_interface_toast = {
					title = intrigue_dread.4100.b.duel_success
					left_icon = scope:petitioner_1
					right_icon = scope:petitioner_2
					add_dread = major_dread_gain
					add_hook = {
						target = scope:petitioner_1
						type = threat_hook
					}
					add_hook = {
						target = scope:petitioner_2
						type = threat_hook
					}
					add_intrigue_lifestyle_xp = major_lifestyle_xp
				}
				hidden_effect = {
					scope:petitioner_1 = {
						add_prestige = major_prestige_loss
						stress_impact = {
							base = minor_stress_impact_gain
						}
					}
					scope:petitioner_2 = {
						add_prestige = major_prestige_loss
						stress_impact = {
							base = minor_stress_impact_gain
						}
					}
				}
			}
			7 = {
				desc = intrigue_dread.4100.b.duel_failure
				modifier = {
					add = 5
					has_trait = lazy
				}
				modifier = {
					add = 5
					has_trait = honest
				}
				send_interface_toast = {
					title = intrigue_dread.4100.b.duel_failure
					left_icon = scope:petitioner_1
					right_icon = scope:petitioner_2
					add_dread = minor_dread_loss
					add_prestige = minor_prestige_loss
					reverse_add_opinion = {
						target = scope:petitioner_1
						modifier = humiliated_opinion
						opinion = low_negative_opinion
					}
					reverse_add_opinion = {
						target = scope:petitioner_2
						modifier = humiliated_opinion
						opinion = low_negative_opinion
					}
					add_intrigue_lifestyle_xp = minor_lifestyle_xp
					stress_impact = {
						base = minor_stress_impact_gain
					}
				}
			}
		}
		stress_impact = {
			diligent = minor_stress_impact_gain
			generous = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
	}

	option = { # Conciliatory Reaction
		name = intrigue_dread.4100.c
		show_as_tooltip = {
			random_list = {
				desc = intrigue_dread.4100.c.tooltip
				50 = {
					show_chance = no
					desc = intrigue_dread.4100.c.support.petitioner_1
					reverse_add_opinion = {
						target = scope:petitioner_1
						modifier = grateful_opinion
						opinion = 20
					}
					if = {
						limit = {
							can_add_hook = {
								target = scope:petitioner_1
								type = favor_hook
							}
						}
						add_hook = {
							type = favor_hook
							target = scope:petitioner_1
							days = default_favor_duration
						}
					}
				}
				50 = {
					show_chance = no
					desc = intrigue_dread.4100.c.support.petitioner_2
					reverse_add_opinion = {
						target = scope:petitioner_2
						modifier = grateful_opinion
						opinion = 20
					}
					if = {
						limit = {
							can_add_hook = {
								target = scope:petitioner_2
								type = favor_hook
							}
						}
						add_hook = {
							type = favor_hook
							target = scope:petitioner_2
							days = default_favor_duration
						}
					}
				}
			}
		}
		trigger_event = intrigue_dread.4102 # Decide whom to support.
		stress_impact = {
			base = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
			compassionate = minor_stress_impact_loss
			sadistic = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
	}

	option = { # Lazy Option
		name = intrigue_dread.4100.d
		trigger = {
			has_trait = lazy
			exists = cp:councillor_chancellor
			NOR = {
				cp:councillor_chancellor = scope:petitioner_1
				cp:councillor_chancellor = scope:petitioner_2
			}
		}
		trait = lazy
		reverse_add_opinion = {
			target = cp:councillor_chancellor
			modifier = considerate_liege_opinion
			opinion = low_positive_opinion
		}
		reverse_add_opinion = {
			target = scope:petitioner_1
			modifier = good_adjudicator_opinion
			opinion = low_positive_opinion
		}
		reverse_add_opinion = {
			target = scope:petitioner_2
			modifier = good_adjudicator_opinion
			opinion = low_positive_opinion
		}
		cp:councillor_chancellor = {
			add_prestige = medium_prestige_gain
		}
		if = {
			limit = { exists = root.capital_county }
			root.capital_county = {
				change_county_control = minor_county_control_loss
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
	}
}

# Conciliatory event.
intrigue_dread.4102 = {
	type = character_event
	title = intrigue_dread.4100.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = flag_intrigue_dread_4102_commanders
				}
				desc = intrigue_dread.4102.desc.commanders
			}
			triggered_desc = {
				trigger = {
					has_character_flag = flag_intrigue_dread_4102_guests
				}
				desc = intrigue_dread.4102.desc.guests
			}
			desc = intrigue_dread.4102.desc.fallback
		}
		desc = intrigue_dread.4102.desc.antagonizer
	}
	
	theme = intrigue_intimidation_focus
	override_background = { reference = throne_room }
	left_portrait = {
		character = scope:petitioner_1
		animation = disapproval
	}
	right_portrait = {
		character = scope:petitioner_2
		animation = disgust
	}

	immediate = {
		# Pick random matter.
		random_list = {
			# Commanders bickering
			# Offended guest
			# Fallback
			25 = {
				trigger = {
					OR = {
						scope:petitioner_1 = {
							OR = {
								is_knight = yes
								has_council_position = councillor_marshal
							}
						}
						scope:petitioner_2 = {
							OR = {
								is_knight = yes
								has_council_position = councillor_marshal
							}
						}
					}
				}
				add_character_flag = flag_intrigue_dread_4102_commanders
			}
			25 = {
				trigger = {
					OR = {
						scope:petitioner_1 = {
							is_foreign_court_guest_of = root
						}
						scope:petitioner_2 = {
							is_foreign_court_guest_of = root
						}
					}
				}
				add_character_flag = flag_intrigue_dread_4102_guests
			}
			25 = {
			}
		}
		# Who is making more of a fuss?
		random_list = {
			50 = {
				modifier = {
					add = 10
					scope:petitioner_1 = {
						has_personality_dominant_trigger = yes
					}
				}
				modifier = {
					add = 10
					scope:petitioner_1 = {
						has_personality_emotional_trigger = yes
					}
				}
				modifier = {
					add = 10
					scope:petitioner_1 = {
						has_personality_extroverted_trigger = yes
					}
				}
				scope:petitioner_1 = {
					save_scope_as = scoped_antagonizer
				}
			}
			50 = {
				modifier = {
					add = 10
					scope:petitioner_2 = {
						has_personality_dominant_trigger = yes
					}
				}
				modifier = {
					add = 10
					scope:petitioner_2 = {
						has_personality_emotional_trigger = yes
					}
				}
				modifier = {
					add = 10
					scope:petitioner_2 = {
						has_personality_extroverted_trigger = yes
					}
				}
				scope:petitioner_2 = {
					save_scope_as = scoped_antagonizer
				}
			}
		}
	}

	option = {
		name = intrigue_dread.4102.a
		trigger = { dread >= medium_dread }
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
	}

	option = {
		name = intrigue_dread.4102.b
		reverse_add_opinion = {
			target = scope:petitioner_1
			modifier = grateful_opinion
			opinion = 20
		}
		if = {
			limit = {
				can_add_hook = {
					target = scope:petitioner_1
					type = favor_hook
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:petitioner_1
				days = default_favor_duration
			}
		}
	}
	option = {
		name = intrigue_dread.4102.c
		reverse_add_opinion = {
			target = scope:petitioner_2
			modifier = grateful_opinion
			opinion = 20
		}
		if = {
			limit = {
				can_add_hook = {
					target = scope:petitioner_2
					type = favor_hook
				}
			}
			add_hook = {
				type = favor_hook
				target = scope:petitioner_2
				days = default_favor_duration
			}
		}
	}

	after = {
		remove_character_flag = flag_intrigue_dread_4102_commanders
		remove_character_flag = flag_intrigue_dread_4102_guests
	}
}

##################################################
# A forest of corpses
# by James Beaumont
# 4200 - 4201
##################################################

scripted_trigger intrigue_dread_4200_full_prison_trigger = {
	any_prisoner = {
		count >= 5
	}
}

# You dream of a forest of corpses
intrigue_dread.4200 = {
	type = character_event
	title = intrigue_dread.4200.t
	desc = {
		desc = intrigue_dread.4200.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					intrigue_dread_4200_full_prison_trigger = yes
				}
				desc = intrigue_dread.4200.desc.noble_forest
			}
			desc = intrigue_dread.4200.desc.commoner_forest
		}
		desc = intrigue_dread.4200.desc.middle
		first_valid = {
			triggered_desc = {
				trigger = {
					intrigue_dread_4200_full_prison_trigger = yes
				}
				desc = intrigue_dread.4200.desc.noble_forest.outro
			}
			desc = intrigue_dread.4200.desc.commoner_forest.outro
		}
	}
	
	theme = intrigue_intimidation_focus
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = personality_callous
	}

	trigger = {
		is_landed_or_landless_administrative = yes
		is_available = yes
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		NOT = { has_character_flag = had_event_intrigue_dread_4200 }
	}

	weight_multiplier = {
		base = 0.75
		modifier = {
			add = 0.50
			has_trait = sadistic
		}
		modifier = {
			add = 0.25
			has_trait = callous
		}
		modifier = {
			add = 0.25
			has_trait = wrathful
		}
		modifier = {
			add = 0.5
			dread <= medium_dread
		}
		modifier = {
			factor = 2
			intrigue_dread_4200_full_prison_trigger = yes
		}
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		add_character_flag = {
			flag = had_event_intrigue_dread_4200
			years = 15
		}
		if = {
			limit = {
				any_prisoner = {
					root = { has_execute_reason = prev }
				}
			}
			random_prisoner = {
				limit = {
					root = { has_execute_reason = prev }
				}
				save_scope_as = random_prisoner_scope
			}
		}
		if = {
			limit = {
				intrigue_dread_4200_full_prison_trigger = yes
			}
			# Only grab a new prisoner for the first slot if nobody fulfilled the previous criteria
			if = {
				limit = {
					NOT = { exists = scope:random_prisoner_scope }
				}
				random_prisoner = {
					weight = {
						modifier = {
							factor = 10
							root = { has_execute_reason = prev }
						}
					}
					save_scope_as = random_prisoner_scope
					add_to_list = random_prisoner_list
				}
			}
			random_prisoner = {
				limit = {
					NOT = { is_in_list = random_prisoner_list }
				}
				weight = {
					modifier = {
						factor = 10
						root = { has_execute_reason = prev }
					}
				}
				add_to_list = random_prisoner_list
			}
			random_prisoner = {
				limit = {
					NOT = { is_in_list = random_prisoner_list }
				}
				weight = {
					modifier = {
						factor = 10
						root = { has_execute_reason = prev }
					}
				}
				add_to_list = random_prisoner_list
			}
			random_prisoner = {
				limit = {
					NOT = { is_in_list = random_prisoner_list }
				}
				weight = {
					modifier = {
						factor = 10
						root = { has_execute_reason = prev }
					}
				}
				add_to_list = random_prisoner_list
			}
			random_prisoner = {
				limit = {
					NOT = { is_in_list = random_prisoner_list }
				}
				weight = {
					modifier = {
						factor = 10
						root = { has_execute_reason = prev }
					}
				}
				add_to_list = random_prisoner_list
			}
		}
	}

	# Kill commoners
	# Kill one noble
	# Kill some nobles
	# Kill everyone in the dungeon
	# Cancel the whole murder forest thing

	option = { # Kill commoners
		name = intrigue_dread.4200.a
		trigger = {
			NOT = {
				exists = scope:random_prisoner_scope
			}
		}
		add_tyranny = medium_tyranny_gain
		add_dread = medium_dread_gain
		add_character_flag = {
			flag = commoner_forest_flag
			years = 15
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		trigger_event = { id = intrigue_dread.4201 days = 10 }
		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			just = medium_stress_impact_gain
			honest = major_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
	}

	option = { # Kill a noble
		name = intrigue_dread.4200.b
		trigger = {
			exists = scope:random_prisoner_scope
		}
		add_tyranny = minor_tyranny_gain
		scope:random_prisoner_scope = {
			death = {
				killer = root
				death_reason = death_for_corpse_forest
			}
		}
		add_dread = medium_dread_gain
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		trigger_event = { id = intrigue_dread.4201 days = 10 }
		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			just = medium_stress_impact_gain
			honest = major_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
	}

	option = { # Kill a bunch of nobles
		name = intrigue_dread.4200.c
		trigger = {
			any_in_list = {
				list = random_prisoner_list
				count >=5
			}
		}
		add_tyranny = major_tyranny_gain
		add_character_flag = {
			flag = medium_forest_flag
			years = 15
		}
		every_in_list = {
			list = random_prisoner_list
			death = {
				killer = root
				death_reason = death_for_corpse_forest
			}
		}
		add_dread = medium_dread_gain
		add_legitimacy = miniscule_legitimacy_loss
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		trigger_event = { id = intrigue_dread.4201 days = 10 }
		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			just = medium_stress_impact_gain
			honest = major_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
	}

	option = { # Kill a bunch of nobles
		name = intrigue_dread.4200.d
		trigger = {
			any_prisoner = {
				count >= 10
			}
		}
		add_tyranny = minor_tyranny_gain
		add_character_flag = {
			flag = large_forest_flag
			years = 15
		}
		every_prisoner = {
			death = {
				killer = root
				death_reason = death_for_corpse_forest
			}
		}
		add_dread = major_dread_gain
		add_legitimacy = minor_legitimacy_loss
		add_intrigue_lifestyle_xp = major_lifestyle_xp
		trigger_event = { id = intrigue_dread.4201 days = 10 }
		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			just = medium_stress_impact_gain
			honest = major_stress_impact_gain
			compassionate = major_stress_impact_gain
		}
	}

	option = { # Cancel the idea
		name = intrigue_dread.4200.e
		add_piety = minor_piety_gain
		stress_impact = {
			sadistic = medium_stress_impact_gain
		}
	}
}

# Forest of corpses is complete
intrigue_dread.4201 = {
	type = character_event
	title = intrigue_dread.4201.t
	desc = {
		desc = intrigue_dread.4201.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = {
						has_character_flag = commoner_forest_flag
					}
				}
				desc = intrigue_dread.4201.desc.noble_forest
			}
			desc = intrigue_dread.4201.desc.commoner_forest
		}
		desc = intrigue_dread.4201.desc.outro
	}
	
	trigger = { # Redundancy check
		OR = {
			exists = capital_county
			exists = top_liege.capital_county
		}
	}
	theme = intrigue_intimidation_focus
	override_background = { reference = battlefield }
	left_portrait = {
		character = root
		animation = personality_callous
	}

	option = {
		name = intrigue_dread.4201.a
		if = {
			limit = {
				is_ai = no
			}
			ek_give_nickname_effect = { NICKNAME = nick_the_impaler} #EK EDIT: Changed nickname effect to our own
		}
		else = {
			random = {
				chance = 15
				ek_give_nickname_effect = { NICKNAME = nick_the_impaler} #EK EDIT: Changed nickname effect to our own
			}
		}
		if = {
			limit = { exists = capital_county }
			if = {
				limit = {
					has_character_flag = large_forest_flag
				}
				capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_3_modifier
						years = 5
					}
				}
			}
			else_if = {
				limit = {
					has_character_flag = medium_forest_flag
				}
				capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_2_modifier
						years = 5
					}
				}
			}
			else = {
				capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_1_modifier
						years = 5
					}
				}
			}
		}
		else = {
			if = {
				limit = {
					has_character_flag = large_forest_flag
				}
				top_liege.capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_3_modifier
						years = 5
					}
				}
			}
			else_if = {
				limit = {
					has_character_flag = medium_forest_flag
				}
				top_liege.capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_2_modifier
						years = 5
					}
				}
			}
			else = {
				top_liege.capital_county = {
					add_county_modifier = {
						modifier = forest_of_corpses_1_modifier
						years = 5
					}
				}
			}
		}
	}
}


################################################
# You're scaring a loved one                   #
# Luke Bean                                    #
################################################

intrigue_dread.2001 = {
	type = character_event
	title = intrigue_dread.2001.t
	desc = intrigue_dread.2001.desc
	theme = intrigue_intimidation_focus
	cooldown = { years = 5 }
	override_background = { reference = garden }
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	right_portrait = {
		character = scope:loved_one
		animation = fear
	}
	
	trigger = {
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		is_available_healthy_adult = yes
		dread >= medium_dread
		OR = {
			any_spouse = {
				is_available_healthy_ai_adult = yes
			}
			any_relation = {
				type = lover
				is_available_healthy_ai_adult = yes
			}
		}
	}

	weight_multiplier = {
		base = 1
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		every_relation = {
			type = lover
			limit = {
				is_available_healthy_ai_adult = yes
			}
			add_to_list = potential_loved_one
		}
		every_spouse = {
			limit = {
				is_available_healthy_ai_adult = yes
			}
			add_to_list = potential_loved_one
		}

		random_in_list = {
			list = potential_loved_one
			save_scope_as = loved_one
		}

		if = {
			limit = {
				OR = {
					any_secret = {
						secret_type = secret_murder
						NOT = { is_known_by = scope:loved_one }
					}
					any_secret = {
						secret_type = secret_cannibal
						NOT = { is_known_by = scope:loved_one }
					}
					any_secret = {
						secret_type = secret_witch
						NOT = { is_known_by = scope:loved_one }
					}
				}
			}
			random_secret = {
				limit = {
					OR = {
						secret_type = secret_murder
						secret_type = secret_cannibal
						secret_type = secret_witch
					}
					NOT = { is_known_by = scope:loved_one }
				}
				save_scope_as = dark_secret
			}
		}
	}

	option = { # They don't know HALF the things I've done.
		name = intrigue_dread.2001.a
		flavor = intrigue_dread.2001.a.tt
		
		trigger = { exists = scope:dark_secret }
		scope:dark_secret = { reveal_to = scope:loved_one }
		add_intrigue_lifestyle_xp = major_lifestyle_xp
		add_dread = medium_dread_gain
		reverse_add_opinion = {
			target = scope:loved_one
			modifier = scared_opinion
			opinion = -50
		}
		stress_impact = {
			deceitful = medium_stress_impact_gain
			paranoid = major_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = paranoid
					has_trait = deceitful
					has_trait = compassionate
				}
			}
		}
	}

	option = { # Everything I do is to protect you!
		name = intrigue_dread.2001.b
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		scope:loved_one = {
			add_character_modifier = {
				modifier = intrigue_protected_by_loved_one_modifier
				days = 3650
			}
		}
		random_list = {
			30 = { #Spouse digs your whole Byronic baddie thing
				desc = intrigue_dread.2001.b.into_it
				compatibility_modifier = {
					who = scope:loved_one
					compatibility_target = root
					multiplier = 3
					max = 50
					min = -30
				}
				modifier = {
					scope:loved_one = { has_trait = sadistic }
					add = 30
				}
				modifier = {
					scope:loved_one = { has_trait = ambitious }
					add = 20
				}
				modifier = {
					scope:loved_one = { has_trait = vengeful }
					add = 20
				}
				modifier = {
					scope:loved_one = { has_trait = craven }
					add = 20
				}
				modifier = {
					scope:loved_one = { has_trait = callous }
					add = 10
				}
				modifier = {
					scope:loved_one = { OR = { has_trait = murderer	any_secret = { secret_type = secret_murder } } }
					add = 50
				}
				min = 2
				send_interface_toast = {
					title = intrigue_dread.2001.b.into_it
					left_icon = scope:loved_one
					if = {
						limit = {
						 	any_relation = { type = lover this = scope:loved_one }
							can_set_relation_soulmate_trigger = { CHARACTER = scope:loved_one }
						}
						set_relation_soulmate = { reason = soulmate_dreadful_for_me copy_reason = lover target = scope:loved_one }
					}
					else_if = {
						limit = {
							NOT = { any_relation = { type = lover this = scope:loved_one } }
						}
						set_relation_lover = { reason = lover_dreadful_for_me target = scope:loved_one }
					}
					else = {
						reverse_add_opinion = {
							target = scope:loved_one
							modifier = grateful_opinion
							opinion = 50
						}
					}
				}
			}
			60 = { #Spouse feels reassured that at least THEY won't get got
				desc = intrigue_dread.2001.b.reassured
				modifier = {
					scope:loved_one = { has_trait = craven }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = callous }
					add = 20
				}
				modifier = {
					scope:loved_one = { has_trait = content }
					add = 20
				}
				min = 2
				send_interface_toast = {
					title = intrigue_dread.2001.b.reassured
					left_icon = scope:loved_one
					reverse_add_opinion = {
						target = scope:loved_one
						modifier = grateful_opinion
						opinion = 20
					}
				}
			}
			30 = { #Spouse does not find your offer to murder people for them either sexy or reassuring
				desc = intrigue_dread.2001.b.terrified
				modifier = {
					scope:loved_one = { has_trait = paranoid }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = honest }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = just }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = compassionate }
					add = 20
				}
				min = 2
				send_interface_toast = {
					title = intrigue_dread.2001.b.terrified
					left_icon = scope:loved_one
					reverse_add_opinion = {
						target = scope:loved_one
						modifier = scared_opinion
						opinion = -50
					}
				}
			}
		}
		
		stress_impact = {
			sadistic = medium_stress_impact_gain
			callous = medium_stress_impact_gain
			deceitful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = sadistic
					has_trait = callous
					has_trait = deceitful
				}
			}
		}
	}

	option = { # Who, specifically, says these things about me? I need names.
		name = intrigue_dread.2001.c
		duel = {
			target = scope:loved_one
			skill = intrigue
			12 = {
				desc = tooltip.intrigue_dread.2001.c.duel_success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = {
					scope:loved_one = { has_trait = craven }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = arbitrary }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = honest }
					add = 10
				}
				min = 2
				send_interface_toast = {
					left_icon = scope:loved_one
					title = tooltip.intrigue_dread.2001.c.duel_success
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
					add_dread = medium_dread_gain
					reverse_add_opinion = {
						target = scope:loved_one
						modifier = scared_opinion
						opinion = -30
					}
				}
				
			}
			12 = {
				desc = tooltip.intrigue_dread.2001.c.duel_failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				modifier = {
					scope:loved_one = { has_trait = brave }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = just }
					add = 10
				}
				modifier = {
					scope:loved_one = { has_trait = deceitful }
					add = 10
				}
				min = 2
				send_interface_toast = {
					left_icon = scope:loved_one
					title = tooltip.intrigue_dread.2001.c.duel_failure
					add_dread = medium_dread_loss
					reverse_add_opinion = {
						target = scope:loved_one
						modifier = intrigue_defied_loved_one_opinion
					}
				}
				hidden_effect = {	# ;)
					if = {
						limit = { any_targeting_scheme = { scheme_type = murder } }
						random_targeting_scheme ={
							limit = { scheme_type = murder }
							save_scope_as = scheme
						}
						try_to_force_assign_character_to_random_agent_slot_effect = {
							SCHEME = scope:scheme
							CHAR = scope:loved_one
							YEARS = 10
						}
					}
				}
			}
		}

		stress_impact = {
			content = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = forgiving
					has_trait = content
					has_trait = calm
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = vengeful
					has_trait = ambitious
					has_trait = wrathful
				}
			}
		}
	}

	option = { # Just smile and walk away.
		name = intrigue_dread.2001.d
		add_dread = 5
		reverse_add_opinion = {
			target = scope:loved_one
			modifier = scared_opinion
			opinion = -10
		}
		ai_chance = {
			base = 100
		}
	}
 }




################################################
# Shut up rumors about a relative              #
# Luke Bean                                    #
################################################

 intrigue_dread.2101 = {
	type = character_event
	title = intrigue_dread.2101.t
	desc = {
		desc = intrigue_dread.2101.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:hater = {
						any_memory = {
							has_memory_type = failed_assassination_by
							any_memory_participant = {
									this = scope:family_member
							}
						}
					}
				}
				desc = intrigue_dread.2101.desc.failed_assassination
			}
			triggered_desc = {
				trigger = {
					scope:hater = {
						any_memory = {
							has_memory_type = spouse_committed_adultery
							any_memory_participant = {
								this = scope:family_member
							}
						}
					}
				}
				desc = intrigue_dread.2101.desc.committed_adultery
			}
			triggered_desc = {
				trigger = {
					scope:hater = {
						any_memory = {
							has_memory_type = tormented_me_during_childhood
							any_memory_participant = {
								this = scope:family_member
							}
						}
					}
				}
				desc = intrigue_dread.2101.desc.bullied_me
			}
			triggered_desc = {
				trigger = {
					scope:hater = {
						any_memory = {
							has_memory_type = stopped_being_friends
							any_memory_participant = {
								this = scope:family_member
							}
						}
					}
				}
				desc = intrigue_dread.2101.desc.bad_friend
			}
			desc = intrigue_dread.2101.desc.sinner
		}
		desc = intrigue_dread.2101.desc.outro
	}


	theme = intrigue_intimidation_focus
	cooldown = { years = 5 }
	
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	right_portrait = {
		character = scope:spymaster
		animation = personality_cynical
	}
	lower_center_portrait = {
		character = scope:hater
	}
	lower_left_portrait = {
		character = scope:family_member
	}
	
	trigger = {
		is_available_healthy_adult = yes
		OR = {
			exists = cp:councillor_spymaster
			employs_court_position = second_camp_officer
		}
		any_close_family_member = {
			is_available_ai_adult = yes
			save_temporary_scope_as = family_member_temporary
			root = {
				any_courtier_or_guest = {
					is_available_healthy_ai_adult = yes
					opinion = {
						target = scope:family_member_temporary
						value <= neutral_opinion
					}
					OR = {
						any_memory = {
							OR = {
								has_memory_type = stopped_being_friends
								has_memory_type = tormented_me_during_childhood
								has_memory_type = failed_assassination_by
								has_memory_type = spouse_committed_adultery
							}
							any_memory_participant = {
								this = scope:family_member_temporary
							}

						}
						scope:family_member_temporary.num_sinful_traits >= 1
					}
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				employs_court_position = second_camp_officer
			}
			random_court_position_holder = {
				type = second_camp_officer
				save_scope_as = spymaster
			}
		}
		else = {
			cp:councillor_spymaster = {
				save_scope_as = spymaster
			}
		}
		random_close_family_member = {
			limit = {
				is_available_ai_adult = yes
				save_temporary_scope_as = family_member
				root = {
					any_courtier_or_guest = {
						is_available_healthy_ai_adult = yes
						opinion = {
							target = scope:family_member
							value <= neutral_opinion
						}
						OR = {
							any_memory = {
								OR = {
									has_memory_type = stopped_being_friends
									has_memory_type = tormented_me_during_childhood
									has_memory_type = failed_assassination_by
									has_memory_type = spouse_committed_adultery
									}
								any_memory_participant = {
									this = scope:family_member
								}

							}
							scope:family_member.num_sinful_traits >= 1
						}
					}
				}
			}
			save_scope_as = family_member
		}
		random_courtier_or_guest = {
			limit = {
				is_available_healthy_ai_adult = yes
				opinion = {
					target = scope:family_member
					value <= neutral_opinion
				}
				OR = {
					any_memory = {
						OR = {
							has_memory_type = stopped_being_friends
							has_memory_type = tormented_me_during_childhood
							has_memory_type = failed_assassination_by
							has_memory_type = spouse_committed_adultery
							}
						any_memory_participant = {
							this = scope:family_member
						}

					}
					scope:family_member.num_sinful_traits >= 1
				}
			}
			save_scope_as = hater
		}

	}


	option = { # Spread even DARKER rumors about FAMILY_MEMBER.
		name = intrigue_dread.2101.a
		# Intrigue duel - makes family member mad, gain dread and xp if you succeed.
		duel = {
			target = scope:family_member
			skill = intrigue
			12 = {		
				desc = intrigue_dread.2101.a.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					left_icon = scope:family_member
					title = tooltip.intrigue_dread.2101.a.duel_success
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
					add_character_modifier = {
						modifier = intrigue_blanket_of_fear_modifier
						days = 1825
					}
					custom_tooltip = {
						text = intrigue_everyone_heard_horrifying_rumours_tt
						every_courtier_or_guest = {
							limit = {
								NOT = {
									this = scope:family_member
								}
							}
							add_opinion = {
								target = scope:family_member
								modifier = heard_bad_rumours_opinion
								opinion = -30
							}
						}
						scope:family_member = {
							add_dread = minor_dread_gain
						}
						reverse_add_opinion = {
							target = scope:family_member
							modifier = intrigue_made_me_sound_scary_opinion
						}
					}
				}
			}
			12 = {		
				desc = intrigue_dread.2101.a.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					left_icon = scope:family_member
					title = tooltip.intrigue_dread.2101.b.duel_failure
					add_prestige = minor_prestige_loss
					reverse_add_opinion = {
						target = scope:family_member
						modifier = intrigue_made_me_sound_scary_opinion
					}
					custom_tooltip = {
						text = intrigue_everyone_heard_rumours_tt
						every_courtier_or_guest = {
							limit = {
								NOT = {
									this = scope:family_member
								}
							}
							add_opinion = {
								target = scope:family_member
								modifier = heard_bad_rumours_opinion
							}
						}
					}
				}
			}
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = honest
					has_trait = compassionate
				}
			}
			modifier = {
				add = 40
				OR = {
					has_trait = deceitful
					has_trait = ambitious
					has_trait = sadistic
				}
			}
		}
	}

	option = { # Offer HATER money to shut HIS mouth.
		name = intrigue_dread.2101.b
		pay_short_term_gold = {
			target = scope:hater
			gold = minor_gold_value
		}
		# Intrigue duel - pay gold either way, everyone happy if it succeeds.
		duel = {
			target = scope:hater
			skill = intrigue
			12 = {		
				desc = intrigue_dread.2101.b.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					left_icon = scope:hater
					title = tooltip.intrigue_dread.2101.b.duel_success
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
					custom_tooltip = {
						text = intrigue_everyone_is_satisfied_tt
						reverse_add_opinion = {
							target = scope:hater
							modifier = grateful_opinion
							opinion = 15
						}
						reverse_add_opinion = {
							target = scope:family_member
							modifier = grateful_opinion
							opinion = 15
						}
					}
					add_character_modifier = {
						modifier = intrigue_controlling_the_narrative_modifier
						days = 3650
					}
				}
			}
			12 = {		
				desc = intrigue_dread.2101.b.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					left_icon = scope:hater
					title = tooltip.intrigue_dread.2101.b.duel_failure
					add_character_modifier = {
						modifier = intrigue_bumbling_tyrant_modifier
						days = 3650
					}
					custom_tooltip = {
						text = intrigue_everyone_heard_rumours_tt
						every_courtier_or_guest = {
							limit = {
								NOT = { this = scope:family_member }
							}
							add_opinion = {
								target = scope:family_member
								modifier = heard_bad_rumours_opinion
							}
						}
					}
					reverse_add_opinion = {
						target = scope:family_member
						modifier = grateful_opinion
						opinion = 15
					}
				}
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
				ai_rationality = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = greedy
					has_trait = vengeful
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = generous
					has_trait = arbitrary
					has_trait = forgiving
				}
			}
		}
	}

	option = { # Pay to have HATER roughed up.
		name = intrigue_dread.2101.c
		remove_short_term_gold = minor_gold_value

		duel = {
			target = scope:hater
			skill = intrigue
			12 = {		
				desc = intrigue_dread.2101.c.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 1
				}
				send_interface_toast = {
					left_icon = scope:hater
					title = tooltip.intrigue_dread.2101.c.duel_success
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
					custom_tooltip = {
						text = intrigue_suspect_you_in_attack_success_tt
						reverse_add_opinion = {
							target = scope:family_member
							modifier = grateful_opinion
							opinion = 20
						}
						reverse_add_opinion = {
							target = scope:hater
							modifier = suspicion_opinion
							opinion = -20
						}
						add_character_modifier = {
							modifier = intrigue_blanket_of_fear_modifier
							days = 1825
						}
					}
					scope:hater = {
						increase_wounds_effect = {
							REASON = fight
						}
					}
				}
				
			}
			12 = {		
				desc = intrigue_dread.2101.c.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -1
				}
				send_interface_toast = {
					left_icon = scope:hater
					title = tooltip.intrigue_dread.2101.c.duel_failure
					custom_tooltip = {
						text = intrigue_everyone_heard_rumours_tt
						every_courtier_or_guest = {
							limit = {
								NOT = { this = scope:family_member }
							}
							add_opinion = {
								target = scope:family_member
								modifier = heard_bad_rumours_opinion
							}
						}
					}
					add_character_modifier = {
						modifier = intrigue_bumbling_tyrant_modifier
						days = 3650
					}
					reverse_add_opinion = {
						target = scope:hater
						modifier = suspicion_opinion
						opinion = -20
					}
				}
			}
		}

		stress_impact = {
			calm = major_stress_impact_gain
			just = medium_stress_impact_gain
			content = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 0.5
			}
			modifier = {
				add = -80
				OR = {
					has_trait = calm
					has_trait = just
					has_trait = content
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = vengeful
					has_trait = wrathful
				}
			}
		}
	}

	option = { # Distance myself from FAMILY_MEMBER.
		name = intrigue_dread.2101.d
		# No duel, makes hater happy and family mad.
		add_prestige = minor_prestige_loss
		reverse_add_opinion = {
			target = scope:family_member
			modifier = intrigue_thrown_under_the_carriage_opinion
		}
		reverse_add_opinion = {
			target = scope:hater
			modifier = grateful_opinion
			opinion = 10
		}
		custom_tooltip = {
			text = intrigue_everyone_heard_rumours_tt
			every_courtier_or_guest = {
				limit = {
					NOT = {
						this = scope:family_member
					}
				}
				add_opinion = {
					target = scope:family_member
					modifier = heard_bad_rumours_opinion
				}
			}
		}

		if = {
			limit = {
				can_set_relation_potential_rival_trigger = { 
					CHARACTER = scope:family_member
				}
			}
			set_relation_potential_rival = scope:family_member
		}

		stress_impact = {
			gregarious = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
			brave = medium_stress_impact_gain
			family_first = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = 0.5
			}
			modifier = {
				add = -80
				OR = {
					has_trait = gregarious
					has_trait = compassionate
					has_trait = trusting
					has_trait = brave
					has_trait = family_first
				}
			}
		}
	}
}


################################################
# Councillor is too scared to speak their mind #
# Luke Bean                                    #
################################################

intrigue_dread.2201 = {
	type = character_event
	title = intrigue_dread.2201.t
	desc = intrigue_dread.2201.desc
	theme = intrigue_intimidation_focus
	cooldown = { years = 5 }
	
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	right_portrait = {
		character = scope:yesman
		animation = fear
	}
	
	trigger = {
		is_landed_or_landless_administrative = yes
		is_available_healthy_adult = yes
		any_councillor = {
			has_dread_level_towards = {
  				target = root
  				level >= 1
  			}
  			is_available_healthy_ai_adult = yes
  			NOT = { is_spouse_of = root }
		}
	}

	weight_multiplier = {
		base = 1
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		random_councillor = {
			limit = {
				is_available_healthy_ai_adult = yes
				has_dread_level_towards = {
  					target = root
  					level >= 1
  				}
  				NOT = { is_spouse_of = root }
			}
			save_scope_as = yesman
		}
	}

	option = { # Perfect. My council SHOULD fear me.
		name = intrigue_dread.2201.a
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_dread = minor_dread_gain
		every_councillor = {
			limit = {
				is_available_ai_adult = yes
				has_dread_level_towards = {
  					target = root
  					level >= 1
  				}
			}
			if = {
				limit = {
					OR = {
						AND = {
							exists = root.cp:councillor_spymaster
							has_council_position = councillor_spymaster
						}
						AND = {
							is_kurultai_trigger = yes
							highest_skill = intrigue
						}
					}
				}
				add_character_modifier = {
					modifier = intrigue_yes_man_spymaster_modifier
					days = 3650
				}
			}
			else_if = {
				limit = {
					OR = {
						AND = {
							exists = root.cp:councillor_chancellor
							has_council_position = councillor_chancellor
						}
						AND = {
							is_kurultai_trigger = yes
							highest_skill = diplomacy
						}
					}
				}
				add_character_modifier = {
					modifier = intrigue_yes_man_chancellor_modifier
					days = 3650
				}
			}
			else_if = {
				limit = {
					OR = {
						AND = {
							exists = root.cp:councillor_steward
							has_council_position = councillor_steward
						}
						AND = {
							is_kurultai_trigger = yes
							highest_skill = stewardship
						}
					}
				}
				add_character_modifier = {
					modifier = intrigue_yes_man_steward_modifier
					days = 3650
				}
			}
			else_if = {
				limit = {
					OR = {
						AND = {
							exists = root.cp:councillor_marshal
							has_council_position = councillor_marshal
						}
						AND = {
							is_kurultai_trigger = yes
							highest_skill = martial
						}
					}
				}
				add_character_modifier = {
					modifier = intrigue_yes_man_marshal_modifier
					days = 3650
				}
			}
			else_if = {
				limit = {
					OR = {
						AND = {
							exists = root.cp:councillor_court_chaplain
							has_council_position = councillor_court_chaplain
						}
						AND = {
							is_kurultai_trigger = yes
							highest_skill = learning
						}
					}
				}
				add_character_modifier = {
					modifier = intrigue_yes_man_court_chaplain_modifier
					days = 3650
				}
			}
		}

		stress_impact = {
			just = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = just
					has_trait = compassionate
				}
			}
		}
	}

	option = { # I'll do your job myself, you fool!
		name = intrigue_dread.2201.b
		trigger = {
			scope:yesman = { can_be_fired_from_council_trigger = { COURT_OWNER = root } }
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		if = {
			limit = {
				NOT = { has_relation_rival = scope:yesman }
			}
			set_relation_rival = {
				reason = rival_fired_from_council
				target = scope:yesman
			}
		}
		if = {
			limit = {
				exists = root.cp:councillor_spymaster
				scope:yesman = {
					has_council_position = councillor_spymaster
				}
			}
			add_character_modifier = {
				modifier = intrigue_doing_spymasters_job_modifier
				days = 3650
			}
			fire_councillor = scope:yesman
		}
		else_if = {
			limit = {
				exists = root.cp:councillor_chancellor
				scope:yesman = {
					has_council_position = councillor_chancellor
				}
			}
			add_character_modifier = {
				modifier = intrigue_doing_chancellors_job_modifier
				days = 3650
			}
			fire_councillor = scope:yesman
		}
		else_if = {
			limit = {
				exists = root.cp:councillor_steward
				scope:yesman = {
					has_council_position = councillor_steward
				}
			}
			add_character_modifier = {
				modifier = intrigue_doing_stewards_job_modifier
				days = 3650
			}
			fire_councillor = scope:yesman
		}
		else_if = {
			limit = {
				exists = root.cp:councillor_marshal
				scope:yesman = {
					has_council_position = councillor_marshal
				}
			}
			add_character_modifier = {
				modifier = intrigue_doing_marshals_job_modifier
				days = 3650
			}
			fire_councillor = scope:yesman
		}
		else_if = {
			limit = {
				exists = root.cp:councillor_court_chaplain
				scope:yesman = {
					has_council_position = councillor_court_chaplain
				}
			}
			add_character_modifier = {
				modifier = intrigue_doing_court_chaplains_job_modifier
				days = 3650
			}
		}
		

		stress_impact = {
			patient = medium_stress_impact_gain
			content = medium_stress_impact_gain
			lazy = major_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = patient
					has_trait = content
					has_trait = lazy
					has_trait = humble
				}
			}
		}
	}

	option = { # Speak your mind freely. Your position is safe.
		name = intrigue_dread.2201.c
		scope:yesman = {
			custom_tooltip = intrigue_guaranteed_position_block_firing_councillor_effect_tt
			set_variable = {
				name = block_fire_councillor
				value = root
				years = 5
			}
		}
		duel = {
			target = scope:yesman
			skill = intrigue
			12 = {		
				desc = intrigue_dread.2201.c.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				min = 4
				send_interface_toast = {
					left_icon = scope:yesman
					title = tooltip.intrigue_dread.2201.c.duel_success
					scope:yesman = {
						if = {
							limit = {
								exists = root.cp:councillor_spymaster
								has_council_position = councillor_spymaster
							}
							add_character_modifier = {
								modifier = intrigue_trusty_spymaster_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_chancellor
								has_council_position = councillor_chancellor
							}
							add_character_modifier = {
								modifier = intrigue_trusty_chancellor_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_steward
								has_council_position = councillor_steward
							}
							add_character_modifier = {
								modifier = intrigue_trusty_steward_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_marshal
								has_council_position = councillor_marshal
							}
							add_character_modifier = {
								modifier = intrigue_trusty_marshal_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_court_chaplain
								has_council_position = councillor_court_chaplain
							}
							add_character_modifier = {
								modifier = intrigue_trusty_court_chaplain_modifier
								days = 3650
							}
						}
					}				
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
				}
				reverse_add_opinion = {
					target = scope:yesman
					modifier = intrigue_position_is_safe_opinion
				}
			}
			12 = {		
				desc = intrigue_dread.2201.c.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				min = 4
				send_interface_toast = {
					left_icon = scope:yesman
					title = tooltip.intrigue_dread.2201.c.duel_failure
					every_councillor = {
						limit = {
							is_available_ai_adult = yes
							has_dread_level_towards = {
									target = root
									level >= 1
							}
						}
						if = {
							limit = {
								exists = root.cp:councillor_spymaster
								has_council_position = councillor_spymaster
							}
							add_character_modifier = {
								modifier = intrigue_yes_man_spymaster_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_chancellor
								has_council_position = councillor_chancellor
							}
							add_character_modifier = {
								modifier = intrigue_yes_man_chancellor_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_steward
								has_council_position = councillor_steward
							}
							add_character_modifier = {
								modifier = intrigue_yes_man_steward_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_marshal
								has_council_position = councillor_marshal
							}
							add_character_modifier = {
								modifier = intrigue_yes_man_marshal_modifier
								days = 3650
							}
						}
						else_if = {
							limit = {
								exists = root.cp:councillor_court_chaplain
								has_council_position = councillor_court_chaplain
							}
							add_character_modifier = {
								modifier = intrigue_yes_man_court_chaplain_modifier
								days = 3650
							}
						}
					}
					scope:yesman = {
						add_opinion = { 
							target = root
							modifier = scared_opinion
							opinion = -15
						}
		 			}
				}
			}
		}

		stress_impact = {
			content = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = forgiving
					has_trait = content
					has_trait = calm
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = vengeful
					has_trait = ambitious
					has_trait = wrathful
				}
			}
		}
	}
 }

################################################
# Your court thinks you're soft                #
# Luke Bean                                    #
################################################


intrigue_dread.2301 = {
	type = character_event
	title = intrigue_dread.2301.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = compassionate
						has_trait = calm
						has_trait = forgiving
					}
				}
				desc = intrigue_dread.2301.desc.a #Gentle-hearted
			}
			triggered_desc = {
				trigger = {
					root = {
						OR = {
							has_trait = honest
							has_trait = trusting
							intrigue <= low_skill_rating
						}
					}
				}
				desc = intrigue_dread.2301.desc.b #Incapable of deception
			}
			triggered_desc = {
				trigger = {
					root = {
						OR = {
							has_trait = content
							has_trait = humble
							has_trait = lazy
						}
					}
				}
				desc = intrigue_dread.2301.desc.c #Simple soul
			}
			triggered_desc = {
				trigger = {
					root = {
						OR = {
							has_trait = just
							has_trait = zealous
						}
					}
				}
				desc = intrigue_dread.2301.desc.d #Righteous
			}
			desc = intrigue_dread.2301.desc.e #Fallback
		}
		desc = intrigue_dread.2301.desc.outro
	}
	theme = intrigue_intimidation_focus
	cooldown = { years = 5 }
	
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:smirking_courtier
		animation = schadenfreude
	}
	
	trigger = {
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		is_available_healthy_adult = yes
		dread <= low_dread
		any_courtier_or_guest = {
			is_of_major_interest_to_root_trigger = no
			is_of_minor_interest_to_root_trigger = no
			is_available_healthy_ai_adult = yes
		}
	}

	weight_multiplier = {
		base = 2
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		every_courtier_or_guest = {
			limit = {
				is_of_major_interest_to_root_trigger = no
				is_of_minor_interest_to_root_trigger = no
				is_available_healthy_ai_adult = yes
			}
			add_to_list = potential_smirking_courtier
		}

		random_in_list = {
			list = potential_smirking_courtier
			weight = {
				base = 1
				modifier = {
					opinion = {
						target = root
						value < medium_positive_opinion
					}
					add = 20
				}
				modifier = {
					OR = {
						has_trait = brave
						has_trait = ambitious
					}
					add = 20
				}
				modifier = {
					OR = {
						has_trait = craven
						has_trait = content
					}
					factor = 0.25
				}
			}
			save_scope_as = smirking_courtier
		}
	}

	option = { # Stab HIM in the throat.
		name = intrigue_dread.2301.a
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_character_modifier = {
			modifier = intrigue_blanket_of_fear_modifier
			days = 1825
		}
		known_murder_effect = {
			VICTIM = scope:smirking_courtier
			MURDERER = root
			EXPOSER = root
		}
		stress_impact = {
			compassionate = major_stress_impact_gain
			calm = major_stress_impact_gain
			patient = major_stress_impact_gain
			just = major_stress_impact_gain
			forgiving = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_boldness = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = patient
					has_trait = compassionate
					has_trait = just
					has_trait = calm
					has_trait = forgiving
				}
			}
		}
	}

	option = { # Have HIM dragged to the dungeon.
		name = intrigue_dread.2301.b
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		add_dread = minor_dread_gain
		imprison_character_effect = {
   			TARGET = scope:smirking_courtier
   			IMPRISONER = root
   		}

		stress_impact = {
			sadistic = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5
				ai_honor = 0.5
			}
			modifier = {
				add = -80
				OR = {
					has_trait = sadistic
					has_trait = just
				}
			}
		}
	}

	option = { # Smile, laugh, and plan your revenge.
		name = intrigue_dread.2301.c
		add_intrigue_lifestyle_xp = minor_lifestyle_xp
		add_character_modifier = {
			modifier = intrigue_show_them_all_modifier
			days = 3650
		}

		stress_impact = {
			base = minor_stress_impact_gain
			sadistic = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_boldness = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = sadistic
					has_trait = arrogant
					has_trait = wrathful
					has_trait = vengeful
					has_trait = impatient
				}
			}
		}
	}

	option = { #NAME will die in the night. Let them speculate why. 
		name = intrigue_dread.2301.d
		trigger = {
			OR = {
				has_trait = schemer
				intrigue >= high_skill_rating
			}
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_dread = minor_dread_gain
		add_character_modifier = {
			modifier = intrigue_blanket_of_fear_modifier
			days = 1825
		}
		unknown_murder_effect = {
			VICTIM = scope:smirking_courtier
			MURDERER = root
			REASON = death_mysterious
		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			just = major_stress_impact_gain
			forgiving = major_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = compassionate
					has_trait = just
					has_trait = forgiving
				}
			}
		}
	}
}

################################################
# Executions could be better                   #
# Luke Bean                                    #
################################################


intrigue_dread.2401 = {
	type = character_event
	title = intrigue_dread.2401.t
	desc = intrigue_dread.2401.desc
	theme = intrigue_intimidation_focus
	cooldown = { years = 5 }
	
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	
	trigger = {
		is_landed_or_landless_administrative = yes
		trigger_if = {
			limit = {
				NOT = { has_focus = intrigue_intimidation_focus }
			}
			OR = {
				has_trait_malicious_trigger = yes
				has_trait = torturer
			}
		}
		is_available_healthy_adult = yes
		any_held_title = {
			tier = tier_county
			NOR = {
				has_county_modifier = intrigue_harsh_justice_modifier
				has_county_modifier = intrigue_arbitrary_justice_modifier
				has_county_modifier = intrigue_instructive_executions_modifier
				has_county_modifier = intrigue_timewasting_executions_modifier
				has_county_modifier = intrigue_horrifying_executions_modifier
				has_county_modifier = intrigue_relaxed_oversight_modifier
			}
		}
	}

	weight_multiplier = {
		base = 1
		upweight_for_focus_modifier = { FOCUS = intrigue_intimidation_focus }
	}

	immediate = {
		random_held_title = {
			limit = {
				tier = tier_county
				NOR = {
				has_county_modifier = intrigue_harsh_justice_modifier
				has_county_modifier = intrigue_arbitrary_justice_modifier
				has_county_modifier = intrigue_instructive_executions_modifier
				has_county_modifier = intrigue_timewasting_executions_modifier
				has_county_modifier = intrigue_horrifying_executions_modifier
				has_county_modifier = intrigue_relaxed_oversight_modifier
				}
			}
			save_scope_as = execution_county
		}
	}

	option = { # More. Of. Them.
		name = intrigue_dread.2401.a
		remove_short_term_gold = medium_gold_value
		duel = {
			value = decent_skill_rating
			skill = intrigue
			12 = {		
				desc = intrigue_dread.2401.a.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread.2401.a.duel_success
					scope:execution_county = {
						add_county_modifier = {
								modifier = intrigue_harsh_justice_modifier
								days = 3650
						}
					}
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
				}
			}
			12 = {		
				desc = intrigue_dread.2401.a.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
					send_interface_toast = {
						left_icon = root
						title = tooltip.intrigue_dread.2401.a.duel_failure
						scope:execution_county = {
							add_county_modifier = {
								modifier = intrigue_arbitrary_justice_modifier
								days = 3650
							}
						}
					}
				}
			}

		stress_impact = {
			content = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = content
					has_trait = compassionate
					has_trait = forgiving
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = vengeful
					has_trait = ambitious
					has_trait = diligent
					has_trait = just
				}
			}
		}
	}

	option = { # Attendance is mandatory!
		name = intrigue_dread.2401.b
		remove_short_term_gold = medium_gold_value
		duel = {
			value = decent_skill_rating
			skill = stewardship
			12 = {		
				desc = intrigue_dread.2401.b.tt.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					left_icon = root
					title = tooltip.intrigue_dread.2401.b.duel_success
					scope:execution_county = {
						add_county_modifier = {
								modifier = intrigue_instructive_executions_modifier
								days = 3650
						}
					}
					add_intrigue_lifestyle_xp = medium_lifestyle_xp
				}
			}
			12 = {		
				desc = intrigue_dread.2401.b.tt.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
					send_interface_toast = {
						left_icon = root
						title = tooltip.intrigue_dread.2401.b.duel_failure
						scope:execution_county = {
							add_county_modifier = {
								modifier = intrigue_timewasting_executions_modifier
								days = 3650
							}
						}
					}
				}
			}

		stress_impact = {
			arbitrary = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 0.5
			}
			modifier = {
				add = -80
				OR = {
					has_trait = arbitrary
					has_trait = lazy
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = diligent
					has_trait = just
				}
			}
		}
	}

	option = { # Executions should be slow. And creative.
		name = intrigue_dread.2401.c
		trigger = {
			OR = {
				has_trait = sadistic
				has_trait = vengeful
				has_trait = arbitrary
				has_trait = torturer
				has_trait = cannibal
				dread >= low_dread
			}
		}
		add_dread = medium_dread_gain
		scope:execution_county = {
			add_county_modifier = {
				modifier = intrigue_horrifying_executions_modifier
				days = 3650
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = compassionate
					has_trait = just
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = sadistic
					has_trait = torturer
					has_trait = cannibal
				}
			}
		}
	}

	option = { # Commoners should not be wasting time at executions.
		name = intrigue_dread.2401.d

		add_dread = minor_dread_loss
		scope:execution_county = {
			add_county_modifier = {
				modifier = intrigue_relaxed_oversight_modifier
				days = 3650
			}
		}
		stress_impact = {
			vengeful = medium_stress_impact_gain
			sadistic = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -1
				ai_compassion = 1
			}
			modifier = {
				add = -80
				OR = {
					has_trait = vengeful
					has_trait = just
					has_trait = sadistic
					has_trait = diligent
				}
			}
			modifier = {
				add = 80
				OR = {
					has_trait = lazy
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}
}
