###################################
#
# Regency Events: 61000 - 61999
#
###################################
# by Henrik Fhraeus
# and Henrik Eklund
###################################

# Regent embezzles money
character_event = {
	id = 61000
	desc = EVTDESC61000
	picture = GFX_evt_council
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no

		OR = {
			trait = greedy
			trait = deceitful
			trait = envious
			trait = arbitrary
			trait = ambitious
		}

		NOR = {
			trait = charitable
			trait = honest
			trait = just
		}

		liege = {
			wealth >= 20
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = greedy
		}

		mult_modifier = {
			factor = 1.33
			trait = deceitful
		}

		mult_modifier = {
			factor = 1.33
			trait = envious
		}

		mult_modifier = {
			factor = 1.33
			trait = arbitrary
		}

		mult_modifier = {
			factor = 0.5
			trait = kind
		}

		mult_modifier = {
			factor = 0.5
			trait = just
		}
	}

	option = {
		name = EVTOPTA61000 # Embezzle

		transfer_scaled_wealth = {
			from = liege
			value = 1
			min = 20
			max = 20
		}

		random_list = {
			50 = {
				mult_modifier = {
					factor = 2.0
					has_job_title = job_treasurer
				}
				# Got away with it!
			}

			40 = {
				liege = {
					show_scope_change = no

					character_event = {
						id = 61001 # Liege suspects
						days = 4
						tooltip = EVTTOOLTIP61001
					}
				}

				if = {
					limit = {
						NOT = { has_job_title = job_treasurer }
					}

					liege = {
						show_scope_change = no

						job_treasurer = {
							show_scope_change = no

							character_event = {
								id = 61002 # The Steward suspects
								days = 4
								tooltip = EVTTOOLTIP61002
							}
						}
					}
				}
			}

			10 = {
				liege = {
					show_scope_change = no

					character_event = {
						id = 61003 # Liege has proof
						days = 4
						tooltip = EVTTOOLTIP61003
					}
				}

				if = {
					limit = {
						NOT = { has_job_title = job_treasurer }
					}

					liege = {
						show_scope_change = no

						job_treasurer = {
							show_scope_change = no

							character_event = {
								id = 61004 # The Steward has proof
								days = 4
								tooltip = EVTTOOLTIP61004
							}
						}
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTB61000 # I dare not!

		piety = 1

		ai_chance = { factor = 0 }
	}
}

# The liege suspects the embezzlement
character_event = {
	id = 61001
	desc = EVTDESC61001
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = {
		name = EVTOPTA61001 # But there is no proof...

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

# The steward suspects the embezzlement
character_event = {
	id = 61002
	desc = EVTDESC61002
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = {
		name = EVTOPTA61001 # But there is no proof...

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

# Liege has proof of embezzlement
character_event = {
	id = 61003
	desc = EVTDESC61003
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = {
		name = EVTOPTA61003 # Treachery!

		opinion = {
			name = opinion_dishonorable
			who = FROM
			years = 6
		}
	}
}

# Steward has proof of embezzlement
character_event = {
	id = 61004
	desc = EVTDESC61004
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = {
		name = EVTOPTA61003 # Treachery!

		opinion = {
			name = opinion_dishonorable
			who = FROM
			years = 6
		}
	}
}

### NEW REGENCY EVENTS ###

# Regency: Regent steals holding.
character_event = {
	id = 61100
	desc = EVTDESC61100
	picture = GFX_evt_lunatic

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no
		NOT = { trait = honest }

		OR = {
			is_feudal = yes
			is_tribal = yes
		}

		liege = {
			OR = {
				is_feudal = yes
				is_tribal = yes
			}

			OR = {
				demesne_size >= 5
				over_max_demesne_size >= 1
			}

			is_adult = yes
			is_incapable = yes

			any_demesne_title = {
				can_be_given_away = yes
				lower_real_tier_than = DUKE

				location = {
					is_capital = no
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = greedy
		}

		mult_modifier = {
			factor = 1.33
			trait = deceitful
		}

		mult_modifier = {
			factor = 2
			trait = envious
		}

		mult_modifier = {
			factor = 1.33
			trait = arbitrary
		}

		mult_modifier = {
			factor = 0.5
			trait = kind
		}

		mult_modifier = {
			factor = 0.5
			trait = just
		}

		# CK2Plus
		mult_modifier = {
			factor = 2
			trait = ambitious
		}

		mult_modifier = {
			factor = 2

			liege = {
				any_demesne_title = {
					claimed_by = ROOT
					can_be_given_away = yes
					lower_real_tier_than = DUKE

					location = {
						is_capital = no
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTA61100 # Grab holding

		liege = {
			show_scope_change = no

			character_event = {
				id = 61101
				tooltip = EVTTOOLTIP61101
			}
		}

		ai_chance = {
			factor = 90

			trigger = {
				OR = {
					trait = ambitious

					NOR = {
						trait = just
						trait = content
						trait = humble
						over_max_demesne_size >= 1
					}
				}
			}

			mult_modifier = {
				factor = 0.5

				trait = kind
				NOT = { trait = ambitious }
			}

			mult_modifier = {
				factor = 0.5

				trait = charitable
				NOT = { trait = ambitious }
			}
		}
	}

	option = {
		name = EVTOPTB61100 # Do not grab holding

		ai_chance = { factor = 10 }

		piety = 40
	}
}

# Regency: Ruler informed of holding loss
character_event = {
	id = 61101
	desc = EVTDESC61101
	picture = GFX_evt_lunatic

	is_triggered_only = yes

	option = {
		name = EVTOPTA61101

		random_demesne_title = {
			show_scope_change = no

			limit = {
				lower_real_tier_than = DUKE
				can_be_given_away = yes

				location = {
					is_capital = no
				}
			}

			preferred_limit = {
				claimed_by = FROM
			}

			preferred_limit = {
				tier = COUNT

				location = {
					any_neighbor_province = {
						owned_by = FROM
					}
				}
			}

			grant_title = FROM
		}
	}
}

# Regency: Regent gives Ruler's money to charity
character_event = {
	id = 61105
	desc = EVTDESC61105
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no

		OR = {
			trait = charitable
			trait = kind
			trait = zealous
		}

		liege = {
			is_incapable = yes
			wealth >= 50
			is_adult = yes
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = charitable
		}

		mult_modifier = {
			factor = 4
			trait = kind
		}

		mult_modifier = {
			factor = 1.33
			trait = just
		}

		mult_modifier = {
			factor = 0.5
			trait = cruel
		}

		mult_modifier = {
			factor = 0.5
			trait = greedy
		}
	}

	option = {
		name = EVTOPTA61105 # Give the money

		piety = 30

		liege = {
			show_scope_change = no

			character_event = {
				id = 61106
				tooltip = EVTTOOLTIP61106
			}
		}
	}

	option = {
		name = EVTOPTB61105 # Do not give the money

		piety = -30

		ai_chance = { factor = 0 }
	}
}

# Regency: Ruler is informed of Regent giving money to charity
character_event = {
	id = 61106
	desc = EVTDESC61106
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes

	option = {
		name = EVTOPTA61106

		scaled_wealth = -0.25
		piety = 60
	}
}

# Regency: Regent is a better administrator than you ever were
character_event = {
	id = 61110
	desc = EVTDESC61110
	picture = GFX_evt_lunatic
	border = GFX_event_normal_frame_economy

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_rulers = yes

	trigger = {
		is_incapable = yes

		any_courtier_or_vassal = {
			has_minor_title = title_regent
			stewardship >= 13

			attribute_diff = {
				character = ROOT
				attribute = stewardship
				value >= 6
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = diligent
		}

		mult_modifier = {
			factor = 0.5
			trait = greedy
		}
	}

	option = {
		name = EVTOPTA61110

		scaled_wealth = 0.25
	}
}

### REGENCY SERIES, OLD RULER HUMILIATED ###

# Regency: Regent humiliates Ruler
character_event = {
	id = 61120
	desc = EVTDESC61120
	picture = GFX_evt_lunatic

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no
		NOT = { has_character_flag = mean_regent }

		opinion = {
			who = liege
			value < -30
		}

		liege = {
			is_incapable = yes
			is_adult = yes
			is_inaccessible_trigger = no
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = cruel
		}

		mult_modifier = {
			factor = 2
			trait = envious
		}

		mult_modifier = {
			factor = 1.33
			trait = deceitful
		}

		mult_modifier = {
			factor = 2
			trait = greedy
		}

		mult_modifier = {
			factor = 0.5
			trait = kind
		}

		mult_modifier = {
			factor = 0.5
			trait = just
		}
	}

	option = {
		name = EVTOPTA61120

		set_character_flag = mean_regent
		save_event_target_as = mean_regent

		liege = {
			show_scope_change = no

			character_event = {
				id = 61121
				tooltip = EVTTOOLTIP61121
			}

			random_courtier = {
				show_scope_change = no

				limit = {
					opinion = {
						who = liege
						value < -25
					}
				}

				opinion = {
					name = opinion_approves
					who = ROOT
					years = 1
				}
			}
		}
	}

	option = {
		name = EVTOPTB61120

		piety = 30

		ai_chance = { factor = 0 }
	}
}

# Regency: Ruler is humiliated by Regent
character_event = {
	id = 61121
	desc = EVTDESC61121
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61121
	}

	option = {
		name = EVTOPTB61121
	}

	after = {
		add_character_modifier = {
			name = mod_ashamed
			years = 1
		}

		random_vassal = {
			limit = {
				trait = just

				opinion = {
					who = liege
					value >= 10
				}

				NOT = { character = event_target:mean_regent }
			}

			character_event = {
				id = 61122
				days = 14
			}
		}
	}
}

# Regency: Vassal upset at treatment of Ruler
character_event = {
	id = 61122
	desc = EVTDESC61122
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61122

		save_event_target_as = valiant_vassal

		liege = {
			show_scope_change = no

			character_event = {
				id = 61123
				tooltip = EVTTOOLTIP61123
			}
		}
	}

	option = {
		name = EVTOPTB61122

		piety = -40

		ai_chance = { factor = 0 }
	}
}

# Regency: Ruler approached by vassal
character_event = {
	id = 61123
	desc = EVTDESC61123
	picture = GFX_evt_emissary

	is_triggered_only = yes

	option = {
		name = EVTOPTA61123

		FROM = {
			show_scope_change = no

			character_event = {
				id = 61124
				days = 14
				tooltip = EVTTOOLTIP61124
			}
		}
	}

	option = {
		name = EVTOPTB61123

		reverse_opinion = {
			name = opinion_disappointed
			who = FROM
			years = 1
		}

		ai_chance = { factor = 0 }
	}
}

# Regency: Vassal gets approval, makes move
character_event = {
	id = 61124
	desc = EVTDESC61124
	picture = GFX_evt_council

	is_triggered_only = yes

	option = {
		name = EVTOPTA61124

		random_list = {
			60 = {
				character_event = {
					id = 61125
					tooltip = EVTTOOLTIP61125
				}
			}

			40 = {
				character_event = {
					id = 61127
					tooltip = EVTTOOLTIP61127
				}
			}
		}
	}

	option = {
		name = EVTOPTB61124

		random_list = {
			60 = {
				character_event = {
					id = 61126
					tooltip = EVTTOOLTIP61126
				}
			}

			40 = {
				character_event = {
					id = 61127
					tooltip = EVTTOOLTIP61127
				}
			}
		}
	}
}

# Regency: Vassal defeats Regent, becomes new Regent
character_event = {
	id = 61125
	desc = EVTDESC61125
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = EVTOPTA61125

		liege = {
			show_scope_change = no

			character_event = { id = 61131 }

			event_target:mean_regent = {
				show_scope_change = no

				character_event = {
					id = 61129
					tooltip = EVTTOOLTIP61129
				}
			}

			event_target:valiant_vassal = {
				show_scope_change = no

				give_minor_title = title_regent
				clear_event_target = valiant_vassal
			}
		}
	}
}

# Regency: Vassal defeats Regent, Regent loses title, goes to next in Regent succession
character_event = {
	id = 61126
	desc = EVTDESC61125
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = EVTOPTA61125

		liege = {
			show_scope_change = no

			character_event = {	id = 61131 }

			event_target:mean_regent = {
				show_scope_change = no

				character_event = {
					id = 61129
					tooltip = EVTTOOLTIP61129
				}
			}

			random_courtier_or_vassal = {
				show_scope_change = no

				limit = {
					is_adult = yes
					prisoner = no
					NOT = { has_minor_title = title_regent }
				}

				give_minor_title = title_regent
			}
		}
	}
}

# Regency: Vassal fails, is jailed
character_event = {
	id = 61127
	desc = EVTDESC61127
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	option = {
		name = EVTOPTA61127

		liege = {
			show_scope_change = no

			character_event = { id = 61130 }

			event_target:mean_regent = {
				show_scope_change = no

				character_event = { id = 61128 }
			}
		}
	}
}

# Regency: Regent successful in keeping title
character_event = {
	id = 61128
	desc = EVTDESC61128
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA61128

		clr_character_flag = mean_regent

		liege = {
			show_scope_change = no

			reverse_imprison = event_target:valiant_vassal
		}
	}
}

# Regency: Regent is jailed
character_event = {
	id = 61129
	desc = EVTDESC61129
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	option = {
		name = EVTOPTA61129

		imprison = yes
		clr_character_flag = mean_regent
	}
}

# Regency: Ruler informed of failure to replace Regent
character_event = {
	id = 61130
	desc = EVTDESC61130
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61130
	}

	option = {
		name = EVTOPTB61130
	}

	after = {
		prestige = -50
	}
}

# Regency: Ruler informed of success in replacing Regent
character_event = {
	id = 61131
	desc = EVTDESC61131
	picture = GFX_evt_emissary

	is_triggered_only = yes

	option = {
		name = EVTOPTA61131
	}

	option = {
		name = EVTOPTB61131
	}

	after = {
		prestige = 50
	}
}

# Regency: Ruler, if child, kills Regent
character_event = {
	id = 61135
	desc = EVTDESC61135
	picture = GFX_evt_child_sword

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	only_rulers = yes
	min_age = 4
	max_age = 15
	only_capable = yes
	prisoner = no

	trigger = {
		has_regent = yes
		is_nomadic = no

		NOT = {
			trait = kind
			trait = just
			has_character_flag = pushed_regent
		}

		any_courtier = {
			has_minor_title = title_regent
			ai = yes
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = cruel
		}

		mult_modifier = {
			factor = 2
			trait = wroth
		}

		mult_modifier = {
			factor = 1.33
			trait = arbitrary
		}

		mult_modifier = {
			factor = 0.5
			trait = kind
		}

		mult_modifier = {
			factor = 0.5
			trait = just
		}
	}

	immediate = {
		set_character_flag = pushed_regent
	}

	option = {
		name = EVTOPTA61135

		random_list = {
			50 = {
				random_courtier_or_vassal = {
					show_scope_change = no

					limit = {
						OR = {
							has_minor_title = title_regent
							has_minor_title = title_appointed_regent
						}
					}

					death = {
						death_reason = death_murder_unknown_fall
						killer = ROOT
					}
				}
			}

			50 = {
				random_courtier_or_vassal = {
					show_scope_change = no

					limit = {
						OR = {
							has_minor_title = title_regent
							has_minor_title = title_appointed_regent
						}
					}

					add_trait_wounded_effect = yes

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

		ai_chance = { factor = 20 }
	}

	option = {
		name = EVTOPTB61135

		piety = 30

		ai_chance = {
			factor = 80

			mult_modifier = {
				factor = 0.25
				trait = cruel
			}
		}
	}
}

### REGENCY SERIES, YOUNG RULER DECLARED INSANE ###

# Regency: Regent attempts to declare ruler insane when he's not
character_event = {
	id = 61140
	desc = EVTDESC61140
	picture = GFX_evt_child_play

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no
		diplomacy >= 10
		intrigue >= 10

		opinion = {
			who = liege
			value < -15
		}

		liege = {
			is_adult = no
			practical_age >= 5
			NOT = { trait = lunatic }
		}

		OR = {
			trait = envious
			trait = deceitful
			trait = ambitious
			trait = greedy
		}

		NOR = {
			trait = kind
			trait = just
			trait = content
			has_character_flag = declared_ruler_insane
			has_minor_title = title_ruler_consort
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = envious
		}

		mult_modifier = {
			factor = 1.33
			trait = deceitful
		}

		mult_modifier = {
			factor = 2
			trait = ambitious
		}

		mult_modifier = {
			factor = 1.33
			trait = greedy
		}

		mult_modifier = {
			factor = 0.5
			trait = kind
		}

		mult_modifier = {
			factor = 0.5
			trait = humble
		}
	}

	immediate = {
		set_character_flag = declared_ruler_insane

		save_persistent_event_target = {
			name = ruler_declared_insane
			scope = liege
		}
	}

	option = {
		name = EVTOPTA61140

		random_list = {
			35 = {
				character_event = {
					id = 61145
					tooltip = EVTTOOLTIP61145
				}

				liege = {
					character_event = {	id = 61151 }
				}
			}

			65 = {
				character_event = {
					id = 61146
					tooltip = EVTTOOLTIP61146
				}

				liege = {
					character_event = {	id = 61150 }
				}
			}
		}
	}

	option = {
		name = EVTOPTB61140

		piety = 30

		ai_chance = { factor = 0 }
	}
}

# Regency: Regent attempts to declare ruler insane
character_event = {
	id = 61141
	desc = EVTDESC61141
	picture = GFX_evt_child_play

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no

		NOR = {
			trait = lunatic
			has_character_flag = declared_ruler_insane
		}

		liege = {
			is_adult = no
			practical_age >= 5
			trait = lunatic
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = just
		}

		mult_modifier = {
			factor = 4
			trait = diligent
		}

		mult_modifier = {
			factor = 1.33
			trait = honest
		}

		mult_modifier = {
			factor = 0.5
			trait = slothful
		}

		mult_modifier = {
			factor = 0.5
			trait = shy
		}
	}

	immediate = {
		set_character_flag = declared_ruler_insane
	}

	option = {
		name = EVTOPTA61141

		random_list = {
			35 = {
				character_event = {
					id = 61142
					tooltip = EVTTOOLTIP61145
				}

				liege = {
					character_event = { id = 61151 }
				}
			}

			65 = {
				character_event = {
					id = 61146
					tooltip = EVTTOOLTIP61146
				}

				liege = {
					character_event = { id = 61150 }
				}
			}
		}
	}

	option = {
		name = EVTOPTB61141

		reverse_opinion = {
			name = opinion_defended_me
			who = liege
			years = 4
		}

		ai_chance = { factor = 0 }
	}
}

# Regency: The insane ruler is imprisoned
character_event = {
	id = 61142
	desc = EVTDESC61142
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	option = {
		name = EVTOPTA61142

		liege = {
			show_scope_change = no

			add_trait = incapable

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

# Regency: The non-insane ruler is imprisoned
character_event = {
	id = 61145
	desc = EVTDESC61145
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	option = {
		name = EVTOPTA61145

		liege = {
			show_scope_change = no

			add_trait = incapable

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

		character_event = {
			id = 61155
			days = 5500
		}
	}
}

# Regency: Regent informed attempt to have ruler declared insane fails
character_event = {
	id = 61146
	desc = EVTDESC61146
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = {
			text = EVTOPTA61146
			trigger = {
				liege = {
					NOT = { trait = lunatic }
				}
			}
		}
		name = {
			text = EVTOPTB61146
			trigger = {
				liege = { trait = lunatic }
			}
		}

		reverse_opinion = {
			name = scheming_bastard
			who = liege
			years = 30
		}
	}
}

# Regency: Ruler informed attempt to have ruler declared insane fails
character_event = {
	id = 61150
	desc = EVTDESC61150
	picture = GFX_evt_shadowy_cabal

	is_triggered_only = yes

	option = {
		name = EVTOPTA61150
	}

	option = {
		name = EVTOPTB61150
		tooltip_info = lunatic

		trigger = { trait = lunatic }
	}

	after = {
		prestige = 30
	}
}

# Regency: Ruler informed he has been declared insane.
character_event = {
	id = 61151
	desc = EVTDESC61151
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	immediate = {
		set_character_flag = imprisoned_by_regent
	}

	option = {
		name = EVTOPTA61151
	}

	option = {
		name = EVTOPTB61151
		tooltip_info = lunatic

		trigger = { trait = lunatic }
	}

	after = {
		prestige = -30
	}
}

# Regency: Regent replaced, Ruler is set free
character_event = {
	id = 61152
	desc = EVTDESC61152
	picture = GFX_evt_emissary

	is_triggered_only = yes # title_regent, lose/retire/death_effect

	only_playable = yes
	has_character_flag = imprisoned_by_regent

	trigger = {
		has_regent = yes

		any_courtier_or_vassal = {
			has_minor_title = title_regent
			NOT = { has_character_flag = declared_ruler_insane }
		}
	}

	immediate = {
		clr_character_flag = imprisoned_by_regent
	}

	option = {
		name = EVTOPTA61152
	}

	option = {
		name = EVTOPTB61152
		tooltip_info = lunatic

		trigger = { trait = lunatic }
	}

	after = {
		remove_trait = incapable
		remove_character_modifier = house_arrest

		any_courtier_or_vassal = {
			limit = { has_character_flag = declared_ruler_insane }
			clr_character_flag = declared_ruler_insane
			clear_persistent_event_target = ruler_declared_insane
		}
	}
}

# Regency: Regent has opportunity to steal throne
character_event = {
	id = 61155
	desc = EVTDESC61155
	picture = GFX_evt_shadowy_cabal

	is_triggered_only = yes

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent
		independent = no

		liege = {
			has_character_flag = imprisoned_by_regent
		}
	}

	option = {
		name = EVTOPTA61155

		random_list = {
			40 = {
				character_event = {
					id = 61156
					tooltip = EVTTOOLTIP61156
				}
			}

			60 = {
				character_event = {
					id = 61157
					tooltip = EVTTOOLTIP61157
				}
			}
		}

		ai_chance = { factor = 0 }
	}

	option = {
		name = EVTOPTB61155
	}

	option = {
		name = EVTOPTC61155

		liege = {
			show_scope_change = no

			remove_trait = incapable
			remove_character_modifier = house_arrest
			clr_character_flag = imprisoned_by_regent
		}

		ai_chance = { factor = 0 }
	}
}

# Regency: Regent informed he has stolen throne
character_event = {
	id = 61156
	desc = EVTDESC61156
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61156

		liege = {
			show_scope_change = no

			character_event = {
				id = 61161
				tooltip = EVTTOOLTIP61161
			}
		}
	}
}

# Regency: Regent informed he failed to steal throne
character_event = {
	id = 61157
	desc = EVTDESC61157
	picture = GFX_evt_scandal

	is_triggered_only = yes

	option = {
		name = EVTOPTA61157

		liege = {
			show_scope_change = no

			character_event = {
				id = 61160
				tooltip = EVTTOOLTIP61160
			}
		}
	}
}

# Regency: Ruler informed Regent failed to steal throne
character_event = {
	id = 61160
	desc = EVTDESC61160
	picture = GFX_evt_recovery

	is_triggered_only = yes

	option = {
		name = EVTOPTA61160

		remove_trait = incapable
		remove_character_modifier = house_arrest
		clr_character_flag = imprisoned_by_regent
	}
}

# Regency: Ruler informed Regent stole throne
character_event = {
	id = 61161
	desc = EVTDESC61161
	picture = GFX_evt_drunk

	is_triggered_only = yes

	option = {
		name = EVTOPTA61161

		random_courtier_or_vassal = {
			show_scope_change = no

			limit = { has_minor_title = title_regent }

			inherit = ROOT
		}

		clr_character_flag = imprisoned_by_regent
		remove_character_modifier = house_arrest
		imprison = FROM
	}
}

# Regency: Ruler escapes from tower
character_event = {
	id = 61165
	desc = EVTDESC61165
	picture = GFX_evt_emissary

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	only_playable = yes
	has_character_flag = imprisoned_by_regent
	min_age = 16
	only_capable = no

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 7
			trait = genius
		}

		mult_modifier = {
			factor = 4
			trait = brave
		}

		mult_modifier = {
			factor = 2
			trait = diligent
		}

		mult_modifier = {
			factor = 2
			trait = ambitious
		}

		mult_modifier = {
			factor = 0.5
			trait = slothful
		}

		mult_modifier = {
			factor = 0.5
			trait = craven
		}

		mult_modifier = {
			factor = 0.33

			OR = {
				trait = slow
				trait = dull
			}
		}

		mult_modifier = {
			factor = 0.2
			trait = imbecile
		}

		# CK2Plus
		mult_modifier = {
			factor = 3

			OR = {
				trait = quick
				trait = shrewd
			}
		}
	}

	option = {
		name = EVTOPTA61165

		remove_trait = incapable
		remove_character_modifier = house_arrest
		clr_character_flag = imprisoned_by_regent

		random_courtier_or_vassal = {
			show_scope_change = no

			limit = { has_minor_title = title_regent }

			imprison = yes
			character_event = { id = 61170 }
		}
	}

	option = {
		name = EVTOPTB61165
		tooltip_info = lunatic

		trigger = { trait = lunatic }

		character_event = {
			id = 61166
			tooltip = EVTTOOLTIP61166
		}
	}
}

# Regency: Ruler escorted back to tower
character_event = {
	id = 61166
	desc = EVTDESC61166
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	option = {
		name = EVTOPTA61166

		random = {
			chance = 50
			add_trait_possessed_effect = yes
		}
	}
}

# Regency: Regent informed Ruler is reinstated after escaping
character_event = {
	id = 61170
	desc = EVTDESC61170
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	option = {
		name = EVTOPTA61170

		imprison = yes
	}
}

### REGENCY SERIES, REGENT TRIES TO KILL YOUNG RULER ###

## Regent sends Ruler to scrub roof
character_event = {
	id = 61190
	desc = EVTDESC61190
	picture = GFX_evt_castle_construction

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		has_minor_title = title_regent

		liege = {
			is_adult = no
			practical_age >= 5

			NOR = {
				is_child_of = ROOT
				is_parent_of = ROOT
				is_married = ROOT
			}

			any_demesne_title = {
				current_heir = {
					character = ROOT
					is_child_of = ROOT
				}
			}
		}

		opinion = {
			who = liege
			value < 0
		}

		NOR = {
			trait = kind
			trait = just
			trait = honest
			trait = content
			trait = patient
			has_character_flag = regent_schemer
			has_character_flag = no_regent_schemer
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 2
			trait = envious
		}

		mult_modifier = {
			factor = 1.33
			trait = deceitful
		}

		mult_modifier = {
			factor = 2
			trait = ambitious
		}

		mult_modifier = {
			factor = 0.5
			trait = slothful
		}

		mult_modifier = {
			factor = 0.5
			trait = craven
		}

		# CK2Plus
		mult_modifier = {
			factor = 0.5

			opinion = {
				who = liege
				value >= -25
			}
		}

		mult_modifier = {
			factor = 0.5

			opinion = {
				who = liege
				value >= -50
			}
		}

		mult_modifier = {
			factor = 2

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

	option = {
		name = EVTOPTA61190

		set_character_flag = regent_schemer
		save_event_target_as = regent_schemer

		liege = {
			show_scope_change = no

			character_event = {
				id = 61191
				tooltip = EVTTOOLTIP61191
			}
		}
	}

	option = {
		name = EVTOPTB61190

		piety = 20
		set_character_flag = no_regent_schemer

		ai_chance = { factor = 0 }
	}
}

## Ruler is sent to scrub roof
character_event = {
	id = 61191
	desc = EVTDESC61191
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	option = {
		name = EVTOPTA61191

		random_list = {
			80 = {
				character_event = {
					id = 61192
					tooltip = EVTTOOLTIP61192
				}
			}

			20 = {
				death = {
					death_reason = death_murder_unknown_fall
					killer = FROM
				}
			}
		}
	}
}

## Ruler scrubs roof successfully
character_event = {
	id = 61192
	desc = EVTDESC61192
	picture = GFX_evt_castle_construction

	is_triggered_only = yes

	option = {
		name = EVTOPTA61192

		piety = 20

		hidden_effect = {
			event_target:regent_schemer = {
				character_event = {
					id = 61195
					days = 18
					random = 10
				}
			}
		}
	}
}

## Regent sends Ruler into forest
character_event = {
	id = 61195
	desc = EVTDESC61195
	picture = GFX_evt_bandits

	is_triggered_only = yes

	trigger = {
		has_minor_title = title_regent
		vassal_of = FROM
	}

	option = {
		name = EVTOPTA61195

		liege = {
			show_scope_change = no

			character_event = {
				id = 61196
				tooltip = EVTTOOLTIP61191
			}
		}
	}

	option = {
		name = EVTOPTB61195

		clr_character_flag = regent_schemer
		piety = 20

		ai_chance = { factor = 0 }
	}
}

## Ruler is sent to forest
character_event = {
	id = 61196
	desc = EVTDESC61196
	picture = GFX_evt_bandits

	is_triggered_only = yes

	option = {
		name = EVTOPTA61196

		random_list = {
			80 = {
				character_event = {
					id = 61197
					tooltip = EVTTOOLTIP61197
				}
			}

			20 = {
				death = {
					death_reason = death_murder_unknown
					killer = FROM
				}
			}
		}
	}
}

## Ruler returns from forest
character_event = {
	id = 61197
	desc = EVTDESC61197
	picture = GFX_evt_bandits

	is_triggered_only = yes

	option = {
		name = EVTOPTA61197

		prestige = 20

		hidden_effect = {
			event_target:regent_schemer = {
				character_event = {
					id = 61200
					days = 18
					random = 10
				}
			}
		}
	}
}

## Regent sends Ruler away by carriage
character_event = {
	id = 61200
	desc = EVTDESC61200
	picture = GFX_evt_carriage

	is_triggered_only = yes

	trigger = {
		has_minor_title = title_regent
		vassal_of = FROM
	}

	option = {
		name = EVTOPTA61200

		liege = {
			show_scope_change = no

			character_event = {
				id = 61201
				tooltip = EVTTOOLTIP61191
			}
		}
	}

	option = {
		name = EVTOPTB61200

		clr_character_flag = regent_schemer
		piety = 20

		ai_chance = { factor = 0 }
	}
}

## Ruler is sent away on the carriage
character_event = {
	id = 61201
	desc = EVTDESC61201
	picture = GFX_evt_carriage

	is_triggered_only = yes

	option = {
		name = EVTOPTA61201

		random_list = {
			80 = {
				character_event = {
					id = 61202
					tooltip = EVTTOOLTIP61202
				}
			}

			20 = {
				death = {
					death_reason = death_murder_unknown_fall
					killer = FROM
				}
			}
		}
	}
}

## Ruler survives the carriage ride
character_event = {
	id = 61202
	desc = EVTDESC61202
	picture = GFX_evt_carriage

	is_triggered_only = yes

	option = {
		name = EVTOPTA61202

		prestige = 20

		hidden_effect = {
			event_target:regent_schemer = {
				character_event = {
					id = 61205
					days = 18
					random = 10
				}
			}
		}
	}
}

## Regent pushes guard on Ruler
character_event = {
	id = 61205
	desc = EVTDESC61205
	picture = GFX_evt_large_army

	is_triggered_only = yes

	trigger = {
		has_minor_title = title_regent
		vassal_of = FROM
	}

	option = {
		name = EVTOPTA61205

		liege = {
			show_scope_change = no

			character_event = {
				id = 61206
				tooltip = EVTTOOLTIP61191
			}
		}
	}

	option = {
		name = EVTOPTB61205

		clr_character_flag = regent_schemer
		piety = 20

		ai_chance = { factor = 0 }
	}
}

## Ruler has guard pushed on him
character_event = {
	id = 61206
	desc = EVTDESC61206
	picture = GFX_evt_large_army

	is_triggered_only = yes

	option = {
		name = EVTOPTA61206

		random_list = {
			80 = {
				character_event = {
					id = 61207
					tooltip = EVTTOOLTIP61207
				}
			}

			20 = {
				death = {
					death_reason = death_murder_unknown
					killer = FROM
				}
			}
		}
	}
}

## Ruler survives guard
character_event = {
	id = 61207
	desc = EVTDESC61207
	picture = GFX_evt_large_army

	is_triggered_only = yes

	option = {
		name = EVTOPTA61207

		hidden_effect = {
			event_target:regent_schemer = {
				character_event = {
					id = 61210
					days = 18
					random = 10
				}
			}
		}

		prestige = 20
	}
}

## Regent storms Ruler's room with dagger
character_event = {
	id = 61210
	desc = EVTDESC61210
	picture = GFX_evt_shadow

	is_triggered_only = yes

	trigger = {
		has_minor_title = title_regent
		vassal_of = FROM
	}

	option = {
		name = EVTOPTA61210

		liege = {
			show_scope_change = no

			character_event = {
				id = 61211
				tooltip = EVTTOOLTIP61211
			}
		}
	}

	option = {
		name = EVTOPTB61210

		clr_character_flag = regent_schemer
		piety = 20

		ai_chance = { factor = 0 }
	}
}

## Ruler is attacked by Regent
character_event = {
	id = 61211
	desc = EVTDESC61211
	picture = GFX_evt_shadow

	is_triggered_only = yes

	option = {
		name = EVTOPTA61211

		random_list = {
			80 = {
				character_event = {
					id = 61212
					tooltip = EVTTOOLTIP61212
				}
			}

			20 = {
				death = {
					death_reason = death_murder
					killer = FROM
				}
			}
		}
	}
}

## Ruler survives
character_event = {
	id = 61212
	desc = EVTDESC61212
	picture = GFX_evt_shadow

	is_triggered_only = yes

	option = {
		name = EVTOPTA61212

		random_courtier_or_vassal = {
			show_scope_change = no

			limit = {
				block_general_event_trigger = no
				NOT = { has_minor_title = title_regent }
			}

			preferred_limit = {
				intrigue >= 10
				trait = ambitious
				is_close_relative = ROOT

				OR = {
					trait = deceitful
					trait = master_schemer
					trait = elusive_shadow
				}
			}

			preferred_limit = {
				trait = ambitious
				is_close_relative = ROOT

				OR = {
					trait = deceitful
					trait = master_schemer
					trait = elusive_shadow
				}
			}

			preferred_limit = {
				intrigue >= 10
				trait = ambitious

				OR = {
					trait = deceitful
					trait = master_schemer
					trait = elusive_shadow
				}
			}

			preferred_limit = {
				intrigue >= 10

				OR = {
					trait = deceitful
					trait = master_schemer
					trait = elusive_shadow
				}
			}

			preferred_limit = {
				intrigue >= 10
				trait = ambitious
			}

			custom_tooltip = {
				text = EVTOPTA61212_TT

				give_minor_title = title_regent
			}
		}

		event_target:regent_schemer = {
			show_scope_change = no

			custom_tooltip = {
				text = EVTOPTA61212_B_TT

				character_event = { id = 61213 }
				clr_character_flag = regent_schemer
			}
		}
	}
}

## Regent is imprisoned
character_event = {
	id = 61213
	desc = EVTDESC61213
	picture = GFX_evt_into_the_dungeon

	is_triggered_only = yes

	immediate = {
		imprison = FROM
	}

	option = {
		name = EVTOPTA61213

		random = {
			chance = 80
			add_trait_lunatic_effect = yes
		}
	}
}

## REGENCY SERIES, COURTIER WANTS TO REPLACE REGENT ##

## Courtier thinks he/she would do a better job than current Regent
character_event = {
	id = 61215
	desc = EVTDESC61215
	picture = GFX_evt_emissary

	is_part_of_plot = yes
	min_age = 16
	prisoner = no
	only_capable = yes
	war = no

	trigger = {
		has_plot = plot_replace_regent
		is_plot_active = no
		plot_power >= 0.75
		is_ill = no
		intrigue >= 10
		in_command_trigger = no
		is_inaccessible_trigger = no

		liege = {
			has_regent = yes
			NOT = { has_character_flag = regent_replace_attempt }
		}

		plot_target_char = {
			same_liege = ROOT
			has_minor_title = title_regent
		}

		NOR = {
			has_minor_title = title_regent
			has_character_modifier = replace_regent_timer
		}
	}

	immediate = {
		liege = {
			random_courtier_or_vassal = {
				limit = { has_minor_title = title_regent }
				save_event_target_as = scoped_regent
			}
		}
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_flag = speed_up_replace_regent
		}

		mult_modifier = {
			factor = 3.0
			liege = { is_inaccessible_trigger = yes }
		}

		mult_modifier = {
			factor = 2.0

			liege = {
				is_adult = yes
				is_incapable = no
			}
		}

		mult_modifier = {
			factor = 1.5

			NOT = { is_close_relative = liege }
		}

		mult_modifier = {
			factor = 2.0

			OR = {
				war = yes
				liege = { war = yes }
			}
		}

		mult_modifier = {
			factor = 0.75
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.75
			plot_power >= 1.25
		}

		mult_modifier = {
			factor = 0.75
			plot_power >= 1.50
		}

		mult_modifier = {
			factor = 0.75
			plot_power >= 1.75
		}

		mult_modifier = {
			factor = 0.75
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.9
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.9
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.9
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.9
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 1.25
			intrigue < 2
		}

		mult_modifier = {
			factor = 1.25
			intrigue <= 4
		}

		mult_modifier = {
			factor = 1.25
			intrigue < 6
		}

		mult_modifier = {
			factor = 1.25
			intrigue < 8
		}

		mult_modifier = {
			factor = 0.9
			intrigue >= 12
		}

		mult_modifier = {
			factor = 0.9
			intrigue >= 14
		}

		mult_modifier = {
			factor = 0.9
			intrigue >= 16
		}

		mult_modifier = {
			factor = 0.9
			intrigue >= 18
		}

		mult_modifier = {
			factor = 0.9
			intrigue >= 20
		}
	}

	# option = { # Challenge to duel
	# 	name = EVTOPTA61215
	# 	tooltip_info = duelist
	#
	# 	trigger = { trait = duelist }
	#
	# 	ai_chance = { factor = 60 }
	#
	# 	custom_tooltip = {
	# 		text = EVTTOOLTIP61221
	#
	# 		# REQUIRED event targets for setting up duel evaluation!
	# 		save_event_target_as = combatant_1						# Person issuing the duel...
	# 		set_character_flag = flag_duel_no_draws					# Prevents duel from ending in a draw.
	# 		set_character_flag = flag_courtier_challenging_regent	# Needed for follow-up event in case of victory.
	#
	# 		event_target:scoped_regent = {
	# 			save_event_target_as = combatant_2					# The target of the duel...
	# 			set_character_flag = flag_duel_no_backsies			# Make the challenged party unable to decline the duel
	# 			set_character_flag = flag_duel_no_draws				# Prevents duel from ending in a draw
	# 		}
	# 	}
	#
	# 	pacifists_lose_piety_effect = yes
	#
	# 	add_character_modifier = {
	# 		name = recent_duel_timer
	# 		years = 1
	# 		hidden = yes
	# 	}
	#
	# 	show_portrait = event_target:scoped_regent
	#
	# 	event_target:combatant_2 = {
	# 		character_event = { id = HFP.10095 }
	# 	}
	#
	# 	# event_target:scoped_regent = {
	# 	#	show_scope_change = no
	# 	#
	# 	#	character_event = {
	# 	#		id = 61221
	# 	#		tooltip = EVTTOOLTIP61221
	# 	#		days = 2
	# 	#	}
	# 	# }
	# }

	option = { # Try to grab Regency
		name = EVTOPTB61215

		liege = {
			set_character_flag = regent_replace_attempt
		}

		activate_plot = yes

		event_target:scoped_regent = {
			show_scope_change = no

			character_event = {
				id = 61216
				tooltip = EVTTOOLTIP61216
			}
		}
	}

	option = { # Never mind
		name = EVTOPTC61215

		cancel_plot = yes

		reverse_opinion = {
			name = opinion_glad
			who = event_target:scoped_regent
			years = 2
		}

		ai_chance = { factor = 0 }
	}
}

## Regent is informed that Courtier is trying to plead case at court
character_event = {
	id = 61216
	desc = EVTDESC61216
	picture = GFX_evt_emissary

	is_triggered_only = yes

	# option = {
	# 	name = EVTOPTA61216
	# 	tooltip_info = duelist
	#
	# 	trigger = { trait = duelist }
	#
	# 	show_portrait = FROM
	# 	show_portrait = event_target:scoped_regent
	#
	# 	custom_tooltip = {
	# 		text = EVTTOOLTIP61221
	#
	# 		# REQUIRED event targets for setting up duel evaluation!
	# 		save_event_target_as = combatant_1			# The person issuing the duel...
	# 		set_character_flag = flag_duel_no_draws		# Prevents duel from ending in a draw.
	#
	# 		FROM = {
	# 			save_event_target_as = combatant_2 						# The target of the duel...
	# 			set_character_flag = flag_courtier_challenging_regent	# Needed for follow-up event in case of victory.
	# 			set_character_flag = flag_duel_no_backsies				# Make the challenged party unable to decline the duel.
	# 			set_character_flag = flag_duel_no_draws					# Prevents duel from ending in a draw.
	# 		}
	# 	}
	#
	# 	pacifists_lose_piety_effect = yes
	#
	# 	add_character_modifier = {
	# 		name = recent_duel_timer
	# 		years = 1
	# 		hidden = yes
	# 	}
	#
	# 	event_target:combatant_2 = {
	# 		character_event = { id = HFP.10095 }
	# 	}
	#
	# #	FROM = {
	# #		show_scope_change = no
	# #
	# #		character_event = {
	# #			id = 61222
	# #			tooltip = EVTTOOLTIP61221
	# #		}
	# #	}
	#
	# 	ai_chance = { factor = 80 }
	# }

	option = {
		name = EVTOPTB61216

		random_list = {
			50 = { # Remains Regent
				mult_modifier = {
					factor = 1.25
					liege = { is_close_relative = ROOT }
				}

				mult_modifier = {
					factor = 0.75
					liege = { is_close_relative = FROM }
				}

				mult_modifier = {
					factor = 0.8
					FROM = {
						OR = {
							trait = quick
							trait = shrewd
						}
					}
				}

				mult_modifier = {
					factor = 0.6
					FROM = { trait = genius }
				}

				mult_modifier = {
					factor = 1.2
					OR = {
						trait = quick
						trait = shrewd
					}
				}

				mult_modifier = {
					factor = 1.65
					trait = genius
				}

				mult_modifier = {
					factor = 0.8

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value <= 2
					}
				}

				mult_modifier = {
					factor = 0.8

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value <= 4
					}
				}

				mult_modifier = {
					factor = 0.8

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value <= 6
					}
				}

				mult_modifier = {
					factor = 0.8

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value <= 8
					}
				}

				mult_modifier = {
					factor = 0.8

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value <= 10
					}
				}

				mult_modifier = {
					factor = 1.2

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value >= 2
					}
				}

				mult_modifier = {
					factor = 1.2

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value >= 4
					}
				}

				mult_modifier = {
					factor = 1.2

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value >= 6
					}
				}

				mult_modifier = {
					factor = 1.2

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value >= 8
					}
				}

				mult_modifier = {
					factor = 1.2

					attribute_diff = {
						character = FROM
						attribute = intrigue
						value >= 10
					}
				}

				character_event = {
					id = 61219
					tooltip = EVTTOOLTIP61219
				}

				FROM = {
					character_event = { id = 61218 }
				}
			}

			50 = { # Loses Regency
				mult_modifier = {
					factor = 1.2
					FROM = { plot_power >= 1.0 }
				}

				mult_modifier = {
					factor = 1.2
					FROM = { plot_power >= 1.25 }
				}

				mult_modifier = {
					factor = 1.2
					FROM = { plot_power >= 1.5 }
				}

				mult_modifier = {
					factor = 1.2
					FROM = { plot_power >= 1.75 }
				}

				mult_modifier = {
					factor = 1.2
					FROM = { plot_power >= 2.0 }
				}

				character_event = {
					id = 61220
					tooltip = EVTTOOLTIP61220
				}

				FROM = {
					character_event = {	id = 61217 }
				}
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTC61216

		FROM = {
			show_scope_change = no

			character_event = {
				id = 61217
				tooltip = EVTTOOLTIP61217
			}
		}

		ai_chance = { factor = 0 }
	}
}

