#########################################
#										#
# RIP Flavor Events						#
# ID RIP.4010 - RIP.4499				#
# ID RIP.29000 - RIP.30999				#
#										#
#########################################

# Court physician events written by Alexander Oltner & Mathilda Bjarnehed
# Mourning events written by Mathilda Bjarnehed
# Maimed events written by Mathilda Bjarnehed
# Child reaction events written by Mathilda Bjarnehed
# Suicide events written by Mathilda Bjarnehed
# Chess with death events written by Mathilda Bjarnehed

namespace = RIP

### COURT PHYSICIAN FLAVOR EVENTS ###

### Court Physician recommends that you "Take it Easy"

character_event = {
	id = RIP.4010
	desc = EVTDESC_RIP_4010
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		has_assigned_minor_title = title_court_physician
		is_tribal = no
		is_nomadic = no

		trigger_if = {
			limit = { health >= 5 }

			OR = {
				trait = stressed
				trait = diligent
				trait = wroth
			}
		}

		NOR = {
			trait = slothful
			has_character_flag = stress_relief
			has_global_flag = ck2_tutorial_2 # Not in the learning scenario
		}

		any_courtier_or_vassal = {
			has_minor_title = title_court_physician

			OR = {
				has_character_flag = is_court_physician
				trait = physician
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = diligent
		}

		mult_modifier = {
			factor = 2
			trait = stressed
		}

		mult_modifier = {
			factor = 1.5

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning >= 16
			}
		}

		mult_modifier = {
			factor = 0.2

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 14
			}
		}

		mult_modifier = {
			factor = 0.1

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 10
			}
		}
	}

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }
			save_event_target_as = physician_target
		}

		set_character_flag = stress_relief
	}

	option = {
		name = EVTOPTA_RIP_4010

		prestige = -50

		random = {
			chance = 50
			remove_trait_stressed_effect = yes
		}

		remove_trait_silently_diligent_effect = yes

		add_character_modifier = {
			name = taking_it_easy
			years = 30
		}
	}

	option = {
		name = EVTOPTB_RIP_4010

		prestige = 50

		random = {
			chance = 30
			add_trait_stressed_effect = yes
		}

		random = {
			chance = 30
			add_trait_fully_diligent_effect = yes
		}
	}
}

### Court Physician gifts you a guide dog
character_event = {
	id = RIP.4011
	desc = EVTDESC_RIP_4011
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		trait = blinded
		has_assigned_minor_title = title_court_physician
		is_tribal = no
		is_nomadic = no

		NOR = {
			has_character_modifier = guide_dog
			has_character_flag = declined_guide_dog
		}

		any_courtier_or_vassal = {
			has_minor_title = title_court_physician

			OR = {
				has_character_flag = is_court_physician
				trait = physician
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 1.5

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning >= 16
			}
		}

		mult_modifier = {
			factor = 0.2

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 14
			}
		}

		mult_modifier = {
			factor = 0.1

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 10
			}
		}
	}

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }
			save_event_target_as = physician_target
		}
	}

	option = {
		name = EVTOPTA_RIP_4011
		tooltip_info = charitable

		trigger = { trait = charitable }

		transfer_scaled_wealth = {
			to = event_target:physician_target
			value = 0.3
		}

		reverse_opinion = {
			name = opinion_was_praised
			who = event_target:physician_target
			years = 10
		}

		add_character_modifier = {
			name = guide_dog
			duration = -1
		}

		character_event = {
			id = RIP.4012 # Dog dies
			days = 3500
			random = 2000
		}
	}

	option = {
		name = EVTOPTB_RIP_4011

		add_character_modifier = {
			name = guide_dog
			duration = -1
		}

		character_event = {
			id = RIP.4012 # Dog dies
			days = 3500
			random = 2000
		}
	}

	option = {
		name = EVTOPTC_RIP_4011

		set_character_flag = declined_guide_dog

		reverse_opinion = {
			name = opinion_insulted
			who = event_target:physician_target
			years = 10
		}
	}
}

# Guide Dog Dies
character_event = {
	id = RIP.4012
	desc = EVTDESC_RIP_4012
	picture = GFX_evt_hunting_scene
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = { has_character_modifier = guide_dog }

	option = { # She taught me a lot
		name = EVTOPTA_RIP_4012

		remove_character_modifier = guide_dog
		prestige = 5
	}

	option = { # Give in to despair
		name = EVTOPTB_RIP_4012

		remove_character_modifier = guide_dog

		random = {
			chance = 50
			add_trait_depressed_effect = yes
		}
	}
}

### Court Physician suggests fertility treatment
character_event = {
	id = RIP.4013
	desc = EVTDESC_RIP_4013
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	only_men = yes
	is_married = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		has_assigned_minor_title = title_court_physician
		has_living_children = no

		spouse = {
			practical_age < 45
			is_pregnant = no
			ai = yes
		}

		is_ascetic_trigger = no
		is_merchant_republic = no

		NOR = {
			trait = celibate
			trait = eunuch
			has_character_flag = fertility_treatment
		}

		any_courtier_or_vassal = {
			has_minor_title = title_court_physician
			ai = yes

			OR = {
				has_character_flag = is_court_physician
				trait = physician
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			practical_age >= 40
		}

		mult_modifier = {
			factor = 2
			practical_age >= 60
		}

		mult_modifier = {
			factor = 1.5

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning >= 16
			}
		}
	}

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }
			save_event_target_as = physician_target
		}

		spouse = {
			save_event_target_as = spouse_target
		}
	}

	option = { # Yes, I need children!
		name = EVTOPTA_RIP_4013

		custom_tooltip = {
			text = fertility_treatment_custom_tooltip

			set_character_flag = fertility_treatment

			event_target:physician_target = {
				character_event = {
					id = RIP.4014
					days = 14
					random = 7
				}
			}
		}
	}

	option = { # No, I know I can do it without help
		name = EVTOPTB_RIP_4013

		prestige = 5
	}
}

# Fertility treatment outcome tombola
character_event = {
	id = RIP.4014

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		random_list = {
			10 = { # Physician seduces and impregnates your spouse
				trigger = {
					is_female = no
					is_ascetic_trigger = no

					NOR = {
						trait = chaste
						trait = celibate
						trait = eunuch
					}

					event_target:spouse_target = {
						NOR = {
							is_lover = FROM
							is_friend = FROM
						}
					}
				}

				mult_modifier = {
					factor = 0.1

					NOR = {
						trait = deceitful
						trait = lustful
						trait = hedonist
						trait = master_seducer
					}
				}

				mult_modifier = {
					factor = 5

					OR = {
						trait = deceitful
						trait = lustful
						trait = hedonist
						trait = master_seducer
					}

					event_target:spouse_target = {
						OR = {
							trait = deceitful
							trait = lustful
							trait = hedonist
							trait = master_seductress
						}
					}
				}

				FROM = {
					character_event = { id = RIP.4015 }
				}
			}

			10 = { # Physician concocts a herbal mixture that is TOO effective...
				trigger = {
					NOT = {
						has_game_rule = {
							name = supernatural_events
							value = off
						}
					}

					trigger_if = {
						limit = {
							FROM = { ai = yes }
						}

						has_game_rule = {
							name = supernatural_events
							value = unrestricted
						}
					}
				}

				mult_modifier = {
					factor = 0.5
					FROM = { ai = yes }
				}

				mult_modifier = {
					factor = 5
					trait = lunatic
				}

				mult_modifier = {
					factor = 5
					trait = possessed
				}

				FROM = {
					set_character_flag = fertility_increased_too_much
					character_event = { id = RIP.4016 }
				}
			}

			50 = { # Physician concocts a herbal mixture that increases your fertility
				mult_modifier = {
					factor = 2
					learning >= 14
				}

				mult_modifier = {
					factor = 2
					learning >= 18
				}

				FROM = {
					set_character_flag = fertility_increased
					character_event = { id = RIP.4016 }
				}
			}

			30 = { # Physician concocts a herbal mixture that DECREASES your fertility
				mult_modifier = {
					factor = 0.1
					learning >= 12
				}

				mult_modifier = {
					factor = 2
					learning < 10
				}

				mult_modifier = {
					factor = 2
					learning < 8
				}

				mult_modifier = {
					factor = 2
					has_character_flag = physician_is_quack
				}

				FROM = {
					set_character_flag = fertility_decreased
					character_event = { id = RIP.4016 }
				}
			}
		}
	}
}

# Wife seduced and impregnated
character_event = {
	id = RIP.4015
	desc = EVTDESC_RIP_4015
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		event_target:physician_target = {
			is_alive = yes
		}

		event_target:spouse_target = {
			is_alive = yes
		}
	}

	immediate = {
		event_target:spouse_target = {
			add_lover = event_target:physician_target
			impregnate_cuckoo = event_target:physician_target
		}
	}

	option = { # Something is fishy here!
		name = EVTOPTA_RIP_4015
		tooltip_info = paranoid

		trigger = { trait = paranoid }

		event_target:spouse_target = {
			father_of_unborn_known = yes
		}
	}

	option = { # But... you didn't do anything?
		name = EVTOPTB_RIP_4015

		trigger = {
			NOT = { trait = paranoid }
		}
	}
}

# You receive the concoction, last chance to back out!
character_event = {
	id = RIP.4016
	desc = EVTDESC_RIP_4016
	picture = GFX_evt_performing_experiments
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		event_target:physician_target = {
			is_alive = yes
		}
	}

	option = { # Drink it
		name = EVTOPTA_RIP_4016

		custom_tooltip = {
			text = drink_the_concoction_custom_tooltip

			trigger_switch = {
				on_trigger = has_character_flag

				fertility_increased_too_much = {
					character_event = { id = RIP.4017 days = 3 random = 5 }
				}

				fertility_increased = {
					character_event = { id = RIP.4018 days = 14 random = 7 }
				}

				fertility_decreased = {
					character_event = { id = RIP.4019 days = 14 random = 7 }
				}
			}
		}
	}

	option = { # Back out
		name = EVTOPTB_RIP_4016

		prestige = -5

		reverse_opinion = {
			name = opinion_insulted
			who = event_target:physician_target
			years = 10
		}

		ai_chance = { factor = 0 }
	}
}

# The concoction works TOO well!
character_event = {
	id = RIP.4017
	desc = EVTDESC_RIP_4017
	picture = GFX_evt_performing_experiments
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		random_realm_character = {
			limit = {
				is_female = yes
				is_marriage_adult = yes
				practical_age < 45
				prisoner = no
				is_pregnant = no
				is_incapable = no
				has_lover = no

				NOR = {
					is_married = ROOT
					is_consort = ROOT
					character = ROOT
				}
			}

			impregnate = ROOT
			save_event_target_as = lover_1
		}

		random_realm_character = {
			limit = {
				is_female = yes
				is_marriage_adult = yes
				practical_age < 45
				prisoner = no
				is_pregnant = no
				is_incapable = no
				has_lover = no

				NOR = {
					is_married = ROOT
					is_consort = ROOT
					character = ROOT
					character = event_target:lover_1
				}
			}

			impregnate = ROOT
			save_event_target_as = lover_2
		}

		random_realm_character = {
			limit = {
				is_female = yes
				is_marriage_adult = yes
				practical_age < 45
				prisoner = no
				is_pregnant = no
				is_incapable = no
				has_lover = no

				NOR = {
					is_married = ROOT
					is_consort = ROOT
					character = ROOT
					character = event_target:lover_1
					character = event_target:lover_2
				}
			}

			impregnate = ROOT
			save_event_target_as = lover_3
		}

		random_realm_character = {
			limit = {
				trait = homosexual
				is_female = no
				is_adult = yes
				has_lover = no
				prisoner = no
				is_incapable = no
				NOT = { character = ROOT }
			}

			save_event_target_as = lover_h_1
		}

		random_realm_character = {
			limit = {
				trait = homosexual
				is_female = no
				is_adult = yes
				has_lover = no
				prisoner = no
				is_incapable = no

				NOR = {
					character = ROOT
					character = event_target:lover_h_1
				}
			}

			save_event_target_as = lover_h_2
		}
	}

	option = { # Worked TOO well!
		name = EVTOPTA_RIP_4017

		add_trait_fully_silently_lustful_effect = yes

		if = {
			limit = {
				NOT = { trait = homosexual }
			}

			add_trait = homosexual
			set_character_flag = revealed_homosexual@ROOT
		}

		fertility = 0.25

		any_spouse = {
			limit = {
				prisoner = no
				is_incapable = no
			}

			hidden_effect = {
				if = {
					limit = {
						practical_age < 45
						is_female = yes
						is_pregnant = no
					}

					impregnate = ROOT
				}
			}

			if = {
				limit = {
					NOT = { is_lover = ROOT }
				}

				add_lover = ROOT
			}
		}

		any_consort = {
			limit = {
				is_senior_consort_party = no
				prisoner = no
				is_incapable = no
			}

			hidden_effect = {
				if = {
					limit = {
						practical_age < 45
						is_female = yes
						is_pregnant = no
					}

					impregnate = ROOT
				}
			}

			if = {
				limit = {
					NOT = { is_lover = ROOT }
				}

				add_lover = ROOT
			}
		}

		add_lover = event_target:lover_1
		add_lover = event_target:lover_2
		add_lover = event_target:lover_3
		add_lover = event_target:lover_h_1
		add_lover = event_target:lover_h_2
	}
}

# Successful fertility treatment!
character_event = {
	id = RIP.4018
	desc = EVTDESC_RIP_4018
	picture = GFX_evt_performing_experiments
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		event_target:physician_target = {
			is_alive = yes
		}
	}

	immediate = {
		impregnate = event_target:spouse_target
	}

	option = { # Fantastic, I shall reward you!
		name = EVTOPTA_RIP_4018

		trigger = { trait = charitable }

		prestige = 15
		fertility = 0.1

		transfer_scaled_wealth = {
			to = event_target:physician_target
			value = 0.3
		}

		reverse_opinion = {
			name = opinion_was_praised
			who = event_target:physician_target
			years = 10
		}
	}

	option = { # You have done well
		name = EVTOPTB_RIP_4018

		prestige = 5
		fertility = 0.1
	}
}

# Botched fertility treatment!
character_event = {
	id = RIP.4019
	desc = EVTDESC_RIP_4019
	picture = GFX_evt_experiments_failed
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		event_target:physician_target = {
			is_alive = yes
		}
	}

	immediate = {
		impregnate = event_target:spouse_target
	}

	option = { # I shall have your head for this!
		name = EVTOPTA_RIP_4019

		fertility = -0.05

		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		else = {
			add_trait_fully_silently_wroth_effect = yes
		}

		opinion = {
			name = opinion_traitor
			who = event_target:physician_target
		}

		reverse_imprison = event_target:physician_target
	}

	option = { # Oh well
		name = EVTOPTB_RIP_4019

		prestige = -5
		fertility = -0.05
	}
}

# Court Physician Friend teaches you medicine
character_event = {
	id = RIP.4020
	desc = EVTDESC_RIP_4020
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	friends = yes
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		NOT = { has_character_flag = physician_learning }

		any_friend = {
			has_minor_title = title_court_physician
			vassal_of = ROOT

			OR = {
				has_character_flag = is_court_physician
				trait = physician
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = scholar
		}

		mult_modifier = {
			factor = 2
			trait = mystic
		}

		mult_modifier = {
			factor = 1.5

			any_friend = {
				has_minor_title = title_court_physician
				vassal_of = ROOT
				learning >= 16
			}
		}

		mult_modifier = {
			factor = 0.2

			any_friend = {
				has_minor_title = title_court_physician
				vassal_of = ROOT
				learning < 14
			}
		}

		mult_modifier = {
			factor = 0.1

			any_friend = {
				has_minor_title = title_court_physician
				vassal_of = ROOT
				learning < 10
			}
		}
	}

	immediate = {
		set_character_flag = physician_learning

		random_friend = {
			limit = {
				has_minor_title = title_court_physician
				vassal_of = ROOT
			}

			save_event_target_as = physician_target
		}
	}

	option = { # This seems interesting!
		name = EVTOPTA_RIP_4020

		custom_tooltip = {
			text = physician_learning_custom_tooltip

			random_list = {
				15 = {
					mult_modifier = {
						factor = 3
						trait = scholar
					}

					mult_modifier = {
						factor = 2
						trait = mystic
					}

					mult_modifier = {
						factor = 2
						trait = diligent
					}

					mult_modifier = {
						factor = 2
						trait = patient
					}

					set_character_flag = physician_learning_excellent_outcome
				}

				20 = {
					mult_modifier = {
						factor = 3
						trait = scholar
					}

					mult_modifier = {
						factor = 2
						trait = mystic
					}

					mult_modifier = {
						factor = 2
						trait = diligent
					}

					mult_modifier = {
						factor = 2
						trait = patient
					}

					set_character_flag = physician_learning_good_outcome
				}

				50 = {
					set_character_flag = physician_learning_middling_outcome
				}

				10 = {
					mult_modifier = {
						factor = 2
						trait = wroth
					}

					mult_modifier = {
						factor = 2
						trait = arbitrary
					}

					set_character_flag = physician_learning_poor_outcome
				}

				5 = {
					mult_modifier = {
						factor = 2
						trait = wroth
					}

					mult_modifier = {
						factor = 2
						trait = arbitrary
					}

					set_character_flag = physician_learning_disastrous_outcome
				}
			}

			character_event = {
				id = RIP.4021
				days = 7
				random = 10
			}
		}
	}

	option = { # Rather not disturb
		name = EVTOPTB_RIP_4020

		prestige = 5
	}
}

# Court Physician Friend teaches you medicine RESULT
character_event = {
	id = RIP.4021
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4021_EXCELLENT
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_learning_excellent_outcome }
	}
	desc = {
		text = EVTDESC_RIP_4021_GOOD
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_learning_good_outcome }
	}
	desc = {
		text = EVTDESC_RIP_4021_MIDDLING
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_learning_middling_outcome }
	}
	desc = {
		text = EVTDESC_RIP_4021_BAD
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = physician_learning_poor_outcome }
	}
	desc = {
		text = EVTDESC_RIP_4021_TERRIBLE
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = physician_learning_disastrous_outcome }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4021

		trigger = { has_character_flag = physician_learning_excellent_outcome }

		prestige = 5
		change_learning = 2

		add_character_modifier = {
			name = invigorated
			years = 15
		}
	}

	option = {
		name = EVTOPTB_RIP_4021

		trigger = { has_character_flag = physician_learning_good_outcome }

		prestige = 5
		change_learning = 1

		add_character_modifier = {
			name = new_insights
			years = 3
		}
	}

	option = {
		name = EVTOPTC_RIP_4021

		trigger = { has_character_flag = physician_learning_middling_outcome }

		prestige = 5
		change_learning = 1
	}

	option = {
		name = EVTOPTD_RIP_4021

		trigger = { has_character_flag = physician_learning_poor_outcome }

		prestige = -5
		change_learning = 1
		add_trait = headache
		set_character_flag = disease_not_serious

		character_event = {
			id = RIP.11009
			days = 100
			random = 365
		}
	}

	option = {
		name = EVTOPTE_RIP_4021

		trigger = { has_character_flag = physician_learning_disastrous_outcome }

		prestige = -5
		add_trait = infection

		character_event = {
			id = RIP.11001
			years = 1
			random = 1095 # 3 years
		}
	}
}

# Court Physician wants you to invest in provincial apothecaries
character_event = {
	id = RIP.4022
	desc = EVTDESC_RIP_4022
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		NOT = { has_character_flag = physician_apothecaries }

		any_courtier_or_vassal = {
			has_minor_title = title_court_physician

			OR = {
				has_character_flag = is_court_physician
				trait = physician
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = charitable
		}

		mult_modifier = {
			factor = 2
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning >= 16
			}
		}

		mult_modifier = {
			factor = 0.2

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 14
			}
		}

		mult_modifier = {
			factor = 0.1

			any_courtier_or_vassal = {
				has_minor_title = title_court_physician
				learning < 10
			}
		}
	}

	immediate = {
		set_character_flag = physician_apothecaries

		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }
			save_event_target_as = physician_target
		}
	}

	option = { # I will invest in this!
		name = EVTOPTA_RIP_4022

		scaled_wealth = -0.5
		prestige = 50

		custom_tooltip = {
			text = physician_apothecaries_custom_tooltip

			any_demesne_province = {
				limit = {
					owned_by = PREV
					has_disease = no

					NOT = {
						any_province_holding = {
							OR = {
								has_siege = yes
								is_occupied = yes
							}
						}
					}
				}

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 1

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4022
	}
}

### Court physician wants to write book ###
character_event = {
	id = RIP.4030
	desc = EVTDESC_RIP_4030
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		any_courtier_or_vassal = {
			has_minor_title = title_court_physician
			NOT = { has_character_flag = physician_wants_to_research }
		}
	}

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }

			save_event_target_as = physician
			set_character_flag = physician_wants_to_research
		}
	}

	# Sure
	option = {
		name = EVTOPTA_RIP_4030

		event_target:physician = {
			show_scope_change = no

			character_event = {
				id = RIP.4031
				days = 3
				tooltip = EVTOPTA_RIP_4030_TOOLTIP
			}
		}

		transfer_scaled_wealth = {
			to = event_target:physician
			value = 0.2
			min = 20
		}

		reverse_opinion = {
			name = opinion_grateful
			who = event_target:physician
			years = 5
		}

	}

	# Nope
	option = {
		name = EVTOPTB_RIP_4030

		custom_tooltip = { text = EVTOPTB_RIP_4030_TOOLTIP }

		reverse_opinion = {
			name = opinion_disappointed
			who = event_target:physician
			years = 5
		}
	}
}

# Notification of patronage
character_event = {
	id = RIP.4031
	desc = EVTDESC_RIP_4031
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4031

		custom_tooltip = {
			text = EVTOPTA_RIP_4031_TOOLTIP

			random_list = {
				# Writes a great book
				15 = {
					mult_modifier = {
						factor = 1.5
						is_smart_trigger = yes
					}

					mult_modifier = {
						factor = 1.5
						physician_good_trigger = yes
					}

					mult_modifier = {
						factor = 1.2
						learning >= 25
					}

					mult_modifier = {
						factor = 1.2
						learning >= 20
					}

					mult_modifier = {
						factor = 1.2
						learning >= 15
					}

					mult_modifier = {
						factor = 0.8
						learning < 15
					}

					mult_modifier = {
						factor = 0.8
						learning < 10
					}

					random_list = {
						33 = { set_character_flag = physician_great_book_1 }
						33 = { set_character_flag = physician_great_book_2 }
						33 = { set_character_flag = physician_great_book_3 }
					}
				}

				# Writes a good book
				35 = {
					mult_modifier = {
						factor = 1.2
						learning >= 25
					}

					mult_modifier = {
						factor = 1.2
						learning >= 20
					}

					mult_modifier = {
						factor = 1.2
						learning >= 15
					}

					mult_modifier = {
						factor = 0.8
						learning < 15
					}

					mult_modifier = {
						factor = 0.8
						learning < 10
					}

					set_character_flag = physician_good_book
				}

				# Writes a meh book
				35 = {
					set_character_flag = physician_meh_book
				}

				# Writes a laughable book
				15 = {
					mult_modifier = {
						factor = 1.5
						is_dumb_trigger = yes
					}

					mult_modifier = {
						factor = 1.5
						physician_bad_trigger = yes
					}

					mult_modifier = {
						factor = 0.8
						learning >= 25
					}

					mult_modifier = {
						factor = 0.8
						learning >= 20
					}

					mult_modifier = {
						factor = 0.8
						learning >= 15
					}

					mult_modifier = {
						factor = 1.2
						learning < 15
					}

					mult_modifier = {
						factor = 1.2
						learning < 10
					}

					set_character_flag = physician_bad_book
				}
			}

			FROM = {
				character_event = {
					id = RIP.4032
					days = 400
				}
			}
		}

		tooltip = {
			transfer_scaled_wealth = {
				from = FROM
				value = 0.2
				min = 20
			}
		}
	}
}

# Patron notification outcome
character_event = {
	id = RIP.4032
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4032_GREAT_1
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { FROM = { has_character_flag = physician_great_book_1 } }
	}
	desc = {
		text = EVTDESC_RIP_4032_GREAT_2
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { FROM = { has_character_flag = physician_great_book_2 } }
	}
	desc = {
		text = EVTDESC_RIP_4032_GREAT_3
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { FROM = { has_character_flag = physician_great_book_3 } }
	}
	desc = {
		text = EVTDESC_RIP_4032_GOOD
		picture = GFX_evt_library
		trigger = { FROM = { has_character_flag = physician_good_book } }
	}
	desc = {
		text = EVTDESC_RIP_4032_MEH
		picture = GFX_evt_performing_experiments
		trigger = { FROM = { has_character_flag = physician_meh_book } }
	}
	desc = {
		text = EVTDESC_RIP_4032_BAD
		picture = GFX_evt_experiments_failed
		trigger = { FROM = { has_character_flag = physician_bad_book } }
	}

	is_triggered_only = yes

	trigger = {
		FROM = {
			is_alive = yes
			prisoner = no

			OR = {
				has_character_flag = physician_great_book_1
				has_character_flag = physician_great_book_2
				has_character_flag = physician_great_book_3
				has_character_flag = physician_good_book
				has_character_flag = physician_meh_book
				has_character_flag = physician_bad_book
			}
		}
	}

	immediate = {
		FROM = {
			character_event = {
				id = RIP.4033
				days = 1
			}
		}
	}

	# Great book outcome
	option = {
		name = EVTOPTA_RIP_4032

		trigger = {
			FROM = {
				OR = {
					has_character_flag = physician_great_book_1
					has_character_flag = physician_great_book_2
					has_character_flag = physician_great_book_3
				}
			}
		}

		custom_tooltip = { text = EVTOPTA_RIP_4032_TOOLTIP }

		prestige = 100

		tooltip = {
			FROM = {
				show_scope_change = no

				if = {
					limit = { trait = physician }
					change_learning = 2
				}
				else = {
					add_trait = physician
				}
			}
		}

		opinion = {
			name = opinion_impressed
			who = FROM
			years = 5
		}
	}

	# Good book outcome
	option = {
		name = EVTOPTB_RIP_4032

		trigger = {
			FROM = { has_character_flag = physician_good_book }
		}


		tooltip = {
			FROM = {
				show_scope_change = no

				change_learning = 1
			}
		}
	}

	# Meh book outcome
	option = {
		name = EVTOPTC_RIP_4032

		trigger = {
			FROM = { has_character_flag = physician_meh_book }
		}
	}

	# Bad outcome
	option = {
		name = EVTOPTD_RIP_4032

		trigger = {
			FROM = { has_character_flag = physician_bad_book }
		}

		custom_tooltip = { text = EVTOPTD_RIP_4032_TOOLTIP }

		prestige = -50

		tooltip = {
			FROM = {
				show_scope_change = no

				if = {
					limit = { is_dumb_trigger = no }
					add_trait = dull
				}
			}
		}

		opinion = {
			name = opinion_disappointed
			who = FROM
			years = 5
		}
	}
}

