namespace = Plus

#reserved: Plus.150 to Plus.299
#reserved: Plus.2900 to Plus.2999

#######################################
# CK2Plus Plot Events
# Written by Rylock
#######################################

### DISCREDIT COUNCILLOR
character_event = {
	id = Plus.155
	desc = EVTDESC_Plus_155
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_discredit_councillor
		is_plot_active = no
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_155 # That position will be mine!

		remove_trait_silently_charitable_effect = yes
		remove_trait_silently_honest_effect = yes
		remove_trait_silently_kind_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				20 = {
					character_event = {
						id = Plus.156 # Succeeds
						tooltip = CUSTOMTOOLTIP33
						days = 3
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 20
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 20
						ROOT = { plot_power >= 2.0 }
					}
				}

				20 = {
					character_event = {
						id = Plus.159 # Fails, not discovered
						tooltip = CUSTOMTOOLTIP34
						days = 3
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 0
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}
				}

				60 = {
					character_event = {
						id = Plus.162 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}

					additive_modifier = {
						value = -20
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -15
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}
				}
			}
		}

		activate_plot = yes

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}

			mult_modifier = {
				factor = 100
				trait = lunatic
			}

			mult_modifier = {
				factor = 100
				trait = possessed
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity...

		ai_chance = { factor = 100 }
	}
}

# Success - notify victim
character_event = {
	id = Plus.156
	desc = EVTDESC_Plus_156
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		FROM = { plot_succeeds = yes }

		# Fire immediately, by means of opinion modifier below, use flag to remember council position
		trigger_switch = {
			on_trigger = has_job_title

			job_chancellor = { set_character_flag = job_chancellor }
			job_treasurer = { set_character_flag = job_treasurer }
			job_marshal = { set_character_flag = job_marshal }
			job_spymaster = { set_character_flag = job_spymaster }
			job_spiritual = { set_character_flag = job_spiritual }
		}

		opinion = {
			name = opinion_fired_from_council
			who = liege
			years = 10
		}
	}

	option = {
		name = EVTOPTA_Plus_156 # I am ruined!

		trigger_switch = {
			on_trigger = has_character_flag

			job_chancellor = {
				change_diplomacy = -4
				remove_title = job_chancellor
				clr_character_flag = job_chancellor
			}

			job_treasurer = {
				change_stewardship = -4
				remove_title = job_treasurer
				clr_character_flag = job_treasurer
			}

			job_marshal = {
				change_martial = -4
				remove_title = job_marshal
				clr_character_flag = job_marshal
			}

			job_spymaster = {
				change_intrigue = -4
				remove_title = job_spymaster
				clr_character_flag = job_spymaster
			}

			job_spiritual = {
				change_learning = -4
				remove_title = job_spiritual
				clr_character_flag = job_spiritual
			}
		}

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.157 } }

			# Notify liege
			liege = {
				if = {
					limit = {
						NOR = {
							character = ROOT
							character = FROM
						}
					}

					character_event = { id = Plus.158 }
				}
			}
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.157
	desc = EVTDESC_Plus_157
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_157 # Excellent!
	}
}

# Success - notify liege
character_event = {
	id = Plus.158
	desc = EVTDESC_Plus_158
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_158 # It had to be done!
	}
}

# Failure (not discovered) - notify victim
character_event = {
	id = Plus.159
	desc = EVTDESC_Plus_159
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_159 # Who could have instigated such an underhanded scheme?

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.160 } }

			# Notify liege
			liege = {
				if = {
					limit = {
						NOR = {
							character = ROOT
							character = FROM
						}
					}

					character_event = { id = Plus.161 }
				}
			}
		}
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.160
	desc = EVTDESC_Plus_160
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_160 # It could have been worse...

		cancel_plot = yes
	}
}

# Failure (not discovered) - notify liege
character_event = {
	id = Plus.161
	desc = EVTDESC_Plus_161
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_159 # Who could have instigated such an underhanded scheme?
	}
}

# Failure (discovered) - notify victim
character_event = {
	id = Plus.162
	desc = EVTDESC_Plus_162
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_162 # He will pay for this!

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

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.163 } }

			# Notify liege
			liege = {
				if = {
					limit = {
						NOR = {
							character = ROOT
							character = FROM
						}
					}

					character_event = { id = Plus.164 }
				}
			}
		}
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.163
	desc = EVTDESC_Plus_163
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_163 # My liege is not pleased...

		prestige = -100
		cancel_plot = yes
	}
}

# Failure (discovered) - notify liege
character_event = {
	id = Plus.164
	desc = EVTDESC_Plus_164
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_164 # He will pay for this!

		opinion = {
			name = devious_plotter
			who = FROMFROM
			years = 5
		}
	}
}

### EMBEZZLE FROM LIEGE
character_event = {
	id = Plus.170
	desc = EVTDESC_Plus_170
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_embezzle_from_liege
		is_plot_active = no
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_170 # We'll all be rich!

		remove_trait_silently_charitable_effect = yes
		remove_trait_silently_honest_effect = yes
		remove_trait_silently_kind_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				40 = {
					additive_modifier = {
						value = 15

						# The target's steward is in on it
						job_treasurer = {
							plot_power_contribution = {
								plotter = ROOT
								power > 0
							}
						}
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.171 # Succeeds
						tooltip = CUSTOMTOOLTIP33
						days = 3
					}
				}

				60 = {
					additive_modifier = {
						value = -15

						# The target's steward is in on it
						job_treasurer = {
							plot_power_contribution = {
								plotter = ROOT
								power > 0
							}
						}
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.174 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}
				}
			}
		}

		activate_plot = yes

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}

			mult_modifier = {
				factor = 100
				trait = lunatic
			}

			mult_modifier = {
				factor = 100
				trait = possessed
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity...

		ai_chance = { factor = 100 }
	}
}

# Success - notify victim
character_event = {
	id = Plus.171
	desc = EVTDESC_Plus_171
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		# TODO: Calculate variable amount with exportable script values
		trigger_switch = {
			on_trigger = real_tier

			COUNT = { wealth = -50 }
			DUKE = { wealth = -75 }
			fallback = { wealth = -100 } # Higher tiers
		}
	}

	option = {
		name = EVTOPTA_Plus_171 # I've been robbed

		tooltip = {
			trigger_switch = {
				on_trigger = real_tier

				COUNT = { wealth = -50 }
				DUKE = { wealth = -75 }
				fallback = { wealth = -100 } # Higher tiers
			}
		}

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.172 } }
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.172
	desc = EVTDESC_Plus_172
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_172 # Everything went as planned!

		plot_succeeds = yes

		if = {
			limit = { FROM = { real_tier = count } }
			wealth = 50
		}
		else_if = {
			limit = { FROM = { real_tier = duke } }
			wealth = 75
		}
		else = {
			wealth = 100
		}

		hidden_effect = {
			# Notify backers
			any_plot_backer = {
				character_event = { id = Plus.173 }
			}
		}
	}
}

# Success - notify plot backers
character_event = {
	id = Plus.173
	desc = EVTDESC_Plus_173
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_157 # Excellent!

		wealth = 10 # TODO: Also take this from plot target
	}
}

# Failure (discovered) - notify victim
character_event = {
	id = Plus.174
	desc = EVTDESC_Plus_174
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	immediate = {
		# Notify plotter
		FROM = { character_event = { id = Plus.175 } }
	}

	option = {
		name = EVTOPTA_Plus_174 # Imprison him

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

		reverse_imprison = FROM

		hidden_effect = {
			opinion = {
				name = opinion_recent_plot
				who = FROM
				years = 5
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTB_Plus_174 # Execute him

		piety = -25

		FROM = {
			show_scope_change = no

			death = {
				death_reason = death_execution
				killer = ROOT
			}
		}

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 0.1
				trait = kind
			}

			mult_modifier = {
				factor = 2.0
				trait = wroth
			}

			mult_modifier = {
				factor = 2.0
				trait = cruel
			}

			mult_modifier = {
				factor = 0.1
				trait = charitable
			}
		}
	}

	option = {
		name = EVTOPTC_Plus_174 # Forgive him

		random = {
			chance = 30
			add_trait_fully_kind_effect = yes
		}

		prestige = -50

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

		hidden_effect = {
			opinion = {
				name = opinion_recent_plot
				who = FROM
				years = 5
			}
		}

		ai_chance = { factor = 0 }
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.175
	desc = EVTDESC_Plus_175
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_175 # Retribution is sure to come...

		prestige = -100
		cancel_plot = yes
	}
}

### FABRICATE EVIDENCE OF TREASON (IF NOT LIEGE)
character_event = {
	id = Plus.180
	desc = EVTDESC_Plus_180
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_fabricate_treason
		is_plot_active = no

		plot_target_char = {
			NOT = { vassal_of = ROOT }
		}
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_180 # I will see him disgraced!

		remove_trait_silently_charitable_effect = yes
		remove_trait_silently_honest_effect = yes
		remove_trait_silently_kind_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				15 = {
					additive_modifier = {
						value = 10

						# Our liege's chancellor is in on it
						liege = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.181 # Succeeds
						tooltip = CUSTOMTOOLTIP33
						days = 3
					}
				}

				15 = {
					additive_modifier = {
						value = 10

						# Our liege's chancellor is in on it
						liege = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.184 # Fails, not discovered
						tooltip = CUSTOMTOOLTIP34
						days = 3
					}
				}

				70 = {
					additive_modifier = {
						value = -20

						# Our liege's chancellor is in on it
						liege = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.187 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}
				}
			}
		}

		activate_plot = yes

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}

			mult_modifier = {
				factor = 100
				trait = lunatic
			}

			mult_modifier = {
				factor = 100
				trait = possessed
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity

		ai_chance = { factor = 100 }
	}
}

# Success - notify victim
character_event = {
	id = Plus.181
	desc = EVTDESC_Plus_181
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_181 # This must be a scheme to see me arrested!

		reverse_opinion = {
			name = opinion_traitor
			who = liege
			years = 10
		}

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.182 } }

			# Notify liege
			liege = { character_event = { id = Plus.183 } }
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.182
	desc = EVTDESC_Plus_182
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_157 # Excellent!

		plot_succeeds = yes
	}
}

# Success - notify liege
character_event = {
	id = Plus.183
	desc = EVTDESC_Plus_183
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_183 # I must have him arrested!

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

# Failure (not discovered) - notify victim
character_event = {
	id = Plus.184
	desc = EVTDESC_Plus_184
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_184 # I wonder who sent it...

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.185 } }

			# Notify liege
			liege = { character_event = { id = Plus.186 } }
		}
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.185
	desc = EVTDESC_Plus_185
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_160 # It could have been worse

		cancel_plot = yes
	}
}

# Failure (not discovered) - notify liege
character_event = {
	id = Plus.186
	desc = EVTDESC_Plus_186
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_186 # Nothing but lies and slander...
	}
}

# Failure (discovered) - notify victim
character_event = {
	id = Plus.187
	desc = EVTDESC_Plus_187
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_187 # How dare he!

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

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.188 } }

			# Notify liege
			liege = { character_event = { id = Plus.189 } }
		}
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.188
	desc = EVTDESC_Plus_188
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	immediate = {
		dishonorable_plus_1_effect = yes
	}

	option = {
		name = EVTOPTA_Plus_188 # This is bad!

		prestige = -100
		cancel_plot = yes
	}
}

# Failure (discovered) - notify liege
character_event = {
	id = Plus.189
	desc = EVTDESC_Plus_189
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_189 # He is the true traitor!

		opinion = {
			name = devious_plotter
			who = FROMFROM
			years = 5
		}
	}
}

### FABRICATE EVIDENCE OF HERESY
character_event = {
	id = Plus.195
	desc = EVTDESC_Plus_195
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_fabricate_heresy
		is_plot_active = no
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_195 # God will be my judge!

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}

			mult_modifier = {
				factor = 100
				trait = lunatic
			}

			mult_modifier = {
				factor = 100
				trait = possessed
			}
		}

		remove_trait_silently_charitable_effect = yes
		remove_trait_silently_honest_effect = yes
		remove_trait_silently_kind_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				15 = {
					additive_modifier = {
						value = 10

						# The target's lord spiritual is in on it
						job_spiritual = {
							plot_power_contribution = {
								plotter = ROOT
								power > 0
							}
						}
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.196 # Succeeds
						tooltip = CUSTOMTOOLTIP33
						days = 3
					}
				}

				15 = {
					additive_modifier = {
						value = 10

						# The target's lord spiritual is in on it
						job_spiritual = {
							plot_power_contribution = {
								plotter = ROOT
								power > 0
							}
						}
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.198 # Fails, not discovered
						tooltip = CUSTOMTOOLTIP34
						days = 3
					}
				}

				70 = {
					additive_modifier = {
						value = -20

						# The target's lord spiritual is in on it
						job_spiritual = {
							plot_power_contribution = {
								plotter = ROOT
								power > 0
							}
						}
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.200 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}
				}
			}
		}

		activate_plot = yes
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity

		ai_chance = { factor = 100 }
	}
}

# Success - notify victim
character_event = {
	id = Plus.196
	desc = EVTDESC_Plus_196
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_196 # God preserve me from these lies!

		add_trait = excommunicated
		piety = -100

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.197 } }
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.197
	desc = EVTDESC_Plus_197
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_197 # It was the will of God!

		plot_succeeds = yes
	}
}

# Failure (not discovered) - notify victim
character_event = {
	id = Plus.198
	desc = EVTDESC_Plus_198
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_198 # God looks after the faithful

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.199 } }
		}
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.199
	desc = EVTDESC_Plus_199
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = OK

		cancel_plot = yes
	}
}