## Courtier informed he/she won the case and is now new regent
character_event = {
	id = 61217
	desc = EVTDESC61217
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61217

		give_minor_title = title_regent

		liege = {
			clr_character_flag = regent_replace_attempt
			character_event = { id = 61236 }
		}
	}
}

## Courtier informed he/she lost the case at court
character_event = {
	id = 61218
	desc = EVTDESC61218
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61218

		prestige = -40
		cancel_plot = yes

		reverse_opinion = {
			name = opinion_angry
			who = event_target:scoped_regent
			years = 3
		}
	}
}

## Regent informed he/she won the case and remains regent
character_event = {
	id = 61219
	desc = EVTDESC61219
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61219

		prestige = 40
	}
}

## Regent informed he/she lost the case and has been replaced
character_event = {
	id = 61220
	desc = EVTDESC61220
	picture = GFX_evt_throne_room

	is_triggered_only = yes

	option = {
		name = EVTOPTA61220

		prestige = -40

		add_character_modifier = {
			name = replace_regent_timer
			years = 5
			hidden = yes
		}
	}
}

## Regent informed courtier has challenged him to duel over regency
# character_event = {
# 	id = 61221
# 	desc = EVTDESC61221
# 	picture = GFX_evt_shadowy_cabal
#
# 	is_triggered_only = yes
#
# 	option = { # Accept
# 		name = EVTOPTA61221
#
# 		ai_chance = { factor = 80 }
#
# 		custom_tooltip = { text = EVTTOOLTIP61223 }
#
# 		FROM = {
#			# Obsolete
# 			# character_event = {
#			#	id = 61223
#			#	tooltip = EVTTOOLTIP61223
#			# }
#
# 			save_event_target_as = duelist_courtier
# 		}
# 	}
#
# 	option = { # Refuse
# 		name = EVTOPTB61221
#
# 		ai_chance = { factor = 0 }
#
# 		prestige = -60
#
# 		liege = {
#			show_scope_change = no
#
# 			any_courtier = {
#				show_scope_change = no
#
# 				opinion = {
# 					name = opinion_coward
# 					who = ROOT
# 					years = 1
# 				}
# 			}
# 		}
#
# 		FROM = {
# 			character_event = {	id = 61245 }
# 		}
# 	}
#
# 	option = { # Surrender regency
# 		name = EVTOPTC61221
#
# 		ai_chance = { factor = 20 }
#
# 		prestige = -20
#
# 		FROM = {
#			show_scope_change = no
#
#			give_minor_title = title_regent
# 			character_event = {	id = 61246 }
# 		}
# 	}
# }