# Doctor notification outcome
character_event = {
	id = RIP.4033
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4033_GREAT_1
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { has_character_flag = physician_great_book_1 }
	}
	desc = {
		text = EVTDESC_RIP_4033_GREAT_2
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { has_character_flag = physician_great_book_2 }
	}
	desc = {
		text = EVTDESC_RIP_4033_GREAT_3
		picture = GFX_evt_doctor_crazy_treatment
		trigger = { has_character_flag = physician_great_book_3 }
	}
	desc = {
		text = EVTDESC_RIP_4033_GOOD
		picture = GFX_evt_library
		trigger = { has_character_flag = physician_good_book }
	}
	desc = {
		text = EVTDESC_RIP_4033_MEH
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = physician_meh_book }
	}
	desc = {
		text = EVTDESC_RIP_4033_BAD
		picture = GFX_evt_bloody_tools
		trigger = { has_character_flag = physician_bad_book }
	}

	is_triggered_only = yes

	# Great book outcome
	option = {
		name = EVTOPTA_RIP_4033

		trigger = {
			OR = {
				has_character_flag = physician_great_book_1
				has_character_flag = physician_great_book_2
				has_character_flag = physician_great_book_3
			}
		}

		custom_tooltip = { text = EVTOPTA_RIP_4033_TOOLTIP }

		prestige = 15

		if = {
			limit = { trait = physician }
			change_learning = 2
		}
		else = {
			add_trait = physician
		}

		tooltip = {
			reverse_opinion = {
				name = opinion_impressed
				who = FROM
				years = 5
			}
		}
	}

	# Good book outcome
	option = {
		name = EVTOPTB_RIP_4033

		trigger = { has_character_flag = physician_good_book }

		change_learning = 1
	}

	# Meh book outcome
	option = {
		name = EVTOPTC_RIP_4033

		trigger = { has_character_flag = physician_meh_book }
	}

	# Bad book outcome outcome
	option = {
		name = EVTOPTD_RIP_4033

		trigger = { has_character_flag = physician_bad_book }

		custom_tooltip = { text = EVTOPTD_RIP_4033_TOOLTIP }

		prestige = -50

		if = {
			limit = { is_dumb_trigger = no }
			add_trait = dull
		}

		tooltip = {
			reverse_opinion = {
				name = opinion_disappointed
				who = FROM
				years = 5
			}
		}
	}

	after = {
		clr_character_flag = physician_great_book_1
		clr_character_flag = physician_great_book_2
		clr_character_flag = physician_great_book_3
		clr_character_flag = physician_good_book
		clr_character_flag = physician_meh_book
		clr_character_flag = physician_bad_book
	}
}

### Court Physician training events ###
character_event = {
	id = RIP.4040

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	trigger = {
		any_courtier_or_vassal = {
			has_minor_title = title_court_physician
			NOT = { trait = physician }
		}
	}

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }

			random_list = {
				# Nothing happens
				20 = { }

				# Receives training
				10 = {
					mult_modifier = {
						factor = 1.8
						learning <= 6
					}

					mult_modifier = {
						factor = 1.6
						learning < 8
					}

					mult_modifier = {
						factor = 1.5
						learning < 10
					}

					mult_modifier = {
						factor = 1.4
						learning < 12
					}

					mult_modifier = {
						factor = 1.2
						learning < 14
					}

					mult_modifier = {
						factor = 1.2
						learning < 16
					}

					save_event_target_as = physician

					ROOT = {
						character_event = { id = RIP.4041 }
					}
				}
			}
		}
	}
}

# Training: buy herbs/tools/books/
character_event = {
	id = RIP.4041
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4041_BOOKS
		picture = GFX_evt_court_physician
		trigger = { has_character_flag = physician_books }
	}
	desc = {
		text = EVTDESC_RIP_4041_HERBS
		picture = GFX_evt_garden
		trigger = { has_character_flag = physician_herbs }
	}
	desc = {
		text = EVTDESC_RIP_4041_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { has_character_flag = physician_tools }
	}
	desc = {
		text = EVTDESC_RIP_4041_LAB_EQUIPMENT
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_lab_equipment }
	}

	is_triggered_only = yes

	immediate = {
		random_list = {
			25 = { set_character_flag = physician_books }
			25 = { set_character_flag = physician_herbs }
			25 = { set_character_flag = physician_tools }
			25 = { set_character_flag = physician_lab_equipment }
		}
	}

	# Yes
	option = {
		name = EVTOPTA_RIP_4041

		custom_tooltip = {
			text = EVTOPTA_RIP_4041_TOOLTIP

			hidden_effect = {
				save_event_target_as = physician_liege

				event_target:physician = {
					random_list = {
						25 = {
							mult_modifier = {
								factor = 1.5
								is_smart_trigger = yes
							}

							mult_modifier = {
								factor = 1.5
								physician_good_trigger = yes
							}

							mult_modifier = {
								factor = 1.2
								learning >= 25
							}

							mult_modifier = {
								factor = 1.2
								learning >= 20
							}

							mult_modifier = {
								factor = 1.2
								learning >= 15
							}

							mult_modifier = {
								factor = 0.8
								learning < 15
							}

							mult_modifier = {
								factor = 0.8
								learning < 10
							}

							character_event = {
								id = RIP.4042 # Best outcome
								months = 1
							}
						}

						50 = {

							mult_modifier = {
								factor = 1.5
								is_dumb_trigger = yes
							}

							mult_modifier = {
								factor = 1.5
								physician_bad_trigger = yes
							}

							mult_modifier = {
								factor = 0.8
								learning >= 25
							}

							mult_modifier = {
								factor = 0.8
								learning >= 20
							}

							mult_modifier = {
								factor = 0.8
								learning >= 15
							}

							mult_modifier = {
								factor = 1.2
								learning < 15
							}

							mult_modifier = {
								factor = 1.2
								learning < 10
							}

							character_event = {
								id = RIP.4044 # Good outcome
								months = 1
							}
						}

						25 = {
							character_event = {
								id = RIP.4046 # Failure
								months = 1
							}
						}
					}
				}
			}
		}

		scaled_wealth = {
			value = -0.15
			min = -10
		}

		ai_chance = {
			factor = 50

			trigger = { wealth >= 10 }

			mult_modifier = {
				factor = 1.5
				trait = charitable
			}

			mult_modifier = {
				factor = 1.5
				is_smart_trigger = yes
			}

			mult_modifier = {
				factor = 1.5
				is_ill = yes
			}
		}
	}

	# No
	option = {
		name = EVTOPTB_RIP_4041

		custom_tooltip = { text = EVTOPTB_RIP_4041_TOOLTIP }

		clr_character_flag = physician_books
		clr_character_flag = physician_herbs
		clr_character_flag = physician_tools
		clr_character_flag = physician_lab_equipment

		ai_chance = {
			factor = 50

			mult_modifier = {
				factor = 1.5
				trait = greedy
			}

			mult_modifier = {
				factor = 1.5
				is_dumb_trigger = yes
			}
		}
	}
}

# Best outcome training herbs/lab/book/tools, physician notification
character_event = {
	id = RIP.4042
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4042_BOOKS
		picture = GFX_evt_court_physician
		trigger = { FROM = { has_character_flag = physician_books } }
	}
	desc = {
		text = EVTDESC_RIP_4042_HERBS
		picture = GFX_evt_performing_experiments
		trigger = { FROM = { has_character_flag = physician_herbs } }
	}
	desc = {
		text = EVTDESC_RIP_4042_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { FROM = { has_character_flag = physician_tools } }
	}
	desc = {
		text = EVTDESC_RIP_4042_LAB_EQUIPMENT
		picture = GFX_evt_performing_experiments
		trigger = { FROM = { has_character_flag = physician_lab_equipment } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4042

		change_learning = 2

		hidden_effect = {
			if = {
				limit = { NOT = { trait = physician } }

				if = {
					limit = {
						check_variable = {
							which = training_level
							value < 1
						}
					}

					set_variable = {
						which = training_level
						value = 1
					}
				}
				else = {
					change_variable = {
						which = training_level
						value = 1
					}
				}

				if = {
					limit = {
						check_variable = {
							which = training_level
							value >= 3
						}
					}

					character_event = {
						id = RIP.4060
						days = 7
					}
				}
			}

			FROM = {
				character_event = { id = RIP.4043 }
			}
		}
	}
}

# Best outcome training herbs/lab/book/tools, liege notification
character_event = {
	id = RIP.4043
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4043_BOOKS
		picture = GFX_evt_court_physician
		trigger = { has_character_flag = physician_books }
	}
	desc = {
		text = EVTDESC_RIP_4043_HERBS
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_herbs }
	}
	desc = {
		text = EVTDESC_RIP_4043_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { has_character_flag = physician_tools }
	}
	desc = {
		text = EVTDESC_RIP_4043_LAB_EQUIPMENT
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_lab_equipment }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4043

		tooltip = {
			FROM = {
				show_scope_change = no

				change_learning = 2
			}
		}

		clr_character_flag = physician_books
		clr_character_flag = physician_herbs
		clr_character_flag = physician_tools
		clr_character_flag = physician_lab_equipment
	}
}

# Good outcome training herbs/lab/book/tools, physician notification
character_event = {
	id = RIP.4044
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4044_BOOKS
		picture = GFX_evt_court_physician
		trigger = { FROM = { has_character_flag = physician_books } }
	}
	desc = {
		text = EVTDESC_RIP_4044_HERBS
		picture = GFX_evt_performing_experiments
		trigger = { FROM = { has_character_flag = physician_herbs } }
	}
	desc = {
		text = EVTDESC_RIP_4044_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { FROM = { has_character_flag = physician_tools } }
	}
	desc = {
		text = EVTDESC_RIP_4044_LAB_EQUIPMENT
		picture = GFX_evt_performing_experiments
		trigger = { FROM = { has_character_flag = physician_lab_equipment } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4044

		change_learning = 1

		hidden_effect = {
			if = {
				limit = { NOT = { trait = physician } }

				if = {
					limit = {
						check_variable = {
							which = training_level
							value < 1
						}
					}

					set_variable = {
						which = training_level
						value = 1
					}
				}
				else = {
					change_variable = {
						which = training_level
						value = 1
					}
				}

				if = {
					limit = {
						check_variable = {
							which = training_level
							value >= 3
						}
					}

					character_event = {
						id = RIP.4060
						days = 7
					}
				}
			}

			FROM = { character_event = { id = RIP.4045 } }
		}
	}
}

# Good outcome training herbs/lab/book/tools, liege notification
character_event = {
	id = RIP.4045
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4045_BOOKS
		picture = GFX_evt_court_physician
		trigger = { has_character_flag = physician_books }
	}
	desc = {
		text = EVTDESC_RIP_4045_HERBS
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_herbs }
	}
	desc = {
		text = EVTDESC_RIP_4045_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { has_character_flag = physician_tools }
	}
	desc = {
		text = EVTDESC_RIP_4045_LAB_EQUIPMENT
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = physician_lab_equipment }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4045

		tooltip = {
			FROM = {
				show_scope_change = no

				change_learning = 1
			}
		}

		clr_character_flag = physician_books
		clr_character_flag = physician_herbs
		clr_character_flag = physician_tools
		clr_character_flag = physician_lab_equipment
	}
}

# Fail outcome training herbs/lab/book/tools, physician notification
character_event = {
	id = RIP.4046
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4046_BOOKS
		picture = GFX_evt_library
		trigger = { FROM = { has_character_flag = physician_books } }
	}
	desc = {
		text = EVTDESC_RIP_4046_HERBS
		picture = GFX_evt_experiments_failed
		trigger = { FROM = { has_character_flag = physician_herbs } }
	}
	desc = {
		text = EVTDESC_RIP_4046_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { FROM = { has_character_flag = physician_tools } }
	}
	desc = {
		text = EVTDESC_RIP_4046_LAB_EQUIPMENT
		picture = GFX_evt_experiments_failed
		trigger = { FROM = { has_character_flag = physician_lab_equipment } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4046

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.4047
				tooltip = EVTOPTA_RIP_4046_TOOLTIP
			}
		}
	}
}

# Fail outcome training herbs/lab/book/tools, liege notification
character_event = {
	id = RIP.4047
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_4047_BOOKS
		picture = GFX_evt_library
		trigger = { has_character_flag = physician_books }
	}
	desc = {
		text = EVTDESC_RIP_4047_HERBS
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = physician_herbs }
	}
	desc = {
		text = EVTDESC_RIP_4047_TOOLS
		picture = GFX_evt_bloody_tools
		trigger = { has_character_flag = physician_tools }
	}
	desc = {
		text = EVTDESC_RIP_4047_LAB_EQUIPMENT
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = physician_lab_equipment }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_4047

		custom_tooltip = { text = EVTOPTA_RIP_4047_TOOLTIP }

		clr_character_flag = physician_books
		clr_character_flag = physician_herbs
		clr_character_flag = physician_tools
		clr_character_flag = physician_lab_equipment
	}
}

# Now a physician notfication for physician
character_event = {
	id = RIP.4060
	desc = EVTDESC_RIP_4060
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		NOT = { trait = physician }
	}

	option = {
		name = EVTOPTA_RIP_4060

		add_trait = physician

		liege = {
			character_event = { id = RIP.4061 }
		}
	}
}

# Now a physician notification for liege
character_event = {
	id = RIP.4061
	desc = EVTDESC_RIP_4061
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_4061

		tooltip = {
			FROM = {
				show_scope_change = no

				add_trait = physician
			}
		}
	}
}

# A Physician-Missionary arrives in a Tribal or Nomadic Court
character_event = {
	id = RIP.4100
	desc = EVTDESC_RIP_4100
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		OR = {
			is_tribal = yes
			is_nomadic = yes
		}

		NOT = { has_assigned_minor_title = title_court_physician }

		trigger_if = {
			limit = { has_character_flag = tribal_physician }

			had_character_flag = {
				flag = tribal_physician
				years >= 25
			}
		}

		any_independent_ruler = {
			higher_real_tier_than = DUKE
			is_feudal = yes
			is_adult = yes
			is_not_unreformed_pagan_trigger = yes
			NOT = { religion_group = ROOT }
			is_within_diplo_range = ROOT
			ai = yes
			mercenary = no
			holy_order = no
			controls_religion = no

			primary_title = {
				is_landless_type_title = no
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			num_of_symptoms >= 1
		}

		mult_modifier = {
			factor = 2.5
			is_ill = yes
		}

		mult_modifier = {
			factor = 1.5
			trait = cynical
		}
	}

	immediate = {
		set_character_flag = tribal_physician

		random_independent_ruler = {
			limit = {
				higher_real_tier_than = DUKE
				is_feudal = yes
				is_adult = yes
				is_not_unreformed_pagan_trigger = yes
				NOT = { religion_group = ROOT }
				is_within_diplo_range = ROOT
				ai = yes
				mercenary = no
				holy_order = no
				controls_religion = no

				primary_title = {
					is_landless_type_title = no
				}
			}

			create_character = {
				religion = THIS
				culture = THIS
				dynasty = none
				age = 35
				random_traits = yes
				female = no
				health = 6
				add_trait = scholarly_theologian
				add_trait = zealous
				add_trait = physician
				flag = is_court_physician

				attributes = {
					learning = 6
				}
			}

			new_character = {
				remove_trait = cynical
				remove_trait = mystic
				remove_trait = poet
				remove_trait = socializer
				remove_trait = game_master
				remove_trait = hedonist
				remove_trait = duelist
				remove_trait = hunter
				remove_trait = strategist
				remove_trait = administrator
				remove_trait = architect
				remove_trait = gardener
				remove_trait = master_schemer
				remove_trait = impaler
				remove_trait = master_seducer
				remove_trait = master_seductress
				remove_trait = theologian
				remove_trait = scholar
				save_event_target_as = missionary_physician_target
				move_character = ROOT
			}

			save_event_target_as = origin_realm_of_missionary_physician_target
		}
	}

	option = { # Recruit him
		name = EVTOPTA_RIP_4100

		event_target:missionary_physician_target = {
			show_scope_change = no

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

			give_minor_title = title_court_physician
		}

		if = {
			limit = { controls_religion = no }

			character_event = {
				id = RIP.4101
				months = 1
				random = 30
			}
		}

		ai_chance = {
			factor = 70

			mult_modifier = {
				factor = 5
				trait = cynical
			}
		}
	}

	option = { # Seize his assets and execute him!
		name = EVTOPTB_RIP_4100

		wealth = 50

		event_target:missionary_physician_target = {
			show_scope_change = no

			death = {
				death_reason = death_execution_burning
				killer = ROOT
			}
		}

		reverse_opinion = {
			name = opinion_dishonorable_scum
			who = event_target:origin_realm_of_missionary_physician_target
			years = 15
		}

		ai_chance = {
			factor = 30

			mult_modifier = {
				factor = 5
				trait = zealous
			}
		}
	}
}

# Convert to the physicians religion?
character_event = {
	id = RIP.4101
	desc = EVTDESC_RIP_4101
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		NOT = { religion_group = event_target:missionary_physician_target }
		controls_religion = no
	}

	option = {
		name = EVTOPTA_RIP_4101

		reverse_opinion = {
			name = opinion_did_not_trust_me
			who = event_target:missionary_physician_target
			years = 10
		}

		ai_chance = {
			factor = 60

			mult_modifier = {
				factor = 2
				trait = humble
			}

			mult_modifier = {
				factor = 2
				trait = craven
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_4101

		reverse_opinion = {
			name = opinion_glad
			who = event_target:missionary_physician_target
			years = 10
		}

		if = {
			limit = { religion_group = pagan_group }
			add_trait = sympathy_pagans
		}

		religion = event_target:missionary_physician_target
		prestige = -500
		piety = 250

		custom_tooltip = {
			text = EVTOPTB_RIP_4101_TT

			hidden_effect = {
				any_close_relative = {
					limit = {
						vassal_of = ROOT
						ai = yes

						NOR = {
							trait = zealous
							trait = stubborn
							has_character_flag = ai_flag_refuse_conversion
						}
					}

					event_target:missionary_physician_target = {
						religion_scope = {
							save_event_target_as = target_religion
						}
					}

					convert_religion_failsafe_effect = yes
				}

				any_spouse = {
					limit = {
						ai = yes

						NOR = {
							trait = zealous
							trait = stubborn
							has_character_flag = ai_flag_refuse_conversion
						}
					}

					event_target:missionary_physician_target = {
						religion_scope = {
							save_event_target_as = target_religion
						}
					}

					convert_religion_failsafe_effect = yes
				}
			}
		}

		ai_chance = {
			factor = 5

			trigger = { religion_group = pagan }

			mult_modifier = {
				factor = 3
				trait = cynical
			}

			mult_modifier = {
				factor = 1.5
				trait = arbitrary
			}

			mult_modifier = {
				factor = 1.5
				trait = trusting
			}

			mult_modifier = {
				factor = 0.75
				year < 900
			}

			mult_modifier = {
				factor = 0.25

				OR = {
					culture_group = baltic
					culture_group = finno_ugric # The most stubborn pagans
				}
			}

			mult_modifier = {
				factor = 0.25

				OR = {
					culture_group = east_slavic # Like alcohol
					culture_group = north_germanic # Vikings do like their alcohol
				}

				event_target:missionary_physician_target = {
					religion_group = muslim
				}
			}

			mult_modifier = {
				factor = 0.25
				trait = paranoid
			}
		}
	}

	option = {
		name = EVTOPTC_RIP_4101

		wealth = 50

		event_target:missionary_physician_target = {
			show_scope_change = no

			death = {
				death_reason = death_execution_burning
				killer = ROOT
			}
		}

		reverse_opinion = {
			name = opinion_dishonorable_scum
			who = event_target:origin_realm_of_missionary_physician_target
			years = 15
		}

		ai_chance = {
			factor = 30

			mult_modifier = {
				factor = 5
				trait = zealous
			}

			mult_modifier = {
				factor = 2
				trait = stubborn
			}

			mult_modifier = {
				factor = 2
				trait = cruel
			}
		}
	}
}

####################################
# RIP Prosperity Increasing Events #
####################################

# Steward suggests building new roads
character_event = {
	id = RIP.4300
	desc = EVTDESC_RIP_4300
	picture = GFX_evt_culture_change
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		is_tribal = no
		is_nomadic = no

		job_treasurer = {
			stewardship >= 5
		}

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = new_roads

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5
			job_treasurer = { stewardship >= 12 }
		}

		mult_modifier = {
			factor = 1.5
			job_treasurer = { stewardship >= 18 }
		}
	}

	immediate = {
		job_treasurer = {
			save_event_target_as = councillor_target
		}

		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = new_roads

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4300

		scaled_wealth = -0.1
		prestige = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = new_roads
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300  }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4300

		ai_chance = { factor = 70 }
	}
}

# Lord Spiritual suggests building shrines
character_event = {
	id = RIP.4301
	desc = EVTDESC_RIP_4301
	picture = GFX_evt_tribal_shrine
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		is_tribal = no
		is_nomadic = no

		job_spiritual = {
			learning >= 5
		}

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = new_shrines

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5
			job_spiritual = { stewardship >= 12 }
		}

		mult_modifier = {
			factor = 1.5
			job_spiritual = { stewardship >= 18 }
		}
	}

	immediate = {
		job_spiritual = {
			save_event_target_as = councillor_target
		}

		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = new_shrines

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4301

		scaled_wealth = -0.1
		piety = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = new_shrines
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4301

		ai_chance = { factor = 70 }
	}
}

# Marshal suggests building outposts
character_event = {
	id = RIP.4302
	desc = EVTDESC_RIP_4302
	picture = GFX_evt_powerful_tower
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		is_tribal = no
		is_nomadic = no

		job_marshal = {
			martial >= 5
		}

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = peasants_protected

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5
			job_marshal = { martial >= 12 }
		}

		mult_modifier = {
			factor = 1.5
			job_marshal = { martial >= 18 }
		}
	}

	immediate = {
		job_marshal = {
			save_event_target_as = councillor_target
		}

		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = peasants_protected

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4302

		scaled_wealth = -0.1
		prestige = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = peasants_protected
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4302

		ai_chance = { factor = 70 }
	}
}

# Spymaster suggests setting up local messenger stations
character_event = {
	id = RIP.4303
	desc = EVTDESC_RIP_4303
	picture = GFX_evt_courier
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		is_tribal = no
		is_nomadic = no

		job_spymaster = {
			intrigue >= 5
		}

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = messenger_stations

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5
			job_spymaster = { intrigue >= 12 }
		}

		mult_modifier = {
			factor = 1.5
			job_spymaster = { intrigue >= 18 }
		}
	}

	immediate = {
		job_spymaster = {
			save_event_target_as = councillor_target
		}

		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = messenger_stations

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4303

		scaled_wealth = -0.1
		prestige = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = messenger_stations
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4303

		ai_chance = { factor = 70 }
	}
}

# Chancellor suggests sponsoring local harvest festivals
character_event = {
	id = RIP.4304
	desc = EVTDESC_RIP_4304
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		is_tribal = no
		is_nomadic = no

		job_chancellor = {
			diplomacy >= 5
		}

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = harvest_festivals

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}

		mult_modifier = {
			factor = 1.5
			job_chancellor = { diplomacy >= 12 }
		}

		mult_modifier = {
			factor = 1.5
			job_chancellor = { diplomacy >= 18 }
		}
	}

	immediate = {
		job_chancellor = {
			save_event_target_as = councillor_target
		}

		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = harvest_festivals

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4304

		scaled_wealth = -0.1
		prestige = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = harvest_festivals
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4304

		ai_chance = { factor = 70 }
	}
}