# Failure (discovered) - notify victim
character_event = {
	id = Plus.200
	desc = EVTDESC_Plus_200
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_200 # I know who sent it!

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

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.201 } }
		}
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.201
	desc = EVTDESC_Plus_201
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_201 # This will not help my reputation...

		rightful_religious_head_scope = {
			show_scope_change = no

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

		piety = -250
		cancel_plot = yes
	}
}

### FABRICATE EVIDENCE OF TREASON (IF LIEGE)
character_event = {
	id = Plus.205
	desc = EVTDESC_Plus_205
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_fabricate_treason_liege
		is_plot_active = no

		plot_target_char = {
			vassal_of = ROOT
		}
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_180 # I will see him disgraced!

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}

			mult_modifier = {
				factor = 100
				trait = lunatic
			}

			mult_modifier = {
				factor = 100
				trait = possessed
			}
		}

		remove_trait_silently_charitable_effect = yes
		remove_trait_silently_honest_effect = yes
		remove_trait_silently_kind_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				15 = {
					additive_modifier = {
						value = 10

						# My chancellor is in on it
						ROOT = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.206 # Succeeds
						tooltip = CUSTOMTOOLTIP33
						days = 3
					}
				}

				15 = {
					additive_modifier = {
						value = 10

						# My chancellor is in on it
						ROOT = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.208 # Fails, not discovered
						tooltip = CUSTOMTOOLTIP34
						days = 3
					}
				}

				70 = {
					additive_modifier = {
						value = -20

						# My chancellor is in on it
						ROOT = {
							job_chancellor = {
								plot_power_contribution = {
									plotter = ROOT
									power > 0
								}
							}
						}
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.210 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}
				}
			}
		}

		activate_plot = yes
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity

		ai_chance = { factor = 100 }
	}
}

# Success - notify victim
character_event = {
	id = Plus.206
	desc = EVTDESC_Plus_206
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_206 # Who could have done such a thing?

		reverse_opinion = {
			name = opinion_traitor
			who = liege
			years = 10
		}

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.207 } }
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.207
	desc = "EVTDESC_Plus_207"
	picture = "GFX_evt_spymaster"

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_157 # Excellent!

		plot_succeeds = yes
	}
}

# Failure (not discovered) - notify victim
character_event = {
	id = Plus.208
	desc = EVTDESC_Plus_208
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_208 # I wonder who was behind it...

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.209 } }
		}
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.209
	desc = EVTDESC_Plus_209
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_160 # It could have been worse...

		cancel_plot = yes
	}
}

# Failure (discovered) - notify victim
character_event = {
	id = Plus.210
	desc = EVTDESC_Plus_210
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_187 # How dare he!

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

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.211 } }
		}
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.211
	desc = EVTDESC_Plus_211
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	immediate = {
		dishonorable_plus_1_effect = yes
	}

	option = {
		name = EVTOPTA_Plus_211 # My reputation is ruined!

		prestige = -100
		cancel_plot = yes
	}
}

### KIDNAPPING

# Chance to kidnap victim arises
character_event = {
	id = Plus.150
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_150_transit
		trigger = { has_character_flag = kidnap_in_transit }
	}
	desc = {
		text = EVTDESC_Plus_150_bed
		trigger = { has_character_flag = kidnap_in_bed }
	}
	desc = {
		text = EVTDESC_Plus_150_hunting
		trigger = { has_character_flag = kidnap_while_hunting }
	}
	desc = {
		text = EVTDESC_Plus_150_carouse
		trigger = { has_character_flag = kidnap_while_carousing }
	}

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

	trigger = {
		OR = {
			has_plot = plot_kidnap_liege
			has_plot = plot_kidnapping
		}

		is_plot_active = no
		plot_power >= 0.5

		plot_target_char = {
			prisoner = no
			in_command_trigger = no
			is_inaccessible_trigger = no
		}

		trigger_if = {
			limit = { is_ruler = no }

			plot_target_char = {
				any_demesne_title = {
					can_be_given_away = yes
					real_tier = COUNT
					location = { is_capital = no }
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 200

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.5
			trait = genius
		}

		mult_modifier = {
			factor = 0.75

			OR = {
				trait = quick
				trait = shrewd
			}
		}

		mult_modifier = {
			factor = 0.75
			plot_target_char = { trait = trusting }
		}

		mult_modifier = {
			factor = 1.25
			plot_target_char = { trait = paranoid }
		}

		mult_modifier = {
			factor = 0.75

			plot_target_char = {
				OR = {
					is_ill = yes
					trait = infirm
					is_dumb_trigger = yes
				}
			}
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 0.75
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 1.0
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 1.25
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 1.50
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 1.75
		}

		mult_modifier = {
			factor = 0.65
			plot_power = 2.0
		}
	}

	immediate = {
		plot_target_char = {
			save_event_target_as = plot_target
		}

		random_list = {
			10 = {
				trigger = {
					plot_target_char = {
						is_adult = yes
						is_ill = no
						is_incapable = no
					}
				}

				set_character_flag = kidnap_in_transit
			}

			10 = {
				mult_modifier = {
					factor = 5

					plot_target_char = {
						OR = {
							trait = infirm
							practical_age >= 50
						}
					}
				}

				set_character_flag = kidnap_in_bed
			}

			10 = {
				trigger = {
					plot_target_char = {
						is_adult = yes
						is_ill = no
						is_incapable = no
						is_female = no
					}
				}

				mult_modifier = {
					factor = 3
					plot_target_char = { martial >= 10 }
				}

				mult_modifier = {
					factor = 5

					plot_target_char = {
						OR = {
							trait = hunter
							has_focus = focus_hunting
						}
					}
				}

				set_character_flag = kidnap_while_hunting
			}

			10 = {
				trigger = {
					plot_target_char = {
						is_adult = yes
						is_ill = no
						is_female = yes
						is_incapable = no
						NOT = { trait = chaste }
					}
				}

				mult_modifier = {
					factor = 5

					plot_target_char = {
						OR = {
							trait = hedonist
							trait = lustful
							has_focus = focus_seduction
						}
					}
				}

				set_character_flag = kidnap_while_carousing
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_150 # Proceed

		ai_chance = {
			factor = 90

			mult_modifier = {
				factor = 0.1

				plot_power < 0.75

				NOR = {
					trait = lunatic
					trait = possessed
				}
			}
		}

		activate_plot = yes

		random_list = {
			20 = {
				mult_modifier = {
					factor = 1.65

					plot_power >= 1.0
					plot_power < 1.5
				}

				mult_modifier = {
					factor = 2.5

					plot_power >= 1.5
					plot_power < 2.0
				}

				mult_modifier = {
					factor = 3.0

					plot_power >= 2.0
					plot_power < 2.5
				}

				mult_modifier = {
					factor = 3.75
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -2 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -4 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -6 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -8 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -10 }
				}

				mult_modifier = {
					factor = 0.5
					plot_target_char = { trait = genius }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { trait = paranoid }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { is_strong_trigger = yes }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { trait = quick }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { trait = shrewd }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { trait = trusting }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { trait = lunatic }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { trait = drunkard }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { is_weak_trigger = yes }
				}

				mult_modifier = {
					factor = 1.2

					plot_target_char = {
						OR = {
							trait = infirm
							is_incapable = no
							is_ill = yes
							is_adult = no
						}
					}
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { martial >= 12 }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { martial >= 18 }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { war = yes }
				}

				mult_modifier = {
					factor = 0.75
					plot_target_char = { higher_real_tier_than = DUKE }
				}

				mult_modifier = {
					factor = 0.75
					plot_target_char = { higher_real_tier_than = KING }
				}

				character_event = {
					id = Plus.215 # Succeeds
					tooltip = CUSTOMTOOLTIP_KIDNAP1
					days = 14
				}
			}

			30 = {
				mult_modifier = {
					factor = 1.1

					plot_power >= 1.0
					plot_power < 1.5
				}

				mult_modifier = {
					factor = 0.8

					plot_power >= 1.5
					plot_power < 2.0
				}

				mult_modifier = {
					factor = 0.65

					plot_power >= 2.0
					plot_power < 2.5
				}

				mult_modifier = {
					factor = 0.5
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 1.1
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -2 }
				}

				mult_modifier = {
					factor = 1.1
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -4 }
				}

				mult_modifier = {
					factor = 1.1
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -6 }
				}

				mult_modifier = {
					factor = 1.1
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -8 }
				}

				mult_modifier = {
					factor = 1.1
					attribute_diff = { character = event_target:plot_target attribute = intrigue value <= -10 }
				}

				character_event = {
					id = Plus.229 # Fails, not discovered
					tooltip = CUSTOMTOOLTIP_KIDNAP2
					days = 14
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.68

					plot_power >= 1.0
					plot_power < 1.5
				}

				mult_modifier = {
					factor = 0.5

					plot_power >= 1.5
					plot_power < 2.0
				}

				mult_modifier = {
					factor = 0.4

					plot_power >= 2.0
					plot_power < 2.5
				}

				mult_modifier = {
					factor = 0.2
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value >= 2 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value >= 4 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value >= 6 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value >= 8 }
				}

				mult_modifier = {
					factor = 0.9
					attribute_diff = { character = event_target:plot_target attribute = intrigue value >= 10 }
				}

				character_event = {
					id = Plus.231 # Fails, discovered
					tooltip = CUSTOMTOOLTIP_KIDNAP3
					days = 14
				}
			}
		}

		hidden_effect = {
			any_plot_backer = {
				letter_event = {
					id = Plus.152 # Notify backers
					days = 4
				}
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity

		clr_character_flag = kidnap_in_transit
		clr_character_flag = kidnap_in_bed
		clr_character_flag = kidnap_while_hunting
		clr_character_flag = kidnap_while_carousing

		ai_chance = {
			factor = 10

			trigger = { plot_power < 1.25 }
		}
	}
}