## Courtier informed Regent challenges to duel
# character_event = {
# 	id = 61222
# 	desc = EVTDESC61222
# 	picture = GFX_evt_shadowy_cabal
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61222
#
# 		ai_chance = { factor = 100 }
#
# 		save_event_target_as = duelist_courtier
#
# 	#	event_target:scoped_regent = {
# 	#		show_scope_change = no
# 	#
# 	#		character_event = {
# 	#			id = 61224
# 	#			tooltip = EVTTOOLTIP61223
# 	#			days = 2
# 	#		}
# 	#	}
# 	}
#
# 	option = {
# 		name = EVTOPTB61222
#
# 		ai_chance = { factor = 0 }
#
# 		prestige = -40
# 	}
# }

## Courtier informed Regent accepts duel, they fight!
# character_event = {
# 	id = 61223
# 	desc = EVTDESC61223
# 	picture = GFX_evt_melee
#
# 	is_triggered_only = yes
#
#	option = {
#		name = EVTOPTA61224
#
#		ai_chance = { factor = 80 }
#
#		if = {
#		 	limit = { martial >= 15 }
#
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					10 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					10 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					40 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					40 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
#		else_if = {
#		 	limit = { martial >= 7 }
#
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
#		else = {
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					40 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61225
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					40 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61226
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					10 = {
#						character_event = {
#							id = 61228
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					10 = {
#						character_event = {
#							id = 61229
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
# 	}
#
# 	option = {
# 		name = EVTOPTB61223
#
# 		ai_chance = { factor = 20 }
#
# 		FROM = {
#			show_scope_change = no
#
# 			character_event = {
#				id = 61231
#				tooltip = EVTTOOLTIP61231
#			}
# 		}
# 	}
# }

## Regent informed courtier accepts duel, they fight!
# character_event = {
# 	id = 61224
# 	desc = EVTDESC61224
# 	picture = GFX_evt_melee
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61224
#
# 		ai_chance = { factor = 80 }
#
# 		if = {
# 		 	limit = { martial >= 15 }
#
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					10 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					10 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					40 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					40 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
# 		else_if = {
# 		 	limit = { martial >= 7 }
#
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					17 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					33 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
# 		else = {
#			if = {
#				limit = { FROM = { martial < 7 } }
#
#				random_list = {
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					25 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					25 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else_if = {
#				limit = { FROM = { martial < 15 } }
#
#				random_list = {
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					33 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					17 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#			else = {
#				random_list = {
#					40 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61228
#								tooltip = EVTTOOLTIP61225
#							}
#						}
#					}
#
#					40 = {
#						FROM = {
#							show_scope_change = no
#
#							character_event = {
#								id = 61229
#								tooltip = EVTTOOLTIP61226
#							}
#						}
#					}
#
#					10 = {
#						character_event = {
#							id = 61225
#							tooltip = EVTTOOLTIP61228
#						}
#					}
#
#					10 = {
#						character_event = {
#							id = 61226
#							tooltip = EVTTOOLTIP61229
#						}
#					}
#				}
#			}
#		}
# 	}
#
# 	option = {
# 		name = EVTOPTB61224
#
# 		ai_chance = { factor = 20 }
#
# 		FROM = {
#			show_scope_change = no
#
# 			character_event = {
#				id = 61231
#				tooltip = EVTTOOLTIP61231
#			}
# 		}
# 	}
# }

## Regent informed he wins.
# character_event = {
# 	id = 61225
# 	desc = EVTDESC61225
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61225
#
# 		event_target:duelist_courtier = {
#			show_scope_change = no
#
# 			character_event = {
#				id = 61232
#				tooltip = EVTTOOLTIP61232
#			}
#
# 			clear_event_target = duelist_courtier
# 		}
#
# 		prestige = 20
# 	}
# }

## Regent informed he wins, courtier maimed.
# character_event = {
# 	id = 61226
# 	desc = EVTDESC61226
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61226 # Spare opponent
#
# 		event_target:duelist_courtier = {
#			show_scope_change = no
#
# 			character_event = {
#				id = 61230
#				tooltip = EVTTOOLTIP61230
#			}
#		}
#
# 		piety = 40
#
# 		ai_chance = { factor = 80 }
# 	}
#
# 	option = {
# 		name = EVTOPTB61226 # Kill opponent
#
# 		event_target:duelist_courtier = {
# 			show_scope_change = no
#
# 			character_event = {
#				id = 61232
#				tooltip = EVTTOOLTIP61232
#			}
# 		}
#
# 		prestige = 20
#
# 		ai_chance = { factor = 20 }
# 	}
#
#	after = {
# 		clear_event_target = duelist_courtier
#	}
# }

## Regent loses, is maimed.
# character_event = {
# 	id = 61227
# 	desc = EVTDESC61227
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61227
#
# 		add_maimed_trait_effect = yes
# 		prestige = -20
# 	}
# }

## Courtier informed he wins.
# character_event = {
# 	id = 61228
# 	desc = EVTDESC61225
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61228
#
# 		event_target:scoped_regent = {
#			show_scope_change = no
#
# 			character_event = {
#				id = 61232
#				tooltip = EVTTOOLTIP61232
#			}
# 		}
#
# 		liege = {
# 			character_event = {	id = 61235 }
# 		}
#
# 		give_minor_title = title_regent
# 		clr_character_flag = duelist_courtier
# 		prestige = 20
# 	}
# }

## Courtier informed he wins, regent maimed.
# character_event = {
# 	id = 61229
# 	desc = EVTDESC61226_HF
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes # 01_scripted_effects_duels.txt
#
# 	option = {
# 		name = EVTOPTA61229 # Spare opponent
#
# 		trigger = {
# 			event_target:scoped_regent = {
# 				is_alive = yes
# 			}
# 		}
#
# 		event_target:scoped_regent = {
# 			show_scope_change = no
#
# 			character_event = {
# 				id = 61227
# 				tooltip = EVTTOOLTIP61230
# 			}
# 		}
#
# 		liege = {
# 			character_event = {	id = 61235 }
# 		}
#
# 		give_minor_title = title_regent
# 		clr_character_flag = duelist_courtier
# 		piety = 40
#
# 		ai_chance = { factor = 80 }
# 	}
#
# 	option = {
# 		name = EVTOPTB61229 # Kill opponent
#
# 		event_target:scoped_regent = {
# 			show_scope_change = no
#
# 			character_event = {
# 				id = 61232
# 				tooltip = EVTTOOLTIP61232
# 			}
# 		}
#
# 		liege = {
# 			character_event = {	id = 61235 }
# 		}
#
# 		give_minor_title = title_regent
# 		clr_character_flag = duelist_courtier
# 		prestige = 20
#
# 		ai_chance = { factor = 20 }
# 	}
# }

## Courtier loses, is maimed.
# character_event = {
# 	id = 61230
# 	desc = EVTDESC61230
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61230
#
# 		add_maimed_trait_effect = yes
# 		prestige = -20
# 	}
# }

## Opponent doesn't show up for duel.
# character_event = {
# 	id = 61231
# 	desc = EVTDESC61231
# 	picture = GFX_evt_shadowy_cabal
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61231
#
# 		prestige = 20
# 	}
# }

## Is killed in duel.
# character_event = {
# 	id = 61232
# 	desc = EVTDESC61232
# 	picture = GFX_evt_bloody_man
#
# 	is_triggered_only = yes
#
#	immediate = {
#		if = {
#			limit = { multiplayer = yes }
#
#			death = {
#				death_reason = death_duel
#				killer = FROM
#			}
#		}
#	}
#
# 	option = {
# 		name = EVTOPTA61232
#
# 		if = {
#			limit = { multiplayer = no }
#
#			death = {
#				death_reason = death_duel
#				killer = FROM
#			}
#		}
#		else = {
#			tooltip = {
#				death = {
#					death_reason = death_duel
#					killer = FROM
#				}
#			}
#		}
# 	}
# }
#
# ## Ruler informed about the new Regent after duel.
# character_event = {
# 	id = 61235
# 	desc = EVTDESC61235
# 	picture = GFX_evt_melee
#
# 	is_triggered_only = yes
#
# 	ai = no
#
# 	option = {
# 		name = EVTOPTA4017
# 	}
# }

## Ruler informed about the new Regent after intrigue.
character_event = {
	id = 61236
	desc = EVTDESC61236
	picture = GFX_evt_shadowy_cabal

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA4017
	}
}

## Courtier informed Regent refuses challenge.
# character_event = {
# 	id = 61245
# 	desc = EVTDESC61245
# 	picture = GFX_evt_shadowy_cabal
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61245
#
# 		prestige = 20
# 	}
# }

## Courtier informed Regent voluntarily abdicates title.
# character_event = {
# 	id = 61246
# 	desc = EVTDESC61246
# 	picture = GFX_evt_shadowy_cabal
#
# 	is_triggered_only = yes
#
# 	option = {
# 		name = EVTOPTA61246
#
# 		prestige = 20
# 	}
# }

## Queen or Queen Mother takes over Regency ##

## Queen takes over regency.
character_event = {
	id = 61237
	desc = EVTDESC61237
	picture = GFX_evt_courtiers_talking

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_events

	min_age = 16
	prisoner = no
	only_capable = yes
	only_women = yes
	is_married = yes

	trigger = {
		always = no
		has_minor_title = title_ruler_consort
		NOT = { has_minor_title = title_regent }

		spouse = {
			is_ruler = yes

			OR = {
				practical_age < 15
				is_incapable = yes
			}

			prisoner = no
			is_abroad = no
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = ambitious
		}

		mult_modifier = {
			factor = 2
			trait = diligent
		}

		mult_modifier = {
			factor = 0.33
			trait = slothful
		}

		mult_modifier = {
			factor = 0.2
			trait = content
		}
	}

	option = {
		name = EVTOPTA61237

		give_minor_title = title_regent

		spouse = {
			character_event = { id = 61239 }
		}
	}
}

## Queen Mother takes over regency.
# character_event = {
# 	id = 61238
# 	desc = EVTDESC61238
# 	picture = GFX_evt_courtiers_talking
#
# 	is_triggered_only = yes
#
# 	only_women = yes
# 	min_age = 16
# 	prisoner = no
# 	only_capable = yes
#
# 	trigger = {
# 		has_minor_title = title_queen_mother
# 		NOT = { has_minor_title = title_regent }
#
# 		liege = {
# 			OR = {
# 				practical_age < 15
# 				is_incapable = yes
# 			}
# 		}
# 	}
#
#	weight_multiplier = {
#		factor = 1
#
#		mult_modifier = {
#			factor = 4
#			trait = ambitious
#		}
#
#		mult_modifier = {
#			factor = 2
#			trait = diligent
#		}
#
#		mult_modifier = {
#			factor = 0.33
#			trait = slothful
#		}
#
#		mult_modifier = {
#			factor = 0.2
#			trait = content
#		}
#	}
#
#	option = {
#		name = EVTOPTA61238
#
#		give_minor_title = title_regent
#
#		liege = {
#			character_event = { id = 61240 }
#		}
#	}
# }

## Ruler informed that Queen takes over regency.
character_event = {
	id = 61239
	desc = EVTDESC61239
	picture = GFX_evt_courtiers_talking

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTB61239
	}
}

## Ruler informed that Queen Mother is taking over regency.
# character_event = {
#	id = 61240
#	desc = EVTDESC61240
#	picture = GFX_evt_courtiers_talking
#
#	is_triggered_only = yes
#
#	ai = no
#
#	option = {
#		name = OK
#	}
# }

## The Regent Lowers Crown Authority in a Kingdom or Empire
# CleanSlate: Event merged with event 61302
character_event = {
	id = 61300
	picture = GFX_evt_courtiers_talking

	desc = {
		text = EVTDESC61300
		trigger = {
			liege = { real_tier = KING }
		}
	}
	desc = {
		text = EVTDESC61302
		trigger = {
			liege = { real_tier = EMPEROR }
		}
	}

	is_triggered_only = yes # on_yearly_pulse, random_events, regency_crown_authority

	only_playable = yes # Only titled Regents do this
	lacks_dlc = "Conclave"
	min_age = 16
	prisoner = no
	only_capable = yes

	trigger = {
		is_landed = yes
		has_minor_title = title_regent
		NOT = { trait = content }

		liege = {
			higher_real_tier_than = DUKE
			NOT = { has_character_flag = regent_lowered_CA }

			any_demesne_title = {
				higher_tier_than = DUKE

				OR = {
					has_law = crown_authority_1
					has_law = crown_authority_2
					has_law = crown_authority_3
					has_law = crown_authority_4
				}

				ROOT = {
					crownlaw_title = {
						title = PREVPREV
					}
				}
			}
		}
	}

	weight_multiplier = {
		factor = 1

		mult_modifier = {
			factor = 4
			trait = ambitious
		}

		mult_modifier = {
			factor = 4
			trait = greedy
		}

		mult_modifier = {
			factor = 2
			trait = arbitrary
		}

		mult_modifier = {
			factor = 0.5
			trait = charitable
		}

		mult_modifier = {
			factor = 0.33
			trait = just
		}
	}

	option = {
		name = EVTOPTA61300

		liege = {
			show_scope_change = no

			random_demesne_title = {
				limit = {
					higher_tier_than = DUKE

					OR = {
						has_law = crown_authority_1
						has_law = crown_authority_2
						has_law = crown_authority_3
						has_law = crown_authority_4
					}

					ROOT = {
						crownlaw_title = {
							title = PREVPREV
						}
					}
				}

				set_title_flag = non_manual_law_change # No prestige loss

				trigger_switch = {
					on_trigger = has_law

					crown_authority_1 = { add_law = crown_authority_0 }
					crown_authority_2 = { add_law = crown_authority_1 }
					crown_authority_3 = { add_law = crown_authority_2 }
					crown_authority_4 = { add_law = crown_authority_3 }
				}

				clr_title_flag = non_manual_law_change # No prestige loss
			}

			character_event = { id = 61301 }
			set_character_flag = regent_lowered_CA
		}
	}

	option = {
		name = EVTOPTB61300

		ai_chance = { factor = 0 }
	}
}

## Ruler informed that Regent has Lowered CA in a Kingdom or Empire
# CleanSlate: Event merged with event 61303
character_event = {
	id = 61301
	picture = GFX_evt_courtiers_talking

	desc = {
		text = EVTDESC61301
		trigger = { real_tier = KING }
	}
	desc = {
		text = EVTDESC61303
		trigger = { real_tier = EMPEROR }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA61301

		opinion = {
			name = opinion_regent_lowered_CA
			who = FROM
		}
	}
}