# You decide upon personally visiting a province
character_event = {
	id = RIP.4305
	desc = EVTDESC_RIP_4305
	picture = GFX_evt_noble_haughty_talking_to_peasants
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	has_dlc = "Reapers"
	min_age = 16
	only_capable = yes
	prisoner = no
	war = no

	trigger = {
		higher_real_tier_than = COUNT
		stewardship >= 6
		is_tribal = no
		is_nomadic = no
		is_inaccessible_trigger = no

		any_demesne_province = {
			OR = {
				has_castle = yes
				has_temple = yes
				has_city = yes
			}

			has_disease = no
			owned_by = PREV

			NOR = {
				has_province_modifier = depopulated_1
				has_province_modifier = depopulated_2
				has_province_modifier = depopulated_3
				has_province_modifier = prosperity_modifier_3
				has_province_modifier = inspired_peasantry

				any_province_holding = {
					OR = {
						has_siege = yes
						is_occupied = yes
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2.5
			has_ambition = obj_see_the_realm_prosper
		}

		mult_modifier = {
			factor = 1.5
			trait = architect
		}

		mult_modifier = {
			factor = 1.5
			trait = diligent
		}
	}

	immediate = {
		random_demesne_province = {
			limit = {
				OR = {
					has_castle = yes
					has_temple = yes
					has_city = yes
				}

				has_disease = no
				owned_by = PREV

				NOR = {
					has_province_modifier = depopulated_1
					has_province_modifier = depopulated_2
					has_province_modifier = depopulated_3
					has_province_modifier = prosperity_modifier_3
					has_province_modifier = inspired_peasantry

					any_province_holding = {
						OR = {
							has_siege = yes
							is_occupied = yes
						}
					}
				}
			}

			save_event_target_as = prosperity_target
		}
	}

	option = { # A wise investment
		name = EVTOPTA_RIP_4305

		scaled_wealth = -0.1
		prestige = 25

		event_target:prosperity_target = {
			show_scope_change = no

			add_province_modifier = {
				name = inspired_peasantry
				years = 2
			}

			custom_tooltip = {
				text = increase_prosperity_event_custom_tooltip

				change_variable = {
					which = prosperity_value
					value = 15
				}
			}
		}

		ai_chance = {
			factor = 30

			trigger = { wealth >= 300 }
		}
	}

	option = { # I can't afford it
		name = EVTOPTB_RIP_4305

		ai_chance = { factor = 70 }
	}
}

#################
# RIP Nicknames #
#################

character_event = { # Execution nicknames
	id = RIP.4400

	is_triggered_only = yes # on_death
	hide_window = yes

	has_dlc = "Reapers"

	trigger = {
		death_execution_trigger = yes
		killer = { always = yes }
	}

	immediate = {
		killer = {
			if = {
				limit = {
					has_nickname = no
					is_adult = yes
					is_incapable = no
				}

				random_list = {
					5 = {
						give_nickname = nick_the_butcher

						trigger = {
							OR = {
								trait = cruel
								trait = wroth
								trait = impaler
							}
						}
					}

					50 = {
						give_nickname = nick_the_impaler

						trigger = {
							ROOT = { death_reason = death_execution_impaling }
						}
					}

					50 = {
						give_nickname = nick_the_flayer

						trigger = {
							ROOT = { death_reason = death_execution_flaying }
						}
					}

					50 = {
						give_nickname = nick_the_cleansing_flame

						trigger = {
							ROOT = { death_reason = death_execution_burning }
							trait = zealous
							NOT = { religion = ROOT }
							piety >= 100
						}
					}

					50 = {
						give_nickname = nick_the_witch_hunter

						trigger = {
							ROOT = {
								is_female = yes

								OR = {
									death_reason = death_execution_burning
									death_reason = death_execution_drowning_pit
								}
							}

							trigger_if = {
								limit = { religion = ROOT }

								ROOT = {
									OR = {
										has_character_modifier = modifier_witch
										has_character_modifier = suspected_witch
										has_character_modifier = known_witch
										has_character_flag = bg_accused_witch
										has_character_flag = physician_witch
									}
								}
							}

							trait = zealous
							piety = 100
						}
					}

					50 = {
						give_nickname = nick_the_vengeful

						trigger = { is_rival = ROOT }
					}

					50 = {
						give_nickname = nick_the_betrayer

						trigger = { is_friend = ROOT }
					}

					500 = {
						give_nickname = nick_the_kingslayer

						trigger = {
							vassal_of = ROOT
							is_nomadic = no

							ROOT = {
								higher_real_tier_than = DUKE
								is_nomadic = no
							}
						}
					}

					15 = {
						give_nickname = nick_son_of_evilgod

						trigger = {
							OR = {
								piety < -50
								trait = possessed
								is_any_kinslayer_trigger = yes
							}
						}
					}

					4 = {
						give_nickname = nick_the_tyrant
						trigger = { is_evil_tyrant_trigger = yes }
					}

					4 = {
						give_nickname = nick_the_oppressor
						trigger = { is_evil_tyrant_trigger = yes }
					}

					100 = { }
				}
			}
		}
	}
}

### MOURNING FLAVOR EVENTS ###

# Lovers/rivals/friends
character_event = {
	id = RIP.29000

	is_triggered_only = yes # on_death, ramdom_events
	hide_window = yes

	trigger = {
		OR = {
			any_lover = {
				is_alive = yes
				is_inaccessible_or_incapable_trigger = no
			}

			any_friend = {
				is_alive = yes
				is_inaccessible_or_incapable_trigger = no
			}

			any_rival = {
				is_alive = yes
				is_inaccessible_or_incapable_trigger = no
			}
		}

		death_no_trace_trigger = no
		death_in_china_trigger = no
	}

	option = {
		save_event_target_as = rip_dead

		spouse = { save_event_target_as = rip_widow }

		random_child = {
			limit = {
				is_adult = yes
				is_inaccessible_or_incapable_trigger = no
			}

			save_event_target_as = rip_child
		}

		# Lover event
		random_lover = {
			limit = {
				is_inaccessible_or_incapable_trigger = no
				NOT = { has_character_modifier = grief_timer }
			}

			character_event = {
				id = RIP.29001
				days = 20
			}
		}

		# Friend event
		random_friend = {
			limit = {
				is_inaccessible_or_incapable_trigger = no
				NOT = { has_character_modifier = grief_timer }
			}

			save_event_target_as = rip_friend_1

			ROOT = {
				random_friend = {
					limit = {
						is_inaccessible_or_incapable_trigger = no

						NOR = {
							character = event_target:rip_friend_1
							is_rival = event_target:rip_friend_1
							is_friend = event_target:rip_friend_1
							is_lover = event_target:rip_friend_1
							is_close_relative = event_target:rip_friend_1
						}
					}

					save_event_target_as = rip_friend_2
				}
			}

			random_list = {
				75 = {
					trigger = {
						# Prevent crocodile tears
						event_target:rip_dead = {
							NOT = {
								killer = {
									character = event_target:rip_friend_1
								}
							}
						}
					}

					character_event = {
						id = RIP.29005
						months = 1
					}
				}

				25 = {
					trigger = {
						ROOT = {
							any_child = {
								age >= 12

								NOR = {
									character = event_target:rip_friend_1
									is_rival = event_target:rip_friend_1
									is_friend = event_target:rip_friend_1
									is_lover = event_target:rip_friend_1
								}
							}
						}
					}

					character_event = {
						id = RIP.29020
						months = 1
					}
				}
			}
		}

		# Rival event
		random_rival = {
			limit = {
				is_inaccessible_or_incapable_trigger = no
				NOT = { has_character_modifier = grief_timer }
			}

			save_event_target_as = rip_enemy_1

			liege = {
				random_courtier = {
					limit = {
						is_inaccessible_or_incapable_trigger = no

						NOR = {
							character = event_target:rip_enemy_1
							is_rival = event_target:rip_enemy_1
							is_friend = event_target:rip_enemy_1
							is_lover = event_target:rip_enemy_1
						}
					}

					save_event_target_as = rip_new_enemy
				}
			}

			ROOT = {
				random_rival = {
					limit = {
						is_inaccessible_or_incapable_trigger = no

						NOR = {
							character = event_target:rip_enemy_1
							is_rival = event_target:rip_enemy_1
							is_friend = event_target:rip_enemy_1
							is_lover = event_target:rip_enemy_1
						}
					}

					save_event_target_as = rip_enemy_2
				}

				random_child = {
					limit = {
						is_inaccessible_or_incapable_trigger = no

						NOR = {
							character = event_target:rip_enemy_1
							is_rival = event_target:rip_enemy_1
							is_friend = event_target:rip_enemy_1
							is_lover = event_target:rip_enemy_1
						}
					}

					save_event_target_as = rip_new_enemy
				}

				random_friend = {
					limit = {
						is_inaccessible_or_incapable_trigger = no

						NOR = {
							character = event_target:rip_enemy_1
							is_rival = event_target:rip_enemy_1
							is_friend = event_target:rip_enemy_1
							is_lover = event_target:rip_enemy_1
						}
					}

					save_event_target_as = rip_new_enemy
				}
			}

			character_event = {
				id = RIP.29010
				days = 40
			}
		}
	}
}

# Lover
character_event = {
	id = RIP.29001
	desc = EVTDSC_RIP_29001
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	immediate = {
		add_character_modifier = {
			name = grief_timer
			years = 10
			hidden = yes
		}
	}

	# Visit their tomb
	option = {
		name = EVTOPTA_RIP_29001

		custom_tooltip = {
			text = EVTOPTA_RIP_29001_TOOLTIP

			if = {
				limit = {
					event_target:rip_widow = { always = yes }
					NOT = { character = event_target:rip_widow }
				}

				event_target:rip_widow = {
					character_event = {
						id = RIP.29002
						days = 7
					}
				}
			}
			else = {
				character_event = {
					id = RIP.29004
					days = 7
				}
			}
		}

		ai_chance = { factor = 10 }
	}

	# Stay in room and cry
	option = {
		name = EVTOPTB_RIP_29001

		trigger = {
			NOR = {
				trait = cruel
				trait = cynical
				trait = depressed
			}
		}

		custom_tooltip = { text = EVTOPTB_RIP_29001_TOOLTIP }

		if = {
			limit = {
				NOT = { trait = depressed }
			}

			random = {
				chance = 50

				add_trait_depressed_effect = yes

				hidden_effect = {
					# Recover from depression
					random_list = {
						10 = {
							character_event = {
								id = RIP.29015
								days = 200
								random = 600
							}
						}

						20 = {
							trigger = {
								NOT = { has_character_modifier = pet_cat }
							}

							character_event = {
								id = RIP.29016
								days = 200
								random = 600
							}
						}

						10 = {
							trigger = {
								any_child = {
									age >= 3
									age < 13
								}
							}

							character_event = {
								id = RIP.29019
								days = 200
								random = 600
							}
						}

						20 = { } # Nothing
					}
				}
			}
		}

		ai_chance = { factor = 15 }
	}

	option = {
		name = EVTOPTD_RIP_29001

		trigger = { trait = depressed }

		custom_tooltip = { text = EVTOPTD_RIP_29001_TOOLTIP }

		death = { death_reason = death_suicide_hanging }

		random = {
			chance = 35

			mult_modifier = {
				factor = 0.3
				has_nickname = yes
			}

			give_nickname = nick_the_suicide
		}
	}

	# Face the world. You're a badass!
	option = {
		name = EVTOPTC_RIP_29001

		trigger = {
			NOR = {
				trait = kind
				trait = craven
			}
		}

		custom_tooltip = { text = EVTOPTC_RIP_29001_TOOLTIP }

		random_list = {
			33 = {
				trigger = {
					NOT = { trait = cynical }
				}

				add_trait_fully_cynical_effect = yes
			}

			33 = {
				trigger = {
					NOT = { trait = cruel }
				}

				add_trait_fully_cruel_effect = yes
			}

			33 = { } # Nothing
		}

		ai_chance = { factor = 10 }
	}
}

# Widow finds lover at tomb
character_event = {
	id = RIP.29002
	desc = EVTDSC_RIP_29002
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	# Let them mourn
	option = {
		name = EVTOPTA_RIP_29002

		trigger = {
			NOR = {
				trait = cruel
				trait = envious
				trait = wroth
			}
		}

		add_trait_fully_kind_effect = yes

		FROM = {
			character_event = {
				id = RIP.29004
				days = 3
			}
		}
	}

	# Lash out
	option = {
		name = EVTOPTB_RIP_29002

		trigger = {
			NOT = { trait = kind }
		}

		tooltip = {
			if = {
				limit = { NOT = { is_rival = FROM } }
				add_rival = FROM
			}
		}

		add_trait_fully_envious_effect = yes

		FROM = {
			character_event = {
				id = RIP.29003
				days = 3
			}
		}

		ai_chance = { factor = 3 }
	}
}

# Lover visits tomb, meets widow
character_event = {
	id = RIP.29003
	desc = EVTDSC_RIP_29003
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29003

		if = {
			limit = {
				NOT = { is_rival = FROM }
			}

			add_rival = FROM
		}
	}
}

# Lover visits tomb, finds memento
character_event = {
	id = RIP.29004
	desc = EVTDSC_RIP_29004
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_RIP_29004

		add_character_modifier = {
			name = lovers_memento
			duration = -1
		}
	}
}

# Death of a friend
character_event = {
	id = RIP.29005
	desc = EVTDSC_RIP_29005
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	immediate = {
		add_character_modifier = {
			name = grief_timer
			years = 10
			hidden = yes
		}
	}

	# Go out drinking
	option = {
		name = EVTOPTA_RIP_29005

		custom_tooltip = {
			text = EVTOPTA_RIP_29005_TOOLTIP

			hidden_effect = {
				if = {
					limit = { event_target:rip_friend_2 = { always = yes } }

					event_target:rip_friend_2 = {
						character_event = {
							id = RIP.29006
							days = 3
						}
					}
				}
				else_if = {
					limit = {
						any_courtier = {
							block_general_event_trigger = no
							NOT = { is_friend = ROOT }
							ai = yes
						}
					}

					random_courtier = {
						limit = {
							block_general_event_trigger = no
							NOT = { is_friend = ROOT }
							ai = yes
						}

						character_event = {
							id = RIP.29006
							days = 3
						}
					}
				}
				else = {
					character_event = {
						id = RIP.29008
						days = 3
					}
				}
			}
		}

		ai_chance = { factor = 20 }
	}

	# Be alone
	option = {
		name = EVTOPTB_RIP_29005

		trigger = {
			NOR = {
				trait = cruel
				trait = cynical
				trait = depressed
			}
		}

		custom_tooltip = { text = EVTOPTB_RIP_29001_TOOLTIP }

		random = {
			chance = 50

			add_trait_depressed_effect = yes

			hidden_effect = {
				# Recover from depression
				random_list = {
					10 = {
						character_event = {
							id = RIP.29015
							days = 200
							random = 600
						}
					}

					20 = {
						trigger = {
							NOT = { has_character_modifier = pet_cat }
						}

						character_event = {
							id = RIP.29016
							days = 200
							random = 600
						}
					}

					10 = {
						trigger = {
							any_child = {
								age >= 3
								age < 13
							}
						}

						character_event = {
							id = RIP.29019
							days = 200
							random = 600
						}
					}

					20 = { } # Nothing
				}
			}
		}

		ai_chance = { factor = 10 }
	}

	# Suicide
	option = {
		name = EVTOPTD_RIP_29001

		trigger = { trait = depressed }

		custom_tooltip = { text = EVTOPTD_RIP_29001_TOOLTIP }

		death = { death_reason = death_suicide_hanging }

		random = {
			chance = 35

			mult_modifier = {
				factor = 0.3
				has_nickname = yes
			}

			give_nickname = nick_the_suicide
		}
	}

	# Get rid of all of your friends
	option = {
		name = EVTOPTD_RIP_29005

		trigger = { num_of_friends >= 1 }

		custom_tooltip = { text = EVTOPTD_RIP_29005_TOOLTIP }

		any_friend = {
			show_scope_change = no

			remove_friend = ROOT
		}

		ai_chance = { factor = 5 }
	}
}

# Ping new friend
character_event = {
	id = RIP.29006
	desc = EVTDSC_RIP_29006
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	# Approach
	option = {
		name = EVTOPTA_RIP_29007_A

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.29007
				tooltip = EVTOPTA_RIP_29006_TOOLTIP
			}
		}

		ai_chance = { factor = 75 }
	}

	# Leave alone
	option = {
		name = EVTOPTB_RIP_29006

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.29008
				tooltip = EVTOPTB_RIP_29006_TOOLTIP
			}
		}

		ai_chance = { factor = 25 }
	}
}

# Meet new friend
character_event = {
	id = RIP.29007
	picture = GFX_evt_brothel
	border = GFX_event_normal_frame_diplomacy

	desc = {
		trigger = { event_target:rip_friend_2 = { always = yes } }
		text = EVTDSC_RIP_29007_A
	}
	desc = {
		trigger = { NOT = { event_target:rip_friend_2 = { always = yes } } }
		text = EVTDSC_RIP_29007_B
	}

	is_triggered_only = yes

	# Let's be friends
	option = {
		name = {
			text = EVTOPTA_RIP_29007_A
			trigger = { event_target:rip_friend_2 = { always = yes } }
		}
		name = {
			text = EVTOPTA_RIP_29007_B
			trigger = { NOT = { event_target:rip_friend_2 = { always = yes } } }
		}

		add_friend = FROM

		FROM = {
			character_event = {
				id = RIP.29009
				days = 3
			}
		}

		ai_chance = { factor = 75 }
	}

	# I don't want your company!
	option = {
		name = EVTOPTB_RIP_29007

		custom_tooltip = {
			text = EVTOPTB_RIP_29007_TOOLTIP

			character_event = {
				id = RIP.29008
				days = 3
			}

			FROM = {
				character_event = {
					id = RIP.29009
					days = 3
				}
			}
		}

		reverse_opinion = {
			name = opinion_rejected_friend
			who = FROM
			years = 3
		}

		ai_chance = { factor = 25 }
	}
}

# Become a drunkard
character_event = {
	id = RIP.29008
	desc = EVTDSC_RIP_29008
	picture = GFX_evt_drunk
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTB_RIP_29008

		add_trait_silently_drunkard_effect = yes
	}
}

# Did approaching the drinking friend of friend work?
character_event = {
	id = RIP.29009
	border = GFX_event_normal_frame_diplomacy

	desc = {
		text = EVTDSC_RIP_29009_A
		picture = GFX_evt_feast
		trigger = { is_friend = FROM }
	}
	desc = {
		text = EVTDSC_RIP_29009_B
		picture = GFX_evt_quarrel
		trigger = { NOT = { is_friend = FROM } }
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = {
			text = EVTOPTA_RIP_29009_A
			trigger = { is_friend = FROM }
		}
		name = {
			text = EVTOPTA_RIP_29009_B
			trigger = { NOT = { is_friend = FROM } }
		}
	}
}

# Death of a rival
character_event = {
	id = RIP.29010
	desc = EVTDSC_RIP_29010
	picture = GFX_evt_death
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	immediate = {
		add_character_modifier = {
			name = grief_timer
			years = 10
			hidden = yes
		}
	}

	# Steal skull
	option = {
		name = EVTOPTA_RIP_29010

		trigger = {
			OR = {
				trait = cruel
				trait = wroth
				trait = impaler
				trait = lunatic
				trait = possessed
				trait = arbitrary
			}
		}

		custom_tooltip = {
			text = EVTOPTA_RIP_29010_TOOLTIP

			hidden_effect = {
				random_list = {
					# Failure
					40 = {
						trigger = {
							OR = {
								event_target:rip_widow = { always = yes }
								event_target:rip_child = { always = yes }
							}

							trigger_if = {
								limit = { character = event_target:rip_widow }
								NOT = { character = event_target:rip_child }
							}
						}

						if = {
							limit = {
								NOT = { character = event_target:rip_widow }
							}

							event_target:rip_widow = {
								character_event = {
									id = RIP.29011
									days = 7
								}
							}
						}
						else_if = {
							limit = {
								NOT = { character = event_target:rip_child }
							}

							event_target:rip_child = {
								character_event = {
									id = RIP.29011
									days = 7
								}
							}
						}
					}

					60 = {
						mult_modifier = {
							factor = 1.2
							intrigue >= 9
						}

						mult_modifier = {
							factor = 1.2
							intrigue >= 12
						}

						mult_modifier = {
							factor = 1.2
							intrigue >= 15
						}

						mult_modifier = {
							factor = 1.2
							intrigue >= 18
						}

						mult_modifier = {
							factor = 1.2
							intrigue >= 21
						}

						character_event = {
							id = RIP.29013 # Success
							days = 7
						}
					}
				}
			}
		}

		ai_chance = { factor = 2 }
	}

	# Enemy of my enemy
	option = {
		name = EVTOPTB_RIP_29010

		trigger = {
			event_target:rip_enemy_2 = { is_alive = yes }
		}

		custom_tooltip = { text = EVTOPTB_RIP_29010_TOOLTIP }

		add_friend = event_target:rip_enemy_2

		ai_chance = { factor = 10 }
	}

	# Get a new enemy
	option = {
		name = EVTOPTC_RIP_29010

		trigger = {
			event_target:rip_new_enemy = { is_alive = yes }
		}

		custom_tooltip = { text = EVTOPTC_RIP_29010_TOOLTIP }

		add_rival = event_target:rip_new_enemy

		ai_chance = { factor = 5 }
	}

	# Repent
	option = {
		name = EVTOPTD_RIP_29010

		trigger = {
			OR = {
				any_rival = { is_alive = yes }
				NOT = { trait = kind }
			}
		}

		custom_tooltip = { text = EVTOPTD_RIP_29010_TOOLTIP }

		if = {
			limit = { trait = cruel }
			remove_trait = cruel
		}
		else_if = {
			limit = { trait = envious }
			remove_trait = envious
		}
		else_if = {
			limit = {
				NOT = { trait = kind }
			}
			add_trait = kind
		}

		random_rival = {
			show_scope_change = no

			remove_rival = ROOT
		}

		ai_chance = { factor = 5 }
	}

	# No time
	option = {
		name = EVTOPTE_RIP_29010

		custom_tooltip = { text = EVTOPTE_RIP_29010_TOOLTIP }

		remove_trait_silently_stressed_effect = yes
		remove_trait_silently_depressed_effect = yes

		ai_chance = { factor = 15 }
	}
}

# Spouse/child catches someone trying to steal skull
character_event = {
	id = RIP.29011
	desc = EVTDSC_RIP_29011
	picture = GFX_evt_bloody_tools
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	# Imprison
	option = {
		name = EVTOPTA_RIP_29011

		trigger = { is_ruler = yes }

		# Adds rival
		if = {
			limit = {
				NOT = { is_rival = FROM }
			}

			add_rival = FROM
		}

		# If they are your liege, you become a traitor
		if = {
			limit = { is_vassal_or_below_of = FROM }

			reverse_opinion = {
				name = opinion_traitor
				who = FROM
				years = 20
			}
		}

		# If you are their liege, they become a traitor
		if = {
			limit = { is_liege_or_above_of = FROM }

			opinion = {
				name = opinion_traitor
				who = FROM
				years = 20
			}
		}

		FROM = {
			show_scope_change = no

			imprison = ROOT
			set_character_flag = rip_imprisoned
			character_event = { id = RIP.29012 }
		}

		ai_chance = {
			factor = 1

			mult_modifier = {
				factor = 3
				trait = wroth
			}
		}
	}

	# Get out
	option = {
		name = EVTOPTB_RIP_29011

		if = {
			limit = {
				NOT = { is_rival = FROM }
			}

			add_rival = FROM
		}

		# If you are their liege, they become a traitor
		if = {
			limit = { is_liege_or_above_of = FROM }

			opinion = {
				name = opinion_traitor
				who = FROM
				years = 20
			}
		}

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.29012
				tooltip = EVTOPTB_RIP_29011_TOOLTIP
			}
		}

		ai_chance = { factor = 5 }
	}
}

# Effects of getting caught
character_event = {
	id = RIP.29012
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDSC_RIP_29012_A
		picture = GFX_evt_into_the_dungeon
		trigger = { has_character_flag = rip_imprisoned }
	}
	desc = {
		text = EVTDSC_RIP_29012_B
		picture = GFX_evt_bloody_tools
		trigger = { NOT = { has_character_flag = rip_imprisoned } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29012

		add_rival = FROM

		tooltip = {
			# If they are your liege, you become a traitor
			if = {
				limit = { is_vassal_or_below_of = FROM }

				reverse_opinion = {
					name = opinion_traitor
					who = FROM
					years = 20
				}
			}
		}

		add_character_modifier = {
			name = graverobber
			years = 10
		}

		if = {
			limit = { has_character_flag = rip_imprisoned }

			clr_character_flag = rip_imprisoned

			tooltip = {
				imprison = FROM
			}
		}

		tooltip = {
			# If you are their liege, they become a traitor
			if = {
				limit = { is_liege_or_above_of = ROOT }

				opinion = {
					name = opinion_traitor
					who = FROM
					years = 20
				}
			}
		}
	}
}

# Successfully steal skull
character_event = {
	id = RIP.29013
	desc = EVTDSC_RIP_29013
	picture = GFX_evt_bloody_tools
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_RIP_29013

		custom_tooltip = {
			text = EVTOPTA_RIP_29013_TT

			add_artifact = rival_skull

			new_artifact = {
				set_original_owner = event_target:rip_dead
			}

			hidden_effect = {
				event_target:rip_widow = {
					character_event = { id = RIP.29014 }
				}

				event_target:rip_dead = {
					any_child = {
						character_event = { id = RIP.29014 }
					}
				}
			}
		}
	}
}

# Notification of stolen skull
character_event = {
	id = RIP.29014
	desc = EVTDSC_RIP_29014
	picture = GFX_evt_bloody_tools
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from_from = yes

	trigger = {
		NOT = { character = FROM }
	}

	option = {
		name = EVTOPTA_RIP_29014

		random_list = {
			30 = {
				trigger = {
					NOT = { trait = stressed }
				}

				add_trait_stressed_effect = yes
			}

			20 = {
				trigger = {
					NOT = { trait = depressed }
				}

				add_trait_depressed_effect = yes
			}

			60 = { } # Nothing
		}
	}
}

# Done mourning, faith
character_event = {
	id = RIP.29015
	desc = EVTDSC_RIP_29015
	picture = GFX_evt_bishop
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_from = yes

	trigger = { trait = depressed }

	option = {
		name = EVTOPTA_RIP_29015

		remove_trait = depressed
		add_trait_partially_silently_zealous_effect = yes
	}

	option = {
		name = EVTOPTB_RIP_29015

		add_trait_partially_silently_cynical_effect = yes
	}
}

# Done mourning, cat
character_event = {
	id = RIP.29016
	desc = EVTDSC_RIP_29016
	picture = GFX_evt_cat
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes
	hide_from = yes

	trigger = { trait = depressed }

	option = {
		name = EVTOPTA_RIP_29016

		remove_trait = depressed
		add_cat_effect = yes
	}

	option = {
		name = EVTOPTB_RIP_29016
	}
}

# Done mourning, child
character_event = {
	id = RIP.29019
	desc = EVTDSC_RIP_29019
	picture = GFX_evt_family
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	trigger = {
		trait = depressed

		any_child = {
			age >= 3
			age < 13
		}
	}

	immediate = {
		random_child = {
			limit = {
				age = 3
				age < 13
			}

			save_event_target_as = rip_child
		}
	}

	option = {
		name = EVTOPTA_RIP_29019

		custom_tooltip = { text = EVTOPTA_RIP_29019_TOOLTIP }

		remove_trait = depressed
		add_friend = event_target:rip_child
	}

	option = {
		name = EVTOPTB_RIP_29019

		custom_tooltip = { text = EVTOPTB_RIP_29019_TOOLTIP }

		reverse_opinion = {
			name = opinion_neglectful_parent
			who = event_target:rip_child
		}
	}
}

# You promised friend to look after their child
character_event = {
	id = RIP.29020
	desc = EVTDSC_RIP_29020
	picture = GFX_evt_death
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	immediate = {
		add_character_modifier = {
			name = grief_timer
			years = 10
			hidden = yes
		}

		event_target:rip_dead = {
			random_child = {
				limit = {
					age >= 12

					NOR = {
						is_rival = ROOT
						is_friend = ROOT
						is_lover = ROOT
						character = ROOT
					}
				}

				preferred_limit = { ai = no }
				preferred_limit = { is_heir = yes }
			}

			save_event_target_as = rip_heir
		}
	}

	# Approach
	option = {
		name = EVTOPTA_RIP_29020

		event_target:rip_heir = {
			show_scope_change = no

			character_event = {
				id = RIP.29021
				days = 7
				tooltip = EVTOPTA_RIP_29020_TOOLTIP
			}
		}

		ai_chance = {
			factor = 7

			mult_modifier = {
				factor = 2

				OR = {
					trait = gregarious
					trait = kind
					trait = just
				}
			}
		}
	}

	# Or become lovers...?
	option = {
		name = EVTOPTC_RIP_29020

		trigger = {
			# Must be appropriate love target
			event_target:rip_heir = {
				root_attraction_trigger = yes
				is_adult = yes

				trigger_if = {
					limit = { is_close_relative = ROOT }

					religion_has_incest = yes

					event_target:rip_heir = {
						religion_has_incest = yes
					}
				}
			}

			# Root must be motivated
			OR = {
				event_target:rip_heir = {
					has_fair_trait_trigger = yes
				}

				trait = lustful
				trait = master_seducer
				trait = master_seductress

				trigger_if = {
					limit = { age >= 40 }

					has_lover = no
					is_married = no
				}
			}

			# Root can't be unmotivated
			NOR = {
				trait = chaste
				trait = celibate
			}
		}

		event_target:rip_heir = {
			show_scope_change = no

			character_event = {
				id = RIP.29024
				days = 7
				tooltip = EVTOPTC_RIP_29020_TOOLTIP
			}
		}

		random = {
			chance = 50
			add_trait_fully_lustful_effect = yes
		}

		ai_chance = { factor = 15 }
	}

	# Don't approach
	option = {
		name = EVTOPTB_RIP_29020

		custom_tooltip = { text = EVTOPTB_RIP_29020_TOOLTIP }

		random = {
			chance = 50
			add_trait_partially_shy_effect = yes
		}

		ai_chance = {
			factor = 3

			mult_modifier = {
				factor = 2

				OR = {
					trait = shy
					trait = cruel
					trait = arbitrary
				}
			}
		}
	}
}

# Getting approached by dead parent's friend
character_event = {
	id = RIP.29021
	desc = EVTDSC_RIP_29021
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	# Let's be friends
	option = {
		name = EVTOPTA_RIP_29021

		add_friend = FROM

		FROM = {
			character_event = { id = RIP.29022 }
		}

		ai_chance = {
			factor = 7

			mult_modifier = {
				factor = 2

				OR = {
					trait = gregarious
					trait = kind
					trait = just
				}
			}
		}
	}

	# I am fine on my own
	option = {
		name = EVTOPTB_RIP_29021


		FROM = {
			show_scope_change = no

			opinion = {
				name = opinion_rejected_friend
				who = ROOT
				years = 5
			}

			character_event = { id = RIP.29023 }
		}

		ai_chance = {
			factor = 3

			mult_modifier = {
				factor = 2

				OR = {
					trait = shy
					trait = cruel
					trait = arbitrary
				}
			}
		}
	}
}

# Confirmed friendship
character_event = {
	id = RIP.29022
	border = GFX_event_normal_frame_diplomacy
	desc = EVTDSC_RIP_29022
	picture = GFX_evt_courtiers_talking

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29022

		tooltip = {
			add_friend = FROM
		}
	}
}