# A plot backer sees the opportunity to kidnap victim
character_event = {
	id = Plus.151
	desc = EVTDESC_Plus_151
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

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

	trigger = {
		any_backed_character = {
			OR = {
				has_plot = plot_kidnapping
				has_plot = plot_kidnap_liege
			}

			plot_power >= 0.5
			is_plot_active = no

			plot_target_char = {
				at_location = ROOT
				prisoner = no
				in_command_trigger = no
				is_inaccessible_trigger = no
			}

			ROOT = {
				plot_power_contribution = {
					plotter = PREV
					power >= 0.04
				}
			}

			trigger_if = {
				limit = { is_ruler = no }

				plot_target_char = {
					any_demesne_title = {
						can_be_given_away = yes
						real_tier = COUNT
						location = { is_capital = no }
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 750

		mult_modifier = {
			factor = 0.75

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_modifier = plot_assisted_spying
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.65

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_modifier = plot_assisted_spying2
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.55

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_modifier = plot_assisted_spying3
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.45

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_modifier = plot_assisted_spying4
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.35

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_modifier = plot_assisted_spying5
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_flag = has_personal_spy_network
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no

					check_variable = {
						which = personal_spy_network
						value >= 10
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_flag = has_personal_spy_network
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no

					check_variable = {
						which = personal_spy_network
						value >= 20
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_flag = has_personal_spy_network
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no

					check_variable = {
						which = personal_spy_network
						value >= 30
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_flag = has_personal_spy_network
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no

					check_variable = {
						which = personal_spy_network
						value >= 40
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				has_character_flag = has_personal_spy_network
				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no

					check_variable = {
						which = personal_spy_network
						value >= 50
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.1
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.2
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.3
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.4
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.5
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.66

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 1.0
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.66

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 1.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.66

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 2.0
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.66

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 2.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.66

			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 3.0
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}

				trigger_if = {
					limit = { is_ruler = no }

					plot_target_char = {
						any_demesne_title = {
							can_be_given_away = yes
							real_tier = COUNT
							location = { is_capital = no }
						}
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_151 # Tell Plotter

		random_backed_character = {
			show_scope_change = no

			limit = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}

				plot_power >= 0.5
				is_plot_active = no

				plot_target_char = {
					at_location = ROOT
					prisoner = no
					in_command_trigger = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.04
					}
				}
			}

			character_event = { id = Plus.150 }
		}
	}
}

# Notify plot backers of kidnap attempt
letter_event = {
	id = Plus.152
	desc = EVTDESC_Plus_152
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = OK
	}
}

# Success - notify plotter
character_event = {
	id = Plus.215
	desc = EVTDESC_Plus_215
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes

	trigger = {
		plot_target_char = { prisoner = no }
	}

	immediate = {
		plot_target_char = {
			save_event_target_as = kidnap_victim

			if = {
				limit = { is_ruler = yes }

				job_spymaster = {
					if = {
						limit = { NOT = { character = ROOT } }
						save_event_target_as = victim_spymaster
					}
				}
			}
			else = {
				liege = {
					if = {
						limit = {
							NOR = {
								character = ROOT
								job_spymaster = { character = ROOT }
							}

						}

						job_spymaster = { save_event_target_as = victim_spymaster }
					}
				}
			}
		}

		plot_succeeds = yes

		if = {
			limit = { is_ruler = no }

			event_target:kidnap_victim = {
				random_demesne_title = {
					limit = {
						real_tier = COUNT
						can_be_given_away = yes
						location = { is_capital = no }
					}

					preferred_limit = {
						ROOT = { has_strong_pressed_claim = PREV }
					}

					preferred_limit = {
						ROOT = { has_strong_claim = PREV }
					}

					preferred_limit = {
						ROOT = { has_weak_pressed_claim = PREV }
					}

					preferred_limit = {
						ROOT = { has_weak_claim = PREV }
					}

					save_event_target_as = demanded_title
				}
			}
		}
		else_if = {
			limit = {
				independent = no
				same_liege = event_target:kidnap_victim
			}

			event_target:kidnap_victim = {
				if = {
					limit = {
						any_vassal = {
							OR = {
								de_jure_liege = ROOT
								dejure_liege_title = { claimed_by = ROOT }
							}

							lower_real_tier_than = ROOT
							higher_real_tier_than = BARON
							is_patrician = no
						}
					}

					random_vassal = {
						limit = {
							OR = {
								de_jure_liege = ROOT
								dejure_liege_title = { claimed_by = ROOT }
							}

							higher_real_tier_than = BARON
							lower_real_tier_than = ROOT
							is_patrician = no
						}

						preferred_limit = {
							de_jure_liege = ROOT
						}

						save_event_target_as = demanded_vassal
					}
				}
				else = {
					random_demesne_title = {
						limit = {
							lower_real_tier_than = DUKE
							can_be_given_away = yes
							is_primary_holder_title = no
							location = { is_capital = no }
						}

						preferred_limit = {
							real_tier = COUNT
							ROOT = { has_strong_pressed_claim = PREV }
						}

						preferred_limit = {
							real_tier = COUNT
							ROOT = { has_strong_claim = PREV }
						}

						preferred_limit = {
							real_tier = COUNT
							ROOT = { has_weak_pressed_claim = PREV }
						}

						preferred_limit = {
							real_tier = COUNT
							ROOT = { has_weak_claim = PREV }
						}

						preferred_limit = {
							real_tier = COUNT
							de_jure_liege_or_above = ROOT
						}

						preferred_limit = {
							real_tier = COUNT
							any_de_jure_liege_title = { claimed_by = ROOT }
						}

						preferred_limit = {
							ROOT = { has_strong_pressed_claim = PREV }
						}

						preferred_limit = {
							ROOT = { has_strong_claim = PREV }
						}

						preferred_limit = {
							ROOT = { has_weak_pressed_claim = PREV }
						}

						preferred_limit = {
							ROOT = { has_weak_claim = PREV }
						}

						preferred_limit = {
							de_jure_liege_or_above = ROOT
						}

						preferred_limit = {
							any_de_jure_liege_title = { claimed_by = ROOT }
						}

						save_event_target_as = demanded_title
					}
				}
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_215 # Demand he turn over title, or else

		trigger = {
			event_target:demanded_title = { always = yes }
		}

		event_target:kidnap_victim = {
			show_scope_change = no

			character_event = {
				id = Plus.218
				tooltip = KIDNAP_DEMAND_TITLE
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTB_Plus_215 # Demand he turn over a vassal, or else

		trigger = {
			is_ruler = yes
			event_target:demanded_vassal = { always = yes }
		}

		ai_chance = { factor = 25 }

		event_target:kidnap_victim = {
			show_scope_change = no

			character_event = {
				id = Plus.225
				tooltip = KIDNAP_DEMAND_VASSAL
			}
		}
	}

	option = {
		name = EVTOPTD_Plus_215 # Kill him--quietly

		tooltip = {
			event_target:kidnap_victim = {
				show_scope_change = no

				death = { death_reason = death_murder_unknown }
			}
		}

		add_trait_partially_silently_deceitful_effect = yes
		add_trait_partially_silently_cruel_effect = yes

		random_list = {
			50 = { # Murder is discovered
				trigger = {
					# Courtiers are helpless, rulers without a spymaster or the kidnapper as their spymaster are out of luck too
					event_target:victim_spymaster = {
						NOT = { character = ROOT }
					}
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 9 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 11 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 13 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 15 }
				}

				character_event = {
					id = Plus.223
					tooltip = KIDNAP_MURDER_DISCOVERED
				}

				hidden_tooltip = {
					event_target:kidnap_victim = { save_event_target_as = target_victim }
					character_event = { id = 10 }
					event_target:kidnap_victim = { death = { death_reason = death_murder killer = ROOT } }
				}
			}

			50 = { # Murder is discovered
				trigger = {
					event_target:kidnap_victim = {
						is_ruler = no

						liege = {
							NOR = {
								character = ROOT
								job_spymaster = { character = ROOT }
							}
						}
					}
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 9 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 11 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 13 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 15 }
				}

				character_event = {
					id = Plus.223
					tooltip = KIDNAP_MURDER_DISCOVERED2
				}

				hidden_effect = {
					event_target:kidnap_victim = { save_event_target_as = target_victim }
					character_event = { id = 10 }

					event_target:kidnap_victim = {
						death = {
							death_reason = death_murder
							killer = ROOT
						}
					}
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -9 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -11 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -13 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -15 }
				}

				custom_tooltip = {
					text = KIDNAP_MURDER_NOT_DISCOVERED

					event_target:kidnap_victim = {
						death = { death_reason = death_murder_unknown }
					}
				}
			}
		}

		ai_chance = { factor = 0 }
	}

	option = {
		name = EVTOPTC_Plus_215 # I'll decide later

		trigger = { is_ruler = yes }

		event_target:kidnap_victim = {
			show_scope_change = no

			tooltip = { imprison = ROOT }
			character_event = { id = Plus.216 }
		}

		ai_chance = {
			factor = 1

			trigger = {
				NOR = {
					event_target:demanded_title = { always = yes }
					event_target:demanded_vassal = { always = yes }
				}
			}
		}
	}
}

# Target informed he has been kidnapped
character_event = {
	id = Plus.216
	desc = EVTDESC_Plus_216
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_216 # He will pay for this!

		imprison = FROM

		hidden_tooltip = {
			opinion = {
				name = opinion_kidnapper
				who = FROM
				years = 100
			}

			any_close_relative = {
				limit = {
					OR = {
						is_parent_of = ROOT
						is_child_of = ROOT
						sibling = ROOT
						is_married = ROOT
					}
				}

				opinion = {
					name = opinion_kidnapped_kin
					who = FROM
					years = 50
				}
			}

			top_liege = {
				character_event = { id = Plus.217 days = 1 } # Notify

				any_realm_character = {
					limit = {
						OR = {
							is_close_relative = ROOT
							is_liege_or_above_of = ROOT
							is_vassal_or_below_of = ROOT
						}
					}

					character_event = { id = Plus.217 days = 1 } # Notify
				}
			}

			any_dynasty_member = {
				limit = { NOT = { same_realm = ROOT } }
				character_event = { id = Plus.217 days = 1 } # Notify
			}
		}
	}
}

# Realm learns of kidnapping
character_event = {
	id = Plus.217
	desc = EVTDESC_Plus_217
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

# Target informed of kidnapping - title demanded
character_event = {
	id = Plus.218
	desc = EVTDESC_Plus_218
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_218 # Take the title, just release me!

		if = {
			limit = { trait = brave }
			remove_trait = brave
		}
		else_if = {
			limit = { NOT = { trait = craven } }

			random = {
				chance = 33
				add_trait_craven_effect = yes
			}
		}

		FROM = {
			if = {
				limit = { is_ruler = no }
				set_character_flag = needs_liege
			}
		}

		event_target:demanded_title = {
			show_scope_change = no

			grant_title_no_opinion = FROM
			add_weak_pressed_claim = ROOT
		}

		if = {
			limit = {
				independent = no
				lower_real_tier_than = DUKE
				FROM = { has_character_flag = needs_liege }
			}

			liege = {
				show_scope_change = no

				FROM = {
					show_scope_change = no

					clr_character_flag = needs_liege
					set_defacto_liege = PREV
					pf_liege_change_effect = yes
				}
			}
		}

		custom_tooltip = {
			text = KIDNAP_IS_SET_FREE

			hidden_effect = {
				FROM = { character_event = { id = Plus.219 } }

				top_liege = {
					character_event = { id = Plus.220 days = 1 } # Notify

					any_realm_lord = {
						limit = { NOT = { character = FROM } }
						character_event = { id = Plus.220 days = 1 } # Notify
					}
				}
			}
		}

		ai_chance = {
			factor = 80

			mult_modifier = {
				factor = 0.1
				trait = brave
			}

			mult_modifier = {
				factor = 0.5
				trait = humble
			}

			mult_modifier = {
				factor = 2

				practical_age < 30
				health >= 3
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 3
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 4
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 5
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 6
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_218 # You'll get nothing from me!

		if = {
			limit = { trait = craven }
			remove_trait = craven
		}
		else_if = {
			limit = { NOT = { trait = brave } }

			random = {
				chance = 33
				add_trait_brave_effect = yes
			}
		}

		FROM = {
			show_scope_change = no

			character_event = {
				id = Plus.221
				tooltip = KIDNAP_DECIDE
			}
		}

		ai_chance = {
			factor = 20

			mult_modifier = {
				factor = 0.5

				reverse_has_opinion_modifier = {
					name = opinion_denied_title
					who = ROOT
				}
			}

			mult_modifier = {
				factor = 0.25

				reverse_has_opinion_modifier = {
					name = opinion_broken_title_promise
					who = ROOT
				}
			}

			mult_modifier = {
				factor = 0.1
				trait = craven
			}

			mult_modifier = {
				factor = 2
				trait = wroth
			}

			mult_modifier = {
				factor = 2
				trait = proud
			}

			mult_modifier = {
				factor = 2
				health < 3
			}
		}
	}
}

# Kidnapper is granted the demanded title
character_event = {
	id = Plus.219
	desc = EVTDESC_Plus_219
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EXCELLENT

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

		dishonorable_plus_1_effect = yes

		hidden_effect = {
			remove_opinion = { who = FROM name = opinion_denied_title }
			remove_opinion = { who = FROM name = opinion_broken_title_promise }
		}
	}
}

# Realm is told of granted title
character_event = {
	id = Plus.220
	desc = EVTDESC_Plus_220
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	ai = no

	option = {
		name = I_SEE
	}
}

# Kidnapper told his demand is refused
character_event = {
	id = Plus.221
	desc = EVTDESC_Plus_221
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_221 # Then he stays in the dungeon

		trigger = { is_ruler = yes }

		FROM = {
			show_scope_change = no

			tooltip = { imprison = ROOT }
			character_event = { id = Plus.222 }
		}

		ai_chance = { factor = 50 }
	}

	option = {
		name = EVTOPTB_Plus_221 # Kill him--quietly

		tooltip = {
			FROM = {
				show_scope_change = no

				death = { death_reason = death_murder_unknown }
			}
		}

		if = {
			limit = { trait = honest }
			remove_trait = honest
		}
		else_if = {
			limit = { NOT = { trait = deceitful } }

			random = {
				chance = 50
				add_trait_deceitful_effect = yes
			}
		}

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

			random = {
				chance = 50
				add_trait_cruel_effect = yes
			}
		}

		random_list = {
			70 = { # Murder is discovered
				trigger = {
					# Courtiers are helpless, rulers without a spymaster or the kidnapper as their spymaster are out of luck too
					event_target:victim_spymaster = {
						NOT = { character = ROOT }
					}
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 9 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 11 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 13 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 15 }
				}

				custom_tooltip = {
					text = KIDNAP_MURDER_DISCOVERED

					character_event = { id = Plus.223 }
					FROM = { save_event_target_as = target_victim }
					character_event = { id = 10 }

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

			30 = {
				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -9 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -11 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -13 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value <= -15 }
				}

				custom_tooltip = {
					text = KIDNAP_MURDER_NOT_DISCOVERED

					FROM = {
						death = { death_reason = death_murder_unknown }
					}
				}
			}
		}

		ai_chance = {
			factor = 50

			mult_modifier = {
				factor = 0.1

				is_close_relative = FROM

				NOR = {
					trait = cruel
					trait = wroth
				}
			}

			mult_modifier = {
				factor = 0.1

				NOR = {
					trait = cruel
					trait = arbitrary
					trait = wroth
					trait = proud
					trait = impaler
				}
			}

			mult_modifier = {
				factor = 2
				trait = cruel
			}

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

	option = {
		name = EVTOPTC_Plus_221 # Just let him go, dammit

		if = {
			limit = {
				is_vassal_or_below_of = FROM
				is_ruler = no
			}

			banish = yes
		}

		FROM = {
			show_scope_change = no

			character_event = {
				id = Plus.224
				tooltip = KIDNAP_RELEASED
			}
		}

		ai_chance = {
			factor = 25

			trigger = {
				is_ruler = no
			}

			mult_modifier = {
				factor = 0.5
				attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 0 }
			}

			mult_modifier = {
				factor = 0.1
				attribute_diff = { character = event_target:victim_spymaster attribute = intrigue value >= 5 }
			}
		}
	}
}

# Kidnapper keeps target in the dungeon after refusal
character_event = {
	id = Plus.222
	desc = EVTDESC_Plus_222
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_216 # He will pay for this!

		imprison = FROM

		hidden_effect = {
			opinion = {
				name = opinion_kidnapper
				who = FROM
				years = 100
			}

			any_close_relative = {
				limit = {
					OR = {
						is_parent_of = ROOT
						is_child_of = ROOT
						sibling = ROOT
						is_married = ROOT
					}
				}

				opinion = {
					name = opinion_kidnapped_kin
					who = FROM
					years = 50
				}
			}

			top_liege = {
				character_event = { id = Plus.217 days = 1 } # Notify

				any_realm_character = {
					limit = {
						OR = {
							is_close_relative = ROOT
							is_liege_or_above_of = ROOT
							is_vassal_or_below_of = ROOT
						}
					}

					character_event = { id = Plus.217 days = 1 } # Notify
				}
			}

			any_dynasty_member = {
				limit = { NOT = { same_realm = ROOT } }
				character_event = { id = Plus.217 days = 1 } # Notify
			}
		}
	}
}

# Kidnapper's murder of target is discovered
character_event = {
	id = Plus.223
	desc = EVTDESC_Plus_223
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	major = yes

	major_trigger = {
		ai = no

		OR = {
			character = FROM
			is_close_relative = FROMFROM
			dynasty = FROMFROM
			same_realm = FROMFROM
			same_realm = FROM
		}
	}

	option = {
		name = {
			text = CURSES
			trigger = { character = FROM }
		}
		name = {
			text = I_SEE
			trigger = { NOT = { character = FROM } }
		}
	}
}

# Kidnapper releases target
character_event = {
	id = Plus.224
	desc = EVTDESC_Plus_224
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_224

		hidden_effect = {
			opinion = {
				name = attempted_kidnapping
				who = FROM
				years = 50
			}

			opinion = {
				name = opinion_relieved
				who = FROM
				years = 50
				multiplier = 2
			}

			any_close_relative = {
				limit = {
					OR = {
						is_parent_of = ROOT
						is_child_of = ROOT
						sibling = ROOT
						is_married = ROOT
					}
				}

				opinion = {
					name = attempted_kidnapping_of_kin
					who = FROM
					years = 25
				}
			}
		}
	}
}

# Target informed of kidnapping - vassal demanded
character_event = {
	id = Plus.225
	desc = EVTDESC_Plus_225
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_225 # Take the vassal, just release me!

		if = {
			limit = { trait = brave }
			remove_trait = brave
		}
		else_if = {
			limit = { NOT = { trait = craven } }

			random = {
				chance = 33
				add_trait_craven_effect = yes
			}
		}

		event_target:demanded_vassal = {
			show_scope_change = no

			set_defacto_liege = FROM
			pf_liege_change_effect = yes
			letter_event = { id = Plus.226 days = 1 }
		}

		custom_tooltip = {
			text = KIDNAP_IS_SET_FREE

			hidden_effect = {
				FROM = { character_event = { id = Plus.227 } }

				top_liege = {
					character_event = { id = Plus.228 days = 1 } # Notify

					any_realm_lord = {
						limit = {
							NOR = {
								character = FROM
								character = event_target:demanded_vassal
							}
						}

						character_event = { id = Plus.228 days = 1 } # Notify
					}
				}
			}
		}

		ai_chance = {
			factor = 80

			mult_modifier = {
				factor = 0.1
				trait = brave
			}

			mult_modifier = {
				factor = 0.5
				trait = humble
			}

			mult_modifier = {
				factor = 2

				practical_age < 30
				health >= 3
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 3
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 4
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 5
			}

			mult_modifier = {
				factor = 0.75
				num_of_count_titles >= 6
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_218 # You'll get nothing from me!

		if = {
			limit = { trait = craven }
			remove_trait = craven
		}
		else_if = {
			limit = { NOT = { trait = brave } }

			random = {
				chance = 33
				add_trait_brave_effect = yes
			}
		}

		FROM = {
			show_scope_change = no

			character_event = {
				id = Plus.221
				tooltip = KIDNAP_DECIDE
			}
		}

		ai_chance = {
			factor = 20

			mult_modifier = {
				factor = 0.1
				trait = craven
			}

			mult_modifier = {
				factor = 2
				trait = wroth
			}

			mult_modifier = {
				factor = 2
				trait = proud
			}

			mult_modifier = {
				factor = 2
				health < 3
			}
		}
	}
}

# Vassal informed they have been transferred to the kidnapper
letter_event = {
	id = Plus.226
	desc = EVTDESC_Plus_226
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	option = {
		name = I_SEE
	}
}

# Kidnapper is granted the demanded title
character_event = {
	id = Plus.227
	desc = EVTDESC_Plus_227
	picture = GFX_evt_into_the_dungeon
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EXCELLENT

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

		dishonorable_plus_1_effect = yes
	}
}

# Realm is told of granted vassal
character_event = {
	id = Plus.228
	desc = EVTDESC_Plus_228
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.229
	desc = EVTDESC_Plus_229
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = CURSES

		hidden_effect = {
			plot_target_char = {
				character_event = { id = Plus.230 }
			}
		}

		cancel_plot = yes
	}
}

# Failure (not discovered) - notify target
character_event = {
	id = Plus.230
	desc = EVTDESC_Plus_230
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_230
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.231
	desc = EVTDESC_Plus_231
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = CURSES

		piety = -50

		if = {
			limit = {
				plot_target_char = {
					job_spymaster = { always = yes }
				}
			}
			reveal_plot_w_message = yes
		}
		else = {
			reveal_plot = yes
		}

		plot_target_char = {
			show_scope_change = no

			character_event = { id = Plus.232 }

			if = {
				limit = {
					independent = no
					NOT = { vassal_of = ROOT }
				}

				if = {
					limit = { liege = { is_close_relative = FROM } }

					liege = {
						show_scope_change = no

						opinion = {
							name = attempted_kidnapping_of_kin
							who = ROOT
							years = 5
						}
					}
				}
				else = {
					liege = {
						show_scope_change = no

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

		cancel_plot = yes
	}
}

# Failure (discovered) - notify target
character_event = {
	id = Plus.232
	desc = EVTDESC_Plus_232
	picture = GFX_evt_carriage
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_216

		hidden_effect = {
			opinion = {
				name = attempted_kidnapping
				who = FROM
				years = 100
			}

			any_close_relative = {
				limit = {
					OR = {
						is_parent_of = ROOT
						is_child_of = ROOT
						sibling = ROOT
						is_married = ROOT
					}
				}

				opinion = {
					name = attempted_kidnapping_of_kin
					who = FROM
					years = 50
				}
			}
		}
	}
}

### SEDUCE

# The plotter sees an opportunity
character_event = {
	id = Plus.235
	desc = EVTDESC_Plus_235
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_part_of_plot = yes
	only_capable = yes
	prisoner = no
	lacks_dlc = "Way of Life"

	trigger = {
		has_plot = plot_seduce
		is_pregnant = no
		is_plot_active = no

		plot_target_char = {
			at_location = ROOT # The Plot Head needs to be at the target's location to get a chance
			prisoner = no
			is_pregnant = no
			is_incapable = no
			is_inaccessible_trigger = no
		}

		plot_power_contribution = {
			plotter = ROOT
			power >= 0.02
		}
	}

	mean_time_to_happen = {
		years = 5

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.75

			plot_power_contribution = {
				plotter = ROOT
				power >= 0.10
			}
		}

		mult_modifier = {
			factor = 0.75

			plot_power_contribution = {
				plotter = ROOT
				power >= 0.20
			}
		}

		mult_modifier = {
			factor = 0.75

			plot_power_contribution = {
				plotter = ROOT
				power >= 0.30
			}
		}

		mult_modifier = {
			factor = 0.75

			plot_power_contribution = {
				plotter = ROOT
				power >= 0.40
			}
		}

		mult_modifier = {
			factor = 0.75

			plot_power_contribution = {
				plotter = ROOT
				power >= 0.50
			}
		}

		mult_modifier = {
			factor = 0.8

			plot_target_char = {
				opinion = {
					who = ROOT
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 0.7

			plot_target_char = {
				opinion = {
					who = ROOT
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 0.7

			plot_target_char = {
				opinion = {
					who = ROOT
					value >= 60
				}
			}
		}

		mult_modifier = {
			factor = 0.6

			plot_target_char = {
				opinion = {
					who = ROOT
					value >= 80
				}
			}
		}

		mult_modifier = {
			factor = 0.5
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.5
			plot_power >= 0.7
		}

		mult_modifier = {
			factor = 0.5
			plot_power >= 0.9
		}

		mult_modifier = {
			factor = 0.5
			trait = attractive
		}

		mult_modifier = {
			factor = 0.85

			is_female = no
			is_strong_trigger = yes
		}

		mult_modifier = {
			factor = 0.75

			OR = {
				trait = lustful
				trait = hedonist
				trait = poet
			}
		}

		mult_modifier = {
			factor = 0.95
			trait = gregarious
		}

		mult_modifier = {
			factor = 0.5

			plot_target_char = {
				OR = {
					trait = lustful
					trait = hedonist
				}
			}
		}

		mult_modifier = {
			factor = 3
			plot_target_char = { trait = chaste }
		}

		mult_modifier = {
			factor = 0.8
			plot_target_char = { is_married = no }
		}

		mult_modifier = {
			factor = 0.95
			diplomacy = 11
		}

		mult_modifier = {
			factor = 0.9
			diplomacy = 13
		}

		mult_modifier = {
			factor = 0.85
			diplomacy = 15
		}

		mult_modifier = {
			factor = 0.8
			diplomacy = 17
		}

		mult_modifier = {
			factor = 0.8
			practical_age < 25
		}

		mult_modifier = {
			factor = 0.9
			practical_age < 35
		}
	}

	option = {
		name = EVTOPTA_Plus_235 # Do it

		activate_plot = yes

		random_list = {
			20 = {
				additive_modifier = {
					value = 20
					plot_power >= 0.5
				}

				additive_modifier = {
					value = 20
					plot_power >= 1.0
				}

				additive_modifier = {
					value = 20
					plot_target_char = { attracted_to_root_trigger = yes }
				}

				character_event = {
					id = Plus.238
					days = 3
					tooltip = seduce_plot_success_tooltip
				}
			}

			80 = {
				additive_modifier = {
					value = -20
					plot_power >= 0.5
				}

				additive_modifier = {
					value = -20
					plot_power >= 1.0
				}

				additive_modifier = {
					value = -20
					plot_target_char = { attracted_to_root_trigger = yes }
				}

				character_event = {
					id = Plus.240
					days = 3
					tooltip = seduce_plot_fail_tooltip
				}
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_235 # Too risky

		ai_chance = { factor = 0 }
	}
}

# A plot backer sees an opportunity
character_event = {
	id = Plus.236
	desc = EVTDESC_Plus_236
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_part_of_plot = yes
	only_capable = yes
	prisoner = no
	lacks_dlc = "Way of Life"

	trigger = {
		any_backed_character = {
			has_plot = plot_seduce
			plot_power >= 0.25
			is_pregnant = no
			is_plot_active = no

			plot_target_char = {
				prisoner = no
				is_pregnant = no
				is_incapable = no
				is_inaccessible_trigger = no
			}

			ROOT = {
				plot_power_contribution = {
					plotter = ROOT
					power >= 0.02
				}
			}
		}
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				has_character_modifier = plot_assisted_spying
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.65

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				has_character_modifier = plot_assisted_spying2
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.55

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				has_character_modifier = plot_assisted_spying3
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.45

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				has_character_modifier = plot_assisted_spying4
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				plot_power_contribution = {
					plotter = ROOT
					power >= 0.02
				}
			}
		}

		mult_modifier = {
			factor = 0.35

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				has_character_modifier = plot_assisted_spying5
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				has_character_flag = has_personal_spy_network
				is_plot_active = no

				plot_target_char = {
					check_variable = {
						which = personal_spy_network
						value >= 10
					}

					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				has_character_flag = has_personal_spy_network
				is_plot_active = no

				plot_target_char = {
					check_variable = {
						which = personal_spy_network
						value >= 20
					}

					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				has_character_flag = has_personal_spy_network
				is_plot_active = no

				plot_target_char = {
					check_variable = {
						which = personal_spy_network
						value >= 30
					}

					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				has_character_flag = has_personal_spy_network
				is_plot_active = no

				plot_target_char = {
					check_variable = {
						which = personal_spy_network
						value >= 40
					}

					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				has_character_flag = has_personal_spy_network
				is_plot_active = no

				plot_target_char = {
					check_variable = {
						which = personal_spy_network
						value >= 50
					}

					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = ROOT
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.6

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.10
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.6

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.20
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.6

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.30
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.6

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.40
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.9

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no

					opinion = {
						who = PREV
						value >= 20
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no

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

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no

					opinion = {
						who = PREV
						value >= 60
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.7

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no

					opinion = {
						who = PREV
						value >= 80
					}
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.5

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.5
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.5

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.7
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.33

			any_backed_character = {
				has_plot = plot_seduce
				plot_power >= 0.9
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}

				ROOT = {
					plot_power_contribution = {
						plotter = PREV
						power >= 0.02
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			trait = gregarious
		}

		mult_modifier = {
			factor = 0.85
			diplomacy >= 7
		}

		mult_modifier = {
			factor = 0.9
			diplomacy >= 9
		}

		mult_modifier = {
			factor = 0.95
			diplomacy >= 11
		}

		mult_modifier = {
			factor = 0.95
			diplomacy >= 13
		}

		mult_modifier = {
			factor = 0.95
			diplomacy >= 15
		}

		mult_modifier = {
			factor = 0.95
			diplomacy >= 17
		}
	}

	option = {
		name = EVTOPTA_Plus_236 # Seduce attempt

		random_backed_character = {
			show_scope_change = no

			limit = {
				has_plot = plot_seduce
				plot_power >= 0.25
				is_pregnant = no
				is_plot_active = no

				plot_target_char = {
					prisoner = no
					is_pregnant = no
					is_incapable = no
					is_inaccessible_trigger = no
				}
			}

			character_event = {
				id = Plus.237
				days = 3
			}
		}
	}
}

# Plotter tells backer to go ahead
character_event = {
	id = Plus.237
	desc = EVTDESC_Plus_237
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_235 # Do it

		trigger = {
			plot_power < 0.5

			plot_target_char = {
				attracted_to_root_trigger = yes
			}
		}

		activate_plot = yes

		random_list = {
			20 = {
				additive_modifier = {
					value = 20
					plot_power >= 0.5
				}

				additive_modifier = {
					value = 20
					plot_power >= 1.0
				}

				additive_modifier = {
					value = 20
					plot_target_char = { attracted_to_root_trigger = yes }
				}

				character_event = {
					id = Plus.238
					days = 3
					tooltip = seduce_plot_success_tooltip
				}
			}

			80 = {
				additive_modifier = {
					value = -20
					plot_power >= 0.5
				}

				additive_modifier = {
					value = -20
					plot_power >= 1.0
				}

				additive_modifier = {
					value = -20
					plot_target_char = { attracted_to_root_trigger = yes }
				}

				character_event = {
					id = Plus.240
					days = 3
					tooltip = seduce_plot_fail_tooltip
				}
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_235 # Too risky

		ai_chance = { factor = 0 }
	}
}

# Success - inform plotter
character_event = {
	id = Plus.238
	desc = EVTDESC_Plus_238
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		set_character_flag = plot_seducer

		plot_target_char = {
			show_scope_change = no

			add_lover = PREV

			character_event = {
				id = Plus.239
				days = 1
			}
		}
	}
}

# Success - inform target
character_event = {
	id = Plus.239
	desc = EVTDESC_Plus_239
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_239

		add_lover = FROM

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

			add_trait = homosexual
			set_character_flag = revealed_homosexual@ROOT
		}

		hidden_effect = {
			if = {
				limit = {
					is_opposite_sex = FROM
					fertility >= 0.33
					FROM = { fertility >= 0.33 }

					trigger_if = {
						limit = { is_female = yes }
						practical_age < 45
					}
					trigger_else = {
						FROM = { practical_age < 45 }
					}
				}

				random = {
					chance = 50

					if = {
						limit = {
							is_married = no
							is_senior_consort_party = no
							is_consort = no

							FROM = {
								is_married = no
								is_senior_consort_party = no
								is_consort = no
							}
						}

						impregnate = FROM
					}
					else = {
						impregnate_cuckoo = FROM
					}
				}
			}

			change_variable = {
				which = lifestyle_hedonist
				value = 1
			}

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

# Failed - inform plotter
character_event = {
	id = Plus.240
	desc = EVTDESC_Plus_240
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = CURSES

		prestige = -25

		plot_target_char = {
			show_scope_change = no

			reverse_opinion = {
				who = ROOT
				name = love_scorned
				years = 2
			}
		}

		cancel_plot = yes

		hidden_effect = {
			plot_target_char = {
				opinion = {
					name = opinion_recent_plot
					who = ROOT
					years = 5
				}

				character_event = {
					id = Plus.241
					days = 1
				}
			}
		}
	}
}

# Failed - inform target
character_event = {
	id = Plus.241
	desc = EVTDESC_Plus_241
	picture = GFX_evt_lovers
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_241

		if = {
			limit = {
				FROM = {
					root_attraction_trigger = yes
				}
			}

			opinion = {
				name = opinion_furious
				who = FROM
				years = 5
			}
		}
		else = {
			opinion = {
				name = devious_plotter
				who = FROM
				years = 5
			}
		}

		if = {
			limit = {
				FROM = { is_female = yes }
			}

			any_spouse = {
				show_scope_change = no

				opinion = {
					name = slut_seductress
					who = FROM
					years = 10
				}
			}
		}
		else = {
			any_spouse = {
				show_scope_change = no

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

### RELIGIOUS FACTION DEMAND

# Ultimatum - Religious
letter_event = {
	id = Plus.250
	desc = EVTDESC_Plus_250

	is_triggered_only = yes

	trigger = {
		FROM = { leads_faction = faction_religious }
	}

	immediate = {
		FROM = {
			diplomatic_immunity = yes
			clr_character_flag = civil_war_faction_leader
			clr_character_flag = civil_war_faction_member
			clr_character_flag = will_join_civil_war

			any_faction_backer = {
				faction = faction_religious

				diplomatic_immunity = yes
				clr_character_flag = civil_war_faction_leader
				clr_character_flag = civil_war_faction_member
				clr_character_flag = will_join_civil_war
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_250 # Agree to convert

		log = "[Root.GetBestName] has caved to the religious faction demands of [From.GetBestName]."
		set_character_flag = converted_religion

		# Inform faction members and vassals
		hidden_effect = {
			any_vassal = {
				limit = { NOT = { in_faction = faction_religious } }
				character_event = { id = Plus.253 }
			}

			FROM = {
				diplomatic_immunity = no
				letter_event = { id = Plus.251 }

				any_faction_backer = {
					faction = faction_religious

					diplomatic_immunity = no
					letter_event = { id = Plus.252 }
				}
			}
		}

		prestige = -250
		piety = -100

		tooltip = { # For a nicer tooltip
			religion = FROM
		}

		# Actually convert religion - TODO: Use safe conversion scripted effects (fake theocracy)
		if = {
			limit = { higher_real_tier_than = BARON }

			religion_authority = { name = ruler_converted_from }

			FROM = {
				show_scope_change = no

				religion_authority = { name = ruler_converted_to }
			}
		}

		hidden_effect = {
			religion = FROM

			any_courtier = {
				limit = {
					religion = ROOT
					employer = { character = ROOT }
				}

				religion = FROM
			}
		}

		FROM = {
			show_scope_change = no

			trigger_switch = {
				on_trigger = trait

				shaivist_hindu = { ROOT = { show_scope_change = no add_trait = shaivist_hindu } }
				vaishnavist_hindu = { ROOT = { show_scope_change = no add_trait = vaishnavist_hindu } }
				shaktist_hindu = { ROOT = { show_scope_change = no add_trait = shaktist_hindu } }
				smartist_hindu = { ROOT = { show_scope_change = no add_trait = smartist_hindu } }
				mahayana_buddhist = { ROOT = { show_scope_change = no add_trait = mahayana_buddhist } }
				vajrayana_buddhist = { ROOT = { show_scope_change = no add_trait = vajrayana_buddhist } }
				theravada_buddhist = { ROOT = { show_scope_change = no add_trait = theravada_buddhist } }
				digambara_jain = { ROOT = { show_scope_change = no add_trait = digambara_jain } }
				svetambara_jain = { ROOT = { show_scope_change = no add_trait = svetambara_jain } }
			}
		}

		remove_trait_silently_zealous_effect = yes

		ai_chance = {
			factor = 10

			trigger = {
				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 1.0
					}
				}

				controls_religion = no

				NOR = {
					rightful_religious_head = ROOT
					trait = zealous
					trait = lunatic
					trait = possessed
				}
			}

			mult_modifier = {
				factor = 10
				trait = cynical
			}

			mult_modifier = {
				factor = 1.25
				is_weak_trigger = yes
			}

			mult_modifier = {
				factor = 1.25
				trait = craven
			}

			mult_modifier = {
				factor = 1.25
				trait = humble
			}

			mult_modifier = {
				factor = 1.25
				trait = patient
			}

			mult_modifier = {
				factor = 1.25
				trait = content
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_250 # Refuse

		log = "[Root.GetBestName] has refused the religious faction demands of [From.GetBestName] -- this should start a civil war."

		FROM = {
			show_scope_change = no

			tooltip = {
				any_faction_backer = {
					faction = faction_religious
					count = 10
				}
			}

			hidden_effect = {
				letter_event = { id = Plus.254 } # Inform

				# Setup faction leader
				clr_character_flag = faction_install_antiking_ultimatum_taken
				set_character_flag = original_war_liege
				diplomatic_immunity = no
				pf_setup_rebel_effect = yes

				# Setup faction backers
				any_faction_backer = {
					faction = faction_religious

					diplomatic_immunity = no
					pf_setup_rebel_effect = yes
				}
			}

			war = {
				target = ROOT
				casus_belli = religious_overthrow_ruler
				faction = faction_religious
			}
		}

		# Inform remaining vassals
		hidden_effect = {
			any_vassal = {
				letter_event = { id = PlusFaction.403 }
			}
		}

		ai_chance = {
			factor = 90

			mult_modifier = {
				factor = 1.25
				is_strong_trigger = yes
			}

			mult_modifier = {
				factor = 1.25
				trait = brave
			}

			mult_modifier = {
				factor = 1.25
				trait = proud
			}

			mult_modifier = {
				factor = 1.25
				trait = wroth
			}

			mult_modifier = {
				factor = 1.25
				trait = ambitious
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 1.0
					}
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 1.5
					}
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 2.0
					}
				}
			}

			mult_modifier = {
				factor = 0.5

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 2.5
					}
				}
			}

			mult_modifier = {
				factor = 0.25

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 3.0
					}
				}
			}

			mult_modifier = {
				factor = 0.25

				FROM = {
					faction_power = {
						faction = faction_religious
						power >= 4.0
					}
				}
			}
		}
	}
}

# Demand Accepted - Religious Faction
letter_event = {
	id = Plus.251
	desc = EVTDESC_Plus_251

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		clr_character_flag = faction_religious_ultimatum_taken
		piety = 100

		add_character_modifier = {
			name = faction_religious_ultimatum_timer
			years = 10
			hidden = yes
		}
	}
}

# Inform faction backers - Religious Faction
letter_event = {
	id = Plus.252
	desc = EVTDESC_Plus_252

	is_triggered_only = yes
	show_from_from = yes

	option = {
		name = GOOD

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

		add_character_modifier = {
			name = faction_religious_ultimatum_timer
			years = 10
			hidden = yes
		}
	}
}

# Inform other vassals - Religious Faction
character_event = {
	id = Plus.253
	desc = EVTDESC_Plus_253
	picture = GFX_evt_council
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	option = {
		name = I_SEE

		clr_character_flag = civil_war_faction_member
		clr_character_flag = will_join_civil_war
	}
}

# Demand Rejected - Religious Faction
letter_event = {
	id = Plus.254
	desc = EVTDESC_Plus_254

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA8100 # Then war it is!
	}
}

# Vassal chooses sides at the outbreak of a religious war
letter_event = {
	id = Plus.255
	desc = EVTDESC_Plus_255
	border = GFX_event_letter_frame_war

	is_triggered_only = yes

	only_playable = yes

	trigger = {
		religion = FROM
		num_of_baron_titles >= 1
		pf_war_trait_trigger = no
	}

	option = {
		name = EVTOPTA_PlusFaction_415 # Join the rebellion

		trigger = {
			is_adult = yes
			prisoner = no
			is_incapable = no

			NOR = {
				has_truce = liege
				has_non_aggression_pact_with = liege
				has_opinion_modifier = { who = liege name = opinion_coerced_into_leaving_faction }
			}
		}

		join_faction = {
			faction = faction_religious
			faction_leader = FROM
			ignore_requirements = yes
		}

		ai_chance = {
			factor = 10

			trigger = {
				NOT = { is_primary_heir = liege }

				opinion = {
					who = liege
					value < 0
				}
			}

			mult_modifier = {
				factor = 0.5

				OR = {
					has_non_aggression_pact_with = liege
					is_allied_with = liege
					dynasty = liege
					is_close_relative = liege
				}
			}

			mult_modifier = {
				factor = 5
				is_rival = liege
			}

			mult_modifier = {
				factor = 2
				trait = zealous
			}

			mult_modifier = {
				factor = 1.25

				OR = {
					is_allied_with = FROM
					is_close_relative = FROM
				}
			}

			mult_modifier = {
				factor = 0.8
				opinion = { who = FROM value < 0 }
			}

			mult_modifier = {
				factor = 0.8
				opinion = { who = FROM value < -25 }
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value < -50 }
			}

			mult_modifier = {
				factor = 0.5
				opinion = { who = FROM value < -75 }
			}

			mult_modifier = {
				factor = 1.25
				opinion = { who = FROM value >= 25 }
			}

			mult_modifier = {
				factor = 1.25
				opinion = { who = FROM value >= 50 }
			}

			mult_modifier = {
				factor = 1.25
				opinion = { who = FROM value >= 75 }
			}

			mult_modifier = {
				factor = 3
				opinion = { who = liege value < -25 }
			}

			mult_modifier = {
				factor = 3
				opinion = { who = liege value < -50 }
			}

			mult_modifier = {
				factor = 3
				opinion = { who = liege value < -75 }
			}
		}
	}

	option = {
		name = EVTOPTB_PlusFaction_415 # Refuse

		trigger = {
			is_adult = yes
			prisoner = no
			is_incapable = no

			NOR = {
				has_truce = liege
				has_non_aggression_pact_with = liege
				has_opinion_modifier = { who = liege name = opinion_coerced_into_leaving_faction }
			}
		}

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

		ai_chance = {
			factor = 100

			mult_modifier = {
				factor = 2
				trait = craven
			}

			mult_modifier = {
				factor = 2
				trait = content
			}

			mult_modifier = {
				factor = 2
				trait = humble
			}

			mult_modifier = {
				factor = 2
				trait = cynical
			}
		}
	}

	option = {
		name = {
			text = EVTOPTC_PlusFaction_415_prisoner # I am imprisoned
			trigger = { prisoner = yes }
		}
		name = {
			text = EVTOPTC_PlusFaction_415_incapable # I am NOT up to such a fight...
			trigger = {
				is_incapable = yes
				prisoner = no
			}
		}
		name = {
			text = EVTOPTC_PlusFaction_415_child # I am a child
			trigger = {
				is_adult = no
				prisoner = no
				is_incapable = no
			}
		}
		name = {
			text = EVTOPTC_PlusFaction_415_truce # I cannot
			trigger = {
				is_adult = yes
				prisoner = no
				is_incapable = no

				OR = {
					has_truce = liege
					has_non_aggression_pact_with = liege
					has_opinion_modifier = { who = liege name = opinion_coerced_into_leaving_faction }
				}
			}
		}

		trigger = {
			NAND = {
				is_adult = yes
				prisoner = no
				is_incapable = no

				NOR = {
					has_truce = liege
					has_non_aggression_pact_with = liege
					has_opinion_modifier = { who = liege name = opinion_coerced_into_leaving_faction }
				}
			}
		}
	}
}


### REPLACE REGENT

# Should I abandon my current plot to become regent?
# TODO: Generalize, find way to do this in plots definitions?
character_event = {
	id = Plus.260

	hide_window = yes

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

	trigger = {
		independent = no
		at_location = liege

		liege = {
			has_regent = yes

			trigger_if = {
				limit = { is_adult = yes }
				is_incapable = yes
			}

			# ROOT isn't already plotting against his liege or liege's regent
			NOR = {
				regent = { ROOT = { plot_target_char = { character = PREVPREV } } }
				ROOT = { plot_target_char = { character = PREVPREV } }
			}
		}

		# Requirements mirrored from plot
		OR = {
			is_married = liege
			is_close_relative = liege
			is_primary_heir = liege
			is_voter = yes
		}

		trigger_if = {
			limit = { is_female = yes }

			liege = {
				OR = {
					has_law = true_cognatic_succession
					has_law = enatic_cognatic_succession
					has_law = enatic_succession
				}
			}
		}
		trigger_else = {
			liege = {
				OR = {
					has_law = agnatic_succession
					has_law = cognatic_succession
					has_law = true_cognatic_succession
				}
			}
		}
		# End of requirements

		is_dumb_trigger = no
		is_inaccessible_trigger = no

		NOR = {
			trait = content
			trait = humble
			has_minor_title = title_regent
			has_character_modifier = replace_regent_timer
		}

		trigger_if = {
			limit = { has_character_flag = replace_regent_check }

			had_character_flag = {
				flag = replace_regent_check
				years >= 5
			}
		}
	}

	mean_time_to_happen = {
		months = 1
	}

	immediate = {
		set_character_flag = replace_regent_check

		random_list = {
			75 = { # Do it
				cancel_plot = yes
				# add_plot = plot_replace_regent # Effect doesn't work!!! - TODO: Find other to make this work

				mult_modifier = {
					factor = 0.5

					OR = {
						has_plot = plot_kill_character
						has_plot = plot_kill_spouse
						has_plot = plot_take_revenge
					}
				}

				mult_modifier = {
					factor = 0.5
					intrigue < 8
				}

				mult_modifier = {
					factor = 0.5
					intrigue < 4
				}
			}

			25 = { # Never mind
				trigger = {
					num_of_plot_backers >= 1
					intrigue < 12
				}
			}
		}
	}
}

# Someone starts to become aware of my plot to replace the regent
character_event = {
	id = Plus.261

	hide_window = yes

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

	trigger = {
		has_plot = plot_replace_regent
		NOT = { plot_is_known_by = liege }

		liege = {
			OR = {
				regent = {
					NOT = { ROOT = { plot_is_known_by = PREV } }
				}

				any_courtier = {
					has_plot = plot_replace_regent
					NOT = { ROOT = { plot_is_known_by = PREV } }
				}
			}
		}

		trigger_if = {
			limit = { has_character_flag = replace_regent_plot_discovery }

			had_character_flag = {
				flag = replace_regent_plot_discovery
				months >= 3
			}
		}
	}

	mean_time_to_happen = {
		years = 1

		mult_modifier = {
			factor = 1.5

			OR = {
				trait = quick
				trait = shrewd
			}
		}

		mult_modifier = {
			factor = 2
			trait = genius
		}

		mult_modifier = {
			factor = 1.5
			is_close_relative = liege
		}

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

		mult_modifier = {
			factor = 1.5

			NOT = {
				liege = {
					any_courtier = {
						has_plot = plot_replace_regent
						count = 2
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 2
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 3
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 4
				}
			}
		}

		mult_modifier = {
			factor = 0.8
			intrigue < 8
		}

		mult_modifier = {
			factor = 0.8
			intrigue < 5
		}

		mult_modifier = {
			factor = 0.8
			intrigue < 3
		}

		mult_modifier = {
			factor = 1.2
			intrigue >= 12
		}

		mult_modifier = {
			factor = 1.2
			intrigue >= 14
		}

		mult_modifier = {
			factor = 1.2
			intrigue >= 16
		}

		mult_modifier = {
			factor = 1.2
			intrigue >= 18
		}

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

	immediate = {
		set_character_flag = replace_regent_plot_discovery

		# If someone else is also plotting
		if = {
			limit = {
				liege = {
					any_courtier = {
						has_plot = plot_replace_regent
						NOT = { ROOT = { plot_is_known_by = PREV } }
					}
				}
			}

			# and the regent isn't aware of my plot yet
			if = {
				limit = {
					liege = {
						regent = {
							NOT = { ROOT = { plot_is_known_by = PREV } }
						}
					}
				}

				# some other plotter finds out about my plot
				liege = {
					random_courtier = {
						limit = {
							has_plot = plot_replace_regent
							NOT = { ROOT = { plot_is_known_by = PREV } }
						}

						character_event = { id = Plus.262 }
					}
				}
			}
			# but if the regent is already aware
			else = {
				# there's a reduced likelihood of someone finding out
				random = {
					chance = 50

					liege = {
						random_courtier = {
							limit = {
								has_plot = plot_replace_regent
								NOT = { ROOT = { plot_is_known_by = PREV } }
							}

							character_event = { id = Plus.262 }
						}
					}
				}
			}
		}
		else = {
			# Regent finds out if no one else is plotting
			liege = {
				regent = {
					character_event = { id = Plus.262 }
				}
			}
		}
	}
}

# Do we try to block the plotter?
character_event = {
	id = Plus.262
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_262A
		trigger = { has_minor_title = title_regent }
	}
	desc = {
		text = EVTDESC_Plus_262B
		trigger = { NOT = { has_minor_title = title_regent } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_262 # We have to stop them

		random_list = {
			50 = {
				mult_modifier = {
					factor = 1.5
					has_minor_title = title_regent
				}

				mult_modifier = {
					factor = 1.5

					OR = {
						trait = quick
						trait = shrewd
					}
				}

				mult_modifier = {
					factor = 2.0
					trait = genius
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value >= 2 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value >= 4 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value >= 6 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value >= 8 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value >= 10 }
				}

				mult_modifier = {
					factor = 0.9
					FROM = { plot_power >= 1.0 }
				}

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

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

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

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

				FROM = {
					show_scope_change = no

					character_event = {
						id = Plus.263
						tooltip = REGENT_PLOT_BLOCKED
					}
				}

				hidden_effect = {
					character_event = { id = Plus.264 }
					liege = { character_event = { id = Plus.268 } }
				}
			}

			50 = {
				mult_modifier = {
					factor = 0.5

					liege = {
						OR = {
							is_close_relative = FROM
							is_close_relative = ROOT
						}
					}
				}

				character_event = {
					id = Plus.265
					tooltip = REGENT_PLOT_NOTHING
				}
			}

			30 = {
				mult_modifier = {
					factor = 1.5

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

						trait = slow
						trait = dull
					}
				}

				mult_modifier = {
					factor = 2.0

					OR = {
						FROM = { trait = genius }
						trait = imbecile
					}
				}

				mult_modifier = {
					factor = 1.5
					is_ill = yes
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value <= -2 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value <= -4 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value <= -6 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value <= -8 }
				}

				mult_modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value <= -10 }
				}

				character_event = {
					id = Plus.266
					tooltip = REGENT_PLOT_WORSE
				}

				hidden_effect = {
					character_event = { id = Plus.267 }
					liege = { character_event = { id = Plus.269 } }
				}
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTB_Plus_262 # I don't want to make things worse

		ai_chance = { factor = 0 }
	}
}

# Plot to replace the regent has been blocked
character_event = {
	id = Plus.263
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_263A
		trigger = { FROM = { has_minor_title = title_regent } }
	}
	desc = {
		text = EVTDESC_Plus_263B
		trigger = { FROM = { NOT = { has_minor_title = title_regent } } }
	}

	is_triggered_only = yes

	option = {
		name = CURSES

		cancel_plot = yes
	}
}

# Informed that their plan to block the plotter was successful
character_event = {
	id = Plus.264
	desc = EVTDESC_Plus_264
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	ai = no

	option = {
		name = EXCELLENT
	}
}

# Informed that their plan to block the plotter did nothing
character_event = {
	id = Plus.265
	desc = EVTDESC_Plus_265
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	ai = no

	option = {
		name = CURSES
	}
}

# Plot to replace the regent has been made more successful
character_event = {
	id = Plus.266
	desc = EVTDESC_Plus_266
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		set_character_flag = speed_up_replace_regent

		liege = {
			show_scope_change = no

			random_courtier = {
				show_scope_change = no

				limit = {
					is_adult = yes
					prisoner = no
					is_incapable = no

					opinion = {
						who = ROOT
						value >= 0
					}

					NOR = {
						has_plot = plot_replace_regent
						ROOT = { any_plot_backer = { character = PREVPREV } }
					}
				}

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

				liege = {
					show_scope_change = no

					regent = {
						show_scope_change = no

						reverse_opinion = {
							name = opinion_irritated
							who = PREVPREV
							years = 1
							multiplier = 2
						}
					}
				}
			}
		}
	}
}

# Informed that their plan to block the plotter made things worse
character_event = {
	id = Plus.267
	desc = EVTDESC_Plus_267
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	ai = no

	option = {
		name = CURSES
	}
}

# Liege informed of plot being blocked
character_event = {
	id = Plus.268
	desc = EVTDESC_Plus_268
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	ai = no
	prisoner = no

	option = {
		name = OK
	}
}

# Liege informed of plot being made worse
character_event = {
	id = Plus.269
	desc = EVTDESC_Plus_269
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	show_from_from = yes

	ai = no
	prisoner = no

	option = {
		name = OK
	}
}

### USURP INCAPABLE LIEGE

# Opportunity to seize the throne arises
character_event = {
	id = Plus.270
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_270A
		trigger = { is_primary_heir = liege }
	}
	desc = {
		text = EVTDESC_Plus_270B
		trigger = {
			OR = {
				is_married = liege
				is_parent_of = liege
				sibling = liege
			}
			NOT = { is_primary_heir = liege }
		}
	}
	desc = {
		text = EVTDESC_Plus_270C
		trigger = {
			NOR = {
				is_primary_heir = liege
				is_married = liege
				is_parent_of = liege
				sibling = liege
			}
		}
	}

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

	trigger = {
		has_plot = plot_incapable_usurp
		is_plot_active = no
		plot_power >= 2.0
		num_of_plot_backers >= 3
		in_command_trigger = no
		is_inaccessible_trigger = no

		plot_target_char = {
			regent = { character = ROOT }
			is_liege_of = ROOT
			is_incapable = yes
			war = no
		}
	}

	mean_time_to_happen = {
		years = 5

		mult_modifier = {
			factor = 0.1
			is_primary_heir = liege
		}

		mult_modifier = {
			factor = 0.5

			OR = {
				is_married = liege
				is_parent_of = liege
				sibling = liege
			}

			NOT = { is_primary_heir = liege }
		}

		mult_modifier = {
			factor = 1.5

			NOR = {
				is_primary_heir = liege
				is_married = liege
				is_parent_of = liege
				sibling = liege
				dynasty = liege
			}
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 2
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 4
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 6
		}

		mult_modifier = {
			factor = 1.2
			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
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.25
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.5
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.75
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 3.25
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 3.5
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 3.75
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 4.0
		}
	}

	option = {
		name = EVTOPTA_Plus_270 # Do it

		activate_plot = yes

		random_list = {
			50 = {
				mult_modifier = {
					factor = 1.5
					trait = genius
				}

				mult_modifier = {
					factor = 1.25

					OR = {
						trait = quick
						trait = shrewd
					}
				}

				mult_modifier = {
					factor = 0.75

					OR = {
						trait = slow
						trait = dull
					}
				}

				mult_modifier = {
					factor = 1.5

					liege = {
						prisoner = yes
						host = { character = ROOT }
					}
				}

				mult_modifier = {
					factor = 1.5
					liege = { prisoner = yes }
				}

				mult_modifier = {
					factor = 0.5

					liege = {
						current_heir = {
							is_adult = yes
							prisoner = no
							is_incapable = no

							NOR = {
								character = ROOT
								trait = lunatic
							}
						}
					}
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.0
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 4.0
				}

				character_event = {
					id = Plus.275
					days = 7
					tooltip = USURP_SUCCESSFUL
				}
			}

			50 = {
				mult_modifier = {
					factor = 1.2
					intrigue < 2
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 4
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 6
				}

				mult_modifier = {
					factor = 1.2
					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
				}

				character_event = {
					id = Plus.271
					days = 7
					tooltip = USURP_FAILED
				}
			}

			50 = {
				trigger = {
					NOT = { liege = { current_heir = { character = ROOT } } }
				}

				mult_modifier = {
					factor = 0.25

					OR = {
						is_married = liege
						is_parent_of = liege
						sibling = liege
					}

					NOT = { is_primary_heir = liege }
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 2
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 4
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 6
				}

				mult_modifier = {
					factor = 1.2
					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
				}

				character_event = {
					id = Plus.272
					days = 7
					tooltip = USURP_REVEALED
				}
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTB_Plus_270 # Forget it

		ai_chance = { factor = 0 }
	}
}

# Attempt to usurp failed
character_event = {
	id = Plus.271
	desc = EVTDESC_Plus_271
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_plot_active = yes
	}

	option = {
		name = CURSES

		cancel_plot = yes
		prestige = -50
	}
}

# Attempt to usurp revealed
character_event = {
	id = Plus.272
	desc = EVTDESC_Plus_272
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_plot_active = yes
	}

	option = {
		name = CURSES

		cancel_plot = yes
		prestige = -100

		tooltip = { imprison = yes }

		hidden_effect = {
			liege = {
				if = {
					limit = { is_friend = ROOT }
					remove_friend = ROOT
				}

				character_event = { id = Plus.273 }

				any_vassal = {
					character_event = { id = Plus.274 }
				}
			}
		}
	}
}

# Liege informed about revealed usurpation
character_event = {
	id = Plus.273
	desc = EVTDESC_Plus_273
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_273

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

		FROM = {
			show_scope_change = no

			remove_title = title_regent
			imprison = ROOT
		}
	}
}

# Vassals informed about revealed usurpation
character_event = {
	id = Plus.274
	desc = EVTDESC_Plus_274
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

# Attempt to usurp successful
character_event = {
	id = Plus.275
	desc = EVTDESC_Plus_275
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	trigger = {
		is_plot_active = yes
	}

	option = {
		name = EXCELLENT

		set_character_flag = regent_usurp_titles
		prestige = 100

		if = {
			limit = {
				has_nickname = no
				NOT = { is_primary_heir = liege }

				liege = {
					NAND = {
						OR = {
							is_married = ROOT
							is_child_of = ROOT
							sibling = ROOT
						}

						current_heir = {
							OR = {
								is_incapable = yes
								trait = lunatic
								NOT = { dynasty = PREV }
							}
						}
					}
				}
			}

			give_nickname = nick_the_usurper
		}

		tooltip = {
			liege = {
				show_scope_change = no

				abdicate_to = ROOT
			}
		}

		hidden_effect = {
			liege = {
				# Set up some flags used in events fired below
				if = {
					limit = { current_heir = { character = ROOT } }
					ROOT = { set_character_flag = was_current_heir }
				}
				else_if = {
					limit = {
						OR = {
							is_married = ROOT
							is_child_of = ROOT
							sibling = ROOT
						}
					}
					ROOT = { set_character_flag = was_close_relative }
				}
				else = {
					ROOT = { set_character_flag = was_not_close_relative }
				}

				character_event = { id = Plus.276 }

				any_vassal = {
					character_event = { id = Plus.277 }
				}

				if = {
					limit = {
						current_heir = { NOT = { character = ROOT } }
					}

					current_heir = {
						opinion = {
							name = succ_law_disinherit
							who = ROOT
							years = 20
						}

						set_character_flag = justified_claimant
					}

					any_dynasty_member = {
						limit = { NOT = { vassal_of = PREV } }
						character_event = { id = Plus.277 }
					}
				}
			}

			# Flags no longer needed, events have been fired
			clr_character_flag = was_current_heir
			clr_character_flag = was_close_relative
			clr_character_flag = was_not_close_relative
		}
	}
}

# Liege informed about usurpation
character_event = {
	id = Plus.276
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_276A
		trigger = { FROM = { has_character_flag = was_current_heir } }
	}
	desc = {
		text = EVTDESC_Plus_276B
		trigger = { FROM = { has_character_flag = was_close_relative } }
	}
	desc = {
		text = EVTDESC_Plus_276C
		trigger = { FROM = { has_character_flag = was_not_close_relative } }
	}

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_276

		# TODO: Transfer artifacts, perhaps only under select circumstances?
		if = {
			limit = { current_heir = { character = FROM } }

			transfer_scaled_wealth = {
				to = FROM
				value = all
			}

			abdicate = yes
			add_trait = abdicated
			# Loan transferred by on_action
		}
		else = {
			abdicate_to = FROM

			hidden_effect = {
				transfer_scaled_wealth = {
					to = FROM
					value = all
				}

				if = {
					limit = {
						check_variable = {
							which = loan_amount
							value > 0
						}
					}

					FROM = {
						if = {
							limit = { NOT = { has_character_modifier = loan_timer } }

							add_character_modifier = {
								name = loan_timer
								years = 2
							}
						}

						change_variable = {
							which = loan_amount
							which = PREV
						}
					}

					set_variable = {
						which = loan_amount
						value = 0
					}

					if = {
						limit = { has_character_modifier = borrowed_from_jews }

						FROM = {
							add_character_modifier = {
								name = borrowed_from_jews
								duration = -1
								inherit = yes
								hidden = yes
							}
						}

						remove_character_modifier = borrowed_from_jews
					}
				}
			}
		}
	}
}

# Vassals informed about usurpation
character_event = {
	id = Plus.277
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	desc = {
		text = EVTDESC_Plus_277A
		trigger = { FROM = { has_character_flag = was_current_heir } }
	}
	desc = {
		text = EVTDESC_Plus_277B
		trigger = { FROM = { has_character_flag = was_close_relative } }
	}
	desc = {
		text = EVTDESC_Plus_277C
		trigger = { FROM = { has_character_flag = was_not_close_relative } }
	}

	is_triggered_only = yes

	ai = no

	option = {
		name = I_SEE
	}
}

### INCITE NATIONALIST REVOLT

# Chance to incite occurs
character_event = {
	id = Plus.280
	desc = EVTDESC_Plus_280
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue

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

	trigger = {
		has_plot = plot_stir_rebellion
		plot_power = 1.0
		independent = no

		plot_target_char = {
			is_liege_of = ROOT
			NOT = { culture = ROOT }
		}

		capital_scope = {
			culture = ROOT
			religion = ROOT

			kingdom = {
				culture = ROOT

				trigger_if = {
					limit = { has_holder = yes }

					holder_scope = {
						OR = {
							NOT = { culture = ROOT }

							top_liege = {
								NOT = {
									any_realm_province = {
										province_id = PREVPREVPREVPREV
										held_under_PREV = yes
									}
								}
							}
						}
					}
				}
			}
		}

		is_inaccessible_trigger = no
		NOT = { has_character_flag = incite_revolt_underway }
	}

	mean_time_to_happen = {
		years = 20

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 2
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 4
		}

		mult_modifier = {
			factor = 1.2
			intrigue < 6
		}

		mult_modifier = {
			factor = 1.2
			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
		}

		mult_modifier = {
			factor = 0.8
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.8
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.8
			num_of_plot_backers >= 12
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 1.25
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 1.75
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.25
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.5
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 2.75
		}

		mult_modifier = {
			factor = 0.9
			plot_power >= 3.0
		}
	}

	option = {
		name = EVTOPTA_Plus_280 # Make the attempt

		set_character_flag = incite_revolt_underway

		random_list = {
			50 = {
				mult_modifier = {
					factor = 1.5
					plot_target_char = { NOT = { culture_group = ROOT } }
				}

				mult_modifier = {
					factor = 1.5
					trait = genius
				}

				mult_modifier = {
					factor = 1.25

					OR = {
						trait = quick
						trait = shrewd
					}
				}

				mult_modifier = {
					factor = 0.75

					OR = {
						trait = slow
						trait = dull
					}
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.0
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.0
				}

				character_event = {
					id = Plus.281
					days = 7
					tooltip = INCITE_REVOLT_SUCCESS
				}
			}

			30 = {
				mult_modifier = {
					factor = 1.2
					intrigue < 6
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 8
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 2
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 4
				}

				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
				}

				character_event = {
					id = Plus.282
					days = 7
					tooltip = INCITE_REVOLT_FAILURE
				}
			}

			20 = {
				trigger = {
					plot_target_char = {
						job_spymaster = { always = yes }
					}
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { intrigue < 4 } }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { intrigue < 6 } }
				}

				mult_modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { intrigue < 8 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 10 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 12 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 14 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 16 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 18 } }
				}

				mult_modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue >= 20 } }
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 2
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 4
				}

				mult_modifier = {
					factor = 1.2
					intrigue < 6
				}

				mult_modifier = {
					factor = 1.2
					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
				}

				character_event = {
					id = Plus.283
					days = 7
					tooltip = INCITE_REVOLT_DISCOVERED
				}
			}
		}

		ai_chance = { factor = 100 }
	}

	option = {
		name = EVTOPTB_Plus_280 # No, too risky

		cancel_plot = yes

		ai_chance = { factor = 0 }
	}
}