# Denied friendship
character_event = {
	id = RIP.29023
	desc = EVTDSC_RIP_29023
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29023

		tooltip = {
			opinion = {
				name = opinion_rejected_friend
				who = FROM
				years = 5
			}
		}
	}
}

# Getting approached by dead parent's friend, lover
character_event = {
	id = RIP.29024
	desc = EVTDSC_RIP_29024
	picture = GFX_evt_death
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	# Let's be lovers
	option = {
		name = EVTOPTA_RIP_29024

		add_lover = FROM

		FROM = {
			character_event = { id = RIP.29025 }
		}

		ai_chance = {
			factor = 1

			trigger = {
				FROM = { root_attraction_trigger = yes }
				NOT = { trait = celibate }
			}

			mult_modifier = {
				factor = 5

				OR = {
					trait = lustful
					trait = master_seducer
					trait = master_seductress
				}
			}
		}
	}

	# No!
	option = {
		name = EVTOPTB_RIP_29024


		FROM = {
			show_scope_change = no

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

			character_event = { id = RIP.29026 }
		}

		ai_chance = {
			factor = 3

			mult_modifier = {
				factor = 2

				OR = {
					is_married = yes
					trait = shy
					trait = chaste
					is_ascetic_trigger = yes
				}
			}

			mult_modifier = {
				factor = 5
				has_lover = yes
			}
		}
	}
}

# Confirmed lovers
character_event = {
	id = RIP.29025
	desc = EVTDSC_RIP_29025
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29022

		tooltip = {
			add_lover = FROM
		}
	}
}

# Denied lover
character_event = {
	id = RIP.29026
	desc = EVTDSC_RIP_29026
	picture = GFX_evt_quarrel
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29023

		tooltip = {
			opinion = {
				who = FROM
				name = opinion_advance_rejected
				years = 10
			}
		}
	}
}

### MAIMED FLAVOUR EVENTS ###

# Disfigured events
character_event = {
	id = RIP.29100

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		trait = disfigured
		NOT = { trait = severely_injured }
		is_inaccessible_trigger = no
	}

	immediate = {
		random_list = {
			# Golden mask
			10 = {
				trigger = {
					has_lover = no
					NOT = { has_character_modifier = golden_mask }
				}

				character_event = { id = RIP.29101 }
			}

			# Scaring the children
			10 = {
				trigger = {
					any_spouse = {
						any_child = {
							is_alive = yes
							is_child_of = ROOT
							age >= 2
							age < 13

							NOR = {
								trait = brave
								trait = willful
								trait = rowdy
							}
						}
					}
				}

				character_event = { id = RIP.29103 }
			}

			# Phantom pain
			10 = {
				trigger = {
					has_assigned_minor_title = title_court_physician
					NOT = { has_character_modifier = phantom_pain }
				}

				character_event = { id = RIP.29500 }
			}

			# Masquerade
			10 = {
				trigger = {
					NOT = {
						any_courtier = {
							OR = {
								has_character_modifier = forced_mask
								has_character_modifier = attending_masquerade
							}
						}
					}
				}

				character_event = { id = RIP.29104 }
			}
		}
	}
}

# Golden mask
character_event = {
	id = RIP.29101
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy

	desc = {
		text = EVTDSC_RIP_29101_A
		trigger = { prefers_men_trigger = yes }
	}
	desc = {
		text = EVTDSC_RIP_29101_B
		trigger = { prefers_men_trigger = no }
	}

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA_RIP_29101_A
			trigger = { prefers_men_trigger = yes }
		}
		name = {
			text = EVTOPTA_RIP_29101_B
			trigger = { prefers_men_trigger = no }
		}

		custom_tooltip = { text = EVTOPTA_RIP_29101_TOOLTIP }

		scaled_wealth = {
			value = -0.2
			min = -25
		}

		add_character_modifier = {
			name = golden_mask
			duration = -1
		}

		# CleanSlate: To trigger portrait update?
		hidden_effect = {
			remove_trait = disfigured
			add_trait = disfigured
		}
	}

	option = {
		name = EVTOPTB_RIP_29101

		custom_tooltip = { text = EVTOPTB_RIP_29101_TOOLTIP }
	}
}

# Scaring the children
character_event = {
	id = RIP.29103
	desc = EVTDSC_RIP_29103
	picture = GFX_evt_child_play
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	immediate = {
		random_spouse = {
			limit = {
				any_child = {
					is_alive = yes
					is_child_of = ROOT
					age = 2
					age < 13

					NOR = {
						trait = brave
						trait = willful
						trait = rowdy
					}
				}
			}

			save_event_target_as = rip_spouse

			random_child = {
				limit = {
					is_alive = yes
					is_child_of = ROOT
					age = 2
					age < 13

					NOR = {
						trait = brave
						trait = willful
						trait = rowdy
					}
				}

				save_event_target_as = rip_scared_child
			}
		}
	}

	option = {
		name = EVTOPTA_RIP_29103

		custom_tooltip = { text = EVTOPTA_RIP_29103_TOOLTIP }

		reverse_opinion = {
			name = opinion_did_not_take_my_advice
			who = event_target:rip_spouse
		}

		random = {
			chance = 50

			event_target:rip_scared_child = {
				show_scope_change = no

				opinion = {
					name = opinion_repulsed_deformity
					who = ROOT
				}

				if = {
					limit = { has_dlc = "Conclave" }

					if = {
						limit = {
							NOT = { trait = timid }
						}

						add_trait = timid
					}
				}
				else_if = {
					limit = {
						NOR = {
							trait = craven
							trait = berserker
						}
					}

					add_trait = craven
				}
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_29103

		custom_tooltip = { text = EVTOPTB_RIP_29103_TOOLTIP }

		random = {
			chance = 50
			add_trait_depressed_effect = yes
		}
	}
}

# Masquerade
character_event = {
	id = RIP.29104
	desc = EVTDSC_RIP_29104
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29104

		custom_tooltip = {
			text = EVTOPTA_RIP_29104_TOOLTIP

			set_character_flag = do_not_disturb

			# Invitations
			any_courtier_or_vassal = {
				character_event = {
					id = RIP.29112
					days = 3
				}
			}

			if = {
				limit = {
					OR = {
						trait = lunatic
						trait = envious
					}
				}

				character_event = {
					id = RIP.29105
					days = 20
				}
			}
			else = {
				character_event = {
					id = RIP.29110
					days = 20
				}
			}
		}

		scaled_wealth = {
			value = -0.25
			min = -25
		}

	}

	option = {
		name = EVTOPTB_RIP_29104

		custom_tooltip = { text = EVTOPTB_RIP_29104_TOOLTIP }
	}
}

# Notice of masquerade ball starting
character_event = {
	id = RIP.29112
	desc = EVTDSC_RIP_29112
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	# Attend
	option = {
		name = EVTOPTA_RIP_29112

		add_character_modifier = {
			name = attending_masquerade
			duration = -1
		}

		set_character_flag = do_not_disturb

		character_event = {
			id = RIP.29114 # Clean-up
			days = 100
		}

		ai_chance = {
			factor = 30

			mult_modifier = {
				factor = 2

				OR = {
					trait = gregarious
					trait = disfigured
					trait = hedonist
					trait = gluttonous
					trait = socializer
				}
			}
		}
	}

	# Decline
	option = {
		name = EVTOPTB_RIP_29112

		reverse_opinion = {
			name = opinion_declined_party
			who = FROM
			years = 10
		}

		hidden_effect = {
			remove_character_modifier = attending_masquerade
		}

		ai_chance = {
			factor = 1

			mult_modifier = {
				factor = 20

				OR = {
					trait = shy
					trait = paranoid
				}
			}
		}
	}
}

# Masquerade for crazy people
character_event = {
	id = RIP.29105
	desc = EVTDSC_RIP_29105
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	# YES (lunatic)
	option = {
		name = EVTOPTA_RIP_29105
		tooltip_info = lunatic

		trigger = { trait = lunatic }

		character_event = {
			id = RIP.29106
			tooltip = EVTOPTA_RIP_29105_TOOLTIP
		}
	}

	# YES (envious)
	option = {
		name = EVTOPTA_RIP_29105
		tooltip_info = envious

		trigger = {
			trait = envious
			NOT = { trait = lunatic }
		}

		random = {
			chance = 50
			add_trait_lunatic_effect = yes
		}

		character_event = {
			id = RIP.29106
			tooltip = EVTOPTA_RIP_29105_TOOLTIP
		}
	}

	# Nah
	option = {
		name = EVTOPTB_RIP_29105

		custom_tooltip = {
			text = EVTOPTB_RIP_29105_TOOLTIP

			hidden_effect = {
				any_realm_character = {
					limit = { has_character_modifier = attending_masquerade }

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

					character_event = { id = RIP.29113 }

					remove_character_modifier = attending_masquerade
				}
			}
		}
	}
}

# Reactions to crazy (ruler)
character_event = {
	id = RIP.29106
	desc = EVTDSC_RIP_29106
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29106

		custom_tooltip = {
			text = EVTOPTA_RIP_29106_TOOLTIP

			hidden_effect = {
				clr_character_flag = do_not_disturb
				set_character_flag = crazy_masked_ruler
				save_event_target_as = rip_masked_ruler

				any_realm_character = {
					limit = { has_character_modifier = attending_masquerade }
					character_event = { id = RIP.29107 }
				}
			}
		}
	}
}

# Reactions to crazy ruler (everyone else)
character_event = {
	id = RIP.29107
	desc = EVTDSC_RIP_29107
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29107

		custom_tooltip = {
			text = EVTOPTA_RIP_29107_TOOLTIP

			remove_do_not_disturb_effect = yes
			remove_character_modifier = attending_masquerade

			character_event = {
				id = RIP.29108
				days = 100
			}
		}

		opinion = {
			name = opinion_insane_ruler
			who = FROM
			years = 100
		}

		add_character_modifier = {
			name = forced_mask
			duration = -1
		}
	}
}

# Checking crazy ruler
character_event = {
	id = RIP.29108

	is_triggered_only = yes
	hide_window = yes

	trigger = {
		liege = {
			has_character_flag = crazy_masked_ruler
		}
	}

	fail_trigger_effect = {
		character_event = { id = RIP.29109 }
	}

	immediate = {
		repeat_event = {
			id = RIP.29108
			days = 100
		}
	}
}

# Rejoice we can take mask off
character_event = {
	id = RIP.29109
	picture = GFX_evt_feast
	border = GFX_event_normal_frame_diplomacy

	desc = {
		text = EVTDSC_RIP_29109_A
		trigger = { event_target:rip_masked_ruler = { is_alive = no } }
	}

	desc = {
		text = EVTDSC_RIP_29109_B
		trigger = { event_target:rip_masked_ruler = { is_alive = yes } }
	}

	is_triggered_only = yes

	immediate = {
		remove_character_modifier = forced_mask
	}

	option = {
		name = EVTOPTA_RIP_29109

		custom_tooltip = { text = EVTOPTA_RIP_29109_TOOLTIP }

		tooltip = {
			remove_character_modifier = forced_mask
		}
	}
}

# Nice masquerade
character_event = {
	id = RIP.29110
	desc = EVTDSC_RIP_29110
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29110

		custom_tooltip = {
			text = EVTOPTA_RIP_29110_TOOLTIP

			remove_do_not_disturb_effect = yes

			any_realm_character = {
				limit = { has_character_modifier = attending_masquerade }

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

				remove_character_modifier = attending_masquerade
				remove_do_not_disturb_effect = yes
				character_event = { id = RIP.29113 }
			}
		}

		add_character_modifier = {
			name = great_dancer
			years = 10
		}
	}
}

# Notice of masquerade ball ending well
character_event = {
	id = RIP.29113
	desc = EVTDSC_RIP_29113
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29113

		tooltip = {
			opinion = {
				name = opinion_great_masquerade
				who = FROM
				years = 10
			}
		}
	}
}

# Cleanup event attending_masquerade
character_event = {
	id = RIP.29114

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		remove_do_not_disturb_effect = yes

		if = {
			limit = { has_character_modifier = attending_masquerade }
			remove_character_modifier = attending_masquerade
		}
	}
}

# One-eyed events
character_event = {
	id = RIP.29200

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		trait = one_eyed
		NOT = { trait = severely_injured }
		is_inaccessible_trigger = no
	}

	immediate = {
		random_list = {
			# Rock thrown at you
			10 = {
				trigger = {
					any_courtier = {
						is_adult = no
						age >= 4
					}
				}

				character_event = { id = RIP.29201 }
			}

			# Glass eye
			10 = {
				trigger = {
					NOT = { has_character_modifier = glass_eye }
				}

				character_event = { id = RIP.29205 }
			}

			# Phantom pain
			10 = {
				trigger = {
					has_assigned_minor_title = title_court_physician
					NOT = { has_character_modifier = phantom_pain }
				}

				character_event = { id = RIP.29500 }
			}
		}
	}
}

# Rock thrown at you
character_event = {
	id = RIP.29201
	desc = EVTDSC_RIP_29201
	picture = GFX_evt_child_bully
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	immediate = {
		random_courtier = {
			limit = {
				is_adult = no
				age >= 4
			}

			preferred_limit = {
				is_child_of = ROOT
			}

			save_event_target_as = rip_throwing_child
		}
	}

	# Catch
	option = {
		name = EVTOPTA_RIP_29201

		random_list = {
			# Success
			60 = {
				character_event = {
					id = RIP.29202
					tooltip = EVTOPTA_RIP_29201_SUCCESS
				}
			}

			# Fail
			40 = {
				character_event = {
					id = RIP.29203
					tooltip = EVTOPTA_RIP_29201_FAILURE
				}
			}
		}
	}

	# Throw yourself at ground
	option = {
		name = EVTOPTB_RIP_29201

		custom_tooltip = { text = EVTOPTB_RIP_29201_TOOLTIP }

		if = {
			limit = {
				NOR = {
					trait = craven
					trait = berserker
				}
			}

			random = {
				chance = 20

				remove_trait_silently_brave_effect = yes
				add_trait = craven
				set_character_flag = became_craven
			}
		}

		character_event = { id = RIP.29204 }
	}
}

# Successful catch
character_event = {
	id = RIP.29202
	desc = EVTDSC_RIP_29202
	border = GFX_event_normal_frame_war
	picture = GFX_evt_guardian

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29202

		prestige = 25
		change_martial = 1

		reverse_opinion = {
			name = opinion_impressed
			who = event_target:rip_throwing_child
			years = 5
		}
	}
}

# Failed catch
character_event = {
	id = RIP.29203
	desc = EVTDSC_RIP_29203
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29203

		hidden_effect = {
			remove_trait = one_eyed

			if = {
				limit = { has_nickname = no }

				random = {
					chance = 20
					give_nickname = nick_the_eyeless
				}
			}
		}

		add_trait = blinded

		if = {
			limit = { NOT = { trait = severely_injured } }

			add_trait = severely_injured
			resolve_severely_injured_effect = yes
		}

		reverse_opinion = {
			name = opinion_afraid
			who = event_target:rip_throwing_child
			years = 10
		}
	}
}

# Throwing yourself on the ground
character_event = {
	id = RIP.29204
	desc = EVTDSC_RIP_29204
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29204

		prestige = -25

		if = {
			limit = { has_character_flag = became_craven }

			clr_character_flag = became_craven
			tooltip = { add_trait = craven }
		}

		reverse_opinion = {
			name = opinion_scolded
			who = event_target:rip_throwing_child
		}
	}
}

# Fake eye
character_event = {
	id = RIP.29205
	picture = GFX_evt_courtiers_talking
	border = GFX_event_normal_frame_diplomacy

	desc = {
		text = EVTDSC_RIP_29205_A
		trigger = { prefers_men_trigger = yes }
	}
	desc = {
		text = EVTDSC_RIP_29205_B
		trigger = { prefers_men_trigger = no }
	}

	is_triggered_only = yes

	# Get eye made
	option = {
		name = EVTOPTA_RIP_29205

		custom_tooltip = { text = EVTOPTA_RIP_29205_TOOLTIP }

		scaled_wealth = {
			value = -0.1
			min = -15
		}

		add_character_modifier = {
			name = glass_eye
			duration = -1
		}

		hidden_effect = {
			remove_trait = one_eyed
			add_trait = one_eyed
		}
	}

	# Don't get eye made
	option = {
		name = EVTOPTB_RIP_29101

		custom_tooltip = { text = EVTOPTB_RIP_29101_TOOLTIP }
	}
}

# One-handed events
character_event = {
	id = RIP.29300

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		trait = one_handed
		NOT = { trait = severely_injured }
		is_inaccessible_trigger = no
	}

	immediate = {
		random_list = {
			# Becoming ambidextrous
			10 = {
				trigger = {
					NOR = {
						has_character_modifier = martially_ambidextrous
						has_artifact = prosthetic_hand_metal
						trait = blinded
					}
				}

				character_event = { id = RIP.29301 }
			}

			# Getting a prosthetic hand
			10 = {
				trigger = {
					NOR = {
						has_artifact = prosthetic_hand_gold
						has_artifact = prosthetic_hand_metal
					}
				}

				character_event = { id = RIP.29305 }
			}

			# Phantom pain
			10 = {
				trigger = {
					has_assigned_minor_title = title_court_physician
					NOT = { has_character_modifier = phantom_pain }
				}

				character_event = { id = RIP.29500 }
			}
		}
	}
}

# Becoming ambidextrous
character_event = {
	id = RIP.29301
	desc = EVTDSC_RIP_29301
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29301

		custom_tooltip = { text = EVTOPTA_RIP_29301_TOOLTIP }

		random_list = {
			# Success
			33 = {
				mult_modifier = {
					factor = 1.2
					martial >= 9
				}

				mult_modifier = {
					factor = 1.2
					martial >= 12
				}

				mult_modifier = {
					factor = 1.2
					martial >= 15
				}

				mult_modifier = {
					factor = 1.2
					martial >= 18
				}

				mult_modifier = {
					factor = 1.2
					martial >= 21
				}

				character_event = {
					id = RIP.29302
					months = 2
					random = 60
					tooltip = EVTOPTA_RIP_29301_SUCCESS
				}
			}

			# Nothing
			33 = {
				character_event = {
					id = RIP.29303
					months = 2
					random = 60
					tooltip = EVTOPTA_RIP_29301_FAILURE
				}
			}

			33 = {
				character_event = {
					id = RIP.29304
					months = 2
					random = 60
					tooltip = EVTOPTA_RIP_29301_INJURY
				}
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_29301

		custom_tooltip = { text = EVTOPTB_RIP_29301_TOOLTIP }

		change_learning = 1
	}
}

# Ambidextrous success
character_event = {
	id = RIP.29302
	desc = EVTDSC_RIP_29302
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29302

		add_character_modifier = {
			name = martially_ambidextrous
			duration = -1
		}
	}
}

# Ambidextrous failure
character_event = {
	id = RIP.29303
	desc = EVTDSC_RIP_29303
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_29303
	}
}

# Ambidextrous injury
character_event = {
	id = RIP.29304
	desc = EVTDSC_RIP_29304
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29304

		random_list = {
			# One-legged
			20 = {
				trigger = {
					NOT = { trait = one_legged }
				}

				add_trait = one_legged
				character_event = { id = RIP.11503 } # Notify one-legged
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			# One-eyed
			10 = {
				trigger = {
					NOT = { trait = one_eyed }
				}

				add_trait = one_eyed
				character_event = { id = RIP.11501 } # Notify one-eyed
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			# Disfigured
			10 = {
				trigger = {
					NOT = { trait = disfigured }
				}

				add_trait = disfigured
				character_event = { id = RIP.11504 } # Notify disfigured
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			# Mangled
			10 = {
				trigger = {
					NOT = { trait = mangled }
				}

				add_trait = mangled
				character_event = { id = RIP.11505 } # Notify mangled
				add_trait = severely_injured
				resolve_severely_injured_effect = yes
			}

			fallback = {
				add_trait_wounded_effect = yes
			}
		}
	}
}

# Get fake hand
character_event = {
	id = RIP.29305
	desc = EVTDSC_RIP_29305
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	# Golden hand
	option = {
		name = EVTOPTA_RIP_29305

		custom_tooltip = { text = EVTOPTA_RIP_29305_TOOLTIP }

		scaled_wealth = {
			value = -0.75
			min = -100
		}

		add_artifact = prosthetic_hand_gold
	}

	# Iron hand
	option = {
		name = EVTOPTB_RIP_29305

		custom_tooltip = {
			text = EVTOPTB_RIP_29305_TOOLTIP

			random = {
				chance = 50
				give_nickname = nick_iron_hand
			}
		}

		scaled_wealth = {
			value = -0.50
			min = -50
		}

		add_artifact = prosthetic_hand_metal
	}

	# No prosthetic hand
	option = {
		name = EVTOPTC_RIP_29305

		custom_tooltip = { text = EVTOPTC_RIP_29305_TOOLTIP }
	}
}

# One-legged events
character_event = {
	id = RIP.29400

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	only_playable = yes
	min_age = 16
	only_capable = yes
	prisoner = no

	trigger = {
		trait = one_legged
		NOT = { trait = severely_injured }
		is_inaccessible_trigger = no
	}

	immediate = {
		random_list = {
			# Dancing
			10 = {
				trigger = {
					any_courtier = {
						root_attraction_trigger = yes
						block_general_event_trigger = no
						NOT = { is_lover = ROOT }

						trigger_if = {
							limit = { is_close_relative = ROOT }

							religion_has_incest = yes
							ROOT = { religion_has_incest = yes }
						}
					}
				}

				character_event = { id = RIP.29401 }
			}

			# Prosthesis
			10 = {
				trigger = {
					NOR = {
						has_artifact = prosthetic_leg_artifact
						has_character_modifier = peg_leg
					}
				}

				character_event = { id = RIP.29404 }
			}

			# Phantom pain
			10 = {
				trigger = {
					has_assigned_minor_title = title_court_physician
					NOT = { has_character_modifier = phantom_pain }
				}

				character_event = { id = RIP.29500 }
			}
		}
	}
}

# Dance with love interest?
character_event = {
	id = RIP.29401
	desc = EVTDSC_RIP_29401
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_diplomacy

	immediate = {
		random_courtier = {
			limit = {
				root_attraction_trigger = yes
				block_general_event_trigger = no
				NOT = { is_lover = ROOT }

				trigger_if = {
					limit = { is_close_relative = ROOT }

					religion_has_incest = yes
					ROOT = { religion_has_incest = yes }
				}
			}

			save_event_target_as = rip_love_interest
		}
	}

	is_triggered_only = yes

	# Try to dance
	option = {
		name = EVTOPTA_RIP_29401

		random_list = {
			60 = {
				character_event = {
					id = RIP.29402
					tooltip = EVTOPTA_RIP_29401_SUCCESS
				}
			}
			40 = {
				character_event = {
					id = RIP.29403
					tooltip = EVTOPTA_RIP_29401_FAILURE
				}
			}
		}
	}

	# Avoid
	option = {
		name = EVTOPTB_RIP_29401

		custom_tooltip = { text = EVTOPTB_RIP_29401_TOOLTIP }

		random = {
			chance = 33
			add_trait_depressed_effect = yes
		}
	}
}

# Dance success
character_event = {
	id = RIP.29402
	desc = EVTDSC_RIP_29402
	picture = GFX_evt_dancing
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29402

		add_lover = event_target:rip_love_interest
	}
}

# Dance fail
character_event = {
	id = RIP.29403
	desc = EVTDSC_RIP_29403
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29403

		reverse_opinion = {
			name = opinion_inept_dancer
			who = event_target:rip_love_interest
		}
	}
}

# Prosthetic leg
character_event = {
	id = RIP.29404
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDSC_RIP_29404_A
		trigger = {
			NOT = { has_assigned_minor_title = title_court_jester }
		}
	}
	desc = {
		text = EVTDSC_RIP_29404_B
		trigger = { has_assigned_minor_title = title_court_jester }
	}

	is_triggered_only = yes

	immediate = {
		random_courtier_or_vassal = {
			limit = { has_minor_title = title_court_jester }
			save_event_target_as = jester
		}
	}

	# Fake leg
	option = {
		name = EVTOPTA_RIP_29404

		custom_tooltip = { text = EVTOPTA_RIP_29404_TOOLTIP }

		scaled_wealth = {
			value = -0.35
			min = -35
		}

		add_artifact = prosthetic_leg_artifact
	}

	# Peg leg
	option = {
		name = EVTOPTB_RIP_29404

		custom_tooltip = {
			text = EVTOPTB_RIP_29404_TOOLTIP

			random = {
				chance = 50
				give_nickname = nick_peg_leg
			}
		}

		scaled_wealth = {
			value = -0.20
			min = -20
		}

		add_character_modifier = {
			name = peg_leg
			duration = -1
		}
	}

	# No prosthetic leg
	option = {
		name = EVTOPTC_RIP_29404

		custom_tooltip = { text = EVTOPTC_RIP_29404_TOOLTIP }
	}
}

# Phantom pain emerges
character_event = {
	id = RIP.29500
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDSC_RIP_29500_NOSE
		trigger = { trait = disfigured }
	}
	desc = {
		text = EVTDSC_RIP_29500_EYE
		trigger = { trait = one_eyed }
	}
	desc = {
		text = EVTDSC_RIP_29500_HAND
		trigger = { trait = one_handed }
	}
	desc = {
		text = EVTDSC_RIP_29500_LEG
		trigger = { trait = one_legged }
	}

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		any_courtier_or_vassal = {
			limit = { has_minor_title = title_court_physician }
			save_event_target_as = rip_physician
		}
	}

	option = {
		name = EVTOPTA_RIP_29500

		add_character_modifier = {
			name = phantom_pain
			duration = -1
		}

		character_event = {
			id = RIP.29501
			months = 1
			random = 60
		}
	}
}

# Court physician suggests treatments
character_event = {
	id = RIP.29501
	desc = EVTDSC_RIP_29501
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_court_physician

	is_triggered_only = yes

	trigger = {
		has_character_modifier = phantom_pain
	}

	option = {
		name = EVTOPTA_RIP_29501

		random_list = {
			50 = {
				character_event = {
					id = RIP.29502
					months = 1
					tooltip = EVTOPTA_RIP_29501_SUCCESS
				}
			}

			# Gives food poisoning
			50 = {
				character_event = {
					id = RIP.29503
					days = 15
					tooltip = EVTOPTA_RIP_29501_FAILURE
				}
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_29501

		random_list = {
			80 = {
				character_event = {
					id = RIP.29502
					months = 1
					tooltip = EVTOPTA_RIP_29501_SUCCESS
				}
			}

			# Gives infirm
			20 = {
				character_event = {
					id = RIP.29504
					days = 15
					tooltip = EVTOPTB_RIP_29501_FAILURE
				}
			}
		}
	}


	option = {
		name = EVTOPTC_RIP_29501

		custom_tooltip = { text = EVTOPTC_RIP_29501_TOOLTIP }
	}
}

# Phantom pain gone
character_event = {
	id = RIP.29502
	desc = EVTDSC_RIP_29502
	picture = GFX_evt_prospering_province
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	trigger = {
		has_character_modifier = phantom_pain
	}

	option = {
		name = EVTOPTA_RIP_29502

		remove_character_modifier = phantom_pain
	}
}

# Failed mild treatment
character_event = {
	id = RIP.29503
	desc = EVTDSC_RIP_29503
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29503

		if = {
			limit = {
				NOT = { has_character_flag = developing_illness }
			}

			tooltip = { add_trait = diarrhea }

			set_character_flag = got_food_poisoning
			set_character_flag = developing_illness
			character_event = { id = RIP.5002 }
		}
	}
}

# Failed extreme treatment
character_event = {
	id = RIP.29504
	desc = EVTDSC_RIP_29504
	picture = GFX_evt_doctor_crazy_treatment
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29504

		add_trait_silently_infirm_effect = yes

		opinion = {
			name = opinion_traitor
			who = event_target:rip_physician
		}
	}
}

# Spouse/lover/child takes care of you
character_event = {
	id = RIP.29511

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_window = yes

	trigger = {
		OR = {
			trait = severely_injured

			trigger_if = {
				limit = { has_character_modifier = bedridden_illness }

				OR = {
					trait = gout
					trait = cancer
					trait = slow_fever
					trait = flu
				}
			}
		}

		OR = {
			any_child = {
				vassal_of = ROOT
				block_general_event_trigger = no
				NOT = { has_minor_title = title_court_physician }
			}

			any_lover = {
				block_general_event_trigger = no
				NOT = { has_minor_title = title_court_physician }
			}

			any_spouse = {
				block_general_event_trigger = no
				NOT = { has_minor_title = title_court_physician }
			}
		}
	}

	option = {
		random_close_relative = {
			limit = {
				block_general_event_trigger = no
				NOT = { has_minor_title = title_court_physician }

				OR = {
					AND = {
						is_married = ROOT
						NOT = { is_lover = ROOT }
					}

					AND = {
						is_child_of = ROOT
						vassal_of = ROOT
					}
				}
			}

			preferred_limit = {
				is_married = ROOT
				NOT = { is_lover = ROOT }
			}

			save_event_target_as = caretaker
		}

		if = {
			limit = {
				NOT = {
					event_target:caretaker = { always = yes }
				}
			}

			random_lover = {
				limit = {
					block_general_event_trigger = no
					NOT = { has_minor_title = title_court_physician }
				}

				save_event_target_as = caretaker
			}
		}

		event_target:caretaker = {
			character_event = { id = RIP.29505 }
		}
	}
}

# Take care of sick person?
character_event = {
	id = RIP.29505
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_doctor_tending_to_sick

	desc = {
		text = EVTDSC_RIP_29505_A
		trigger = { FROM = { trait = severely_injured } }
	}
	desc = {
		text = EVTDSC_RIP_29505_B
		trigger = { FROM = { NOT = { trait = severely_injured } } }
	}

	is_triggered_only = yes

	# Yes
	option = {
		name = EVTOPTA_RIP_29505

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.29506
				tooltip = EVTOPTA_RIP_29505_TOOLTIP
			}
		}

		ai_chance = {
			factor = 60

			mult_modifier = {
				factor = 2
				trait = kind
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = FROM
					value >= 40
				}
			}
		}
	}

	# Yes, but badly...
	option = {
		name = EVTOPTB_RIP_29505

		trigger = {
			opinion = {
				who = FROM
				value < 20
			}
		}

		set_character_flag = bad_caretaker

		FROM = {
			show_scope_change = no

			character_event = {
				id = RIP.29506
				tooltip = EVTOPTB_RIP_29505_TOOLTIP
			}
		}

		ai_chance = {
			factor = 15

			mult_modifier = {
				factor = 2
				trait = ambitious
			}

			mult_modifier = {
				factor = 2
				trait = cruel
			}

			mult_modifier = {
				factor = 2
				trait = deceitful
			}

			mult_modifier = {
				factor = 0.5
				trait = honest
			}

			mult_modifier = {
				factor = 2

				opinion = {
					who = FROM
					value < -20
				}
			}
		}
	}

	# No
	option = {
		name = EVTOPTC_RIP_29505

		ai_chance = { factor = 40 }
	}
}

# Relation offers to take care
character_event = {
	id = RIP.29506
	desc = EVTDSC_RIP_29506
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	# Yes
	option = {
		name = EVTOPTA_RIP_29506

		custom_tooltip = {
			text = EVTOPTA_RIP_29506_TOOLTIP

			random_list = {
				60 = {
					mult_modifier = {
						factor = 1.3
						physician_good_trigger = yes
					}

					mult_modifier = {
						factor = 1.3
						is_smart_trigger = yes
					}

					mult_modifier = {
						factor = 1.3
						learning >= 12
					}

					character_event = {
						id = RIP.29507
						days = 14
					}
				}

				40 = {
					mult_modifier = {
						factor = 5
						FROM = { has_character_flag = bad_caretaker }
					}

					mult_modifier = {
						factor = 1.3
						physician_bad_trigger = yes
					}

					mult_modifier = {
						factor = 1.3
						is_dumb_trigger = yes
					}

					mult_modifier = {
						factor = 1.3
						learning < 8
					}

					character_event = {
						id = RIP.29509
						days = 14
					}
				}
			}
		}
	}

	# No
	option = {
		name = EVTOPTB_RIP_29506

		prestige = 20

		reverse_opinion = {
			name = opinion_ungrateful
			who = FROM
			years = 3
		}
	}
}

# Recieving good care
character_event = {
	id = RIP.29507
	desc = EVTDSC_RIP_29507
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29507

		add_character_modifier = {
			name = good_care
			years = 1
		}

		if = {
			limit = {
				event_target:caretaker = {
					NOR = {
						is_lover = ROOT
						has_character_flag = bad_caretaker
					}

					trigger_if = {
						limit = { is_child_of = ROOT }
						is_pc_marriage_religion_trigger = yes
					}
				}
			}

			event_target:caretaker = { set_character_flag = make_lover }
			tooltip = { add_lover = event_target:caretaker }
		}

		else_if = {
			limit = {
				event_target:caretaker = {
					is_child_of = ROOT

					NOR = {
						is_friend = ROOT
						has_character_flag = bad_caretaker
					}
				}
			}

			event_target:caretaker = { set_character_flag = make_friend }
			tooltip = { add_friend = event_target:caretaker }
		}

		tooltip = {
			opinion = {
				name = opinion_grateful
				who = event_target:caretaker
				years = 10
			}
		}

		event_target:caretaker = {
			character_event = { id = RIP.29508 }
		}
	}
}

# You took good care
character_event = {
	id = RIP.29508
	desc = EVTDSC_RIP_29508
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA_RIP_29508
			trigger = {
				NOT = { has_character_flag = bad_caretaker }
			}
		}
		name = {
			text = EVTOPTB_RIP_29508
			trigger = { has_character_flag = bad_caretaker }
		}

		clr_character_flag = bad_caretaker

		if = {
			limit = { has_character_flag = make_lover }

			FROM = {
				show_scope_change = no

				add_lover = ROOT
			}

			clr_character_flag = make_lover
		}
		else_if = {
			limit = { has_character_flag = make_friend }

			add_friend = FROM
			clr_character_flag = make_friend
		}

		reverse_opinion = {
			name = opinion_grateful
			who = FROM
			years = 10
		}
	}
}

# Recieving bad care
character_event = {
	id = RIP.29509
	desc = EVTDSC_RIP_29509
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29509

		add_character_modifier = {
			name = bad_care
			years = 1
		}

		tooltip = {
			opinion = {
				name = opinion_neglected
				who = event_target:caretaker
				years = 10
			}
		}

		event_target:caretaker = {
			character_event = { id = RIP.29510 }
		}
	}
}

# You took bad care
character_event = {
	id = RIP.29510
	desc = EVTDSC_RIP_29510
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA_RIP_29510
			trigger = {
				NOT = { has_character_flag = bad_caretaker }
			}
		}
		name = {
			text = EVTOPTB_RIP_29510
			trigger = { has_character_flag = bad_caretaker }
		}

		clr_character_flag = bad_caretaker

		reverse_opinion = {
			name = opinion_neglected
			who = FROM
			years = 10
		}
	}
}

### REACTION CHILD ###
character_event = {
	id = RIP.29600

	is_triggered_only = yes # on_birth, random_events
	hide_window = yes

	immediate = {
		any_close_relative = {
			limit = {
				is_parent_of = ROOT
				is_playable = yes
				dynasty = ROOT
			}

			if = {
				limit = { num_of_children < 2 }

				character_event = {
					id = RIP.29601 # Reactions to firstborn
					days = 7
				}
			}
			else_if = {
				limit = {
					# First male will inherit
					player_heir = {
						character = ROOT
						is_female = no
					}

					OR = {
						has_law = succ_primogeniture
						has_law = succ_gavelkind
					}
				}

				character_event = {
					id = RIP.29602 # Finally a son
					days = 7
				}
			}
		}
	}
}

# Reactions to firstborn
# Plus: Use hidden traits here, text doesn't matter that much.
character_event = {
	id = RIP.29601
	picture = GFX_evt_birth
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDSC_RIP_29601_A
		trigger = { has_character_flag = text_bastard }
	}
	desc = {
		text = EVTDSC_RIP_29601_B
		trigger = { has_character_flag = text_girl_cant_inherit }
	}
	desc = {
		text = EVTDSC_RIP_29601_C
		trigger = { has_character_flag = text_firstborn_inherits }
	}
	desc = {
		text = EVTDSC_RIP_29601_D
		trigger = { has_character_flag = text_unsure_future }
	}
	desc = {
		text = EVTDSC_RIP_29601_E
		trigger = { has_character_flag = text_ugly }
	}
	desc = {
		text = EVTDSC_RIP_29601_F
		trigger = { has_character_flag = text_weak }
	}
	desc = {
		text = EVTDSC_RIP_29601_G
		trigger = { has_character_flag = text_strong }
	}

	is_triggered_only = yes

	trigger = {
		is_parent_of = FROM

		NOR = {
			has_character_modifier = good_relationship_omen
			has_character_modifier = bad_relationship_omen
		}
	}

	immediate = {
		# Child is ugly
		if = {
			limit = { FROM = { trait = ugly } }
			set_character_flag = text_ugly
		}
		# Child is weak/sickly/inbred
		else_if = {
			limit = {
				FROM = {
					OR = {
						trait = sickly
						trait = inbred
						trait = weak
					}
				}
			}
			set_character_flag = text_weak
		}
		# Child is strong
		else_if = {
			limit = { FROM = { trait = strong } }
			set_character_flag = text_strong
		}
		# Child is bastard
		else_if = {
			limit = { FROM = { trait = bastard } }
			set_character_flag = text_bastard
		}
		# Female won't inherit
		else_if = {
			limit = {
				FROM = { is_female = yes }
				has_law = agnatic_succession
			}
			set_character_flag = text_girl_cant_inherit
		}
		# Firstborn will inherit
		else_if = {
			limit = {
				player_heir = {
					character = FROM
				}

				OR = {
					has_law = succ_primogeniture
					has_law = succ_gavelkind
				}
			}
			set_character_flag = text_firstborn_inherits
		}
		# All other outcomes
		else = {
			set_character_flag = text_unsure_future
		}
	}

	option = {
		name = {
			text = EVTOPTA_RIP_29601_A
			trigger = { has_character_flag = text_bastard }
		}
		name = {
			text = EVTOPTA_RIP_29601_B
			trigger = { has_character_flag = text_girl_cant_inherit }
		}
		name = {
			text = EVTOPTA_RIP_29601_C
			trigger = { has_character_flag = text_firstborn_inherits }
		}
		name = {
			text = EVTOPTA_RIP_29601_A
			trigger = { has_character_flag = text_unsure_future }
		}
		name = {
			text = EVTOPTA_RIP_29601_D
			trigger = { has_character_flag = text_ugly }
		}
		name = {
			text = EVTOPTA_RIP_29601_E
			trigger = { has_character_flag = text_weak }
		}
		name = {
			text = EVTOPTA_RIP_29601_F
			trigger = { has_character_flag = text_strong }
		}

		hidden_effect = {
			if = {
				limit = { has_character_flag = text_firstborn_inherits }
				FROM = { prestige = 50 }
			}
		}

		if = {
			limit = {
				OR = {
					has_character_flag = text_firstborn_inherits
					has_character_flag = text_strong
				}

				NOT = { is_mother = FROM }
			}

			FROM = {
				mother = { save_event_target_as = firstborn_mother }
			}

			opinion = {
				name = opinion_mother_of_my_child
				who = event_target:firstborn_mother
				years = 5
			}
		}

		clr_character_flag = text_bastard
		clr_character_flag = text_girl_cant_inherit
		clr_character_flag = text_firstborn_inherits
		clr_character_flag = text_unsure_future
		clr_character_flag = text_ugly
		clr_character_flag = text_weak
		clr_character_flag = text_strong
	}
}

# Firstborn son
character_event = {
	id = RIP.29602
	desc = EVTDSC_RIP_29602
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_birth

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29601_C

		FROM = {
			show_scope_change = no

			prestige = 50
		}

		if = {
			limit = {
				NOT = { is_mother = FROM }
			}

			FROM = {
				mother = { save_event_target_as = firstborn_mother }
			}

			opinion = {
				name = opinion_mother_of_my_child
				who = event_target:firstborn_mother
				years = 5
			}
		}
	}
}

### RECRUIT PRISONER EVENTS ###

# Imprisoned courtier defects to gaoler (from decision "recruit_prisoner")
character_event = {
	id = RIP.29700
	desc = EVTDSC_RIP_29700
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes # recruit_prisoner, rip_various_decisions.txt

	ai = no

	option = {
		name = EVTOPTA_RIP_29700
	}
}

### Old ruler on deathbed talking about their child's similarities to parent
character_event = {
	id = RIP.29800

	is_triggered_only = yes # on_death, random_events
	hide_window = yes

	trigger = {
		death_reason = death_natural

		NOT = {
			has_game_rule = {
				name = supernatural_events
				value = off
			}
		}

		player_heir = {
			is_child_of = ROOT
			is_inaccessible_or_incapable_trigger = no
			NOT = { trait = reincarnation }
		}

		OR = {
			father_even_if_dead = {
				is_alive = no
			}

			mother_even_if_dead = {
				is_alive = no
			}
		}
	}

	immediate = {
		random_list = {
			50 = {
				trigger = {
					father_even_if_dead = {
						is_alive = no
					}
				}

				father_even_if_dead = {
					save_event_target_as = reincarnation_target
				}
			}

			50 = {
				trigger = {
					mother_even_if_dead = {
						is_alive = no
					}
				}

				mother_even_if_dead = {
					save_event_target_as = reincarnation_target
				}
			}
		}

		player_heir = {
			character_event = {
				id = RIP.29801
				days = 10
				random = 10
			}
		}
	}
}

character_event = {
	id = RIP.29801
	picture = GFX_evt_into_the_dungeon

	desc = {
		text = EVTDESC_RIP_29801
		trigger = {
			event_target:reincarnation_target = { is_female = no }
		}
	}
	desc = {
		text = EVTDESC_RIP_29801_B
		trigger = {
			event_target:reincarnation_target = { is_female = yes }
		}
	}

	is_triggered_only = yes

	prisoner = no
	only_capable = yes

	trigger = {
		is_inaccessible_trigger = no
		NOT = { trait = reincarnation }

		trigger_if = {
			limit = { ai = yes }

			has_game_rule = {
				name = supernatural_events
				value = unrestricted
			}
		}
	}

	immediate = {
		set_reincarnation = event_target:reincarnation_target
	}

	option = {
		name = EVTOPTA_RIP_29801

		character_event = {
			id = RIP.29802
			days = 20
			tooltip = EVTOPTA_RIP_29801_TOOLTIP
		}
	}

	option = {
		name = EVTOPTB_RIP_29801

		custom_tooltip = { text = EVTOPTB_RIP_29801_TOOLTIP }
	}
}

character_event = {
	id = RIP.29802
	desc = EVTDESC_RIP_29802
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes
	hide_from = yes

	prisoner = no
	only_capable = yes

	trigger = {
		is_inaccessible_trigger = no
		NOT = { trait = reincarnation }
	}

	option = {
		name = EVTOPTA_RIP_29802

		custom_tooltip = {
			text = EVTOPTA_RIP_29802_TOOLTIP

			random_list = {
				50 = {
					character_event = {
						id = RIP.29803 # Become possessed, reincarnation trait
						days = 10
					}
				}

				50 = {
					character_event = {
						id = RIP.29804 # Find some money
						days = 10
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_29802

		custom_tooltip = { text = EVTOPTB_RIP_29802_TOOLTIP }

		prestige = 50
	}
}

# Get reincarnation, and possessed
character_event = {
	id = RIP.29803
	desc = EVTDESC_RIP_29803
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	prisoner = no
	only_capable = yes

	trigger = {
		is_inaccessible_trigger = no
		NOT = { trait = reincarnation }
	}

	option = { # What is happening to meeeeeee
		name = EVTOPTA_RIP_29803

		add_trait = possessed
		add_trait = reincarnation
	}
}

# Found valuables
character_event = {
	id = RIP.29804
	desc = EVTDESC_RIP_29804
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	prisoner = no
	only_capable = yes

	trigger = {
		is_inaccessible_trigger = no
		NOT = { trait = reincarnation }
	}

	option = {
		name = EVTOPTA_RIP_29804

		scaled_wealth = 0.5
	}
}

# Child is reborn ancestor
character_event = {
	id = RIP.29805

	is_triggered_only = yes # on_birth, random_events
	hide_window = yes

	trigger = {
		# CleanSlate: on_action says "Reincarnation for non west_african"
		OR = {
			religion = manichaean
			religion_openly_west_african_or_reformed_trigger = yes
		}

		NOT = {
			has_game_rule = {
				name = supernatural_events
				value = off
			}
		}

		OR = {
			father = {
				ai = no
				is_reincarnated = no

				father_even_if_dead = {
					OR = {
						is_alive = no

						father_even_if_dead = {
							is_alive = no
						}
					}
				}

				NOT = {
					any_sibling = {
						is_reincarnated = yes
					}
				}
			}

			mother = {
				ai = no
				is_reincarnated = no

				father_even_if_dead = {
					OR = {
						is_alive = no

						father_even_if_dead = {
							is_alive = no
						}
					}
				}

				NOT = {
					any_sibling = {
						is_reincarnated = yes
					}
				}
			}
		}

		NOT = {
			any_sibling = {
				is_reincarnated = yes
			}
		}
	}

	option = {
		if = {
			limit = {
				father = { ai = no }
			}

			father = {
				if = {
					limit = {
						father_even_if_dead = {
							father_even_if_dead = {
								is_alive = no
							}
						}
					}

					father_even_if_dead = {
						father_even_if_dead = {
							ROOT = {
								set_reincarnation = PREV
							}
						}
					}
				}
				else = {
					father_even_if_dead = {
						ROOT = {
							set_reincarnation = PREV
						}
					}
				}

				character_event = {
					id = RIP.29806
					months = 1
				}
			}
		}
		else_if = {
			limit = {
				mother = { ai = no }
			}

			mother = {
				if = {
					limit = {
						father_even_if_dead = {
							father_even_if_dead = {
								is_alive = no
							}
						}
					}

					father_even_if_dead = {
						father_even_if_dead = {
							ROOT = {
								set_reincarnation = PREV
							}
						}
					}
				}
				else = {
					father_even_if_dead = {
						ROOT = {
							set_reincarnation = PREV
						}
					}
				}

				character_event = {
					id = RIP.29806
					months = 1
				}
			}
		}
	}
}

# Reincarnation: Player notices the similarities
# TODO: consider making slight changes, similar to RoI.10001, roi_various_events
character_event = {
	id = RIP.29806
	desc = EVTDESC_RIP_29806
	picture = GFX_evt_into_the_dungeon

	only_capable = yes
	prisoner = no

	trigger = {
		is_inaccessible_trigger = no
	}

	fail_trigger_effect = {
		repeat_event = {
			id = RIP.29806
			days = 7
		}
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_29806

		piety = 100

		FROM = {
			show_scope_change = no

			add_trait = reincarnation
		}
	}

	option = {
		name = EVTOPTB_RIP_29806

		add_trait_silently_cynical_effect = yes
	}
}

#######################################
# LIEGE INTERFERES IN VASSAL WARS
# by Henrik Fhraeus
#######################################

# Vassal is asked by Liege to stop war of aggression against another vassal
letter_event = {
	id = RIP.30000
	desc = EVTDESC_RIP_30000
	border = GFX_event_letter_frame_war

	is_triggered_only = yes # interfere_in_vassal_war_attacker, rip_various_decisions.txt

	option = {
		name = EVTOPTA_RIP_30000 # Ask for money

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				transfer_scaled_wealth = {
					to = ROOT
					value = 0.2
					min = 20
				}
			}

			letter_event = {
				id = RIP.30003
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 5.0
				trait = greedy
			}

			mult_modifier = {
				factor = 2.0
				trait = envious
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30000 # Ask for a Favor

		trigger = {
			has_dlc = "Conclave"
			NOT = { holds_favor_on = FROMFROM }
		}

		FROMFROM = {
			letter_event = {
				id = RIP.30007
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 3.0
				trait = deceitful
			}

			mult_modifier = {
				factor = 3.0
				trait = ambitious
			}
		}
	}

	option = {
		name = EVTOPTC_RIP_30000 # Ask for nothing

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				opinion = {
					name = opinion_very_grateful
					who = ROOT
					years = 5
				}
			}

			letter_event = {
				id = RIP.30001
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			trigger = {
				NOT = { is_rival = FROMFROM }
			}

			mult_modifier = {
				factor = 20.0

				OR = {
					is_friend = FROMFROM
					is_lover = FROMFROM
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value >= 50
				}
			}

			mult_modifier = {
				factor = 4.0

				opinion = {
					who = FROMFROM
					value >= 90
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000 # Refuse

		trigger = {
			FROMFROM = {
				NOR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = opinion_refused_to_end_war
				who = ROOT
				years = 5
			}

			letter_event = {
				id = RIP.30006
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000_TRAITOR # Refuse and become a traitor

		trigger = {
			FROMFROM = {
				OR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = opinion_traitor
				who = ROOT
				years = 5
			}

			letter_event = {
				id = RIP.30006
				days = 3
			}
		}

		ai_chance = {
			factor = 20

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}
}

# Vassal agrees, asking for nothing
letter_event = {
	id = RIP.30001
	desc = EVTDESC_RIP_30001
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		event_target:target_defender = {
			show_scope_change = no

			letter_event = { id = RIP.30002 }

			opinion = {
				name = opinion_very_grateful
				who = ROOT
				years = 5
			}
		}

		opinion = {
			name = opinion_very_grateful
			who = FROM
			years = 5
		}

		FROM = {
			show_scope_change = no

			set_character_flag = no_whitepeace_prison

			any_war = {
				limit = {
					defender = { character = event_target:target_defender }
					attacker = { character = FROM }
				}

				end_war = whitepeace
			}

			set_pacified = { years = 1 }
		}
	}
}

# The other vassal is notified
letter_event = {
	id = RIP.30002
	desc = EVTDESC_RIP_30002
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30002

		tooltip = {
			opinion = {
				name = opinion_very_grateful
				who = FROM
				years = 5
			}
		}
	}
}

# Vassal agrees, asking for money
letter_event = {
	id = RIP.30003
	desc = EVTDESC_RIP_30003
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30003 # Very well...

		event_target:target_defender = {
			show_scope_change = no

			letter_event = { id = RIP.30002 }

			opinion = {
				name = opinion_very_grateful
				who = ROOT
				years = 5
			}
		}

		transfer_scaled_wealth = {
			to = FROM
			value = 0.2
			min = 20
		}

		FROM = {
			show_scope_change = no

			set_character_flag = no_whitepeace_prison

			any_war = {
				limit = {
					defender = { character = event_target:target_defender }
					attacker = { character = FROM }
				}

				end_war = whitepeace
			}

			set_pacified = { years = 3 }
			letter_event = { id = RIP.30004 }
		}

		ai_chance = {
			factor = 100

			trigger = { scaled_wealth = 0.2 }
		}
	}

	option = {
		name = EVTOPTB_RIP_30003 # I can't afford that

		FROM = {
			letter_event = { id = RIP.30005 }
		}
	}
}

# The attacker is notified and given money
letter_event = {
	id = RIP.30004
	desc = EVTDESC_RIP_30004
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EXCELLENT

		tooltip = {
			transfer_scaled_wealth = {
				from = FROM
				value = 0.2
				min = 20
			}
		}
	}
}

# The attacker is notified - liege cannot afford to pay that much money
letter_event = {
	id = RIP.30005
	desc = EVTDESC_RIP_30005
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30005
	}
}

# Vassal refuses liege's request. Liege is notified.
letter_event = {
	id = RIP.30006
	desc = EVTDESC_RIP_30006
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30006

		trigger = {
			NOR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = opinion_refused_to_end_war
				who = FROM
				years = 5
			}
		}
	}

	option = {
		name = EVTOPTA_RIP_30006_TRAITOR

		trigger = {
			OR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = opinion_traitor
				who = FROM
				years = 5
			}
		}
	}
}

# Vassal agrees, asking for a Favor
letter_event = {
	id = RIP.30007
	desc = EVTDESC_RIP_30007
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30003 # Very well...

		event_target:target_defender = {
			show_scope_change = no

			letter_event = { id = RIP.30002 }

			opinion = {
				name = opinion_very_grateful
				who = ROOT
				years = 5
			}
		}

		opinion = {
			name = opinion_grateful
			who = FROM
			years = 5
		}

		FROM = {
			show_scope_change = no

			add_favor = ROOT
			set_character_flag = no_whitepeace_prison

			any_war = {
				limit = {
					defender = { character = event_target:target_defender }
					attacker = { character = FROM }
				}

				end_war = whitepeace
			}

			set_pacified = { years = 3 }
			letter_event = { id = RIP.30008 }
		}
	}

	option = {
		name = EVTOPTB_RIP_30007 # No

		FROM = {
			letter_event = { id = RIP.30009 }
		}

		ai_chance = { factor = 0 }
	}
}

# The attacker is notified about the favor
letter_event = {
	id = RIP.30008
	desc = EVTDESC_RIP_30008
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		tooltip = {
			add_favor = FROM

			reverse_opinion = {
				name = opinion_grateful
				who = FROM
				years = 5
			}
		}
	}
}

# The attacker is notified - liege not willing to owe a favor
letter_event = {
	id = RIP.30009
	desc = EVTDESC_RIP_30009
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30005
	}
}

# Vassal is asked by Liege to stop war of aggression against another vassal - can't refuse since the liege calls in a favor
letter_event = {
	id = RIP.30010
	desc = EVTDESC_RIP_30010
	border = GFX_event_letter_frame_war

	is_triggered_only = yes # interfere_in_vassal_war_attacker_use_favor, rip_various_decisions.txt

	option = {
		name = EVTOPTA_RIP_30010

		set_character_flag = no_whitepeace_prison

		any_war = {
			limit = {
				defender = { character = event_target:target_defender }
				attacker = { character = ROOT }
			}

			end_war = whitepeace
		}

		set_pacified = { years = 2 }

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				opinion = {
					who = ROOT
					name = opinion_grateful
					years = 5
				}

				remove_favor = ROOT
			}

			letter_event = { id = RIP.30011 }
		}
	}
}

# Liege gets feedback on the stopped war. The favor is used up.
letter_event = {
	id = RIP.30011
	desc = EVTDESC_RIP_30011
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		event_target:target_defender = {
			show_scope_change = no

			letter_event = { id = RIP.30002 }

			opinion = {
				name = opinion_very_grateful
				who = ROOT
				years = 5
			}
		}

		opinion = {
			name = opinion_grateful
			who = FROM
			years = 5
		}
	}
}