# Attempt to incite succeeds
character_event = {
	id = Plus.281
	desc = EVTDESC_Plus_281
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EXCELLENT

		capital_scope = {
			show_scope_change = no

			add_province_modifier = {
				name = cultural_unrest
				years = 1
			}
		}

		any_realm_province = {
			show_scope_change = no

			limit = {
				owned_by = ROOT # Merely owning one holding here is not enough
				culture = ROOT
				religion = ROOT
				is_capital = no
				NOT = { has_province_modifier = cultural_unrest }
				held_under_PREV = yes
			}

			random = {
				chance = 25

				add_province_modifier = {
					name = cultural_unrest
					years = 1
				}
			}
		}
	}
}

# Attempt to incite fails
character_event = {
	id = Plus.282
	desc = EVTDESC_Plus_282
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = CURSES

		prestige = -50

		if = {
			limit = { ai = yes }
			cancel_plot = yes
		}
	}
}

# Attempt to incite is discovered
character_event = {
	id = Plus.283
	desc = EVTDESC_Plus_283
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = CURSES

		cancel_plot = yes
		prestige = -100

		any_liege = {
			show_scope_change = no

			character_event = {
				id = Plus.284
				tooltip = INCITE_INFORM_LIEGES
			}
		}
	}
}

# Lieges are informed about attempt to incite
character_event = {
	id = Plus.284
	desc = EVTDESC_Plus_284
	picture = GFX_evt_peasants
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_284

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

### REVEAL PLOT

# Target informed about plot against them
letter_event = {
	id = Plus.285
	desc = EVTDESC_Plus_285
	border = GFX_event_letter_frame_intrigue
	portrait = FROMFROM

	is_triggered_only = yes

	immediate = {
		FROM = { reveal_plot = ROOT }
	}

	option = {
		name = EVTOPTA_Plus_285 # Then he should do something about it!

		trigger = {
			FROM = { is_vassal_or_below_of = ROOT_FROMFROM }
		}

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

		opinion = {
			name = opinion_thankful
			who = FROMFROM
			years = 1
		}

		FROMFROM = {
			letter_event = { id = Plus.286 }
		}
	}

	option = {
		name = EVTOPTB_Plus_285 # This is good to know

		trigger = {
			NOT = { FROM = { is_vassal_or_below_of = ROOT_FROMFROM } }
		}

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

		opinion = {
			name = opinion_uncovered_plot
			who = FROMFROM
			years = 5
		}

		FROMFROM = {
			letter_event = { id = Plus.287 }
		}
	}
}

# Informant asked to do something about his vassal
letter_event = {
	id = Plus.286
	desc = EVTDESC_Plus_286
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

		tooltip = {
			reverse_opinion = {
				name = opinion_thankful
				who = FROM
				years = 1
			}
		}
	}
}