# DEFENDER SURRENDER EVENTS

# Vassal is asked by Liege to surrender to another vassal on an ongoing war
letter_event = {
	id = RIP.30020
	desc = EVTDESC_RIP_30020
	border = GFX_event_letter_frame_war

	is_triggered_only = yes # interfere_in_vassal_war_defender, rip_various_decisions.txt

	option = {
		name = EVTOPTA_RIP_30000 # Ask for money

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				transfer_scaled_wealth = {
					to = ROOT
					value = 0.33
					min = 30
				}
			}

			letter_event = {
				id = RIP.30023
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 5.0
				trait = greedy
			}

			mult_modifier = {
				factor = 2.0
				trait = envious
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30020 # Ask for a Favor

		trigger = {
			has_dlc = "Conclave"
			NOT = { holds_favor_on = FROMFROM }
		}

		FROMFROM = {
			letter_event = {
				id = RIP.30027
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 3.0
				trait = deceitful
			}

			mult_modifier = {
				factor = 3.0
				trait = ambitious
			}
		}
	}

	option = {
		name = EVTOPTC_RIP_30000 # Ask for nothing

		prestige = 100

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				opinion = {
					name = opinion_very_grateful
					who = ROOT
					years = 10
				}
			}

			letter_event = {
				id = RIP.30021
				days = 3
			}
		}

		ai_chance = {
			factor = 50

			trigger = {
				NOT = { is_rival = FROMFROM }
			}

			mult_modifier = {
				factor = 10.0

				OR = {
					is_friend = FROMFROM
					is_lover = FROMFROM
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROMFROM
					value >= 50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value >= 90
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000 # Refuse

		trigger = {
			FROMFROM = {
				NOR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = opinion_refused_to_end_war
				who = ROOT
				years = 3
			}

			letter_event = {
				id = RIP.30026
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000_TRAITOR # Refuse

		trigger = {
			FROMFROM = {
				OR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = opinion_traitor
				who = FROMFROM
				years = 3
			}

			letter_event = {
				id = RIP.30026
				days = 3
			}
		}

		ai_chance = {
			factor = 20

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}
}

# Vassal agrees, asking for nothing
letter_event = {
	id = RIP.30021
	desc = EVTDESC_RIP_30021
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		add_favor = event_target:target_attacker

		event_target:target_attacker = {
			show_scope_change = no

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

			letter_event = { id = RIP.30022 }
		}

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

		FROM = {
			show_scope_change = no

			any_war = {
				limit = {
					attacker = { character = event_target:target_attacker }
					defender = { character = FROM }
				}

				end_war = success
			}
		}
	}
}

# The other vassal is notified
letter_event = {
	id = RIP.30022
	desc = EVTDESC_RIP_30022
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30002

		tooltip = {
			opinion = {
				name = opinion_very_grateful
				who = FROM
				years = 10
			}

			reverse_add_favor = FROM
		}
	}
}

# Vassal agrees, asking for money
letter_event = {
	id = RIP.30023
	desc = EVTDESC_RIP_30023
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30003 # Very well...

		ai_chance = {
			factor = 100

			trigger = { scaled_wealth = 0.33 }
		}

		add_favor = event_target:target_attacker

		event_target:target_attacker = {
			show_scope_change = no

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

			letter_event = { id = RIP.30022 }
		}

		transfer_scaled_wealth = {
			to = FROM
			value = 0.33
			min = 30
		}

		FROM = {
			show_scope_change = no

			letter_event = { id = RIP.30024 }

			any_war = {
				limit = {
					attacker = { character = event_target:target_attacker }
					defender = { character = FROM }
				}

				end_war = success
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30003 # I can't afford that

		FROM = {
			letter_event = { id = RIP.30025 }
		}
	}
}

# The defender is notified and given money
letter_event = {
	id = RIP.30024
	desc = EVTDESC_RIP_30024
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		prestige = 100

		tooltip = {
			transfer_scaled_wealth = {
				from = FROM
				value = 0.33
				min = 30
			}
		}
	}
}

# The defender is notified - liege cannot afford to pay that much money
letter_event = {
	id = RIP.30025
	desc = EVTDESC_RIP_30025
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30025
	}
}

# Vassal refuses liege's request. Liege is notified.
letter_event = {
	id = RIP.30026
	desc = EVTDESC_RIP_30026
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30006

		trigger = {
			NOR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = opinion_refused_to_end_war
				who = FROM
				years = 3
			}
		}
	}

	option = {
		name = EVTOPTA_RIP_30006_TRAITOR

		trigger = {
			OR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = opinion_traitor
				who = FROM
				years = 3
			}
		}
	}
}

# Vassal agrees, asking for a Favor
letter_event = {
	id = RIP.30027
	desc = EVTDESC_RIP_30027
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30003 # Very well...

		add_favor = event_target:target_attacker

		event_target:target_attacker = {
			show_scope_change = no

			letter_event = { id = RIP.30022 }

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

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

		FROM = {
			show_scope_change = no

			add_favor = ROOT
			letter_event = { id = RIP.30028 }

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

			any_war = {
				limit = {
					attacker = { character = event_target:target_attacker }
					defender = { character = FROM }
				}

				end_war = success
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30007 # No

		FROM = {
			letter_event = { id = RIP.30029 }
		}

		ai_chance = { factor = 0 }
	}
}

# The defender is notified about the favor
letter_event = {
	id = RIP.30028
	desc = EVTDESC_RIP_30028
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		prestige = 100

		tooltip = {
			add_favor = FROM

			reverse_opinion = {
				name = opinion_grateful
				who = FROM
				years = 10
			}
		}
	}
}

# The defender is notified - liege not willing to owe a favor
letter_event = {
	id = RIP.30029
	desc = EVTDESC_RIP_30029
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30005
	}
}

# Vassal is asked by Liege to surrender to another vassal - can't refuse since the liege calls in a favor
letter_event = {
	id = RIP.30030
	desc = EVTDESC_RIP_30030
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30010

		any_war = {
			limit = {
				attacker = { character = event_target:target_attacker }
				defender = { character = FROM }
			}

			end_war = success
		}

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				remove_favor = ROOT

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

			letter_event = { id = RIP.30031 }
		}
	}
}

# Liege gets feedback on the surrender. The favor is used up.
letter_event = {
	id = RIP.30031
	desc = EVTDESC_RIP_30031
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		event_target:target_attacker = {
			show_scope_change = no

			letter_event = { id = RIP.30022 }

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

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

#####################################################
# LIEGE DEMANDS GAVELKIND SUCCESSION LAW OF A VASSAL
# Decision: demand_gavelkind, rip_various_decisions.txt
#####################################################

# Liege asks the vassal to change succession law to Gavelkind
letter_event = {
	id = RIP.30040
	desc = EVTDESC_RIP_30040
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30000 # Ask for money

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				transfer_scaled_wealth = {
					to = ROOT
					value = 0.25
					min = 25
				}
			}

			letter_event = {
				id = RIP.30043
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 5.0
				trait = greedy
			}

			mult_modifier = {
				factor = 2.0
				trait = envious
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30040 # Ask for a Favor

		trigger = {
			has_dlc = "Conclave"
			NOT = { holds_favor_on = FROMFROM }
		}

		FROMFROM = {
			letter_event = {
				id = RIP.30047
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 3.0
				trait = deceitful
			}

			mult_modifier = {
				factor = 3.0
				trait = ambitious
			}
		}
	}

	option = {
		name = EVTOPTC_RIP_30000 # Ask for nothing

		prestige = 100

		FROMFROM = {
			show_scope_change = no

			tooltip = {
				opinion = {
					name = opinion_very_grateful
					who = ROOT
					years = 10
				}
			}

			letter_event = {
				id = RIP.30041
				days = 3
			}
		}

		ai_chance = {
			factor = 50

			trigger = {
				NOT = { is_rival = FROMFROM }
			}

			mult_modifier = {
				factor = 10.0

				OR = {
					is_friend = FROMFROM
					is_lover = FROMFROM
				}
			}

			mult_modifier = {
				factor = 1.5

				opinion = {
					who = FROMFROM
					value >= 50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value >= 90
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000 # Refuse

		trigger = {
			FROMFROM = {
				NOR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = succ_law_change
				who = ROOT
				years = 3
				multiplier = 2
			}

			letter_event = {
				id = RIP.30046
				days = 3
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}

	option = {
		name = EVTOPTD_RIP_30000_TRAITOR # Refuse

		trigger = {
			FROMFROM = {
				OR = {
					has_law = ze_administration_laws_1
					has_law = ze_administration_laws_2
				}
			}
		}

		FROMFROM = {
			show_scope_change = no

			opinion = {
				name = opinion_traitor
				who = FROMFROM
				years = 3
			}

			letter_event = {
				id = RIP.30046
				days = 3
			}
		}

		ai_chance = {
			factor = 20

			mult_modifier = {
				factor = 20.0
				is_rival = FROMFROM
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -25
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -50
				}
			}

			mult_modifier = {
				factor = 2.0

				opinion = {
					who = FROMFROM
					value < -75
				}
			}
		}
	}
}

# Vassal agrees, asking for nothing
letter_event = {
	id = RIP.30041
	desc = EVTDESC_RIP_30041
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

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

		FROM = {
			show_scope_change = no

			primary_title = {
				set_title_flag = non_manual_law_change # No prestige loss
				add_law_w_cooldown = succ_gavelkind
				clr_title_flag = non_manual_law_change # No prestige loss
			}

			set_character_flag = liege_forced_succ_law
		}
	}
}

# Vassal agrees, asking for money
letter_event = {
	id = RIP.30043
	desc = EVTDESC_RIP_30043
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30043 # Very well...

		transfer_scaled_wealth = {
			to = FROM
			value = 0.25
			min = 25
		}

		FROM = {
			show_scope_change = no

			primary_title = {
				set_title_flag = non_manual_law_change # No prestige loss
				add_law_w_cooldown = succ_gavelkind
				clr_title_flag = non_manual_law_change # No prestige loss
			}

			letter_event = { id = RIP.30044 }
			set_character_flag = liege_forced_succ_law
		}

		ai_chance = {
			factor = 100

			trigger = { scaled_wealth = 0.25 }
		}
	}

	option = {
		name = EVTOPTB_RIP_30003 # I can't afford that

		FROM = {
			letter_event = { id = RIP.30045 }
		}

		ai_chance = { factor = 1 }
	}
}

# The vassal is notified and given money
letter_event = {
	id = RIP.30044
	desc = EVTDESC_RIP_30044
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		prestige = 100

		tooltip = {
			transfer_scaled_wealth = {
				from = FROM
				value = 0.25
				min = 25
			}
		}
	}
}

# The vassal is notified - liege cannot afford to pay that much money
letter_event = {
	id = RIP.30045
	desc = EVTDESC_RIP_30045
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30045
	}
}

# Vassal refuses liege's request. Liege is notified.
letter_event = {
	id = RIP.30046
	desc = EVTDESC_RIP_30046
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30006

		trigger = {
			NOR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = succ_law_change
				who = FROM
				years = 3
				multiplier = 2
			}
		}
	}

	option = {
		name = EVTOPTA_RIP_30006_TRAITOR

		trigger = {
			OR = {
				has_law = ze_administration_laws_1
				has_law = ze_administration_laws_2
			}
		}

		tooltip = {
			opinion = {
				name = opinion_traitor
				who = FROM
				years = 3
			}
		}
	}
}

# Vassal agrees, asking for a Favor
letter_event = {
	id = RIP.30047
	desc = EVTDESC_RIP_30047
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30043 # Very well...

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

		FROM = {
			show_scope_change = no

			add_favor = ROOT
			letter_event = { id = RIP.30048 }

			primary_title = {
				set_title_flag = non_manual_law_change # No prestige loss
				add_law_w_cooldown = succ_gavelkind
				clr_title_flag = non_manual_law_change # No prestige loss
			}

			set_character_flag = liege_forced_succ_law
		}
	}

	option = {
		name = EVTOPTB_RIP_30007 # No

		FROM = {
			letter_event = { id = RIP.30049 }
		}

		ai_chance = { factor = 0 }
	}
}

# The vassal is notified about the favor
letter_event = {
	id = RIP.30048
	desc = EVTDESC_RIP_30048
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		prestige = 100

		tooltip = {
			add_favor = FROM

			reverse_opinion = {
				name = opinion_grateful
				who = FROM
				years = 10
			}
		}
	}
}

# The vassal is notified - liege not willing to owe a favor
letter_event = {
	id = RIP.30049
	desc = EVTDESC_RIP_30049
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30045
	}
}

# Vassal is asked by Liege to institute Gavelkind Law - can't refuse since the liege calls in a favor
letter_event = {
	id = RIP.30050
	desc = EVTDESC_RIP_30050
	border = GFX_event_letter_frame_war

	is_triggered_only = yes # demand_gavelkind_use_favor, rip_various_decisions.txt

	option = {
		name = EVTOPTA_RIP_30010

		primary_title = {
			set_title_flag = non_manual_law_change # No prestige loss
			add_law_w_cooldown = succ_gavelkind
			clr_title_flag = non_manual_law_change # No prestige loss
		}

		set_character_flag = liege_forced_succ_law

		FROMFROM = {
			show_scope_change = no

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

			tooltip = {
				remove_favor = ROOT
			}

			letter_event = { id = RIP.30051 }
		}
	}
}

# Liege gets feedback on the law change. The favor is used up.
letter_event = {
	id = RIP.30051
	desc = EVTDESC_RIP_30051
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EXCELLENT

		tooltip = {
			opinion = {
				name = opinion_very_grateful
				who = FROM
				years = 10
			}
		}
	}
}

###################################################################
# Vassals appreciate when the liege builds stuff in their Holdings
# Fired from 'on_holding_building_start'
###################################################################

character_event = {
	id = RIP.30100

	is_triggered_only = yes # on_holding_building_start
	hide_window = yes

	immediate = {
		FROM = {
			holder_scope = {
				if = {
					limit = {
						NOT = { character = ROOT }
					}

					opinion = {
						name = opinion_built_building
						who = ROOT
						years = 5
					}
				}
			}
		}
	}
}

### SUICIDE EVENT CHAIN ###

# Suicide, from commit_suicide_immortal and commit_suicide, rip_various_decisions.txt
character_event = {
	id = RIP.30200
	picture = GFX_evt_depopulated_town
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30200_A
		trigger = { immortal = yes }
	}
	desc = {
		text = EVTDESC_RIP_30200_B
		trigger = {
			immortal = no

			NOR = {
				any_child = { is_alive = yes }
				any_lover = { is_alive = yes }
				any_friend = { is_alive = yes }
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30200_C
		trigger = {
			immortal = no

			OR = {
				any_child = { is_alive = yes }
				any_lover = { is_alive = yes }
				any_friend = { is_alive = yes }
			}
		}
	}

	is_triggered_only = yes # commit_suicide_immortal, rip_various_decisions.txt; commit_suicide, dynasty_decisions.txt
	hide_from = yes

	immediate = {
		character_event = {
			id = RIP.30201 # Clean-up
			years = 1
		}

		random_rival = {
			limit = { block_general_event_trigger = no }
			save_event_target_as = suicide_duel_target
		}
	}

	# Challenge rival to duel
	option = {
		name = EVTOPTA_RIP_30200

		trigger = {
			event_target:suicide_duel_target = { always = yes }
		}

		event_target:suicide_duel_target = {
			show_scope_change = no

			letter_event = {
				id = RIP.30202
				days = 1
				tooltip = EVTOPTA_RIP_30200_TOOLTIP
			}
		}
	}

	# Drink poison
	option = {
		name = EVTOPTB_RIP_30200

		hidden_effect = {
			random_list = {
				50 = {
					set_character_flag = suicide_success

					mult_modifier = {
						factor = 2
						intrigue >= 15
					}

					mult_modifier = {
						factor = 10
						immortal = no
					}
				}

				50 = {
					set_character_flag = suicide_fail

					mult_modifier = {
						factor = 1.3
						health >= 7
					}

					mult_modifier = {
						factor = 1.3
						health >= 8
					}

					mult_modifier = {
						factor = 1.3
						health >= 9
					}

					mult_modifier = {
						factor = 1.3
						health >= 10
					}

					mult_modifier = {
						factor = 2
						intrigue < 10
					}
				}
			}

			character_event = {
				id = RIP.30207
				days = 14
			}
		}
	}

	# Hang yourself
	option = {
		name = EVTOPTC_RIP_30200

		hidden_effect = {
			random_list = {
				30 = {
					mult_modifier = {
						factor = 10
						immortal = no
					}

					set_character_flag = suicide_success
				}

				70 = {
					trigger = {
						any_courtier = {
							block_general_event_trigger = no
							ai = yes
						}
					}

					set_character_flag = suicide_fail
				}
			}

			character_event = {
				id = RIP.30208
				days = 14
			}
		}
	}

	# Throw yourself off a cliff
	option = {
		name = EVTOPTD_RIP_30200

		hidden_effect = {
			random_list = {
				50 = {
					mult_modifier = {
						factor = 2
						is_weak_trigger = yes
					}

					mult_modifier = {
						factor = 10
						immortal = no
					}

					set_character_flag = suicide_success
				}

				50 = {
					mult_modifier = {
						factor = 1.3
						health >= 7
					}

					mult_modifier = {
						factor = 1.3
						health >= 8
					}

					mult_modifier = {
						factor = 1.3
						health >= 9
					}

					mult_modifier = {
						factor = 1.3
						health >= 10
					}

					mult_modifier = {
						factor = 2
						is_strong_trigger = yes
					}

					set_character_flag = suicide_fail
				}
			}

			character_event = {
				id = RIP.30209
				days = 14
			}
		}
	}
}

# Cleanup-event
character_event = {
	id = RIP.30201

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		clr_character_flag = suicide_fail
		clr_character_flag = suicide_success
		clr_character_flag = lost_suicide_duel
		clr_character_flag = incapable_suicide_duel
		clr_character_flag = won_suicide_duel
		clr_character_flag = attempting_suicide
	}
}

# Rival recieves challenge
letter_event = {
	id = RIP.30202
	desc = EVTDESC_RIP_30202
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	# Yes
	option = {
		name = EVTOPTA_RIP_30202

		FROM = {
			letter_event = {
				id = RIP.30203
				days = 14
			}
		}

		ai_chance = {
			factor = 50

			modifier = {
				factor = 0.01
				trait = craven
			}
		}
	}

	# No
	option = {
		name = EVTOPTB_RIP_30202

		FROM = {
			letter_event = {
				id = RIP.30204
				days = 14
			}
		}

		add_character_modifier = {
			name = wol_refused_duel
			years = 10
		}
	}
}

# Recieve accept
letter_event = {
	id = RIP.30203
	desc = EVTDESC_RIP_30203
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30203

		hidden_effect = {
			random_list = {
				50 = {
					mult_modifier = {
						factor = 2
						immortal = no
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 10 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 20 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 30 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 40 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 50 }
					}

					set_character_flag = lost_suicide_duel
				}

				20 = {
					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 10 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 20 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 30 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 40 }
					}

					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating >= 50 }
					}

					set_character_flag = incapable_suicide_duel
				}

				30 = {
					mult_modifier = {
						factor = 1.5
						FROM = { combat_rating < 0 }
					}

					set_character_flag = won_suicide_duel
				}
			}

			character_event = {
				id = RIP.30205
				days = 14
			}
		}
	}
}

# Recieve decline
letter_event = {
	id = RIP.30204
	desc = EVTDESC_RIP_30204
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_RIP_30204

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }
	}
}

# Duel outcome
character_event = {
	id = RIP.30205
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	desc = {
		text = EVTDESC_RIP_30205_LOST
		trigger = { has_character_flag = lost_suicide_duel }
	}
	desc = {
		text = EVTDESC_RIP_30205_WON
		trigger = { has_character_flag = won_suicide_duel }
	}
	desc = {
		text = EVTDESC_RIP_30205_INCAPABLE
		trigger = { has_character_flag = incapable_suicide_duel }
	}

	is_triggered_only = yes

	# You died in the duel
	option = {
		name = EVTOPTA_RIP_30205

		trigger = { has_character_flag = lost_suicide_duel }

		prestige = -100

		death = {
			death_reason = death_duel
			killer = event_target:suicide_duel_target
		}

		event_target:suicide_duel_target = {
			show_scope_change = no

			tooltip = {
				prestige = 100
			}

			character_event = { id = RIP.30206 }
		}
	}

	# Rival didn't kill you
	option = {
		name = EVTOPTB_RIP_30205

		trigger = { has_character_flag = won_suicide_duel }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }

		add_trait_silently_wounded_effect = yes

		event_target:suicide_duel_target = {
			character_event = { id = RIP.30206 }
		}
	}

	# Rival didn't kill you but you kill them
	option = {
		name = EVTOPTC_RIP_30205

		trigger = {
			has_character_flag = won_suicide_duel
			event_target:suicide_duel_target = { ai = yes }
			NOT = { trait = kind }
		}

		prestige = 100
		add_trait_silently_wounded_effect = yes

		random = {
			chance = 50
			add_trait_fully_wroth_effect = yes
		}

		event_target:suicide_duel_target = {
			show_scope_change = no

			prestige = -100

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}
	}

	# You become incapable in the duel
	option = {
		name = EVTOPTD_RIP_30205

		trigger = { has_character_flag = incapable_suicide_duel }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }

		prestige = -100

		event_target:suicide_duel_target = {
			show_scope_change = no

			tooltip = {
				prestige = 100
			}

			character_event = { id = RIP.30206 }
		}

		add_trait = incapable
	}
}

# Rival outcome
character_event = {
	id = RIP.30206
	picture = GFX_evt_melee
	border = GFX_event_normal_frame_war

	desc = {
		text = EVTDESC_RIP_30206_WON
		trigger = {
			FROM = {
				OR = {
					has_character_flag = lost_suicide_duel
					has_character_flag = incapable_suicide_duel
				}
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30206_LOST
		trigger = { FROM = { has_character_flag = won_suicide_duel } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30206

		trigger = {
			FROM = { has_character_flag = lost_suicide_duel }
		}

		prestige = 100

		FROM = {
			show_scope_change = no

			tooltip = {
				prestige = -100

				death = {
					death_reason = death_duel
					killer = ROOT
				}
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30206

		trigger = {
			FROM = { has_character_flag = incapable_suicide_duel }
		}

		prestige = 100

		FROM = {
			show_scope_change = no

			tooltip = {
				prestige = -100
				add_trait = incapable
			}
		}
	}

	option = {
		name = EVTOPTC_RIP_30206

		trigger = {
			FROM = { has_character_flag = won_suicide_duel }
		}
	}
}

# Suicide attempt through poison
character_event = {
	id = RIP.30207
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30207_SUCCESS
		picture = GFX_evt_performing_experiments
		trigger = { has_character_flag = suicide_success }
	}
	desc = {
		text = EVTDESC_RIP_30207_FAIL
		picture = GFX_evt_experiments_failed
		trigger = { has_character_flag = suicide_fail }
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_RIP_30207

		trigger = { has_character_flag = suicide_success }

		prestige = -200

		add_character_modifier = {
			name = suicide
			duration = -1
		}

		death = { death_reason = death_suicide_poison }

		random = {
			chance = 35

			mult_modifier = {
				factor = 0.3
				has_nickname = yes
			}

			give_nickname = nick_the_suicide
		}
	}

	option = {
		name = EVTOPTB_RIP_30207

		trigger = { has_character_flag = suicide_fail }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }

		give_food_poisoning_effect = yes
	}
}

# Suicide attempt through hanging
character_event = {
	id = RIP.30208
	picture = GFX_evt_scandal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30208_SUCCESS
		trigger = { has_character_flag = suicide_success }
	}
	desc = {
		text = EVTDESC_RIP_30208_FAIL
		trigger = { has_character_flag = suicide_fail }
	}

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		random_courtier = {
			limit = {
				block_general_event_trigger = no
				ai = yes
			}

			save_event_target_as = found_hanger
		}
	}

	option = {
		name = EVTOPTA_RIP_30207

		trigger = { has_character_flag = suicide_success }

		prestige = -200

		add_character_modifier = {
			name = suicide
			duration = -1
		}

		death = { death_reason = death_suicide_hanging }

		random = {
			chance = 35

			mult_modifier = {
				factor = 0.3
				has_nickname = yes
			}

			give_nickname = nick_the_suicide
		}
	}

	option = {
		name = EVTOPTB_RIP_30207

		trigger = { has_character_flag = suicide_fail }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }

		prestige = -100

		opinion = {
			name = opinion_distressing_encounter
			who = event_target:found_hanger
			years = 5
		}

		reverse_opinion = {
			name = opinion_distressing_encounter
			who = event_target:found_hanger
			years = 5
		}
	}
}

# Suicide attempt through fall
character_event = {
	id = RIP.30209
	picture = GFX_evt_prospering_province
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30209_SUCCESS
		trigger = { has_character_flag = suicide_success }
	}
	desc = {
		text = EVTDESC_RIP_30209_FAIL
		trigger = { has_character_flag = suicide_fail }
	}

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_RIP_30207

		trigger = { has_character_flag = suicide_success }

		prestige = -200

		add_character_modifier = {
			name = suicide
			duration = -1
		}

		death = { death_reason = death_suicide_fall }

		random = {
			chance = 35

			mult_modifier = {
				factor = 0.3
				has_nickname = yes
			}

			give_nickname = nick_the_suicide
		}
	}

	option = {
		name = EVTOPTD_RIP_30205

		trigger = { has_character_flag = suicide_fail }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }

		prestige = -100
		add_trait = incapable
	}
}