# Informant thanked for the assistance
letter_event = {
	id = Plus.287
	desc = EVTDESC_Plus_287
	border = GFX_event_letter_frame_intrigue

	is_triggered_only = yes

	ai = no

	option = {
		name = OK

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

# Plotter informed that his plot is revealed
character_event = {
	id = Plus.288
	desc = EVTDESC_Plus_288
	picture = GFX_evt_shadowy_cabal
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	is_part_of_plot = yes

	trigger = {
		has_plot = yes

		plot_target_char = {
			character = event_target:revealed_target
		}
	}

	immediate = {
		reveal_plot = yes
		}

	option = {
		name = CURSES

		opinion = {
			name = revealed_plot
			who = FROMFROM
			years = 5
		}

		if = {
			limit = {
				ai = yes
				independent = no

				NOR = {
					trait = lunatic
					trait = possessed
					has_plot = plot_take_revenge
				}
			}

			cancel_plot = yes
		}
	}
}

### BECOME REPUBLIC

# Chance for the city to usurp the county
character_event = {
	id = Plus.290

	hide_window = yes

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

	trigger = {
		has_plot = plot_become_republic
		is_republic = yes
		real_tier = BARON
		is_patrician = no
		is_inaccessible_trigger = no
		NOT = { has_character_flag = county_usurp_underway }

		primary_title = {
			dejure_liege_title = {
				is_contested = no
				is_occupied = no

				holder_scope = {
					is_plot_target_of = ROOT
					is_liege_of = ROOT
					ai = yes

					OR = {
						ROOT = { relative_power_to_liege >= 1.0 }
						has_regent = yes
						trait = imbecile
						trait = lunatic
						trait = excommunicated
						in_command_trigger = yes
						health_traits >= 2
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		years = 10

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value >= 1 } }
				}
			}
		}

		mult_modifier = {
			factor = 0.8

			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value >= 3 } }
				}
			}
		}

		mult_modifier = {
			factor = 0.65

			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value >= 5 } }
				}
			}
		}

		mult_modifier = {
			factor = 1.2

			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value >= 1 }
				}
			}
		}

		mult_modifier = {
			factor = 1.2

			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value >= 3 }
				}
			}
		}

		mult_modifier = {
			factor = 1.5

			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value >= 5 }
				}
			}
		}

		mult_modifier = {
			factor = 0.5
			liege = { has_regent = yes }
		}

		mult_modifier = {
			factor = 0.5
			relative_power_to_liege >= 2.0
		}

		mult_modifier = {
			factor = 0.1

			liege = {
				OR = {
					regent = { character = ROOT }
					job_spymaster = { character = ROOT }
				}
			}
		}

		mult_modifier = {
			factor = 1.5
			plot_power < 1.0
		}

		mult_modifier = {
			factor = 2.0
			plot_power < 0.75
		}

		mult_modifier = {
			factor = 2.0
			plot_power < 0.50
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 1.25
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 1.75
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 2.25
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 2.5
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 2.75
		}

		mult_modifier = {
			factor = 0.8
			plot_power >= 3.0
		}
	}

	immediate = {
		liege = {
			job_spymaster = {
				save_event_target_as = liege_spymaster
			}
		}

		random_list = {
			50 = {
				mult_modifier = {
					factor = 0.25

					liege = {
						OR = {
							regent = { character = ROOT }
							job_spymaster = { character = ROOT }
						}
					}
				}

				mult_modifier = {
					factor = 0.5
					liege = { has_regent = yes }
				}

				mult_modifier = {
					factor = 0.5
					relative_power_to_liege >= 1.0
				}

				mult_modifier = {
					factor = 0.5
					relative_power_to_liege >= 2.0
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 1 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 3 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 5 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 7 }
				}

				mult_modifier = {
					factor = 0.8
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 9 }
				}

				character_event = { id = Plus.291 } # Failure
			}

			50 = {
				mult_modifier = {
					factor = 1.5
					trait = genius
				}

				mult_modifier = {
					factor = 1.25

					OR = {
						trait = quick
						trait = shrewd
					}
				}

				mult_modifier = {
					factor = 0.75

					OR = {
						trait = slow
						trait = dull
					}
				}

				mult_modifier = {
					factor = 0.75
					plot_power < 1.0
				}

				mult_modifier = {
					factor = 0.75
					plot_power < 0.75
				}

				mult_modifier = {
					factor = 0.5
					plot_power < 0.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 1.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.0
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.25
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.5
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 2.75
				}

				mult_modifier = {
					factor = 1.1
					plot_power >= 3.0
				}

				mult_modifier = {
					factor = 1.5
					attribute_diff = { character = event_target:liege_spymaster attribute = intrigue value >= 1 }
				}

				liege = { save_event_target_as = former_liege }

				if = {
					limit = { liege = { higher_real_tier_than = COUNT } }
					liege = { save_event_target_as = new_liege }
				}
				else_if = {
					limit = { liege = { independent = no } }
					liege = { liege = { save_event_target_as = new_liege } }
				}
				else = {
					save_event_target_as = new_liege
				}
				character_event = { id = Plus.292 } # Success
			}
		}
	}
}