# Incapable suicide help request
character_event = {
	id = RIP.30210
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30210_A
		trigger = { event_target:suicide_assistant = { always = yes } }
	}
	desc = {
		text = EVTDESC_RIP_30210_B
		trigger = { NOT = { event_target:suicide_assistant = { always = yes } } }
	}

	is_triggered_only = yes # commit_suicide_immortal, rip_various_decisions.txt; commit_suicide, dynasty_decisions.txt

	immediate = {
		random_character = {
			limit = {
				OR = {
					is_friend = ROOT
					is_child_of = ROOT
					is_lover = ROOT

					trigger_if = {
						limit = { has_minor_title = title_court_physician }
						host = { character = ROOT }
					}
				}

				block_general_event_trigger = no
				NOT = { has_character_flag = refused_assisted_suicide }
			}

			preferred_limit = { is_friend = ROOT }
			preferred_limit = { is_lover = ROOT }

			preferred_limit = {
				has_minor_title = title_court_physician
				host = { character = ROOT }
			}

			preferred_limit = { is_child_of = ROOT }

			save_event_target_as = suicide_assistant
		}

		character_event = {
			id = RIP.30201 # Cleanup
			years = 1
		}
	}

	option = {
		name = EVTOPTA_RIP_30210

		trigger = { event_target:suicide_assistant = { always = yes } }

		event_target:suicide_assistant = {
			character_event = {
				id = RIP.30211
				days = 5
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30210

		trigger = { NOT = { event_target:suicide_assistant = { always = yes } } }

		set_character_flag = suicide_success

		character_event = {
			id = RIP.30212
			days = 5
		}
	}
}

# Suicide request response
character_event = {
	id = RIP.30211
	desc = EVTDESC_RIP_30211
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes

	# Yes
	option = {
		name = EVTOPTA_RIP_30211

		FROM = {
			show_scope_change = no

			tooltip = {
				death = {
					death_reason = death_murder_unknown_strangle
					killer = ROOT
				}
			}

			set_character_flag = suicide_success
			character_event = { id = RIP.30212 }
		}

		ai_chance = {
			factor = 33

			mult_modifier = {
				factor = 2
				is_benevolent_trigger = yes
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 4

				trait = ambitious
				is_primary_heir = FROM
			}
		}
	}

	# No
	option = {
		name = EVTOPTB_RIP_30211

		opinion = {
			name = opinion_distressing_encounter
			who = FROM
			years = 5
		}

		reverse_opinion = {
			name = opinion_distressing_encounter
			who = FROM
			years = 5
		}

		set_character_flag = refused_assisted_suicide

		FROM = {
			set_character_flag = suicide_fail
			character_event = { id = RIP.30212 }
		}

		ai_chance = {
			factor = 67

			mult_modifier = {
				factor = 2
				is_evil_trigger = yes
			}

			mult_modifier = {
				factor = 2
				trait = craven
			}
		}
	}
}

# Incapable suicide request outcome
character_event = {
	id = RIP.30212
	picture = GFX_evt_doctor_tending_to_sick
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30212_SUCCESS_A
		trigger = {
			has_character_flag = suicide_success
			NOT = { character = FROM }
		}
	}
	desc = {
		text = EVTDESC_RIP_30212_SUCCESS_B
		trigger = {
			has_character_flag = suicide_success
			character = FROM
		}
	}
	desc = {
		text = EVTDESC_RIP_30212_FAIL
		trigger = { has_character_flag = suicide_fail }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_RIP_30207

		trigger = { has_character_flag = suicide_success }

		death = {
			death_reason = death_murder_unknown_strangle
			killer = FROM
		}
	}

	option = {
		name = EVTOPTB_RIP_30212

		trigger = { has_character_flag = suicide_fail }

		custom_tooltip = { text = EVTOPTA_RIP_30204_TOOLTIP }
	}
}

### CHESS WITH DEATH ###

# Seeing someone during a walk
character_event = {
	id = RIP.30222
	desc = EVTDESC_RIP_30222
	picture = GFX_evt_garden
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes # on_yearly_pulse, random_events
	hide_from = yes
	hide_new = yes

	ai = no
	has_dlc = "Reapers"
	min_age = 45
	only_capable = yes
	war = no

	trigger = {
		OR = {
			religion_group = christian

			any_realm_province = {
				held_under_PREV = yes

				any_neighbor_province = {
					owner = {
						religion_group = christian
					}
				}
			}
		}

		is_nomadic = no
		immortal = no

		NOR = {
			has_character_flag = chess_with_death
			has_character_flag = is_child_of_destiny

			has_game_rule = {
				name = supernatural_events
				value = off
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2

			any_realm_province = {
				OR = {
					disease = bubonic_plague

					any_neighbor_province = {
						disease = bubonic_plague
					}
				}

				held_under_PREV = yes
			}
		}

		mult_modifier = {
			factor = 1.5
			practical_age >= 70
		}

		mult_modifier = {
			factor = 1.4
			health < 2
		}

		mult_modifier = {
			factor = 1.2
			health < 4
		}

		mult_modifier = {
			factor = 1.3
			trait = game_master
		}
	}

	immediate = {
		if = {
			limit = { religion_group = christian }

			create_character = {
				random_traits = no
				age = 32
				dynasty = none
				female = 50
				add_trait = mastermind_theologian
				add_trait = chaste
				add_trait = shrewd
				add_trait = game_master
				add_trait = patient
				add_trait = fatigue
				add_trait = on_pilgrimage

				attributes = {
					martial = 5
				}
			}
		}
		else = {
			if = {
				limit = { has_global_flag = schism_happened }

				create_character = {
					random_traits = no
					age = 32
					dynasty = none
					female = 50
					culture = italian
					race = italian
					religion = catholic
					add_trait = mastermind_theologian
					add_trait = chaste
					add_trait = shrewd
					add_trait = game_master
					add_trait = patient
					add_trait = fatigue
					add_trait = on_pilgrimage

					attributes = {
						martial = 5
					}
				}
			}
			else = {
				create_character = {
					random_traits = no
					age = 32
					dynasty = none
					female = 50
					culture = italian
					race = italian
					religion = chalcedonian
					add_trait = mastermind_theologian
					add_trait = chaste
					add_trait = shrewd
					add_trait = game_master
					add_trait = patient
					add_trait = fatigue
					add_trait = on_pilgrimage

					attributes = {
						martial = 5
					}
				}
			}

			new_character = {
				if = {
					limit = { is_female = yes }
					set_name = "Eugenia"
				}
				else = {
					set_name = "Augusto"
				}
			}
		}

		new_character = {
			save_event_target_as = death
			set_character_flag = is_death
			health = 10
			set_christian_ascetic_effect = yes
		}

		set_character_flag = chess_with_death
	}

	# Have a chat
	option = {
		name = EVTOPTA_RIP_30222

		if = {
			limit = { trait = shy }

			random = {
				chance = 30
				remove_trait_shy_effect = yes
			}
		}
		else = {
			random = {
				chance = 20
				add_trait_gregarious_effect = yes
			}
		}

		set_character_flag = walked_with_death

		character_event = {
			id = RIP.30223 # Talking to the nun/monk, they want room & board
			days = 5
		}
	}

	# Want to be alone
	option = {
		name = EVTOPTB_RIP_30222

		if = {
			limit = { trait = gregarious }

			random = {
				chance = 30
				remove_trait_gregarious_effect = yes
			}
		}
		else = {
			random = {
				chance = 20
				add_trait_shy_effect = yes
			}
		}

		narrative_event = {
			id = RIP.30224 # Death comes for you
			days = 14
			random = 14
		}
	}
}

# You talk, they want room and board
character_event = {
	id = RIP.30223
	border = GFX_event_normal_frame_religion

	desc = {
		text = EVTDESC_RIP_30223_A
		picture = GFX_evt_wise_woman
		trigger = {
			religion = event_target:death
			event_target:death = { is_female = yes }
		}
	}
	desc = {
		text = EVTDESC_RIP_30223_B
		picture = GFX_evt_monk
		trigger = {
			religion = event_target:death
			event_target:death = { is_female = no }
		}
	}
	desc = {
		text = EVTDESC_RIP_30223_C
		picture = GFX_evt_wise_woman
		trigger = {
			NOT = { religion = event_target:death }
			event_target:death = { is_female = yes }
		}
	}
	desc = {
		text = EVTDESC_RIP_30223_D
		picture = GFX_evt_monk
		trigger = {
			NOT = { religion = event_target:death }
			event_target:death = { is_female = no }
		}
	}

	is_triggered_only = yes
	hide_new = yes

	# Come stay with me
	option = {
		name = EVTOPTA_RIP_30223

		narrative_event = {
			id = RIP.30224 # Death comes for you
			days = 14
			random = 14
			tooltip = EVTOPTA_RIP_30223_TOOLTIP
		}

		if = {
			limit = {
				NOT = { religion_group = christian }
			}

			remove_trait_zealous_effect = yes
			add_trait = sympathy_christendom
		}

		set_character_flag = invited_death
	}

	# Have some money, sleep at the inn
	option = {
		name = EVTOPTB_RIP_30223

		narrative_event = {
			id = RIP.30224 # Death comes for you
			days = 14
			random = 14
			tooltip = EVTOPTB_RIP_30223_TOOLTIP
		}

		scaled_wealth = {
			value = -0.1
			min = -15
		}

		set_character_flag = gave_death_money
	}

	# Go away!
	option = {
		name = {
			trigger = { religion_group = christian }
			text = EVTOPTC_RIP_30223_A
		}
		name = {
			trigger = {
				NOT = { religion_group = christian }
			}
			text = EVTOPTC_RIP_30223_B
		}

		narrative_event = {
			id = RIP.30224 # Death comes for you
			days = 14
			random = 14
			tooltip = EVTOPTC_RIP_30223_TOOLTIP
		}

		if = {
			limit = { religion_group = christian }

			piety = -50

			random = {
				chance = 50
				remove_trait_zealous_effect = yes
			}
		}

		random = {
			chance = 50
			add_trait_partially_greedy_effect = yes
		}
	}
}

# The reveal
narrative_event = {
	id = RIP.30224
	title = EVTNAME_RIP_30224
	border = GFX_event_narrative_frame_intrigue
	picture = GFX_evt_shadow

	desc = {
		text = EVTDESC_RIP_30224_A
		trigger = { has_character_flag = invited_death }
	}
	desc = {
		text = EVTDESC_RIP_30224_B
		trigger = {
			NOT = { has_character_flag = invited_death }
			has_character_flag = walked_with_death
		}
	}
	desc = {
		text = EVTDESC_RIP_30224_C
		trigger = {
			NOR = {
				has_character_flag = invited_death
				has_character_flag = walked_with_death
			}
		}
	}

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		event_target:death = {
			remove_trait = fatigue
			remove_trait = on_pilgrimage
			remove_trait = nun
			remove_trait = monk
		}

		# To "enable" seduction
		if = {
			limit = {
				OR = {
					trait = master_seducer
					trait = master_seductress
				}

				same_sex = event_target:death
			}

			event_target:death = {
				add_trait = homosexual
				set_character_flag = revealed_homosexual@ROOT
			}
		}
	}

	# Play chess with me!
	option = {
		name = EVTOPTA_RIP_30224

		character_event = {
			id = RIP.30226 # Picking chess pieces
			days = 5
			tooltip = EVTOPTA_RIP_30224_TOOLTIP
		}
	}

	# Do your worst!
	option = {
		name = EVTOPTB_RIP_30224

		custom_tooltip = { text = EVTOPTB_RIP_30224_TOOLTIP }

		random_list = {
			# You die
			80 = {
				death = {
					death_reason = death_murder_unknown
					killer = event_target:death
				}

				hidden_effect = {
					event_target:death = {
						leave_court_effect = yes
						death = { death_reason = death_missing }
					}
				}
			}

			# You survive
			20 = {
				trigger = {
					NAND = {
						trait = wounded
						trait = mangled
						trait = one_eyed
						trait = one_handed
					}
				}

				character_event = {
					id = RIP.30225 # Outcome of attacking death
					days = 1
					tooltip = EVTOPTB_RIP_30224_TOOLTIP_SURVIVE
				}
			}
		}

		clr_character_flag = walked_with_death
		clr_character_flag = invited_death
		clr_character_flag = gave_death_money
	}
}

# You survived but got injured
character_event = {
	id = RIP.30225
	picture = GFX_evt_bloody_tools
	desc = EVTDESC_RIP_30225
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		random_list = {
			25 = {
				trigger = {
					NOT = { trait = wounded }
				}

				set_character_flag = give_wounded
			}

			25 = {
				trigger = {
					NOT = { trait = mangled }
				}

				set_character_flag = give_mangled
			}

			25 = {
				trigger = {
					NOT = { trait = one_eyed }
				}

				set_character_flag = give_one_eyed
			}

			25 = {
				trigger = {
					NOT = { trait = one_handed }
				}

				set_character_flag = give_one_handed
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30225

		trigger_switch = {
			on_trigger = has_character_flag

			give_wounded    = { add_trait_wounded_effect = yes }
			give_mangled    = { mangle_effect = yes }
			give_one_eyed   = { add_trait_one_eyed_effect = yes }
			give_one_handed = { add_trait_one_handed_effect = yes }
		}

		clr_character_flag = give_wounded
		clr_character_flag = give_mangled
		clr_character_flag = give_one_eyed
		clr_character_flag = give_one_handed

		event_target:death = {
			show_scope_change = no

			death = {
				death_reason = death_murder_unknown
				killer = ROOT
			}
		}
	}
}

# Chess starts, pick piece
character_event = {
	id = RIP.30226
	picture = GFX_evt_court_physician
	desc = EVTDESC_RIP_30226
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		set_variable = {
			which = chess_score
			value = 0
		}

		if = {
			limit = {
				OR = {
					has_character_flag = invited_death
					has_character_flag = gave_death_money
				}
			}

			change_variable = {
				which = chess_score
				value = 1
			}

			clr_character_flag = invited_death
			clr_character_flag = gave_death_money
		}

		clr_character_flag = walked_with_death
	}

	# White
	option = {
		name = EVTOPTA_RIP_30226

		custom_tooltip = {
			text = EVTOPTA_RIP_30226_TOOLTIP
			set_character_flag = picked_white
		}
	}

	# Black
	option = {
		name = EVTOPTB_RIP_30226

		custom_tooltip = {
			text = EVTOPTB_RIP_30226_TOOLTIP

			set_character_flag = picked_black

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	after = {
		character_event = {
			id = RIP.30227 # First move
			days = 3
		}
	}
}

# First move
character_event = {
	id = RIP.30227
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30226_BLACK
		trigger = { has_character_flag = picked_black }
	}
	desc = {
		text = EVTDESC_RIP_30226_WHITE
		trigger = { has_character_flag = picked_white }
	}

	is_triggered_only = yes
	hide_new = yes

	# Play it safe
	option = {
		name = EVTOPTA_RIP_30227

		random_list = {
			25 = {
				custom_tooltip = {
					text = CHESS_GOOD_MOVE

					set_character_flag = good_move

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			55 = {
				custom_tooltip = {
					text = CHESS_NEUTRAL_MOVE
					set_character_flag = neutral_move
				}
			}

			20 = {
				custom_tooltip = {
					text = CHESS_BAD_MOVE

					set_character_flag = bad_move

					change_variable = {
						which = chess_score
						value = -1
					}
				}
			}
		}
	}

	# Play it risky
	option = {
		name = EVTOPTB_RIP_30227

		random_list = {
			20 = {
				custom_tooltip = {
					text = CHESS_GREAT_MOVE

					set_character_flag = great_move

					change_variable = {
						which = chess_score
						value = 2
					}
				}
			}

			40 = {
				custom_tooltip = {
					text = CHESS_GOOD_MOVE

					set_character_flag = good_move

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			40 = {
				custom_tooltip = {
					text = CHESS_TERRIBLE_MOVE

					set_character_flag = bad_move

					change_variable = {
						which = chess_score
						value = -2
					}
				}
			}
		}
	}

	# Deceitful
	option = {
		name = EVTOPTC_RIP_30227
		tooltip_info = deceitful

		trigger = {
			trait = deceitful
			NOT = { trait = master_schemer }

			NAND = {
				trait = strategist
				is_smart_trigger = yes
			}
		}

		custom_tooltip = {
			text = CHESS_GOOD_MOVE_100

			set_character_flag = good_move

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	# Master schemer
	option = {
		name = EVTOPTC_RIP_30227
		tooltip_info = master_schemer

		trigger = { trait = master_schemer }

		custom_tooltip = {
			text = CHESS_GOOD_MOVE_100

			set_character_flag = good_move

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	# Gamer option
	option = {
		name = EVTOPTD_RIP_30227
		tooltip_info = game_master

		trigger = { trait = game_master }

		custom_tooltip = {
			text = CHESS_GREAT_MOVE_100

			set_character_flag = great_move

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Strategist option
	option = {
		name = EVTOPTD_RIP_30227
		tooltip_info = strategist

		trigger = { trait = strategist }

		custom_tooltip = {
			text = CHESS_GOOD_MOVE_100

			set_character_flag = good_move

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	# Genius option
	option = {
		name = EVTOPTE_RIP_30227
		tooltip_info = genius

		trigger = {
			trait = genius
			NOT = { trait = game_master }
		}

		custom_tooltip = {
			text = CHESS_GREAT_MOVE_100

			set_character_flag = great_move

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Quick
	option = {
		name = EVTOPTE_RIP_30227
		tooltip_info = quick

		trigger = {
			trait = quick
			NOT = { trait = game_master }
		}

		custom_tooltip = {
			text = CHESS_GOOD_MOVE_100

			set_character_flag = good_move

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	# Shrewd
	option = {
		name = EVTOPTE_RIP_30227
		tooltip_info = shrewd

		trigger = {
			trait = shrewd

			NOR = {
				trait = genius
				trait = quick
				trait = game_master
			}
		}

		custom_tooltip = {
			text = CHESS_GOOD_MOVE_100

			set_character_flag = good_move

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	after = {
		character_event = {
			id = RIP.30228 # Outcome of first move
			days = 1
		}
	}
}

# Death reacts to your move
character_event = {
	id = RIP.30228
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30228_GREAT
		trigger = { has_character_flag = great_move }
	}
	desc = {
		text = EVTDESC_RIP_30228_GOOD
		trigger = { has_character_flag = good_move }
	}
	desc = {
		text = EVTDESC_RIP_30228_NEUTRAL
		trigger = { has_character_flag = neutral_move }
	}
	desc = {
		text = EVTDESC_RIP_30228_BAD
		trigger = { has_character_flag = bad_move }
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = {
			text = EVTOPTA_RIP_30228_A
			trigger = {
				OR = {
					has_character_flag = great_move
					has_character_flag = good_move
				}
			}
		}
		name = {
			text = EVTOPTA_RIP_30228_B
			trigger = {
				OR = {
					has_character_flag = bad_move
					has_character_flag = neutral_move
				}
			}
		}

		clr_character_flag = great_move
		clr_character_flag = good_move
		clr_character_flag = neutral_move
		clr_character_flag = bad_move

		character_event = {
			id = RIP.30229 # Another tactic
			days = 5
			tooltip = EVTOPTA_RIP_30228_TOOLTIP
		}
	}
}

# Some other tactic
character_event = {
	id = RIP.30229
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30229_GOOD
		trigger = {
			check_variable = {
				which = chess_score
				value >= 3
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30229_NEUTRAL
		trigger = {
			check_variable = {
				which = chess_score
				value >= 1
			}

			check_variable = {
				which = chess_score
				value < 3
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30229_BAD
		trigger = {
			check_variable = {
				which = chess_score
				value < 1
			}
		}
	}

	is_triggered_only = yes
	hide_new = yes

	# Drinking competition 1
	option = {
		name = EVTOPTA_RIP_30229
		tooltip_info = drunkard

		trigger = { trait = drunkard }

		custom_tooltip = {
			text = EVTOPTA_RIP_30229_TOOLTIP

			set_character_flag = chess_drinking_competition

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Drinking competition 2
	option = {
		name = EVTOPTA_RIP_30229
		tooltip_info = hedonist

		trigger = {
			trait = hedonist
			NOT = { trait = drunkard }
		}

		custom_tooltip = {
			text = EVTOPTA_RIP_30229_TOOLTIP

			set_character_flag = chess_drinking_competition

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Seduce (as man)
	option = {
		name = EVTOPTB_RIP_30229
		tooltip_info = master_seducer

		trigger = { trait = master_seducer }

		custom_tooltip = {
			text = EVTOPTB_RIP_30229_TOOLTIP

			set_character_flag = chess_seduction

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Seduce (as woman)
	option = {
		name = EVTOPTB_RIP_30229
		tooltip_info = master_seductress

		trigger = { trait = master_seductress }

		custom_tooltip = {
			text = EVTOPTB_RIP_30229_TOOLTIP

			set_character_flag = chess_seduction

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Intimidate
	option = {
		name = EVTOPTC_RIP_30229
		tooltip_info = impaler

		trigger = { trait = impaler }

		custom_tooltip = {
			text = EVTOPTC_RIP_30229_TOOLTIP

			set_character_flag = chess_intimidation

			change_variable = {
				which = chess_score
				value = 2
			}
		}
	}

	# Brag about past victories
	option = {
		name = EVTOPTF_RIP_30229
		tooltip_info = game_master

		trigger = { trait = game_master }

		custom_tooltip = {
			text = EVTOPTF_RIP_30229_TOOLTIP

			set_character_flag = chess_brag

			change_variable = {
				which = chess_score
				value = 1
			}
		}
	}

	# Knock wine
	option = {
		name = EVTOPTD_RIP_30229

		custom_tooltip = { text = EVTOPTD_RIP_30229_TOOLTIP }

		random_list = {
			67 = {
				custom_tooltip = {
					text = CHESS_GOOD_TRICK

					set_character_flag = good_trick

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			33 = {
				custom_tooltip = {
					text = CHESS_BAD_TRICK
					set_character_flag = bad_trick
				}
			}
		}
	}

	# Focus on the game, skips next event
	option = {
		name = EVTOPTE_RIP_30229

		set_character_flag = no_trick

		random_list = {
			25 = {
				custom_tooltip = {
					text = CHESS_GOOD_MOVE

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			75 = {
				custom_tooltip = { text = CHESS_NEUTRAL_MOVE }
			}
		}
	}

	after = {
		if = {
			limit = { has_character_flag = no_trick }

			character_event = {
				id = RIP.30231 # Last move
				days = 5
			}
		}
		else = {
			character_event = {
				id = RIP.30230 # Outcome of the tactic
				days = 1
			}
		}
	}
}

# Another tactic reaction
character_event = {
	id = RIP.30230
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30230_DRINKING
		picture = GFX_evt_drunk
		trigger = { has_character_flag = chess_drinking_competition }
	}
	desc = {
		text = EVTDESC_RIP_30230_SEDUCTION
		picture = GFX_evt_lovers
		trigger = { has_character_flag = chess_seduction }
	}
	desc = {
		text = EVTDESC_RIP_30230_INTIMIDATION
		picture = GFX_evt_impalement
		trigger = { has_character_flag = chess_intimidation }
	}
	desc = {
		text = EVTDESC_RIP_30230_BRAG
		picture = GFX_evt_courtiers_talking
		trigger = { has_character_flag = chess_brag }
	}
	desc = {
		text = EVTDESC_RIP_30230_GOOD_TRICK
		picture = GFX_evt_drunk
		trigger = { has_character_flag = good_trick }
	}
	desc = {
		text = EVTDESC_RIP_30230_BAD_TRICK
		picture = GFX_evt_drunk
		trigger = { has_character_flag = bad_trick }
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = EVTOPTA_RIP_30230

		trigger = {
			NOT = { has_character_flag = bad_trick }
		}

		custom_tooltip = {
			text = EVTOPTA_RIP_30228_TOOLTIP

			# Randomness
			random = {
				chance = 50

				change_variable = {
					which = chess_score
					value = -1
				}
			}

			clr_character_flag = chess_drinking_competition
			clr_character_flag = chess_seduction
			clr_character_flag = chess_intimidation
			clr_character_flag = chess_brag
			clr_character_flag = good_trick

			character_event = {
				id = RIP.30231 # Last move
				days = 5
			}
		}
	}

	option = {
		name = EVTOPTB_RIP_30230

		trigger = { has_character_flag = bad_trick }

		custom_tooltip = {
			text = EVTOPTB_RIP_30230_TOOLTIP

			clr_character_flag = bad_trick

			event_target:death = {
				leave_court_effect = yes
				death = { death_reason = death_missing }
			}
		}

		death = {
			death_reason = death_murder_unknown
			killer = event_target:death
		}
	}
}

# Last move
character_event = {
	id = RIP.30231
	picture = GFX_evt_court_physician
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30231_GOOD
		trigger = {
			check_variable = {
				which = chess_score
				value >= 5
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30231_NEUTRAL
		trigger = {
			check_variable = {
				which = chess_score
				value == 4
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30231_BAD
		trigger = {
			check_variable = {
				which = chess_score
				value < 4
			}
		}
	}

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		random_courtier_or_vassal = {
			limit = {
				ai = yes
				is_alive = yes

				OR = {
					is_child_of = ROOT
					is_lover = ROOT
					is_friend = ROOT
					is_married = ROOT
				}
			}

			preferred_limit = { is_child_of = ROOT }
			preferred_limit = { is_lover = ROOT }
			preferred_limit = { is_friend = ROOT }
			preferred_limit = { is_married = ROOT }

			save_event_target_as = chess_sacrifice
		}
	}

	# Trust my skill
	option = {
		name = EVTOPTA_RIP_30231

		random_list = {
			20 = {
				trigger = {
					OR = {
						trait = game_master
						is_smart_trigger = yes
					}
				}

				custom_tooltip = {
					text = CHESS_GREAT_MOVE

					set_character_flag = great_move

					change_variable = {
						which = chess_score
						value = 2
					}
				}
			}

			20 = {
				mult_modifier = {
					factor = 1.5

					OR = {
						trait = game_master
						is_smart_trigger = yes
					}
				}

				custom_tooltip = {
					text = CHESS_GOOD_MOVE

					set_character_flag = good_move

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.6

					OR = {
						trait = game_master
						is_smart_trigger = yes
					}
				}

				custom_tooltip = {
					text = CHESS_NEUTRAL_MOVE
					set_character_flag = neutral_move
				}
			}

			30 = {
				mult_modifier = {
					factor = 0.67

					OR = {
						trait = game_master
						is_smart_trigger = yes
					}
				}

				custom_tooltip = {
					text = CHESS_BAD_MOVE

					set_character_flag = bad_move

					change_variable = {
						which = chess_score
						value = -1
					}
				}
			}
		}
	}

	# Offer lover/friend
	option = {
		name = {
			text = EVTOPTB_RIP_30231_A
			trigger = { is_married = event_target:chess_sacrifice }
		}
		name = {
			text = EVTOPTB_RIP_30231_B
			trigger = { is_friend = event_target:chess_sacrifice }
		}
		name = {
			text = EVTOPTB_RIP_30231_C
			trigger = { is_lover = event_target:chess_sacrifice }
		}
		name = {
			text = EVTOPTB_RIP_30231_D
			trigger = { is_parent_of = event_target:chess_sacrifice }
		}

		trigger = {
			event_target:chess_sacrifice = { always = yes }
		}

		show_portrait = event_target:chess_sacrifice

		event_target:chess_sacrifice = { save_event_target_as = kill_sacrifice }

		random_list = {
			15 = {
				custom_tooltip = {
					text = CHESS_GREAT_MOVE

					set_character_flag = great_move

					change_variable = {
						which = chess_score
						value = 2
					}
				}
			}

			35 = {
				custom_tooltip = {
					text = CHESS_GOOD_MOVE

					set_character_flag = good_move

					change_variable = {
						which = chess_score
						value = 1
					}
				}
			}

			35 = {
				custom_tooltip = {
					text = CHESS_NEUTRAL_MOVE
					set_character_flag = neutral_move
				}
			}

			15 = {
				custom_tooltip = {
					text = CHESS_BAD_MOVE

					set_character_flag = bad_move

					change_variable = {
						which = chess_score
						value = -1
					}
				}
			}
		}
	}

	after = {
		narrative_event = {
			id = RIP.30232 # The end
			days = 1
		}
	}
}

# The end of the game
narrative_event = {
	id = RIP.30232
	title = EVTNAME_RIP_30232
	picture = GFX_evt_danse_macabre
	border = GFX_event_narrative_frame_intrigue

	desc = {
		text = EVTDESC_RIP_30232_GOOD
		trigger = {
			check_variable = {
				which = chess_score
				value >= 5
			}
		}
	}
	desc = {
		text = EVTDESC_RIP_30232_BAD
		trigger = {
			check_variable = {
				which = chess_score
				value < 5
			}
		}
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = EVTOPTA_RIP_30232

		trigger = {
			check_variable = {
				which = chess_score
				value >= 5
			}
		}

		custom_tooltip = {
			text = EVTOPTB_RIP_302232_TOOLTIP

			hidden_effect = {
				event_target:death = {
					leave_court_effect = yes
					death = { death_reason = death_missing }
				}
			}
		}

		if = {
			limit = {
				NOT = { has_character_modifier = deaths_gift }
			}

			add_character_modifier = {
				name = deaths_gift
				duration = -1
			}
		}

		remove_disease_trait_effect = yes
	}

	option = {
		name = EVTOPTB_RIP_30232

		trigger = {
			check_variable = {
				which = chess_score
				value < 5
			}
		}

		custom_tooltip = {
			text = EVTOPTB_RIP_30230_TOOLTIP

			hidden_effect = {
				event_target:death = {
					leave_court_effect = yes
					death = { death_reason = death_missing }
				}
			}
		}

		death = {
			death_reason = death_murder_unknown
			killer = event_target:death
		}

		event_target:kill_sacrifice = {
			show_scope_change = no

			death = {
				death_reason = death_murder_unknown
				killer = event_target:death
			}
		}
	}
}

# Death's gift
character_event = {
	id = RIP.30233
	desc = EVTDESC_TOG_7015
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_danse_macabre

	is_triggered_only = yes # deaths_gift_removes_disease_effect

	trigger = { is_ill = yes }

	option = {
		name = EVTOPTA_RIP_30233

		remove_disease_trait_effect = yes
		remove_character_modifier = deaths_gift
		remove_trait_silently_cynical_effect = yes
	}
}

### Immortal rival events
narrative_event = {
	id = RIP.30300
	title = RIP.30300.title
	picture = GFX_evt_suspicious_noble
	border = GFX_event_narrative_frame_war

	is_triggered_only = yes # on_yearly_pulse, random_events

	only_playable = yes
	only_capable = yes

	trigger = {
		trait = immortal
		NOT = { has_character_flag = immortal_rival_appeared }
	}

	immediate = {
		set_character_flag = immortal_rival_appeared

		if = {
			limit = {
				NOR = {
					has_character_flag = immortal_rival_highlander
					has_character_flag = immortal_rival_evildude
					has_character_flag = immortal_rival_goodguy
					has_character_flag = immortal_rival_shieldmaiden
					has_character_flag = immortal_rival_horse
				}
			}

			random_list = {
				100 = { set_character_flag = immortal_rival_highlander }

				100 = {
					mult_modifier = {
						factor = 2
						is_virtous = yes
					}

					set_character_flag = immortal_rival_evildude
				}

				100 = {
					mult_modifier = {
						factor = 2
						is_wicked = yes
					}

					mult_modifier = {
						factor = 2

						OR = {
							trait = lunatic
							trait = cruel
							trait = wroth
							trait = cannibal
							trait = impaler
						}
					}

					set_character_flag = immortal_rival_goodguy
				}

				100 = {
					mult_modifier = {
						factor = 2
						combat_rating >= 30
					}

					mult_modifier = {
						factor = 1.5
						combat_rating >= 40
					}

					set_character_flag = immortal_rival_shieldmaiden
				}

				25 = {
					mult_modifier = {
						factor = 15
						any_courtier = { culture = horse }
					}

					mult_modifier = {
						factor = 10

						any_courtier = {
							culture = horse
							trait = immortal
						}
					}

					set_character_flag = immortal_rival_horse
				}
			}
		}
	}

	desc = {
		text = RIP.30300.d.highlander
		trigger = { has_character_flag = immortal_rival_highlander }
	}
	desc = {
		text = RIP.30300.d.evildude
		trigger = { has_character_flag = immortal_rival_evildude }
	}
	desc = {
		text = RIP.30300.d.goodguy
		trigger = { has_character_flag = immortal_rival_goodguy }
	}
	desc = {
		text = RIP.30300.d.shieldmaiden
		trigger = { has_character_flag = immortal_rival_shieldmaiden }
	}
	desc = {
		text = RIP.30300.d.horse
		trigger = { has_character_flag = immortal_rival_horse }
	}

	option = {
		name = {
			text = RIP.30300.a
			trigger = {
				NOR = {
					trait = craven
					trait = lunatic
					trait = cruel
					trait = wroth
					trait = cannibal
					trait = impaler
				}
			}
		}
		name = {
			text = RIP.30300.b
			trigger = { trait = craven }
		}
		name = {
			text = RIP.30300.c
			trigger = {
				OR = {
					trait = lunatic
					trait = cruel
					trait = wroth
					trait = cannibal
					trait = impaler
				}
			}
		}

		character_event = {
			id = RIP.30301
			months = 6
			random = 100
			tooltip = IMMORTAL_RIVAL_COMING_TOOLTIP
		}
	}
}

character_event = {
	id = RIP.30301
	title = RIP.30301.title
	picture = GFX_evt_end_of_days
	border = GFX_event_normal_frame_war

	is_triggered_only = yes
	hide_new = yes

	immediate = {
		trigger_switch = {
			on_trigger = has_character_flag

			immortal_rival_highlander = {
				create_character = {
					random_traits = no
					name = "Ramirez"
					dynasty = none
					religion = catholic
					culture = scottish
					female = no
					age = 1500
					immortal_age = 40
					health = 6
					fertility = 0.8
					add_trait = skilled_tactician
					add_trait = patient
					add_trait = immortal
					add_trait = just
					add_trait = duelist
					add_trait = cynical
					historical = yes

					attributes = {
						martial = 12
						diplomacy = 10
						stewardship = 9
						intrigue = 9
						learning = 15
					}
				}
			}

			immortal_rival_evildude = {
				create_character = {
					random_traits = no
					name = "Uran"
					dynasty = culture
					religion = pagan
					culture = random
					female = no
					age = 1800
					immortal_age = 25
					health = 6
					fertility = 0.8
					add_trait = brilliant_strategist
					add_trait = wroth
					add_trait = immortal
					add_trait = proud
					add_trait = impaler
					add_trait = cynical
					add_trait = strong
					add_trait = berserker
					add_trait = envious
					historical = yes

					attributes = {
						martial = 15
						diplomacy = 5
						stewardship = 4
						intrigue = 6
						learning = 8
					}
				}

				new_character = {
					add_scarred_high_effect = yes
				}
			}

			immortal_rival_goodguy = {
				create_character = {
					random_traits = no
					name = "Arthur"
					dynasty = none
					religion = catholic
					culture = breton
					female = no
					age = 950
					immortal_age = 30
					health = 6
					fertility = 0.8
					add_trait = brilliant_strategist
					add_trait = patient
					add_trait = immortal
					add_trait = just
					add_trait = kind
					add_trait = temperate
					add_trait = chaste
					add_trait = strategist
					historical = yes

					attributes = {
						martial = 16
						diplomacy = 12
						stewardship = 15
						intrigue = 8
						learning = 14
					}
				}
			}

			immortal_rival_shieldmaiden = {
				create_character = {
					random_traits = no
					name = "Torhild"
					dynasty = none
					religion = norse_pagan
					culture = norse
					female = yes
					age = 1300
					immortal_age = 18
					health = 6
					fertility = 0.8
					add_trait = tough_soldier
					add_trait = lustful
					add_trait = immortal
					add_trait = kind
					add_trait = honest
					add_trait = brawny
					add_trait = brave
					add_trait = sea_queen
					add_trait = hunter
					historical = yes

					attributes = {
						martial = 15
						diplomacy = 8
						stewardship = 8
						intrigue = 10
						learning = 12
					}
				}
			}

			immortal_rival_horse = {
				create_character = {
					random_traits = no
					name = "Incitatus"
					dynasty = none
					religion = roman_pagan
					culture = horse
					female = no
					age = 2200
					immortal_age = 20
					health = 6
					fertility = 0.8
					add_trait = elusive_shadow
					add_trait = genius
					add_trait = attractive
					add_trait = patient
					add_trait = immortal
					add_trait = cruel
					add_trait = wroth
					add_trait = strong
					add_trait = brawny
					add_trait = stubborn
					add_trait = master_schemer
					add_trait = cynical
					add_trait = ares_own
					add_trait = horse
					historical = yes

					attributes = {
						martial = 8
						diplomacy = 18
						stewardship = 12
						intrigue = 18
						learning = 16
					}
				}
			}
		}

		new_character = {
			add_rival = ROOT
			diplomatic_immunity = yes
			save_event_target_as = immortal_rival
		}

		if = {
			limit = { has_character_flag = immortal_rival_horse }

			if = { # Horse councillor?
				limit = {
					any_voter = { culture = horse }
				}

				random_voter = {
					limit = { culture = horse }

					save_event_target_as = immortal_horse_victim

					death = {
						death_reason = death_execution_horses
						killer = event_target:immortal_rival
					}
				}
			}
			else_if = { # Any horse?
				limit = {
					any_courtier = { culture = horse }
				}

				random_courtier = {
					limit = { culture = horse }

					save_event_target_as = immortal_horse_victim

					death = {
						death_reason = death_execution_horses
						killer = event_target:immortal_rival
					}
				}
			}
			else = { # Backup victim
				set_character_flag = no_horse_victim

				random_courtier = {
					limit = {
						OR = {
							has_job_title = yes
							is_close_relative = ROOT
							is_consort = ROOT
							is_married = ROOT
						}
					}

					save_event_target_as = immortal_horse_victim

					death = {
						death_reason = death_execution_horses
						killer = event_target:immortal_rival
					}
				}
			}
		}
	}

	desc = {
		text = RIP.30301.d.highlander
		trigger = { has_character_flag = immortal_rival_highlander }
	}
	desc = {
		text = RIP.30301.d.evildude
		trigger = { has_character_flag = immortal_rival_evildude }
	}
	desc = {
		text = RIP.30301.d.goodguy
		trigger = { has_character_flag = immortal_rival_goodguy }
	}
	desc = {
		text = RIP.30301.d.shieldmaiden
		trigger = { has_character_flag = immortal_rival_shieldmaiden }
	}
	desc = {
		text = RIP.30301.d.horse
		trigger = {
			has_character_flag = immortal_rival_horse
			has_character_flag = no_horse_victim
			any_courtier = { culture = horse }
		}
	}
	desc = {
		text = RIP.30301.d.horse2
		trigger = {
			has_character_flag = immortal_rival_horse
			NOT = { has_character_flag = no_horse_victim }
		}
	}

	option = { # Fight. berserker and craven get the same option with custom text
		name = RIP.30301.fight

		trigger = {
			health >= 2
			is_incapable = no

			NOR = {
				trait = severely_injured
				trait = infirm
				trait = craven
				trait = berserker
			}
		}

		add_blood_splatter_effect = yes

		if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_great # Tooltip reuse FTW

				random_list = {
					84 = { long_character_event = { id = RIP.30302 } } # Win, no wound
					10 = { long_character_event = { id = RIP.30303 } } # Win, wound
					 5 = { long_character_event = { id = RIP.30304 } } # Win, maimed
					 1 = { long_character_event = { id = RIP.30305 } } # Lose
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_good

				random_list = {
					70 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					10 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_good

				random_list = {
					60 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_even

				random_list = {
					20 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					40 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_poor

				random_list = {
					 5 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					60 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_poor

				random_list = {
					 1 = { long_character_event = { id = RIP.30302 } }
					 4 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					80 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else = {
			custom_tooltip = {
				text = holmgang_chances_terrible

				random_list = {
					 1 = { long_character_event = { id = RIP.30303 } }
					 9 = { long_character_event = { id = RIP.30304 } }
					90 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
	}

	option = { # Fight. berserker
		name = RIP.30301.berserkfight
		tooltip_info = berserker

		add_blood_splatter_effect = yes

		trigger = {
			trait = berserker
			health >= 2
			is_incapable = no

			NOR = {
				trait = severely_injured
				trait = infirm
				trait = craven
			}
		}

		custom_tooltip = { text = RIP.30301.tt.berserker }

		if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_great # Tooltip reuse FTW

				random_list = {
					84 = { long_character_event = { id = RIP.30302 } }
					10 = { long_character_event = { id = RIP.30303 } }
					 5 = { long_character_event = { id = RIP.30304 } }
					 1 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_good

				random_list = {
					70 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					10 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_good

				random_list = {
					60 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_even

				random_list = {
					20 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					40 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_poor

				random_list = {
					 5 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					60 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_poor

				random_list = {
					 1 = { long_character_event = { id = RIP.30302 } }
					 4 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					80 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else = {
			custom_tooltip = {
				text = holmgang_chances_terrible

				random_list = {
					 1 = { long_character_event = { id = RIP.30303 } }
					 9 = { long_character_event = { id = RIP.30304 } }
					90 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
	}

	option = { # Fight. craven.
		name = RIP.30301.fight

		trigger = {
			trait = craven
			health >= 2
			is_incapable = no

			NOR = {
				trait = severely_injured
				trait = infirm
				trait = berserker
			}
		}

		add_blood_splatter_effect = yes

		if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_great # Tooltip reuse FTW

				random_list = {
					84 = { long_character_event = { id = RIP.30302 } }
					10 = { long_character_event = { id = RIP.30303 } }
					 5 = { long_character_event = { id = RIP.30304 } }
					 1 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_good

				random_list = {
					70 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					10 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= 10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_good

				random_list = {
					60 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					 5 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -10
				}
			}

			custom_tooltip = {
				text = holmgang_chances_even

				random_list = {
					20 = { long_character_event = { id = RIP.30302 } }
					20 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					40 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -30
				}
			}

			custom_tooltip = {
				text = holmgang_chances_poor

				random_list = {
					 5 = { long_character_event = { id = RIP.30302 } }
					15 = { long_character_event = { id = RIP.30303 } }
					20 = { long_character_event = { id = RIP.30304 } }
					60 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else_if = {
			limit = {
				combat_rating_diff = {
					who = event_target:immortal_rival
					value >= -50
				}
			}

			custom_tooltip = {
				text = holmgang_chances_very_poor

				random_list = {
					 1 = { long_character_event = { id = RIP.30302 } }
					 4 = { long_character_event = { id = RIP.30303 } }
					15 = { long_character_event = { id = RIP.30304 } }
					80 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
		else = {
			custom_tooltip = {
				text = holmgang_chances_terrible

				random_list = {
					 1 = { long_character_event = { id = RIP.30303 } }
					 9 = { long_character_event = { id = RIP.30304 } }
					90 = { long_character_event = { id = RIP.30305 } }
				}
			}
		}
	}

	option = { # Die
		name = RIP.30301.die

		custom_tooltip = { text = RIP.30301.die.tooltip }

		death = {
			death_reason = death_duel
			killer = event_target:immortal_rival
		}
	}

	option = { # Persuade
		name = RIP.30301.persuade
		tooltip_info = diplomacy

		trigger = {
			diplomacy >= 18
			is_incapable = no

			OR = {
				calc_true_if = {
					amount < 2

					intrigue >= 18
					stewardship >= 18
					learning >= 18
				}

				has_education_diplomacy_trigger = yes
				has_lifestyle_diplomacy_trigger = yes
			}
		}

		character_event = { id = RIP.30309 }
	}

	option = { # Trick
		name = RIP.30301.trick
		tooltip_info = intrigue

		trigger = {
			intrigue >= 18
			is_incapable = no

			OR = {
				calc_true_if = {
					amount < 2

					diplomacy >= 18
					stewardship >= 18
					learning >= 18
				}

				has_education_intrigue_trigger = yes
				has_lifestyle_intrigue_trigger = yes
			}
		}

		character_event = { id = RIP.30310 }
	}

	option = { # Money power
		name = EVTOPTBLoR.410 # Guards!
		tooltip_info = stewardship

		trigger = {
			stewardship >= 18
			is_incapable = no

			OR = {
				calc_true_if = {
					amount < 2

					diplomacy >= 18
					intrigue >= 18
					learning >= 18
				}

				has_education_stewardship_trigger = yes
				has_lifestyle_stewardship_trigger = yes
			}
		}

		character_event = { id = RIP.30311 }
	}

	option = { # Debate
		name = RIP.30301.debate
		tooltip_info = learning

		trigger = {
			learning >= 18
			is_incapable = no

			OR = {
				calc_true_if = {
					amount < 2

					diplomacy >= 18
					intrigue >= 18
					stewardship >= 18
				}

				has_education_learning_trigger = yes
				has_lifestyle_learning_trigger = yes
				is_learned_trigger = yes
			}
		}

		character_event = { id = RIP.30312 }
	}

	after = {
		clr_character_flag = immortal_rival_highlander
		clr_character_flag = immortal_rival_evildude
		clr_character_flag = immortal_rival_goodguy
		clr_character_flag = immortal_rival_shieldmaiden
		clr_character_flag = immortal_rival_horse
		clr_character_flag = no_horse_victim
	}
}

long_character_event = { # win - no wound
	id = RIP.30302
	picture = GFX_evt_melee
	border = GFX_event_long_frame_war

	desc = {
		text = RIP.30302.d
		trigger = {
			NOR = {
				trait = berserker
				trait = craven
			}
		}
	}
	desc = {
		text = RIP.30302.d.berserker
		trigger = { trait = berserker }

	}
	desc = {
		text = RIP.30302.d.craven
		trigger = { trait = craven }
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30302.a

		trigger = {
			NOR = {
				trait = berserker
				trait = craven
			}
		}

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}
	}

	option = {
		name = RIP.30302.b

		trigger = { trait = craven }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}

	option = {
		name = RIP.30302.c

		trigger = { trait = berserker }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}
}

long_character_event = { # win - wound
	id = RIP.30303
	picture = GFX_evt_melee
	border = GFX_event_long_frame_war

	desc = {
		text = RIP.30303.d
		trigger = {
			NOR = {
				trait = berserker
				trait = craven
			}
		}
	}
	desc = {
		text = RIP.30302.d.berserker
		trigger = { trait = berserker }
	}
	desc = {
		text = RIP.30302.d.craven
		trigger = { trait = craven }
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30303.a

		trigger = {
			NOR = {
				trait = berserker
				trait = craven
			}
		}

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		add_trait_silently_wounded_effect = yes
	}

	option = {
		name = RIP.30303.b

		trigger = { trait = craven }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		add_trait_silently_wounded_effect = yes

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}

	option = {
		name = RIP.30303.c

		trigger = { trait = berserker }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		add_trait_silently_wounded_effect = yes

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}
}

long_character_event = { # win - maimed
	id = RIP.30304
	picture = GFX_evt_melee
	border = GFX_event_long_frame_war

	desc = {
		text = RIP.30304.d
		trigger = {
			NOR = {
				trait = berserker
				trait = craven
			}
		}
	}
	desc = {
		text = RIP.30302.d.berserker
		trigger = { trait = berserker }
	}
	desc = {
		text = RIP.30302.d.craven
		trigger = { trait = craven }
	}

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30304.a

		trigger = {
			NOR = {
				trait = craven
				trait = berserker
			}
		}

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		if = {
			limit = { can_be_maimed_trigger = yes }
			add_maimed_trait_effect = yes
		}
		else = {
			add_trait_silently_wounded_effect = yes
		}
	}

	option = {
		name = RIP.30303.b

		trigger = { trait = craven }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		if = {
			limit = { can_be_maimed_trigger = yes }
			add_maimed_trait_effect = yes
		}
		else = {
			add_trait_silently_wounded_effect = yes
		}

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}

	option = {
		name = RIP.30303.c

		trigger = { trait = berserker }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_duel
				killer = ROOT
			}
		}

		if = {
			limit = { can_be_maimed_trigger = yes }

			add_maimed_trait_effect = yes
		}
		else = {
			add_trait_silently_wounded_effect = yes
		}

		custom_tooltip = { text = RIP.30303.clothes.tooltip }
	}
}

long_character_event = { # loss - death
	id = RIP.30305
	desc = RIP.30305.d
	picture = GFX_evt_melee
	border = GFX_event_long_frame_war

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30305.a

		long_character_event = { id = RIP.30306 }
	}
}

long_character_event = { # loss - death2
	id = RIP.30306
	desc = RIP.30306.d
	picture = GFX_evt_beheading
	border = GFX_event_long_frame_war

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30306.a

		death = {
			death_reason = death_duel
			killer = event_target:immortal_rival
		}

		hidden_effect = {
			event_target:immortal_rival = {
				leave_court_and_die_effect = yes
			}
		}
	}
}

# character_event = { # loss - mercy
#	id = RIP.30307
#	desc = RIP.30307.d
#	picture = GFX_evt_suspicious_noble
#	border = GFX_event_normal_frame_war
#
#	is_triggered_only = yes
#
#	option = {
#		name = RIP.30307.a
#	}
# }

character_event = {
	id = RIP.30309
	desc = RIP.30309.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_diplomacy

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30309.a

		add_friend = event_target:immortal_rival
	}

	option = {
		name = RIP.30309.b

		trigger = {
			NOT = { trait = honest }
		}

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_murder_butchered
				killer = ROOT
			}
		}
	}
}

character_event = { # trick
	id = RIP.30310
	desc = RIP.30310.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30310.a

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_execution_crushing
				killer = ROOT
			}
		}
	}

	option = {
		name = RIP.30310.b
		tooltip_info = stewardship

		trigger = { stewardship >= 14 }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_missing
				killer = ROOT
			}
		}

		capital_scope = {
			show_scope_change = no

			add_province_modifier = {
				name = trapped_immortal
				duration = -1
			}
		}
	}
}

character_event = { # The power of money
	id = RIP.30311
	desc = RIP.30311.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30311.a # prison

		reverse_imprison = event_target:immortal_rival
	}

	option = {
		name = RIP.30311.e # platypus
		tooltip_info = hunter

		trigger = {
			OR = {
				trait = lunatic
				trait = possessed
				trait = hunter
			}
		}

		custom_tooltip = { text = immortal_hunter_tooltip }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_platypus
				killer = ROOT
			}
		}
	}

	option = {
		name = RIP.30311.b # burn

		trigger = {
			NOT = { trait = kind }
		}

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_execution_burning
				killer = ROOT
			}
		}
	}

	option = {
		name = RIP.30310.b # work
		tooltip_info = stewardship

		trigger = { stewardship >= 14 }

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_missing
				killer = ROOT
			}
		}

		capital_scope = {
			show_scope_change = no

			add_province_modifier = {
				name = trapped_immortal
				duration = -1
			}
		}
	}
}

character_event = { # Debate
	id = RIP.30312
	desc = RIP.30312.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30312.a # raise new arguments
	}

	option = {
		name = RIP.30312.b # refuse
	}

	after = {
		character_event = { id = RIP.30313 }
	}
}

character_event = { # Debate2
	id = RIP.30313
	desc = RIP.30313.d
	border = GFX_event_normal_frame_religion
	picture = GFX_evt_suspicious_noble

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30313.a # argue on
		character_event = { id = RIP.30314 }
	}

	option = {
		name = RIP.30313.b # kill

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_accident
				killer = ROOT
			}
		}
	}
}

character_event = { # Debate3
	id = RIP.30314
	desc = RIP.30314.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_religion

	is_triggered_only = yes
	hide_new = yes

	option = {
		name = RIP.30314.a

		event_target:immortal_rival = {
			show_scope_change = no

			death = {
				death_reason = death_missing
				killer = ROOT
			}
		}
	}
}

# character_event = { # spare event
# 	id = RIP.30400
# 	desc = RIP.30302.d
# 	picture = GFX_evt_suspicious_noble
# 	border = GFX_event_normal_frame_war
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = RIP.30302.a
# 	}
# }

character_event = { # Immortal suspicions
	id = RIP.30315
	desc = RIP.30315.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes # on_yearly_pulse, random_events

	min_age = 70
	only_playable = yes
	only_capable = yes

	trigger = {
		immortal = yes

		NOR = {
			has_character_flag = immortal_crisis
			has_character_flag = immortal_crisis_confirmed
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			age >= 100
		}

		mult_modifier = {
			factor = 2
			age >= 150
		}

		mult_modifier = {
			factor = 2
			age >= 200
		}

		mult_modifier = {
			factor = 2
			age >= 300
		}
	}

	immediate = {
		most_popular_vassal = {
			limit = {
				intrigue >= 12
				immortal = no
				prisoner = no
				ai = yes

				opinion = {
					who = ROOT
					value < 50
				}
			}

			save_event_target_as = immortal_suspector
		}
	}

	option = {
		name = EVTOPTA_CM_6000 # Sweet text reuse

		set_character_flag = immortal_crisis

		reverse_opinion = {
			name = immortal_suspicions
			who = event_target:immortal_suspector
			years = 100
		}
	}
}

character_event = { # clean up immortal crisis
	id = RIP.30316

	is_triggered_only = yes # on_yearly_pulse
	hide_window = yes

	only_playable = yes
	only_capable = yes

	trigger = {
		immortal = yes

		OR = {
			has_character_flag = immortal_crisis
			has_character_flag = immortal_crisis_confirmed
		}

		NOT = {
			any_vassal = {
				OR = {
					has_opinion_modifier = {
						name = immortal_hate
						who = ROOT
					}

					has_opinion_modifier = {
						name = immortal_suspicions
						who = ROOT
					}
				}
			}
		}
	}

	immediate = {
		clr_character_flag = immortal_crisis
		clr_character_flag = immortal_crisis_confirmed
	}
}

character_event = { # suspicions spread
	id = RIP.30317

	is_triggered_only = yes # on_yearly_pulse
	hide_window = yes

	has_character_flag = immortal_crisis
	only_playable = yes
	only_capable = yes

	trigger = {
		NOT = { has_character_flag = immortal_crisis_confirmed }

		any_vassal = {
			ai = yes
			immortal = no

			NOR = {
				has_opinion_modifier = { who = ROOT name = immortal_suspicions }
				has_opinion_modifier = { who = ROOT name = immortal_loyalty }
				has_opinion_modifier = { who = ROOT name = immortal_hate }
			}

			opinion = {
				who = ROOT
				value < 50
			}
		}
	}

	immediate = {
		random_vassal = {
			limit = {
				ai = yes
				immortal = no

				NOR = {
					has_opinion_modifier = { who = ROOT name = immortal_suspicions }
					has_opinion_modifier = { who = ROOT name = immortal_loyalty }
					has_opinion_modifier = { who = ROOT name = immortal_hate }
				}

				opinion = {
					who = ROOT
					value < 50
				}
			}

			random_list = {
				90 = {
					opinion = {
						name = immortal_suspicions
						who = ROOT
						years = 100
					}
				}

				10 = {
					opinion = {
						name = immortal_loyalty
						who = ROOT
						years = 100
					}
				}
			}
		}
	}
}

character_event = { # Suspicions are confirmed
	id = RIP.30318
	desc = RIP.30318.d
	picture = GFX_evt_suspicious_noble
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes # on_yearly_pulse, random_events

	min_age = 70
	has_character_flag = immortal_crisis
	only_playable = yes
	only_capable = yes

	trigger = {
		immortal = yes

		any_vassal = {
			has_opinion_modifier = {
				name = immortal_suspicions
				who = ROOT
			}

			intrigue >= 16
			ai = yes
			immortal = no
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			age >= 100
		}

		mult_modifier = {
			factor = 2
			age >= 150
		}

		mult_modifier = {
			factor = 2
			age >= 200
		}

		mult_modifier = {
			factor = 2
			age >= 300
		}
	}

	option = {
		name = CURSES

		set_character_flag = immortal_crisis_confirmed

		any_vassal = {
			show_scope_change = no

			limit = {
				has_opinion_modifier = {
					name = immortal_suspicions
					who = ROOT
				}
			}

			hidden_effect = {
				remove_opinion = {
					name = immortal_suspicions
					who = ROOT
				}
			}

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

		clr_character_flag = immortal_crisis
	}
}