# Attempt to usurp the county fails
character_event = {
	id = Plus.291

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		cancel_plot = yes
		prestige = -100

		liege = {
			opinion = {
				name = devious_plotter
				who = ROOT
				years = 20
			}
		}
	}
}

# Attempt to usurp the county succeeds
character_event = {
	id = Plus.292

	is_triggered_only = yes
	hide_window = yes

	immediate = {
		log = "[Root.GetTitledName] has successfully usurped the [Root.PrimaryTitle.County.GetFullName] and made [Root.PrimaryTitle.GetName] the new capital."
		prestige = 50
		wealth = 50

		if = {
			limit = { dynasty = none }

			dynasty = father_bastard

			any_child = {
				limit = { dynasty = none }

				dynasty = ROOT

				any_child = {
					limit = { dynasty = none }

					dynasty = ROOT
				}
			}
		}

		primary_title = {
			province_capital = yes

			dejure_liege_title = {
				usurp_title = ROOT

				if = {
					limit = { event_target:former_liege = { higher_real_tier_than = COUNT } }

					remove_claim = event_target:former_liege
					add_weak_pressed_claim = event_target:former_liege
				}
			}
		}

		set_defacto_liege = event_target:new_liege
		pf_liege_change_effect = yes

		# First attempt to marry the ruler
		if = {
			limit = {
				event_target:former_liege = {
					is_married = no
					is_betrothed = no
				}

				OR = {
					AND = {
						is_married = no
						is_betrothed = no
					}

					any_child = {
						is_married = no
						is_betrothed = no
					}
				}
			}

			if = {
				limit = {
					event_target:former_liege = {
						is_female = yes
						religion = ROOT
						is_adult = yes
						practical_age <= 40
					}

					is_female = no
					is_married = no
					is_betrothed = no
				}

				add_spouse = event_target:former_liege
			}
			else_if = {
				limit = {
					event_target:former_liege = {
						is_female = yes
						is_adult = no
						religion = ROOT
						age < 14
					}

					is_female = no
					is_married = no
					is_betrothed = no
				}

				add_betrothal = event_target:former_liege
			}
			else_if = {
				limit = {
					event_target:former_liege = {
						is_female = no
						is_adult = yes
					}
				}

				random_child = {
					limit = {
						dynasty = ROOT
						religion = ROOT
						is_female = yes
						is_adult = yes
						is_married = no
						is_betrothed = no
						practical_age < 40
					}

					if = {
						limit = {
							ROOT = {
								trigger_if = {
									limit = { has_law = agnatic_succession }
									is_feminist_trigger = yes
								}
							}
						}

						add_spouse_matrilineal = event_target:former_liege
					}
					else = {
						add_spouse = event_target:former_liege
					}
				}
			}
			else_if = {
				limit = {
					event_target:former_liege = {
						is_female = yes
						is_adult = no
						age < 14
					}
				}

				random_child = {
					limit = {
						dynasty = ROOT
						religion = event_target:former_liege
						is_female = no
						is_married = no
						is_betrothed = no

						age_diff = {
							who = event_target:former_liege
							years < 10
						}
					}

					add_betrothal = event_target:former_liege
				}
			}
		}

		# Then attempt to marry a child of the ruler
		else_if = {
			limit = {
				event_target:former_liege = {
					any_child = {
						is_married = no
						is_betrothed = no
						religion = ROOT
					}
				}
			}

			if = {
				limit = {
					can_marry = yes
					is_female = no
				}

				event_target:former_liege = {
					random_child = {
						limit = {
							religion = ROOT
							is_female = yes
							is_married = no
							is_betrothed = no
							age >= 14
						}

						preferred_limit = {
							can_marry = ROOT
							practical_age < 40
						}

						if = {
							limit = { is_adult = yes }
							add_spouse = ROOT
						}
						else = {
							add_betrothal = ROOT
						}
					}
				}
			}
			else_if = {
				limit = {
					event_target:former_liege = {
						any_child = {
							can_marry = yes
							is_female = yes
							religion = ROOT
							practical_age < 40

							ROOT = {
								any_child = {
									can_marry = PREVPREV
									religion = ROOT
								}
							}
						}
					}
				}

				event_target:former_liege = {
					random_child = {
						limit = {
							can_marry = yes
							is_female = yes
							religion = ROOT
							practical_age < 40

							ROOT = {
								any_child = {
									can_marry = PREVPREV
									religion = ROOT
								}
							}
						}

						ROOT = {
							random_child = {
								limit = {
									can_marry = PREVPREV
									religion = ROOT
								}

								add_spouse = PREVPREV
							}
						}
					}
				}
			}
			else_if = {
				limit = {
					event_target:former_liege = {
						any_child = {
							religion = ROOT
							is_female = yes
							is_adult = no
							is_betrothed = no

							ROOT = {
								any_child = {
									religion = ROOT
									is_female = no
									is_married = no
									is_betrothed = no

									age_diff = {
										who = PREVPREV
										years < 10
									}
								}
							}
						}
					}
				}

				event_target:former_liege = {
					random_child = {
						limit = {
							religion = ROOT
							is_female = yes
							is_adult = no
							is_betrothed = no

							ROOT = {
								any_child = {
									religion = ROOT
									is_female = no
									is_married = no
									is_betrothed = no

									age_diff = {
										who = PREVPREV
										years < 10
									}
								}
							}
						}

						ROOT = {
							random_child = {
								limit = {
									religion = ROOT
									is_female = no
									is_married = no
									is_betrothed = no

									age_diff = {
										who = PREVPREV
										years < 10
									}
								}

								add_betrothal = PREVPREV
							}
						}
					}
				}
			}
		}

		# Then attempt to marry a relative
		else_if = {
			limit = {
				event_target:former_liege = {
					any_close_relative = {
						dynasty = PREV
						religion = ROOT
						can_marry = yes
						is_ruler = no
						practical_age < 40

						ROOT = {
							OR = {
								can_marry = PREV

								any_child = {
									can_marry = PREV
									religion = PREV
								}
							}
						}

						NOT = {
							any_player = {
								OR = {
									is_liege_of = PREV
									is_close_relative = PREV
								}
							}
						}
					}
				}
			}

			event_target:former_liege = {
				random_close_relative = {
					limit = {
						dynasty = PREV
						religion = ROOT
						can_marry = yes
						is_ruler = no
						practical_age < 40

						ROOT = {
							OR = {
								can_marry = PREV

								any_child = {
									can_marry = PREV
									religion = PREV
								}
							}
						}

						NOT = {
							any_player = {
								OR = {
									is_liege_of = PREV
									is_close_relative = PREV
								}
							}
						}
					}

					if = {
						limit = { can_marry = ROOT }
						add_spouse = ROOT
					}
					else = {
						ROOT = {
							random_child = {
								limit = {
									can_marry = PREVPREV
									religion = PREVPREV
									is_female = no
								}

								add_spouse = PREVPREV
							}
						}
					}
				}
			}
		}
		else = {
			# Then imprison the ruler if possible
			event_target:former_liege = {
				if = {
					limit = { at_location = ROOT }
					imprison = ROOT
				}
			}
		}
	}
}

character_event = {
	id = Plus.293
	desc = EVTDESC_Plus_293
	picture = GFX_evt_spymaster

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

	trigger = {
		has_plot = plot_elope
		is_plot_active = no
	}

	mean_time_to_happen = {
		years = 25

		mult_modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}

		mult_modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}

		mult_modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}

		mult_modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}

		mult_modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 10
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 20
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 30
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 40
				}
			}
		}

		mult_modifier = {
			factor = 1.1

			has_character_flag = has_personal_spy_network

			plot_target_char = {
				check_variable = {
					which = personal_spy_network
					value >= 50
				}
			}
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 1
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 2
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 3
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 4
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 5
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 6
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 7
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 8
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 9
		}

		mult_modifier = {
			factor = 0.95
			num_of_plot_backers >= 10
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 0.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 1.5
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 2.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 3.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 4.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 6.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 8.0
		}

		mult_modifier = {
			factor = 0.66
			plot_power >= 10.0
		}
	}

	option = {
		name = EVTOPTA_Plus_293 # We will elope!

		trigger = {
			OR = {
				AND = {
					plot_power < 0.5
					NOT = { plot_target_char = { any_heir_title = { higher_tier_than = BARON } } }
				}
				AND = {
					plot_power < 0.7
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}

		remove_trait_silently_honest_effect = yes

		plot_target_char = {
			show_scope_change = no

			random_list = {
				25 = {
					additive_modifier = {
						value = -15
						any_heir_title = { higher_real_tier_than = BARON }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = 15
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.294 # Succeeds
						days = 3
						tooltip = CUSTOMTOOLTIP33
					}
				}

				25 = {
					additive_modifier = {
						value = -5
						any_heir_title = { higher_real_tier_than = BARON }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -5
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.297 # Fails, not discovered
						days = 3
						tooltip = CUSTOMTOOLTIP34
					}
				}

				50 = {
					additive_modifier = {
						value = 20
						any_heir_title = { higher_real_tier_than = BARON }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 0.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.0 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 1.5 }
					}

					additive_modifier = {
						value = -10
						ROOT = { plot_power >= 2.0 }
					}

					character_event = {
						id = Plus.2900 # Fails, discovered
						tooltip = CUSTOMTOOLTIP35
						days = 3
					}
				}
			}
		}

		activate_plot = yes

		ai_chance = {
			factor = 10

			mult_modifier = {
				factor = 2.5
				plot_power >= 0.5
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.0
			}

			mult_modifier = {
				factor = 4
				plot_power >= 1.5
			}

			mult_modifier = {
				factor = 2.5
				plot_power >= 2.0
			}

			mult_modifier = {
				factor = 2
				trait = brave
			}

			mult_modifier = {
				factor = 0.75
				trait = craven
			}
		}
	}

	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity...

		ai_chance = { factor = 100 }
	}
}

# Success - notify lover
character_event = {
	id = Plus.294
	desc = EVTDESC_Plus_294
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	immediate = {
		FROM = { plot_succeeds = yes }
	}

	option = {
		name = EVTOPTA_Plus_294 # Finally we are one

		add_spouse = FROM

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.295 } }

			# Notify liege
			liege = { character_event = { id = Plus.296 } }
		}
	}
}

# Success - notify plotter
character_event = {
	id = Plus.295
	desc = EVTDESC_Plus_295
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_295 # Finally we shall be married
	}
}

# Success - notify liege
character_event = {
	id = Plus.296
	desc = EVTDESC_Plus_296
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_296 # How dare they!

		# The elope plotter
		opinion = {
			name = opinion_eloped_plotter
			who = FROMFROM
			years = 20
		}

		# The elope target
		opinion = {
			name = opinion_eloped_target
			who = FROM
			years = 10
		}
	}
}

# Failure (not discovered) - notify target
character_event = {
	id = Plus.297
	desc = EVTDESC_Plus_297
	picture = GFX_evt_spymaster

	is_triggered_only = yes
	hide_from = yes

	option = {
		name = EVTOPTA_Plus_297 # It's almost like they knew

		hidden_effect = {
			# Notify plotter
			FROM = { character_event = { id = Plus.298 } }

			# Notify liege
			liege = {
				if = {
					limit = {
						NOR = {
							character = ROOT
							character = FROM
						}
					}
				}

				character_event = { id = Plus.299 }
			}
		}
	}
}

# Failure (not discovered) - notify plotter
character_event = {
	id = Plus.298
	desc = EVTDESC_Plus_298
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	ai = no

	option = {
		name = EVTOPTA_Plus_298 # We'll just have to try again
	}
}

# Failure (not discovered) - notify liege
character_event = {
	id = Plus.299
	desc = EVTDESC_Plus_299
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_299 # Perhaps I am being paranoid...
	}
}

# Failure (discovered) - notify target
character_event = {
	id = Plus.2900
	desc = EVTDESC_Plus_2900
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_2900 # My liege will not be pleased...

		set_character_flag = known_eloper

		# Notify plotter
		FROM = { character_event = { id = Plus.2901 } }

		# Notify liege
		liege = { character_event = { id = Plus.2902 } }
	}
}

# Failure (discovered) - notify plotter
character_event = {
	id = Plus.2901
	desc = EVTDESC_Plus_2901
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_2901 # She'll never escape now...

		cancel_plot = yes
	}
}

# Failure (discovered) - notify liege
character_event = {
	id = Plus.2902
	desc = EVTDESC_Plus_2902
	picture = GFX_evt_spymaster

	is_triggered_only = yes

	option = {
		name = EVTOPTA_Plus_2902 # They will both pay for this!

		opinion = {
			name = devious_plotter
			who = FROMFROM
			years = 5
		}

		# The elope plotter
		opinion = {
			name = opinion_eloped_plotter
			who = FROMFROM
			years = 20
		}

		# The elope target
		opinion = {
			name = opinion_eloped_target
			who = FROM
			years = 10
		}
	}
}