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
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_plot = plot_discredit_councillor
		NOT = { has_character_flag = plot_in_action }
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_155" #That position will be mine!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			NOT = { plot_power = 0.5 }
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		plot_target_char = {
			random_list = {
				20 = { character_event = { id = Plus.156 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				20 = { character_event = { id = Plus.159 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				60 = { character_event = { id = Plus.162 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_155" #That position will be mine!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		plot_target_char = {
			random_list = {
				30 = { character_event = { id = Plus.156 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				30 = { character_event = { id = Plus.159 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				40 = { character_event = { id = Plus.162 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_155" #That position will be mine!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.0
			NOT = { plot_power = 1.5 }
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		plot_target_char = {
			random_list = {
				50 = { character_event = { id = Plus.156 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				25 = { character_event = { id = Plus.159 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				25 = { character_event = { id = Plus.162 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_155" #That position will be mine!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.5
			NOT = { plot_power = 2.0 }
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		plot_target_char = {
			random_list = {
				60 = { character_event = { id = Plus.156 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				25 = { character_event = { id = Plus.159 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				15 = { character_event = { id = Plus.162 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_155" #That position will be mine!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			plot_power = 2.0
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		plot_target_char = {
			random_list = {
				80 = { character_event = { id = Plus.156 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				15 = { character_event = { id = Plus.159 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				5 = { character_event = { id = Plus.162 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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"

	hide_from = yes
	is_triggered_only = yes

	immediate = {
		hidden_tooltip = {
			FROM = { set_character_flag = plot_success }
		}
		if = {
			limit = { has_job_title = job_chancellor }
			set_character_flag = job_chancellor
		}
		if = {
			limit = { has_job_title = job_treasurer }
			set_character_flag = job_treasurer
		}
		if = {
			limit = { has_job_title = job_marshal }
			set_character_flag = job_marshal
		}
		if = {
			limit = { has_job_title = job_spymaster }
			set_character_flag = job_spymaster
		}
		if = {
			limit = { has_job_title = job_spiritual }
			set_character_flag = job_spiritual
		}
		liege = {
			reverse_opinion = {
				modifier = opinion_fired_from_council
				who = ROOT
				years = 10
			}
		}
	}

	option = {
		name = "EVTOPTA_Plus_156" #I am ruined!
		if = {
			limit = { has_character_flag = job_chancellor }
			change_diplomacy = -4
			remove_title = job_chancellor
			clr_character_flag = job_chancellor
		}
		if = {
			limit = { has_character_flag = job_treasurer }
			change_stewardship = -4
			remove_title = job_treasurer
			clr_character_flag = job_treasurer
		}
		if = {
			limit = { has_character_flag = job_marshal }
			change_martial = -4
			remove_title = job_marshal
			clr_character_flag = job_marshal
		}
		if = {
			limit = { has_character_flag = job_spymaster }
			change_intrigue = -4
			remove_title = job_spymaster
			clr_character_flag = job_spymaster
		}
		if = {
			limit = { has_character_flag = job_spiritual }
			change_learning = -4
			remove_title = job_spiritual
			clr_character_flag = job_spiritual
		}
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.157 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				liege = { 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

	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

	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"
	
	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_159" #Who could have instigated such an underhanded scheme?
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.160 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				liege = { 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...
		set_character_flag = abort_plot
	}
}

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

	is_triggered_only = yes

	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 = {
			who = FROM
			modifier = devious_plotter
			years = 10
		}
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.163 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				liege = { 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
		set_character_flag = abort_plot
	}
}

# 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 = { who = FROMFROM modifier = devious_plotter 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
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_plot = plot_embezzle_from_liege
		NOT = { has_character_flag = plot_in_action }
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_170" #We'll all be rich!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			NOT = { plot_power = 0.5 }
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_treasurer = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					40 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_treasurer = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					60 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_170" #We'll all be rich!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_treasurer = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					70 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_treasurer = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					50 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					50 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_170" #We'll all be rich!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.0
			NOT = { plot_power = 1.5 }
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_treasurer = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_treasurer = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					40 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_170" #We'll all be rich!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.5
			NOT = { plot_power = 2.0 }
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_treasurer = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					95 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					5 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_treasurer = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_170" #We'll all be rich!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			plot_power = 2.0
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = charitable }
			remove_trait = charitable
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_treasurer = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					95 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					5 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_treasurer = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					90 = { character_event = { id = Plus.171 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					10 = { character_event = { id = Plus.174 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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"

	hide_from = yes
	is_triggered_only = yes

	immediate = {
		if = {
			limit = {
				tier = count
			}
			wealth = -50
		}
		if = {
			limit = {
				tier = duke
			}
			wealth = -75
		}
		if = {
			limit = {
				higher_tier_than = duke
			}
			wealth = -100
		}
	}

	option = {
		name = "EVTOPTA_Plus_171" #I've been robbed
		tooltip = {
			if = {
				limit = { tier = count }
				wealth = -50
			}
			if = {
				limit = { tier = duke }
				wealth = -75
			}
			if = {
				limit = { higher_tier_than = duke }
				wealth = -100
			}
		}
		hidden_tooltip = {
			#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!
		set_character_flag = plot_success
		if = {
			limit = {
				FROM = { tier = count }
			}
			wealth = 50
		}
		if = {
			limit = {
				FROM = { tier = duke }
			}
			wealth = 75
		}
		if = {
			limit = {
				FROM = { higher_tier_than = duke }
			}
			wealth = 100
		}
		hidden_tooltip = {
			#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
	}
}

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

	is_triggered_only = yes

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

	option = {
		name = "EVTOPTA_Plus_174" #Imprison him
		ai_chance = { factor = 100 }
		opinion = { who = FROM modifier = devious_plotter years = 10 }
		FROM = { imprison = ROOT }
		hidden_tooltip = {
			opinion = { who = FROM modifier = opinion_recent_plot months = 60 }
		}
	}
	option = {
		name = "EVTOPTB_Plus_174" #Execute him
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0.1
				trait = kind
			}
			modifier = {
				factor = 2.0
				trait = wroth
			}
			modifier = {
				factor = 2.0
				trait = cruel
			}
			modifier = {
				factor = 0.1
				trait = charitable
			}
		}
		piety = -25
		FROM = {
			death = { death_reason = death_execution killer = ROOT }
		}
	}
	option = {
		name = "EVTOPTC_Plus_174" #Forgive him
		ai_chance = {
			factor = 0
		}
		if = {
			limit = { NOT = { trait = kind } }
			random = {
				chance = 30
				add_trait = kind
			}
		}
		prestige = -50
		FROM = {
			opinion = { who = ROOT modifier = opinion_relieved years = 10 }
		}
		hidden_tooltip = {
			opinion = { who = FROM modifier = opinion_recent_plot months = 60 }
		}
	}
}

# 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
		set_character_flag = abort_plot
	}
}

### 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
	capable_only = yes
	
	trigger = {
		OR = {
			has_plot = plot_fabricate_treason
			has_plot = plot_fabricate_treason_liege
		}
		NOT = { has_character_flag = plot_in_action }
		plot_target_char = {
			liege = {
				NOT = { character = ROOT }
			}
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			NOT = { plot_power = 0.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				liege = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					liege = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					15 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					70 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				liege = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					liege = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.0
			NOT = { plot_power = 1.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				liege = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					liege = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.5
			NOT = { plot_power = 2.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				liege = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					liege = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			plot_power = 2.0
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				liege = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					90 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					5 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					liege = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.181 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.184 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.187 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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"

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_181" #This must be a scheme to see me arrested!
		liege = {
			opinion = {
				who = ROOT
				modifier = opinion_traitor
				years = 10
			}
		}
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.182 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				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!
		set_character_flag = plot_success
	}
}

# 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 = {
			who = FROM
			modifier = opinion_traitor
			years = 10
		}
	}
}

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

	option = {
		name = "EVTOPTA_Plus_184" #I wonder who sent it...
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.185 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				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
		set_character_flag = abort_plot
	}
}

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

	is_triggered_only = yes

	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 = {
			who = FROM
			modifier = devious_plotter
			years = 10
		}
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.188 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				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
		set_character_flag = abort_plot
	}
}

# 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 = { who = FROMFROM modifier = devious_plotter 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
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_plot = plot_fabricate_heresy
		NOT = { has_character_flag = plot_in_action }
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_195" #God will be my judge!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			NOT = { plot_power = 0.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_spiritual = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_spiritual = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					15 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					70 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_195" #God will be my judge!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_spiritual = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_spiritual = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_195" #God will be my judge!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.0
			NOT = { plot_power = 1.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_spiritual = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_spiritual = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_195" #God will be my judge!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.5
			NOT = { plot_power = 2.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_spiritual = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_spiritual = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_195" #God will be my judge!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			plot_power = 2.0
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				plot_target_char = {
					job_spiritual = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					90 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					5 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					plot_target_char = {
						job_spiritual = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.196 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.198 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.200 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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"

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_196" #God preserve me from these lies!
		add_trait = excommunicated
		piety = -100
		hidden_tooltip = {
			#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!
		set_character_flag = plot_success
	}
}

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

	option = {
		name = "EVTOPTA_Plus_198" #God looks after the faithful
		hidden_tooltip = {
			#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"
		set_character_flag = abort_plot
	}
}

# 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 = {
			who = FROM
			modifier = devious_plotter
			years = 10
		}
		hidden_tooltip = {
			#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 = {
			opinion = {
				who = ROOT
				modifier = devious_plotter
				years = 10
			}
		}
		piety = -250
		set_character_flag = abort_plot
	}
}

### 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
	capable_only = yes
	prisoner = no
	
	trigger = {
		OR = {
			has_plot = plot_fabricate_treason
			has_plot = plot_fabricate_treason_liege
		}
		NOT = { has_character_flag = plot_in_action }
		plot_target_char = {
			liege = {
				character = ROOT
			}
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			NOT = { plot_power = 0.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				ROOT = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					ROOT = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					15 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					70 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				ROOT = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					25 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					25 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					50 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					ROOT = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.0
			NOT = { plot_power = 1.5 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				ROOT = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					ROOT = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					40 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					30 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					30 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			plot_power = 1.5
			NOT = { plot_power = 2.0 }
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				ROOT = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					ROOT = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					60 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					20 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					20 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_180" #I will see him disgraced!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			plot_power = 2.0
		}
		if = {
			limit = { trait = just }
			remove_trait = just
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		if = {
			limit = {
				ROOT = {
					job_chancellor = {
						ROOT = {
							OR = {
								character = PREV
								any_plot_backer = {
									character = PREVPREV
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					90 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					5 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		if = {
			limit = {
				NOT = {
					ROOT = {
						job_chancellor = {
							ROOT = {
								OR = {
									character = PREV
									any_plot_backer = {
										character = PREVPREV
									}
								}
							}
						}
					}
				}
			}
			plot_target_char = {
				random_list = {
					80 = { character_event = { id = Plus.206 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
					15 = { character_event = { id = Plus.208 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
					5 = { character_event = { id = Plus.210 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
				}
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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"

	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_206" #Who could have done such a thing?
		liege = {
			opinion = {
				who = ROOT
				modifier = opinion_traitor
				years = 10
			}
		}
		hidden_tooltip = {
			#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!
		set_character_flag = plot_success
	}
}

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

	option = {
		name = "EVTOPTA_Plus_208" #I wonder who was behind it...
		hidden_tooltip = {
			#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...
		set_character_flag = abort_plot
	}
}

# 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 = {
			who = FROM
			modifier = devious_plotter
			years = 10
		}
		hidden_tooltip = {
			#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
		set_character_flag = abort_plot
	}
}

### 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
	capable_only = yes
	prisoner = no
	
	immediate = {
		random_list = {
			10 = {
				modifier = {
					factor = 0
					plot_target_char = {
						OR = {
							is_adult = no
							is_ill = yes
							trait = incapable
						}
					}
				}
				set_character_flag = kidnap_in_transit
			}
			10 = {
				modifier = {
					factor = 5
					plot_target_char = {
						OR = {
							trait = infirm
							age = 50
						}
					}
				}
				set_character_flag = kidnap_in_bed
			}
			10 = {
				modifier = {
					factor = 3
					plot_target_char = { martial = 10 }
				}
				modifier = {
					factor = 5
					plot_target_char = {
						OR = {
							trait = hunter
							has_focus = focus_hunting
						}
					}
				}
				modifier = {
					factor = 0
					plot_target_char = {
						OR = {
							is_adult = no
							is_ill = yes
							is_female = no
							trait = incapable
						}
					}
				}
				set_character_flag = kidnap_while_hunting
			}
			10 = {
				modifier = {
					factor = 5
					plot_target_char = {
						OR = {
							trait = hedonist
							trait = lustful
							has_focus = focus_seduction
						}
					}
				}
				modifier = {
					factor = 0
					plot_target_char = {
						OR = {
							is_adult = no
							is_ill = yes
							is_female = no
							trait = incapable
							trait = chaste
						}
					}
				}
				set_character_flag = kidnap_while_carousing
			}
		}
	}
	
	trigger = {
		OR = {
			has_plot = plot_kidnap_liege
			has_plot = plot_kidnapping
		}
		plot_power = 0.5
		plot_target_char = {
			in_command_trigger = no
			prisoner = no
			NOT = { is_inaccessible_trigger = yes }
		}
		NOT = { has_character_flag = kidnap_attempt }
		OR = {
			is_ruler = yes
			plot_target_char = {
				any_demesne_title = {
					can_be_given_away = yes
					tier = COUNT
					location = { is_capital = no }
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 200
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.5
			trait = genius
		}
		modifier = {
			factor = 0.75
			OR = {
				trait = quick
				trait = shrewd
			}
		}
		modifier = {
			factor = 0.75
			plot_target_char = { trait = trusting }
		}
		modifier = {
			factor = 1.25
			plot_target_char = { trait = paranoid }
		}
		modifier = {
			factor = 0.75
			plot_target_char = {
				OR = {
					is_ill = yes
					trait = infirm
					is_dumb_trigger = yes
				}
			}
		}
		modifier = {
			factor = 0.65
			plot_power = 0.75
		}
		modifier = {
			factor = 0.65
			plot_power = 1.0
		}
		modifier = {
			factor = 0.65
			plot_power = 1.25
		}
		modifier = {
			factor = 0.65
			plot_power = 1.50
		}
		modifier = {
			factor = 0.65
			plot_power = 1.75
		}
		modifier = {
			factor = 0.65
			plot_power = 2.0
		}
	}
	
	option = {
		name = EVTOPTA_Plus_150 # Proceed
		ai_chance = {
			factor = 90
			modifier = {
				factor = 0.1
				NOR = {
					plot_power = 0.75
					trait = lunatic
					trait = possessed
				}
			}
		}
		set_character_flag = kidnap_attempt
		random_list = {
			20 = {
				modifier = {
					factor = 1.65
					plot_power = 1.0
					NOT = { plot_power = 1.5 }
				}
				modifier = {
					factor = 2.5
					plot_power = 1.5
					NOT = { plot_power = 2.0 }
				}
				modifier = {
					factor = 3.0
					plot_power = 2.0
					NOT = { plot_power = 2.5 }
				}
				modifier = {
					factor = 3.75
					plot_power = 2.5
				}
				modifier = {
					factor = 0.9
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 2 } }
				}
				modifier = {
					factor = 0.9
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 4 } }
				}
				modifier = {
					factor = 0.9
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 6 } }
				}
				modifier = {
					factor = 0.9
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 8 } }
				}
				modifier = {
					factor = 0.9
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 10 } }
				}
				modifier = {
					factor = 0.5
					plot_target_char = { trait = genius }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { trait = paranoid }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { is_strong_trigger = yes }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { trait = quick }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { trait = shrewd }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { trait = trusting }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { trait = lunatic }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { trait = drunkard }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { is_weak_trigger = yes }
				}
				modifier = {
					factor = 1.2
					plot_target_char = {
						OR = {
							trait = infirm
							trait = incapable
							is_ill = yes
							is_adult = no
						}
					}
				}
				modifier = {
					factor = 0.8
					plot_target_char = { martial = 12 }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { martial = 18 }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { war = yes }
				}
				modifier = {
					factor = 0.75
					plot_target_char = { higher_tier_than = DUKE }
				}
				modifier = {
					factor = 0.75
					plot_target_char = { higher_tier_than = KING }
				}
				character_event = { id = Plus.215 tooltip = "CUSTOMTOOLTIP_KIDNAP1" days = 14 } #succeeds
			}
			30 = {
				modifier = {
					factor = 1.1
					plot_power = 1.0
					NOT = { plot_power = 1.5 }
				}
				modifier = {
					factor = 0.8
					plot_power = 1.5
					NOT = { plot_power = 2.0 }
				}
				modifier = {
					factor = 0.65
					plot_power = 2.0
					NOT = { plot_power = 2.5 }
				}
				modifier = {
					factor = 0.5
					plot_power = 2.5
				}
				modifier = {
					factor = 1.1
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 2 } }
				}
				modifier = {
					factor = 1.1
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 4 } }
				}
				modifier = {
					factor = 1.1
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 6 } }
				}
				modifier = {
					factor = 1.1
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 8 } }
				}
				modifier = {
					factor = 1.1
					plot_target_char = { attribute_diff = { character = ROOT attribute = intrigue value = 10 } }
				}
				character_event = { id = Plus.229 tooltip = "CUSTOMTOOLTIP_KIDNAP2" days = 14 } #fails, not discovered
			}
			50 = {
				modifier = {
					factor = 0.68
					plot_power = 1.0
					NOT = { plot_power = 1.5 }
				}
				modifier = {
					factor = 0.5
					plot_power = 1.5
					NOT = { plot_power = 2.0 }
				}
				modifier = {
					factor = 0.4
					plot_power = 2.0
					NOT = { plot_power = 2.5 }
				}
				modifier = {
					factor = 0.2
					plot_power = 2.5
				}
				modifier = {
					factor = 0.9
					plot_target_char = {
						ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 2 } }
					}
				}
				modifier = {
					factor = 0.9
					plot_target_char = {
						ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 4 } }
					}
				}
				modifier = {
					factor = 0.9
					plot_target_char = {
						ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 6 } }
					}
				}
				modifier = {
					factor = 0.9
					plot_target_char = {
						ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 8 } }
					}
				}
				modifier = {
					factor = 0.9
					plot_target_char = {
						ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 10 } }
					}
				}
				character_event = { id = Plus.231 tooltip = "CUSTOMTOOLTIP_KIDNAP3" days = 14 } #fails, discovered
			}
		}
		hidden_tooltip = {
			any_plot_backer = { letter_event = { id = Plus.152 days = 4 } } #notify backers
		}	
	}
	option = {
		name = EVTOPTB_Plus_150 # Wait for a better opportunity
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				plot_power = 1.25
			}
		}
		clr_character_flag = kidnap_in_transit
		clr_character_flag = kidnap_in_bed
		clr_character_flag = kidnap_while_hunting
		clr_character_flag = kidnap_while_carousing
	}
}

# 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
	capable_only = yes
	prisoner = no
	
	trigger = {
		any_backed_character = {
			OR = {
				has_plot = plot_kidnapping
				has_plot = plot_kidnap_liege
			}
			plot_power = 0.5
			plot_target_char = {
				at_location = ROOT
				in_command_trigger = no
				prisoner = no
				NOT = { is_inaccessible_trigger = yes }
			}
			NOT = { has_character_flag = kidnap_attempt }
			ROOT = { plot_power_contribution = { plotter = PREV power = 0.04 } }
			OR = {
				is_ruler = yes
				plot_target_char = {
					any_demesne_title = {
						can_be_given_away = yes
						tier = COUNT
						location = { is_capital = no }
					}
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 750
		modifier = {
			factor = 0.75
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				has_character_modifier = plot_assisted_spying
			}
		}
		modifier = {
			factor = 0.65
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				has_character_modifier = plot_assisted_spying2
			}
		}
		modifier = {
			factor = 0.55
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				has_character_modifier = plot_assisted_spying3
			}
		}
		modifier = {
			factor = 0.45
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				has_character_modifier = plot_assisted_spying4
			}
		}
		modifier = {
			factor = 0.35
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				has_character_modifier = plot_assisted_spying5
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				ROOT = { plot_power_contribution = { plotter = PREV power = 0.1 } }
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				ROOT = { plot_power_contribution = { plotter = PREV power = 0.2 } }
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				ROOT = { plot_power_contribution = { plotter = PREV power = 0.3 } }
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				ROOT = { plot_power_contribution = { plotter = PREV power = 0.4 } }
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				ROOT = { plot_power_contribution = { plotter = PREV power = 0.5 } }
			}
		}
		modifier = {
			factor = 0.66
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 1.0
			}
		}
		modifier = {
			factor = 0.66
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 1.5
			}
		}
		modifier = {
			factor = 0.66
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 2.0
			}
		}
		modifier = {
			factor = 0.66
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 2.5
			}
		}
		modifier = {
			factor = 0.66
			any_backed_character = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 3
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_151 # Tell Plotter
		random_backed_character = {
			limit = {
				OR = {
					has_plot = plot_kidnapping
					has_plot = plot_kidnap_liege
				}
				plot_power = 0.5
				plot_target_char = {
					at_location = ROOT
					in_command_trigger = no
					prisoner = no
					NOT = { is_inaccessible_trigger = yes }
				}
				NOT = { has_character_flag = kidnap_attempt }
				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
	
	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 }
		plot_succeeds = yes
		if = {
			limit = { is_ruler = no }
			event_target:kidnap_victim = {
				random_demesne_title = {
					limit = {
						can_be_given_away = yes
						tier = COUNT
						location = { is_capital = no }
						ROOT = { has_strong_claim = PREV }
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						can_be_given_away = yes
						tier = COUNT
						location = { is_capital = no }
						claimed_by = ROOT
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						can_be_given_away = yes
						tier = COUNT
						location = { is_capital = no }
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = COUNT
						location = { is_capital = no }
					}
					save_event_target_as = demanded_title
					break = yes
				}
			}
		}
		if = {
			limit = {
				is_ruler = yes
				independent = no
				event_target:kidnap_victim = { same_liege = ROOT }
			}
			event_target:kidnap_victim = {
				random_vassal = {
					limit = {
						lower_tier_than = ROOT
						higher_tier_than = BARON
						de_jure_liege = ROOT
						is_patrician = no
					}
					save_event_target_as = demanded_vassal
				}
				if = {
					limit = {
						NOT = {
							any_vassal = {
								lower_tier_than = ROOT
								higher_tier_than = BARON
								de_jure_liege = ROOT
								is_patrician = no
							}
						}
					}
					random_vassal = {
						limit = {
							lower_tier_than = ROOT
							higher_tier_than = BARON
							dejure_liege_title = { claimed_by = ROOT }
							is_patrician = no
						}
						save_event_target_as = demanded_vassal
					}
				}
				random_demesne_title = {
					limit = {
						tier = COUNT
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						ROOT = { has_strong_claim = PREV }
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = COUNT
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						claimed_by = ROOT
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = COUNT
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						de_jure_liege_or_above = ROOT
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = COUNT
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						dejure_liege_title = { claimed_by = ROOT }
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = BARON
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						ROOT = { has_strong_claim = PREV }
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = BARON
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						claimed_by = ROOT
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = BARON
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						de_jure_liege_or_above = ROOT
					}
					save_event_target_as = demanded_title
					break = yes
				}
				random_demesne_title = {
					limit = {
						tier = BARON
						can_be_given_away = yes
						is_primary_holder_title = no
						location = { is_capital = no }
						dejure_liege_title = { claimed_by = ROOT }
					}
					save_event_target_as = demanded_title
					break = yes
				}
			}
		}
	}

	option = {
		name = EVTOPTA_Plus_215 # Demand he turn over title, or else
		trigger = {
			event_target:demanded_title = { always = yes }
		}
		ai_chance = { factor = 100 }
		event_target:kidnap_victim = {
			character_event = { id = Plus.218 tooltip = KIDNAP_DEMAND_TITLE }
		}
	}
	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 = {
			character_event = { id = Plus.225 tooltip = KIDNAP_DEMAND_VASSAL }
		}
	}
	option = {
		name = EVTOPTD_Plus_215 # Kill him--quietly
		trigger = { ai = no }
		tooltip = { event_target:kidnap_victim = { death = { death_reason = death_murder_unknown } } }
		if = {
			limit = {
				NOT = { trait = honest }
				NOT = { trait = deceitful }
			}
			add_trait = deceitful
			
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = {
				NOT = { trait = kind }
				NOT = { trait = cruel }
			}
			add_trait = cruel
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		ROOT = {
			random_list = {
				50 = {
					modifier = {
						factor = 0
						event_target:kidnap_victim = { job_spymaster = { character = ROOT } }
					}
					modifier = {
						factor = 0
						event_target:kidnap_victim = {
							OR = {
								is_ruler = no
								NOT = { any_courtier = { has_job_title = job_spymaster } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 1 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 3 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 5 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 7 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 9 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 11 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 13 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV 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 = {
					modifier = {
						factor = 0
						event_target:kidnap_victim = {
							OR = {
								liege = { job_spymaster = { character = ROOT } }
								liege = { character = ROOT }
							}
						}
					}
					modifier = {
						factor = 0
						event_target:kidnap_victim = { is_ruler = yes }
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 1 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 3 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 5 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 7 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 9 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 11 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 13 } }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								job_spymaster = {
									ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 15 } }
								}
							}
						}
					}
					character_event = { id = Plus.223 tooltip = KIDNAP_MURDER_DISCOVERED2 }
					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 = {
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 1 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 3 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 5 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 7 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 9 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 11 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 13 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 15 }
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								NOT = { character = ROOT }
								job_spymaster = {
									attribute_diff = { character = ROOT attribute = intrigue value = 1 }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								NOT = { character = ROOT }
								job_spymaster = {
									attribute_diff = { character = ROOT attribute = intrigue value = 3 }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								NOT = { character = ROOT }
								job_spymaster = {
									attribute_diff = { character = ROOT attribute = intrigue value = 5 }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								NOT = { character = ROOT }
								job_spymaster = {
									attribute_diff = { character = ROOT attribute = intrigue value = 7 }
								}
							}
						}
					}
					modifier = {
						factor = 0.8
						event_target:kidnap_victim = {
							liege = {
								NOT = { character = ROOT }
								job_spymaster = {
									attribute_diff = { character = ROOT attribute = intrigue value = 9 }
								}
							}
						}
					}
					custom_tooltip = { text = KIDNAP_MURDER_NOT_DISCOVERED }
					hidden_tooltip = {
						event_target:kidnap_victim = { death = { death_reason = death_murder_unknown } }
					}
				}
			}
		}
	}
	option = {
		name = EVTOPTC_Plus_215 # I'll decide later
		trigger = { is_ruler = yes }
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					event_target:demanded_title = { always = yes }
					event_target:demanded_vassal = { always = yes }
				}
			}
		}
		event_target:kidnap_victim = {
			tooltip = { imprison = ROOT }
			hidden_tooltip = { character_event = { id = Plus.216 } }
		}
	}
}

# 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 = { who = FROM modifier = opinion_kidnapper months = 1200 }
			father = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			mother = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			any_sibling = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			any_spouse = {
				limit = { NOT = { sibling = ROOT } }
				opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 }
			}
			any_child = {
				limit = { NOT = { is_married = ROOT } }
				opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 }
			}
			top_liege = {
				character_event = { id = Plus.217 days = 1 } # Notify
				any_realm_character = {
					limit = {
						NOT = { character = ROOT }
						OR = {
							is_close_relative = ROOT
							is_liege_or_above = ROOT
							is_vassal_or_below = 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!
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.1
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 2
				NOT = { age = 30 }
				health = 3
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 3
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 4
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 5
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 6
			}
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 33
				add_trait = craven
			}
		}
		if = {
			limit = { trait = brave }
			remove_trait = brave
		}
		if = {
			limit = { FROM = { is_ruler = no } }
			FROM = { set_character_flag = needs_liege }
		}	
		event_target:demanded_title = {
			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 = {
				FROM = {
					clr_character_flag = needs_liege
					set_defacto_liege = PREV
					pf_liege_change_effect = yes
				}
			}
		}
		custom_tooltip = { text = KIDNAP_IS_SET_FREE }
		hidden_tooltip = {
			FROM = { character_event = { id = Plus.219 } }
			top_liege = {
				character_event = { id = Plus.220 days = 1 } #notify
				any_realm_character = {
					limit = {
						NOT = { character = FROM }
						is_ruler = yes
					}
					character_event = { id = Plus.220 days = 1 } #notify
				}
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_218 # You'll get nothing from me!
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0.5
				reverse_has_opinion_modifier = { who = ROOT modifier = opinion_denied_title }
			}
			modifier = {
				factor = 0.25
				reverse_has_opinion_modifier = { who = ROOT modifier = opinion_broken_title_promise }
			}
			modifier = {
				factor = 0.1
				trait = craven
			}
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				NOT = { health = 3 }
			}
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 33
				add_trait = brave
			}
		}
		if = {
			limit = { trait = craven }
			remove_trait = craven
		}
		FROM = { character_event = { id = Plus.221 tooltip = KIDNAP_DECIDE } }
	}
}

# 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
		FROM = { opinion = { who = ROOT modifier = kidnapped_me months = 120 } }
		dishonorable_plus_1_effect = yes
		hidden_tooltip = {
			remove_opinion = { who = FROM modifier = opinion_denied_title }
			remove_opinion = { who = FROM modifier = 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 }
		ai_chance = {
			factor = 50
		}
		FROM = {
			tooltip = { imprison = ROOT }
			hidden_tooltip = { character_event = { id = Plus.222 } }
		}		
	}
	option = {
		name = EVTOPTB_Plus_221 # Kill him--quietly
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.1
				is_close_relative = FROM
				NOR = {
					trait = cruel
					trait = wroth
				}
			}
			modifier = {
				factor = 0.1
				NOR = {
					trait = cruel
					trait = arbitrary
					trait = wroth
					trait = proud
					trait = impaler
				}
			}
			modifier = {
				factor = 2
				trait = cruel
			}
			modifier = {
				factor = 2
				trait = wroth
			}
		}
		tooltip = { FROM = { death = { death_reason = death_murder_unknown } } }
		if = {
			limit = {
				NOT = { trait = honest }
				NOT = { trait = deceitful }
			}
			random = {
				chance = 50
				add_trait = deceitful
				
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		if = {
			limit = {
				NOT = { trait = kind }
				NOT = { trait = cruel }
			}
			random = {
				chance = 50
				add_trait = cruel
			}
		}
		if = {
			limit = { trait = kind }
			remove_trait = kind
		}
		ROOT = {
			random_list = {
				70 = {
					modifier = {
						factor = 0
						FROM = { job_spymaster = { character = ROOT } }
					}
					modifier = {
						factor = 0
						FROM = {
							OR = {
								is_ruler = no
								NOT = { any_courtier = { has_job_title = job_spymaster } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 1 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 3 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 5 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 7 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 9 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 11 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 13 } }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 15 } }
							}
						}
					}
					character_event = { id = Plus.223 tooltip = KIDNAP_MURDER_DISCOVERED }
					hidden_tooltip = {
						FROM = { save_event_target_as = target_victim }
						character_event = { id = 10 }
						FROM = { death = { death_reason = death_murder killer = ROOT } }
					}
				}
				30 = {
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 1 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 3 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 5 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 7 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 9 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 11 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 13 }
							}
						}
					}
					modifier = {
						factor = 0.8
						FROM = {
							job_spymaster = {
								attribute_diff = { character = ROOT attribute = intrigue value = 15 }
							}
						}
					}
					custom_tooltip = { text = KIDNAP_MURDER_NOT_DISCOVERED }
					hidden_tooltip = {
						FROM = { death = { death_reason = death_murder_unknown } }
					}
				}
			}
		}
	}
	option = {
		name = EVTOPTC_Plus_221 # Just let him go, dammit
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0
				is_ruler = yes
			}
			modifier = {
				factor = 0.5
				FROM = {
					job_spymaster = {
						NOT = { attribute_diff = { character = ROOT attribute = intrigue value = 1 } }
					}
				}
			}
			modifier = {
				factor = 0.1
				FROM = {
					job_spymaster = {
						ROOT = {
							attribute_diff = { character = PREV attribute = intrigue value = 5 }
						}
					}
				}
			}
		}
		if = {
			limit = {
				is_ruler = no
				is_liege_or_above = FROM
			}
			banish = yes
		}
		FROM = {
			character_event = { id = Plus.224 tooltip = KIDNAP_RELEASED }
		}
	}
}
	
# 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_tooltip = {
			opinion = { who = FROM modifier = opinion_kidnapper months = 1200 }
			father = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			mother = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			any_sibling = { opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 } }
			any_spouse = {
				limit = { NOT = { sibling = ROOT } }
				opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 }
			}
			any_child = {
				limit = { NOT = { is_married = ROOT } }
				opinion = { who = FROM modifier = opinion_kidnapped_kin months = 600 }
			}
			top_liege = {
				character_event = { id = Plus.217 days = 1 } # Notify
				any_realm_character = {
					limit = {
						NOT = { character = ROOT }
						OR = {
							is_close_relative = ROOT
							is_liege_or_above = ROOT
							is_vassal_or_below = 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 = {
		OR = {
			character = FROM
			is_close_relative = FROMFROM
			dynasty = FROMFROM
			same_realm = FROMFROM
			same_realm = FROM
		}
	}
	
	option = {
		trigger = { character = FROM }
		name = CURSES
	}
	option = {
		trigger = { NOT = { character = FROM } }
		name = I_SEE
	}
}

# 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_tooltip = {
			opinion = { who = FROM modifier = attempted_kidnapping months = 600 }
			opinion = { who = FROM modifier = opinion_relieved multiplier = 2 months = 600 }
			father = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 300 } }
			mother = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 300 } }
			any_sibling = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 300 } }
			any_spouse = {
				limit = { NOT = { sibling = ROOT } }
				opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 300 }
			}
			any_child = {
				limit = { NOT = { is_married = ROOT } }
				opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 300 }
			}
		}
	}
}

# 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!
		ai_chance = {
			factor = 80
			modifier = {
				factor = 0.1
				trait = brave
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 2
				NOT = { age = 30 }
				health = 3
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 3
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 4
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 5
			}
			modifier = {
				factor = 0.75
				num_of_count_titles = 6
			}
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 33
				add_trait = craven
			}
		}
		if = {
			limit = { trait = brave }
			remove_trait = brave
		}
		event_target:demanded_vassal = {
			set_defacto_liege = FROM
			pf_liege_change_effect = yes
			hidden_tooltip = { letter_event = { id = Plus.226 days = 1 } }
		}
		custom_tooltip = { text = KIDNAP_IS_SET_FREE }
		hidden_tooltip = {
			FROM = { character_event = { id = Plus.227 } }
			top_liege = {
				character_event = { id = Plus.228 days = 1 } #notify
				any_realm_character = {
					limit = {
						NOT = { character = FROM }
						NOT = { character = event_target:demanded_vassal }
						is_ruler = yes
					}
					character_event = { id = Plus.228 days = 1 } #notify
				}
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_218 # You'll get nothing from me!
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0.1
				trait = craven
			}
			modifier = {
				factor = 2
				trait = wroth
			}
			modifier = {
				factor = 2
				trait = proud
			}
			modifier = {
				factor = 2
				NOT = { health = 3 }
			}
		}
		if = {
			limit = {
				NOT = { trait = brave }
				NOT = { trait = craven }
			}
			random = {
				chance = 33
				add_trait = brave
			}
		}
		if = {
			limit = { trait = craven }
			remove_trait = craven
		}
		FROM = { character_event = { id = Plus.221 tooltip = KIDNAP_DECIDE } }
	}
}	

# 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
		FROM = { opinion = { who = ROOT modifier = kidnapped_me months = 120 } }
		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_tooltip = {
			plot_target_char = { character_event = { id = Plus.230 } }
		}
		set_character_flag = abort_plot
	}
}

# 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 = {
					any_courtier = { has_job_title = job_spymaster }
				}
			}
			reveal_plot_w_message = yes
		}
		if = {
			limit = {
				plot_target_char = {
					NOT = {
						any_courtier = { has_job_title = job_spymaster }
					}
				}
			}
			reveal_plot = yes
		}
		plot_target_char = {
			hidden_tooltip = { character_event = { id = Plus.232 } }
			if = {
				limit = {
					independent = no
					liege = { is_close_relative = FROM }
					liege = { NOT = { character = ROOT } }
				}
				liege = {
					opinion = {
						who = ROOT
						modifier = attempted_kidnapping_of_kin
						months = 60
					}
				}
			}
			if = {
				limit = {
					independent = no
					is_ruler = yes
					liege = { NOT = { is_close_relative = FROM } }
					liege = { NOT = { character = ROOT } }
				}
				liege = {
					opinion = {
						who = ROOT
						modifier = attempted_kidnapping_of_vassal
						months = 60
					}
				}
			}
		}
		set_character_flag = abort_plot
	}
}

# 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_tooltip = {
			opinion = { who = FROM modifier = attempted_kidnapping months = 1200 }
			father = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 600 } }
			mother = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 600 } }
			any_sibling = { opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 600 } }
			any_spouse = {
				limit = { NOT = { sibling = ROOT } }
				opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 600 }
			}
			any_child = {
				limit = { NOT = { is_married = ROOT } }
				opinion = { who = FROM modifier = attempted_kidnapping_of_kin months = 600 }
			}
		}
	}
}

### 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
	capable_only = yes
	prisoner = no
	lacks_dlc = "Way of Life"

	trigger = {
		has_plot = plot_seduce
		is_pregnant = no
		plot_target_char = {
			prisoner = no
			is_pregnant = no
			at_location = ROOT # The Plot Head needs to be at the target's location to get a chance
			NOT = { trait = incapable }
			NOT = { is_inaccessible_trigger = yes }
		}
		NOT = { has_character_flag = seduce_in_motion }
		plot_power_contribution = {
			plotter = ROOT
			power = 0.02
		}
	}

	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.75
			plot_power_contribution =
			{
				plotter = ROOT
				power = 0.10
			}
		}
		modifier = {
			factor = 0.75
			plot_power_contribution =
			{
				plotter = ROOT
				power = 0.20
			}
		}
		modifier = {
			factor = 0.75
			plot_power_contribution =
			{
				plotter = ROOT
				power = 0.30
			}
		}
		modifier = {
			factor = 0.75
			plot_power_contribution =
			{
				plotter = ROOT
				power = 0.40
			}
		}
		modifier = {
			factor = 0.75
			plot_power_contribution =
			{
				plotter = ROOT
				power = 0.50
			}
		}
		modifier = {
			factor = 0.8
			plot_target_char = {
				opinion = { who = ROOT value = 20 }
			}
		}

		modifier = {
			factor = 0.7
			plot_target_char = {
				opinion = { who = ROOT value = 40 }
			}
		}

		modifier = {
			factor = 0.7
			plot_target_char = {
				opinion = { who = ROOT value = 60 }
			}
		}

		modifier = {
			factor = 0.6
			plot_target_char = {
				opinion = { who = ROOT value = 80 }
			}
		}

		modifier = {
			factor = 0.5
			plot_power = 0.5
		}

		modifier = {
			factor = 0.5
			plot_power = 0.7
		}

		modifier = {
			factor = 0.5
			plot_power = 0.9
		}

		modifier = {
			factor = 0.5
			trait = fair
		}

		modifier = {
			factor = 0.85
			is_female = no
			is_strong_trigger = yes
		}
		
		modifier = {
			factor = 0.75
			OR = {
				trait = lustful
				trait = hedonist
				trait = poet
			}
		}

		modifier = {
			factor = 0.95
			trait = gregarious
		}

		modifier = {
			factor = 0.5
			plot_target_char = {
				OR = {
					trait = lustful
					trait = hedonist
				}
			}
		}

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

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

		modifier = {
			factor = 0.95
			diplomacy = 11
		}

		modifier = {
			factor = 0.9
			diplomacy = 13
		}

		modifier = {
			factor = 0.85
			diplomacy = 15
		}

		modifier = {
			factor = 0.8
			diplomacy = 17
		}

		modifier = {
			factor = 0.8
			NOT = { age = 25 }
		}

		modifier = {
			factor = 0.9
			NOT = { age = 35 }
		}
	}
	
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			NOT = { plot_power = 0.5 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			40 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			60 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			NOT = { plot_power = 1.0 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			40 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			60 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			60 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			40 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 1.0
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			60 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			40 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 1.0
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			80 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			20 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_235" # Too risky
		trigger = {
			ai = no
		}
	}
}

# 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
	capable_only = yes
	prisoner = no
	lacks_dlc = "Way of Life"

	trigger = {
		any_backed_character = {
			has_plot = plot_seduce
			plot_power = 0.25
			is_pregnant = no
			plot_target_char = {
				prisoner = no
				is_pregnant = no
				NOT = { trait = incapable }
				NOT = { is_inaccessible_trigger = yes }
			}
			NOT = { has_character_flag = seduce_in_motion }
			plot_power_contribution = {
				plotter = ROOT
				power = 0.02
			}
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			any_backed_character = {
				has_plot = plot_seduce
				has_character_modifier = plot_assisted_spying
			}
		}
		modifier = {
			factor = 0.65
			any_backed_character = {
				has_plot = plot_seduce
				has_character_modifier = plot_assisted_spying2
			}
		}
		modifier = {
			factor = 0.55
			any_backed_character = {
				has_plot = plot_seduce
				has_character_modifier = plot_assisted_spying3
			}
		}
		modifier = {
			factor = 0.45
			any_backed_character = {
				has_plot = plot_seduce
				has_character_modifier = plot_assisted_spying4
			}
		}
		modifier = {
			factor = 0.35
			any_backed_character = {
				has_plot = plot_seduce
				has_character_modifier = plot_assisted_spying5
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
			}
		}
		modifier = {
			factor = 1.1
			any_backed_character = {
				has_character_flag = has_personal_spy_network
				plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
			}
		}
		modifier = {
			factor = 0.6
			any_backed_character = {
				has_plot = plot_seduce
				ROOT = {
					plot_power_contribution =
					{
						plotter = PREV
						power = 0.10
					}
				}
			}
		}
		modifier = {
			factor = 0.6
			any_backed_character = {
				has_plot = plot_seduce
				ROOT = {
					plot_power_contribution =
					{
						plotter = PREV
						power = 0.20
					}
				}
			}
		}
		modifier = {
			factor = 0.6
			any_backed_character = {
				has_plot = plot_seduce
				ROOT = {
					plot_power_contribution =
					{
						plotter = PREV
						power = 0.30
					}
				}
			}
		}
		modifier = {
			factor = 0.6
			any_backed_character = {
				has_plot = plot_seduce
				ROOT = {
					plot_power_contribution =
					{
						plotter = PREV
						power = 0.40
					}
				}
			}
		}
		modifier = {
			factor = 0.9
			any_backed_character = {
				has_plot = plot_seduce
				plot_target_char = {
					opinion = { who = PREV value = 20 }
				}
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				has_plot = plot_seduce
				plot_target_char = {
					opinion = { who = PREV value = 40 }
				}
			}
		}
		modifier = {
			factor = 0.8
			any_backed_character = {
				has_plot = plot_seduce
				plot_target_char = {
					opinion = { who = PREV value = 60 }
				}
			}
		}
		modifier = {
			factor = 0.7
			any_backed_character = {
				has_plot = plot_seduce
				plot_target_char = {
					opinion = { who = PREV value = 80 }
				}
			}
		}

		modifier = {
			factor = 0.5
			any_backed_character = {
				has_plot = plot_seduce
				plot_power = 0.5
			}
		}

		modifier = {
			factor = 0.5
			any_backed_character = {
				has_plot = plot_seduce
				plot_power = 0.7
			}
		}

		modifier = {
			factor = 0.33
			any_backed_character = {
				has_plot = plot_seduce
				plot_power = 0.9
			}
		}

		modifier = {
			factor = 0.95
			trait = gregarious
		}

		modifier = {
			factor = 0.85
			diplomacy = 7
		}

		modifier = {
			factor = 0.9
			diplomacy = 9
		}

		modifier = {
			factor = 0.95
			diplomacy = 11
		}

		modifier = {
			factor = 0.95
			diplomacy = 13
		}

		modifier = {
			factor = 0.95
			diplomacy = 15
		}

		modifier = {
			factor = 0.95
			diplomacy = 17
		}

	}

	option = {
		name = "EVTOPTA_Plus_236" # Seduce attempt
		random_backed_character = {
			limit = {
				has_plot = plot_seduce
				plot_power = 0.25
				is_pregnant = no
				plot_target_char = {
					prisoner = no
					is_pregnant = no
					NOT = { trait = incapable }
				}
				NOT = { has_character_flag = seduce_in_motion }
			}
			set_character_flag = seduce_in_motion
			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 = {
			NOT = { plot_power = 0.5 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			40 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			60 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			NOT = { plot_power = 1.0 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			40 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			60 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 0.5
			NOT = { plot_power = 1.0 }
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			60 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			40 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 1.0
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			60 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			40 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTA_Plus_235" # Do it
		trigger = {
			plot_power = 1.0
			OR = {
				AND = {
					is_female = no
					plot_target_char = {
						is_female = yes
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = no
					plot_target_char = {
						is_female = no
						trait = homosexual
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = no
						NOT = { trait = homosexual }
					}
				}
				AND = {
					is_female = yes
					plot_target_char = {
						is_female = yes
						trait = homosexual
					}
				}
			}
		}
		set_character_flag = seduce_in_motion
		random_list = {
			80 = {
				character_event = { id = Plus.238 days = 3 tooltip = "seduce_plot_success_tooltip" }
			}
			20 = {
				character_event = { id = Plus.240 days = 3 tooltip = "seduce_plot_fail_tooltip" }
			}
		}
	}
	option = {
		name = "EVTOPTB_Plus_235" # Too risky
		trigger = {
			ai = no
		}
	}
}

# 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 = {
			ROOT = { add_lover = PREV }
			hidden_tooltip = {
				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 = {
				OR = {
					AND = {
						NOT = { trait = homosexual }
						is_female = yes
						FROM = { is_female = yes }
					}
					AND = {
						NOT = { trait = homosexual }
						is_female = no
						FROM = { is_female = no }
					}
				}
			}
			add_trait = homosexual
		}
		hidden_tooltip = {
			if = {
				limit = {
					is_female = yes
					fertility = 0.33
					FROM = {
						is_female = no
						fertility = 0.33
					}
				}
				if = {
					limit = { is_married = no }
					random = {
						chance = 50
						FROM = { impregnate = ROOT }
					}
				}
				if = {
					limit = { is_married = yes }
					random = {
						chance = 50
						FROM = { impregnate_cuckoo = ROOT }
					}
				}
			}
			if = {
				limit = {
					is_female = no
					fertility = 0.33
					FROM = {
						NOT = { age = 45 }
						is_female = yes
						fertility = 0.33
					}
				}
				if = {
					limit = { is_married = no }
					random = {
						chance = 50
						impregnate = FROM
					}
				}
				if = {
					limit = { is_married = yes }
					random = {
						chance = 50
						impregnate_cuckoo = FROM
					}
				}
			}
			change_variable = { which = lifestyle_hedonist value = 1 }
			opinion = { who = FROM modifier = opinion_recent_plot months = 60 }
		}
	}
}

# 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 = {
			reverse_opinion = { who = ROOT modifier = love_scorned months = 24 }
		}
		hidden_tooltip = {
			set_character_flag = abort_plot
			plot_target_char = {
				opinion = { who = ROOT modifier = opinion_recent_plot months = 60 }
				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 = {
				OR = {
					AND = {
						FROM = { is_female = no }
						is_female = yes
						NOT = { trait = homosexual }
					}
					AND = {
						FROM = { is_female = no }
						is_female = no
						trait = homosexual
					}
					AND = {
						FROM = { is_female = yes }
						is_female = no
						NOT = { trait = homosexual }
					}
					AND = {
						FROM = { is_female = yes }
						is_female = yes
						trait = homosexual
					}
				}
			}
			opinion = { who = FROM modifier = opinion_furious months = 60 }
		}
		if = {
			limit = {
				OR = {
					AND = {
						FROM = { is_female = yes }
						is_female = yes
						NOT = { trait = homosexual }
					}
					AND = {
						FROM = { is_female = yes }
						is_female = no
						trait = homosexual
					}
					AND = {
						FROM = { is_female = no }
						is_female = no
						NOT = { trait = homosexual }
					}
					AND = {
						FROM = { is_female = no }
						is_female = yes
						trait = homosexual
					}
				}
			}
			opinion = { who = FROM modifier = devious_plotter months = 60 }
		}
		if = {
			limit = {
				FROM = { is_female = yes }
			}
			any_spouse = {
				opinion = { who = FROM modifier = slut_seductress months = 120 }
			}
		}
		if = {
			limit = {
				FROM = { is_female = no }
			}
			any_spouse = {
				opinion = { who = FROM modifier = opinion_cuckolded months = 120 }
			}
		}
	}
}

### 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 = {
			clr_character_flag = civil_war_faction_leader
			clr_character_flag = civil_war_faction_member
			clr_character_flag = will_join_civil_war
			diplomatic_immunity = yes 
			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
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				NOT = {
					FROM = {
						faction_power = {
							faction = faction_religious
							power = 1.0
						}
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					controls_religion = yes
					rightful_religious_head = ROOT
				}
			}
			modifier = {
				factor = 0
				OR = {
					trait = zealous
					trait = lunatic
					trait = possessed
				}
			}
			modifier = {
				factor = 10
				trait = cynical
			}
			modifier = {
				factor = 1.25
				is_weak_trigger = yes
			}
			modifier = {
				factor = 1.25
				trait = craven
			}
			modifier = {
				factor = 1.25
				trait = humble
			}
			modifier = {
				factor = 1.25
				trait = patient
			}
			modifier = {
				factor = 1.25
				trait = content
			}
		}

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

		set_character_flag = converted_religion
		#inform faction members and vassals
		hidden_tooltip = {
			any_vassal = {
				limit = { NOT = { in_faction = faction_religious } }
				character_event = { id = Plus.253 }
			}
			FROM = {
				letter_event = { id = Plus.251 }
				any_faction_backer = {
					faction = faction_religious
					letter_event = { id = Plus.252 }
					diplomatic_immunity = no
				}
				diplomatic_immunity = no
			}
		}
		
		prestige = -250
		piety = -100
		
		#actually convert religion
		if = {
			limit = { higher_tier_than = BARON }
			religion_authority = {
				modifier = ruler_converted_from
			}
		}
		hidden_tooltip = {
			any_courtier = {
				limit = {
					religion = ROOT
					employer = { character = ROOT }
				}
				religion = FROM
			}
		}
		religion = FROM
		if = {
			limit = { higher_tier_than = BARON }
			hidden_tooltip = {
				religion_authority = {
					modifier = ruler_converted_to
				}
			}
		}
		if = {
			limit = { FROM = { trait = shaivist_hindu } }
			add_trait = shaivist_hindu
		}
		if = {
			limit = { FROM = { trait = vaishnavist_hindu } }
			add_trait = vaishnavist_hindu
		}
		if = {
			limit = { FROM = { trait = shaktist_hindu } }
			add_trait = shaktist_hindu
		}
		if = {
			limit = { FROM = { trait = smartist_hindu } }
			add_trait = smartist_hindu
		}
		if = {
			limit = { FROM = { trait = mahayana_buddhist } }
			add_trait = mahayana_buddhist
		}
		if = {
			limit = { FROM = { trait = vajrayana_buddhist } }
			add_trait = vajrayana_buddhist
		}
		if = {
			limit = { FROM = { trait = theravada_buddhist } }
			add_trait = theravada_buddhist
		}
		if = {
			limit = { FROM = { trait = digambara_jain } }
			add_trait = digambara_jain
		}
		if = {
			limit = { FROM = { trait = svetambara_jain } }
			add_trait = svetambara_jain
		}
		if = {
			limit = { trait = zealous }
			remove_trait = zealous
		}
	}
	option = {
		name = EVTOPTB_Plus_250 # Refuse
		ai_chance = {
			factor = 90
			modifier = {
				factor = 1.25
				is_strong_trigger = yes
			}
			modifier = {
				factor = 1.25
				trait = brave
			}
			modifier = {
				factor = 1.25
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 1.0
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 1.5
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 2.0
					}
				}
			}
			modifier = {
				factor = 0.5
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 2.5
					}
				}
			}
			modifier = {
				factor = 0.25
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 3.0
					}
				}
			}	
			modifier = {
				factor = 0.25
				FROM = {
					faction_power = {
						faction = faction_religious
						power = 4.0
					}
				}
			}
		}

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

		FROM = {
			tooltip = { any_faction_backer = { faction = faction_religious } }
			hidden_tooltip = {
				letter_event = { id = Plus.254 } #inform
				
				#setup faction leader
				diplomatic_immunity = no
				clr_character_flag = faction_install_antiking_ultimatum_taken
				set_character_flag = original_war_liege
				pf_setup_rebel_effect = yes
				
				#setup faction backers
				any_faction_backer = {
					faction = faction_pretender
					diplomatic_immunity = no
					pf_setup_rebel_effect = yes
				}
			}
		}
		
		reverse_war = {
			target = FROM
			casus_belli = religious_overthrow_ruler
			faction = faction_religious
		}
		
		#inform remaining vassals
		hidden_tooltip = {
			any_vassal = {
				letter_event = { id = PlusFaction.403 }
			}
		}
	}
}

# 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
			hidden = yes
			duration = 3650
		}
	}
}

# Inform faction backers - Religious Faction
letter_event = {
	id = Plus.252
	desc = EVTDESC_Plus_252
	
	show_from_from = yes
	is_triggered_only = yes
	
	option = {
		name = GOOD
		reverse_opinion = {
			modifier = opinion_grateful
			who = FROMFROM
			years = 5
		}
		add_character_modifier = {
			name = faction_religious_ultimatum_timer
			hidden = yes
			duration = 3650
		}
	}
}

# Inform other vassals - Religious Faction
character_event = {
	id = Plus.253
	desc = EVTDESC_Plus_253
	picture = GFX_evt_council
	border = GFX_event_normal_frame_intrigue
	
	show_from_from = yes
	is_triggered_only = 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
	
	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 = {
		num_of_baron_titles = 1
		pf_war_trait_trigger = no
		religion = FROM
	}
	
	option = {
		name = EVTOPTA_PlusFaction_415 #join the rebellion
		trigger = {
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
			liege = {
				NOR = {
					reverse_has_truce = ROOT
					has_non_aggression_pact_with = ROOT
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_coerced_into_leaving_faction }
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated }
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated_other_rel }
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				liege = { current_heir = { character = ROOT } }
			}
			modifier = {
				factor = 0.5
				liege = {
					OR = {
						has_non_aggression_pact_with = ROOT
						is_allied_with = ROOT
						dynasty = ROOT
						is_close_relative = ROOT
					}
				}
			}
			modifier = {
				factor = 5
				liege = { is_rival = ROOT }
			}
			modifier = {
				factor = 2
				trait = zealous
			}
			modifier = {
				factor = 1.25
				OR = {
					is_allied_with = FROM
					is_close_relative = FROM
				}
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.8
				NOT = { opinion = { who = FROM value = -25 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -50 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -75 } }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 25 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 75 }
			}
			modifier = {
				factor = 0
				opinion = { who = liege value = 0 }
			}
			modifier = {
				factor = 3
				NOT = { opinion = { who = liege value = -25 } }
			}
			modifier = {
				factor = 3
				NOT = { opinion = { who = liege value = -50 } }
			}
			modifier = {
				factor = 3
				NOT = { opinion = { who = liege value = -75 } }
			}
		}
		set_character_flag = will_join_civil_war
		custom_tooltip = { text = MUST_MANUALLY_JOIN_FACTION }
	}
	option = {
		name = EVTOPTB_PlusFaction_415 #refuse
		trigger = {
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
			liege = {
				NOR = {
					reverse_has_truce = ROOT
					has_non_aggression_pact_with = ROOT
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_coerced_into_leaving_faction }
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated }
					reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated_other_rel }
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = craven
			}
			modifier = {
				factor = 2
				trait = content
			}
			modifier = {
				factor = 2
				trait = humble
			}
			modifier = {
				factor = 2
				trait = cynical
			}
		}
		reverse_opinion = { who = FROM modifier = opinion_disappointed years = 5 }
	}
	option = {
		trigger = {
			NAND = {
				prisoner = no
				NOT = { trait = incapable }
				is_adult = yes
				liege = {
					NOR = {
						reverse_has_truce = ROOT
						has_non_aggression_pact_with = ROOT
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_coerced_into_leaving_faction }
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated }
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated_other_rel }
					}
				}
			}
		}
		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 = {
				prisoner = no
				trait = incapable
			}
		}
		name = {
			text = EVTOPTC_PlusFaction_415_child #I am a child
			trigger = {
				prisoner = no
				NOT = { trait = incapable }
				is_adult = no
			}
		}
		name = {
			text = EVTOPTC_PlusFaction_415_truce #I cannot
			trigger = {
				prisoner = no
				NOT = { trait = incapable }
				is_adult = yes
				liege = {
					OR = {
						reverse_has_truce = ROOT
						has_non_aggression_pact_with = ROOT
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_coerced_into_leaving_faction }
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated }
						reverse_has_opinion_modifier = { who = ROOT modifier = opinion_subjugated_other_rel }
					}
				}
			}
		}
	}
}	


### REPLACE REGENT

# Should I abandon my current plot to become regent?
character_event = {
	id = Plus.260
	desc = AI_EVENT
	picture = GFX_evt_council
	
	is_part_of_plot = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	ai = yes
	
	trigger = {
		independent = no
		liege = {
			has_regent = yes
			any_courtier = { character = ROOT }
			OR = {
				is_adult = no
				trait = incapable
			}
			OR = {
				is_married = ROOT
				is_lover = ROOT
				is_close_relative = ROOT
				current_heir = { character = ROOT }
				ROOT = { is_councillor = yes }
			}
			OR = {
				ROOT = { is_female = no }
				is_married = ROOT
				is_child_of = ROOT
				current_heir = { character = ROOT }
				ROOT = { is_councillor = yes }
				NOR = {
					has_law = agnatic_succession
					has_law = cognatic_succession
				}
			}
			OR = {
				ROOT = { is_female = yes }
				is_married = ROOT
				is_child_of = ROOT
				current_heir = { character = ROOT }
				ROOT = { is_councillor = yes }
				NOR = {
					has_law = enatic_succession
					has_law = enatic_cognatic_succession
				}
			}
			NOR = {
				regent = { ROOT = { plot_target_char = { character = PREVPREV } } }
				ROOT = { plot_target_char = { character = PREVPREV } }
			}
		}
		NOR = {
			trait = content
			trait = humble
			is_dumb_trigger = yes
			is_inaccessible_trigger = yes
			has_minor_title = title_regent
			has_character_modifier = replace_regent_timer
		}
		OR = {
			NOT = { has_character_flag = replace_regent_check }
			had_character_flag = { flag = replace_regent_check days = 1825 }
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	immediate = {
		set_character_flag = replace_regent_check
	}
	
	option = {
		name = AI_EVENT # Do it
		ai_chance = {
			factor = 75
			modifier = {
				factor = 0.5
				OR = {
					has_plot = plot_kill_character
					has_plot = plot_kill_spouse
					has_plot = plot_take_revenge
				}
			}
			modifier = {
				factor = 0.5
				NOT = { intrigue = 8 }
			}
			modifier = {
				factor = 0.5
				NOT = { intrigue = 4 }
			}
		}
		set_character_flag = abort_plot
		character_event = { id = Plus.302 days = 7 }
	}
	option = {
		name = AI_EVENT # Never mind
		ai_chance = {
			factor = 25
			modifier = {
				factor = 0
				NOT = { num_of_plot_backers = 1 }
			}
			modifier = {
				factor = 0
				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
	capable_only = yes
	prisoner = no

	trigger = {
		has_plot = plot_replace_regent
		liege = {
			NOT = { any_known_plotter = { character = ROOT } }
			OR = {
				regent = {
					NOT = { any_known_plotter = { character = ROOT } }
				}
				any_courtier = {
					has_plot = plot_replace_regent
					NOT = { character = ROOT }
					NOT = { any_known_plotter = { character = ROOT } }
				}
			}
		}
		OR = {
			NOT = { has_character_flag = replace_regent_plot_discovery }
			had_character_flag = { flag = replace_regent_plot_discovery days = 90 }
		}
	}
	
	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 1.5
			OR = {
				trait = quick
				trait = shrewd
			}
		}
		modifier = {
			factor = 2
			trait = genius
		}
		modifier = {
			factor = 1.5
			liege = { is_close_relative = ROOT }
		}
		modifier = {
			factor = 0.75
			liege = { NOT = { is_close_relative = ROOT } }
		}
		modifier = {
			factor = 1.5
			NOT = {
				liege = {
					any_courtier = {
						has_plot = plot_replace_regent
						count = 2
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 2
				}
			}
		}
		modifier = {
			factor = 0.8
			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 3
				}
			}
		}
		modifier = {
			factor = 0.8
			liege = {
				any_courtier = {
					has_plot = plot_replace_regent
					count = 4
				}
			}
		}
		modifier = {
			factor = 0.8
			NOT = { intrigue = 8 }
		}
		modifier = {
			factor = 0.8
			NOT = { intrigue = 5 }
		}
		modifier = {
			factor = 0.8
			NOT = { intrigue = 3 }
		}
		modifier = {
			factor = 1.2
			intrigue = 12
		}
		modifier = {
			factor = 1.2
			intrigue = 14
		}
		modifier = {
			factor = 1.2
			intrigue = 16
		}
		modifier = {
			factor = 1.2
			intrigue = 18
		}
		modifier = {
			factor = 1.2
			intrigue = 20
		}
	}
	
	immediate = {
		set_character_flag = replace_regent_plot_discovery
		if = {
			limit = {
				liege = {
					any_courtier = {
						NOT = { character = ROOT }
						NOT = { any_known_plotter = { character = ROOT } }
						has_plot = plot_replace_regent
					}
				}
			}
			if = {
				limit = {
					liege = {
						regent = { any_known_plotter = { character = ROOT } }
					}
				}
				liege = {
					random_courtier = {
						limit = {
							NOT = { character = ROOT }
							NOT = { any_known_plotter = { character = ROOT } }
							has_plot = plot_replace_regent
						}
						character_event = { id = Plus.262 }
					}
				}
				break = yes
			}
			random = {
				chance = 50
				liege = {
					random_courtier = {
						limit = {
							NOT = { character = ROOT }
							NOT = { any_known_plotter = { character = ROOT } }
							has_plot = plot_replace_regent
						}
						character_event = { id = Plus.262 }
					}
				}
				break = yes
			}
		}
		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
		ai_chance = { factor = 100 }
		random_list = {
			50 = {
				modifier = {
					factor = 1.5
					has_minor_title = title_regent
				}
				modifier = {
					factor = 1.5
					OR = {
						trait = quick
						trait = shrewd
					}
				}
				modifier = {
					factor = 2.0
					trait = genius
				}
				modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value = 2 }
				}
				modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value = 4 }
				}
				modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value = 6 }
				}
				modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value = 8 }
				}
				modifier = {
					factor = 1.2
					attribute_diff = { attribute = intrigue character = FROM value = 10 }
				}
				modifier = {
					factor = 0.9
					FROM = { plot_power = 1.0 }
				}
				modifier = {
					factor = 0.9
					FROM = { plot_power = 1.25 }
				}
				modifier = {
					factor = 0.9
					FROM = { plot_power = 1.5 }
				}
				modifier = {
					factor = 0.9
					FROM = { plot_power = 1.75 }
				}
				modifier = {
					factor = 0.9
					FROM = { plot_power = 2.0 }
				}
				FROM = { character_event = { id = Plus.263 tooltip = REGENT_PLOT_BLOCKED } }
				hidden_tooltip = {
					character_event = { id = Plus.264 }
					liege = { character_event = { id = Plus.268 } }
				}
			}
			50 = {
				modifier = {
					factor = 0.5
					liege = {
						OR = {
							is_close_relative = FROM
							is_close_relative = ROOT
						}
					}
				}
				FROM = { custom_tooltip = { text = REGENT_PLOT_NOTHING } }
				hidden_tooltip = { character_event = { id = Plus.265 } }
			}
			30 = {
				modifier = {
					factor = 1.5
					OR = {
						FROM = { trait = quick }
						FROM = { trait = shrewd }
						trait = slow
						trait = dull
					}
				}
				modifier = {
					factor = 2.0
					OR = {
						FROM = { trait = genius }
						trait = imbecile
					}
				}
				modifier = {
					factor = 1.5
					is_ill = yes
				}
				modifier = {
					factor = 1.2
					FROM = { attribute_diff = { attribute = intrigue character = ROOT value = 2 } }
				}
				modifier = {
					factor = 1.2
					FROM = { attribute_diff = { attribute = intrigue character = ROOT value = 4 } }
				}
				modifier = {
					factor = 1.2
					FROM = { attribute_diff = { attribute = intrigue character = ROOT value = 6 } }
				}
				modifier = {
					factor = 1.2
					FROM = { attribute_diff = { attribute = intrigue character = ROOT value = 8 } }
				}
				modifier = {
					factor = 1.2
					FROM = { attribute_diff = { attribute = intrigue character = ROOT value = 10 } }
				}
				FROM = { character_event = { id = Plus.266 tooltip = REGENT_PLOT_WORSE } }
				hidden_tooltip = {
					character_event = { id = Plus.267 }
					liege = { character_event = { id = Plus.269 } }
				}
			}
		}
	}
	option = {
		ai_chance = { factor = 0 }
		name = EVTOPTB_Plus_262 # I don't want to make things worse
	}
}

# 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
		set_character_flag = abort_plot
	}
}

# 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 = {
			random_courtier = {
				limit = {
					opinion = { who = ROOT value = 0 }
					is_adult = yes
					prisoner = no
					NOR = {
						trait = incapable
						has_plot = plot_replace_regent
						ROOT = { any_plot_backer = { character = PREVPREV } }
					}
				}
				opinion = { who = ROOT modifier = opinion_plot_help years = 1 }
				liege = {
					regent = {
						reverse_opinion = { who = PREVPREV modifier = opinion_irritated multiplier = 2 years = 1 }
					}
				}
			}
		}
	}
}

# 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 = {
			liege = {
				current_heir = { character = ROOT }
			}
		}
	}
	desc = {
		text = EVTDESC_Plus_270B
		trigger = {
			liege = {
				NOT = { current_heir = { character = ROOT } }
				OR = {
					is_married = ROOT
					is_child_of = ROOT
					sibling = ROOT
				}
			}
		}
	}
	desc = {
		text = EVTDESC_Plus_270C
		trigger = {
			liege = {
				NOR = {
					current_heir = { character = ROOT }
					is_married = ROOT
					is_child_of = ROOT
					sibling = ROOT
				}
			}
		}
	}

	is_part_of_plot = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	war = no
	is_sick = no
	
	trigger = {
		has_plot = plot_incapable_usurp
		plot_power = 2.0
		num_of_plot_backers = 3
		in_command_trigger = no
		#is_ill = no
		plot_target_char = {
			war = no
			is_liege_of = ROOT
			trait = incapable
			regent = { character = ROOT }
		}
		NOR = {
			is_inaccessible_trigger = yes
			has_character_flag = plot_incapable_usurp_underway
		}
	}
	
	mean_time_to_happen = {
		months = 60
		modifier = {
			factor = 0.1
			liege = { current_heir = { character = ROOT } }
		}
		modifier = {
			factor = 0.5
			liege = {
				NOT = { current_heir = { character = ROOT } }
				OR = {
					is_married = ROOT
					is_child_of = ROOT
					sibling = ROOT
				}
			}
		}
		modifier = {
			factor = 1.5
			liege = {
				NOR = {
					current_heir = { character = ROOT }
					is_married = ROOT
					is_child_of = ROOT
					sibling = ROOT
					dynasty = ROOT
				}
			}
		}
		modifier = {
			factor = 0.9
			intrigue = 12
		}
		modifier = {
			factor = 0.9
			intrigue = 14
		}
		modifier = {
			factor = 0.9
			intrigue = 16
		}
		modifier = {
			factor = 0.9
			intrigue = 18
		}
		modifier = {
			factor = 0.9
			intrigue = 20
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 8 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 6 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 4 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 2 }
		}
		modifier = {
			factor = 0.9
			plot_power = 2.25
		}
		modifier = {
			factor = 0.9
			plot_power = 2.5
		}
		modifier = {
			factor = 0.9
			plot_power = 2.75
		}
		modifier = {
			factor = 0.9
			plot_power = 3.0
		}
		modifier = {
			factor = 0.9
			plot_power = 3.25
		}
		modifier = {
			factor = 0.9
			plot_power = 3.5
		}
		modifier = {
			factor = 0.9
			plot_power = 3.75
		}
		modifier = {
			factor = 0.9
			plot_power = 4.0
		}
	}
	
	option = {
		name = EVTOPTA_Plus_270 # Do it
		ai_chance = { factor = 100 }
		set_character_flag = plot_incapable_usurp_underway
		random_list = {
			50 = {
				modifier = {
					factor = 1.5
					trait = genius
				}
				modifier = {
					factor = 1.25
					OR = {
						trait = quick
						trait = shrewd
					}
				}
				modifier = {
					factor = 0.75
					OR = {
						trait = slow
						trait = dull
					}
				}
				modifier = {
					factor = 1.5
					liege = {
						prisoner = yes
						host = { character = ROOT }
					}
				}
				modifier = {
					factor = 1.5
					liege = { prisoner = yes }
				}
				modifier = {
					factor = 0.5
					liege = {
						current_heir = {
							NOR = {
								character = ROOT
								trait = incapable
								trait = lunatic
							}
							is_adult = yes
							prisoner = no
						}
					}
				}
				modifier = {
					factor = 1.1
					plot_power = 2.25
				}
				modifier = {
					factor = 1.1
					plot_power = 2.5
				}
				modifier = {
					factor = 1.1
					plot_power = 2.75
				}
				modifier = {
					factor = 1.1
					plot_power = 3.0
				}
				modifier = {
					factor = 1.1
					plot_power = 3.25
				}
				modifier = {
					factor = 1.1
					plot_power = 3.5
				}
				modifier = {
					factor = 1.1
					plot_power = 3.75
				}
				modifier = {
					factor = 1.1
					plot_power = 4.0
				}				
				character_event = { id = Plus.275 days = 7 tooltip = USURP_SUCCESSFUL }
			}
			50 = {
				modifier = {
					factor = 0.9
					intrigue = 12
				}
				modifier = {
					factor = 0.9
					intrigue = 14
				}
				modifier = {
					factor = 0.9
					intrigue = 16
				}
				modifier = {
					factor = 0.9
					intrigue = 18
				}
				modifier = {
					factor = 0.9
					intrigue = 20
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 8 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 6 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 4 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 2 }
				}
				character_event = { id = Plus.271 days = 7 tooltip = USURP_FAILED }
			}
			50 = {
				modifier = {
					factor = 0
					liege = { current_heir = { character = ROOT } }
				}
				modifier = {
					factor = 0.25
					liege = {
						NOT = { current_heir = { character = ROOT } }
						OR = {
							is_married = ROOT
							is_child_of = ROOT
							sibling = ROOT
						}
					}
				}
				modifier = {
					factor = 0.9
					intrigue = 12
				}
				modifier = {
					factor = 0.9
					intrigue = 14
				}
				modifier = {
					factor = 0.9
					intrigue = 16
				}
				modifier = {
					factor = 0.9
					intrigue = 18
				}
				modifier = {
					factor = 0.9
					intrigue = 20
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 8 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 6 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 4 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 2 }
				}
				character_event = { id = Plus.272 days = 7 tooltip = USURP_REVEALED }
			}
		}
	}
	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 = {
		has_plot = plot_incapable_usurp
		plot_target_char = {
			is_liege_of = ROOT
			trait = incapable
			regent = { character = ROOT }
		}
	}
	
	option = {
		name = CURSES
		set_character_flag = abort_plot
		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 = {
		has_plot = plot_incapable_usurp
		plot_target_char = {
			is_liege_of = ROOT
			trait = incapable
			regent = { character = ROOT }
		}
	}
	
	option = {
		name = CURSES
		set_character_flag = abort_plot
		prestige = -100
		tooltip = { imprison = yes }
		hidden_tooltip = {
			liege = {
				if = {
					limit = { is_friend = ROOT }
					remove_friend = ROOT
				}
				character_event = { id = Plus.273 }
				any_vassal = {
					limit = { NOT = { character = ROOT } }
					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 = {
			who = FROM
			modifier = opinion_charge_traitor
			years = 100
		}
		FROM = {
			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
	
	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
	
	is_part_of_plot = yes
	
	trigger = {
		has_plot = plot_incapable_usurp
		plot_target_char = {
			is_liege_of = ROOT
			trait = incapable
			regent = { character = ROOT }
		}
	}
	
	option = {
		name = EXCELLENT
		set_character_flag = regent_usurp_titles
		prestige = 100
		if = {
			limit = {
				has_nickname = no
				liege = {
					NOR = {
						current_heir = { character = ROOT }
						AND = {
							OR = {
								is_married = ROOT
								is_child_of = ROOT
								sibling = ROOT
							}
							current_heir = {
								OR = {
									trait = lunatic
									trait = incapable
									NOT = { dynasty = PREV }
								}
							}
						}
					}
				}
			}
			give_nickname = nick_the_usurper
		}
		tooltip = { liege = { abdicate_to = ROOT } }
		hidden_tooltip = {
			liege = {
				if = {
					limit = { current_heir = { character = ROOT } }
					ROOT = { set_character_flag = was_current_heir }
				}
				if = {
					limit = {
						NOT = { current_heir = { character = ROOT } }
						OR = {
							is_married = ROOT
							is_child_of = ROOT
							sibling = ROOT
						}
					}
					ROOT = { set_character_flag = was_close_relative }
				}
				if = {
					limit = {
						NOR = {
							current_heir = { character = ROOT }
							is_married = ROOT
							is_child_of = ROOT
							sibling = ROOT
						}
					}
					ROOT = { set_character_flag = was_not_close_relative }
				}
				character_event = { id = Plus.276 }
				any_vassal = {
					limit = { NOT = { character = ROOT } }
					character_event = { id = Plus.277 }
				}
				if = {
					limit = {
						current_heir = { NOT = { character = ROOT } }
					}
					current_heir = {
						opinion = { who = ROOT modifier = succ_law_disinherit months = 240 }
						set_character_flag = justified_claimant
					}
					any_dynasty_member = {
						limit = {
							NOT = { character = ROOT }
							NOT = { vassal_of = PREV }
						}
						character_event = { id = Plus.277 }
					}
				}
			}
			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
		if = {
			limit = { current_heir = { character = FROM } }
			transfer_scaled_wealth = { to = FROM value = all }
			abdicate = yes
			add_trait = abdicated
		}
		if = {
			limit = { current_heir = { NOT = { character = FROM } } }
			abdicate_to = FROM
			hidden_tooltip = {
				transfer_scaled_wealth = { to = FROM value = all }
				if = {
					limit = { has_character_flag = loan_taken }
					if = {
						limit = { has_character_modifier = loan_50 }
						FROM = {
							add_character_modifier = {
								name = loan_50
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_50
					}
					if = {
						limit = { has_character_modifier = loan_50_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_50_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_50_hidden
					}
					if = {
						limit = { has_character_modifier = loan_100 }
						FROM = {
							add_character_modifier = {
								name = loan_100
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_100
					}
					if = {
						limit = { has_character_modifier = loan_100_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_100_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_100_hidden
					}
					if = {
						limit = { has_character_modifier = loan_200 }
						FROM = {
							add_character_modifier = {
								name = loan_200
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_200
					}
					if = {
						limit = { has_character_modifier = loan_200_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_200_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_200_hidden
					}
					if = {
						limit = { has_character_modifier = loan_400 }
						FROM = {
							add_character_modifier = {
								name = loan_400
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_400
					}
					if = {
						limit = { has_character_modifier = loan_400_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_400_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_400_hidden
					}
					if = {
						limit = { has_character_modifier = loan_600 }
						FROM = {
							add_character_modifier = {
								name = loan_600
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_600
					}
					if = {
						limit = { has_character_modifier = loan_600_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_600_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_600_hidden
					}
					if = {
						limit = { has_character_modifier = loan_800 }
						FROM = {
							add_character_modifier = {
								name = loan_800
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_800
					}
					if = {
						limit = { has_character_modifier = loan_800_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_800_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_800_hidden
					}
					if = {
						limit = { has_character_modifier = loan_1000 }
						FROM = {
							add_character_modifier = {
								name = loan_1000
								duration = 730
								inherit = yes						
							}
						}
						remove_character_modifier = loan_1000
					}
					if = {
						limit = { has_character_modifier = loan_1000_hidden }
						FROM = {
							add_character_modifier = {
								name = loan_1000_hidden
								duration = -1
								inherit = yes
								hidden = yes
							}
						}
						remove_character_modifier = loan_1000_hidden
					}
					if = {
						limit = { has_character_modifier = loan_timer_jews }
						FROM = {
							add_character_modifier = {
								name = "loan_timer_jews"
								duration = 730
								inherit = yes
							}
						}
						remove_character_modifier = loan_timer_jews
					}
					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
	
	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
	capable_only = 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
				OR = {
					has_holder = no
					AND = {
						has_holder = yes
						holder_scope = { NOT = { culture = ROOT } }
					}
					AND = {
						has_holder = yes
						holder_scope = {
							top_liege = { NOT = { any_realm_province = { province_id = PREVPREVPREVPREV } } }
						}
					}
				}
			}
		}
		NOR = {
			is_inaccessible_trigger = yes
			has_character_flag = incite_revolt_underway
		}
		is_not_busy_trigger = yes
	}
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.9
			intrigue = 12
		}
		modifier = {
			factor = 0.9
			intrigue = 14
		}
		modifier = {
			factor = 0.9
			intrigue = 16
		}
		modifier = {
			factor = 0.9
			intrigue = 18
		}
		modifier = {
			factor = 0.9
			intrigue = 20
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 8 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 6 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 4 }
		}
		modifier = {
			factor = 1.2
			NOT = { intrigue = 2 }
		}
		modifier = {
			factor = 0.8
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.8
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.8
			num_of_plot_backers = 12
		}
		modifier = {
			factor = 0.9
			plot_power = 1.25
		}
		modifier = {
			factor = 0.9
			plot_power = 1.5
		}
		modifier = {
			factor = 0.9
			plot_power = 1.75
		}
		modifier = {
			factor = 0.9
			plot_power = 2.0
		}
		modifier = {
			factor = 0.9
			plot_power = 2.25
		}
		modifier = {
			factor = 0.9
			plot_power = 2.5
		}
		modifier = {
			factor = 0.9
			plot_power = 2.75
		}
		modifier = {
			factor = 0.9
			plot_power = 3.0
		}
	}
	
	option = {
		name = EVTOPTA_Plus_280 #Make the attempt
		ai_chance = { factor = 100 }
		set_character_flag = incite_revolt_underway
		random_list = {
			50 = {
				modifier = {
					factor = 1.5
					plot_target_char = {
						NOT = { culture_group = ROOT }
					}
				}
				modifier = {
					factor = 1.5
					trait = genius
				}
				modifier = {
					factor = 1.25
					OR = {
						trait = quick
						trait = shrewd
					}
				}
				modifier = {
					factor = 0.75
					OR = {
						trait = slow
						trait = dull
					}
				}
				modifier = {
					factor = 1.1
					plot_power = 1.25
				}
				modifier = {
					factor = 1.1
					plot_power = 1.5
				}
				modifier = {
					factor = 1.1
					plot_power = 1.75
				}
				modifier = {
					factor = 1.1
					plot_power = 2.0
				}
				modifier = {
					factor = 1.1
					plot_power = 2.25
				}
				modifier = {
					factor = 1.1
					plot_power = 2.5
				}
				modifier = {
					factor = 1.1
					plot_power = 2.75
				}
				modifier = {
					factor = 1.1
					plot_power = 3.0
				}
				custom_tooltip = { text = INCITE_REVOLT_SUCCESS }
				hidden_tooltip = {
					character_event = { id = Plus.281 days = 7 }
				}
			}
			30 = {
				modifier = {
					factor = 0.9
					intrigue = 12
				}
				modifier = {
					factor = 0.9
					intrigue = 14
				}
				modifier = {
					factor = 0.9
					intrigue = 16
				}
				modifier = {
					factor = 0.9
					intrigue = 18
				}
				modifier = {
					factor = 0.9
					intrigue = 20
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 8 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 6 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 4 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 2 }
				}
				custom_tooltip = { text = INCITE_REVOLT_FAILURE }
				hidden_tooltip = {
					character_event = { id = Plus.282 days = 7 }
				}
			}
			20 = {
				modifier = {
					factor = 0
					plot_target_char = {
						NOT = { any_courtier = { has_job_title = job_spymaster } }
					}
				}
				modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { NOT = { intrigue = 4 } } }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { NOT = { intrigue = 6 } } }
				}
				modifier = {
					factor = 0.8
					plot_target_char = { job_spymaster = { NOT = { intrigue = 8 } } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 10 } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 12 } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 14 } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 16 } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 18 } }
				}
				modifier = {
					factor = 1.2
					plot_target_char = { job_spymaster = { intrigue = 20 } }
				}
				modifier = {
					factor = 0.9
					intrigue = 12
				}
				modifier = {
					factor = 0.9
					intrigue = 14
				}
				modifier = {
					factor = 0.9
					intrigue = 16
				}
				modifier = {
					factor = 0.9
					intrigue = 18
				}
				modifier = {
					factor = 0.9
					intrigue = 20
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 8 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 6 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 4 }
				}
				modifier = {
					factor = 1.2
					NOT = { intrigue = 2 }
				}
				custom_tooltip = { text = INCITE_REVOLT_DISCOVERED }
				hidden_tooltip = {
					character_event = { id = Plus.283 days = 7 }
				}
			}
		}
	}
	option = {
		name = EVTOPTB_Plus_280 #No, too risky
		ai_chance = { factor = 0 }
		set_character_flag = abort_plot
		tooltip = { cancel_plot = plot_stir_rebellion }
	}
}

# 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 = {
			add_province_modifier = {
				name = cultural_unrest
				duration = 365
			}
		}
		any_realm_province = {
			limit = {
				owner = { character = ROOT }
				is_capital = no
				culture = ROOT
				religion = ROOT
				NOT = { has_province_modifier = cultural_unrest }
			}
			random = {
				chance = 25
				add_province_modifier = {
					name = cultural_unrest
					duration = 365
				}
			}
		}
	}
}

# 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 }
			set_character_flag = abort_plot
		}
	}
}

# 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
		set_character_flag = abort_plot
		prestige = -100
		tooltip = { cancel_plot = plot_stir_rebellion }
		any_liege = {
			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 = { who = FROM modifier = devious_plotter 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
	
	is_triggered_only = yes
	
	immediate = {
		FROM = { reveal_plot = ROOT }
	}
	
	option = {
		name = EVTOPTA_Plus_285 #Then he should do something about it!
		trigger = {
			FROM = { is_liege_or_above = FROMFROM }
		}
		opinion = { who = FROM modifier = devious_plotter months = 120 }
		opinion = { who = FROMFROM modifier = opinion_thankful months = 12 }
		hidden_tooltip = {
			FROMFROM = { letter_event = { id = Plus.286 } }
		}
	}
	option = {
		name = EVTOPTB_Plus_285 #This is good to know
		trigger = {
			NOT = { FROM = { is_liege_or_above = FROMFROM } }
		}
		opinion = { who = FROM modifier = devious_plotter months = 120 }
		opinion = { who = FROMFROM modifier = opinion_uncovered_plot months = 60 }
		hidden_tooltip = {
			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

	option = {
		name = OK
		tooltip = {
			reverse_opinion = { who = FROM modifier = opinion_thankful months = 12 }
		}
	}
}

# Informant thanked for the assistance
letter_event = {
	id = Plus.287
	desc = EVTDESC_Plus_287
	border = GFX_event_letter_frame_intrigue
	
	is_triggered_only = yes

	option = {
		name = OK
		tooltip = {
			reverse_opinion = { who = FROM modifier = opinion_uncovered_plot months = 60 }
		}
	}
}

# 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 = {
			event_target:revealed_target = { character = PREV }
		}
	}
	
	immediate = { reveal_plot = yes }
	
	option = {
		name = CURSES
		opinion = { who = FROMFROM modifier = revealed_plot months = 60 }
		if = {
			limit = {
				ai = yes
				NOR = {
					trait = lunatic
					trait = possessed
					independent = yes
					has_plot = plot_take_revenge
				}
			}
			set_character_flag = abort_plot
		}
	}
}

### 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
	capable_only = yes
	prisoner = no
	ai = yes
	war = no
	
	trigger = {
		has_plot = plot_become_republic
		is_republic = yes
		is_merchant_republic = no
		is_patrician = no
		tier = BARON
		primary_title = {
			dejure_liege_title = {
				is_contested = no
				is_occupied = no
				holder_scope = {
					ai = yes
					is_plot_target_of = ROOT
					is_liege_of = ROOT
					OR = {
						ROOT = { relative_power_to_liege = 1.0 }
						has_regent = yes
						trait = imbecile
						trait = lunatic
						trait = excommunicated
						in_command_trigger = yes
						health_traits = 2
					}
				}
			}
		}
		NOR = {
			is_inaccessible_trigger = yes
			has_character_flag = county_usurp_underway
		}
		is_not_busy_trigger = yes
	}
	
	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.8
			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 1 } }
				}
			}
		}
		modifier = {
			factor = 0.8
			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 3 } }
				}
			}
		}
		modifier = {
			factor = 0.65
			liege = {
				job_spymaster = {
					ROOT = { attribute_diff = { character = PREV attribute = intrigue value = 5 } }
				}
			}
		}
		modifier = {
			factor = 1.2
			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value = 1 }
				}
			}
		}
		modifier = {
			factor = 1.2
			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value = 3 }
				}
			}
		}
		modifier = {
			factor = 1.5
			liege = {
				job_spymaster = {
					attribute_diff = { character = ROOT attribute = intrigue value = 5 }
				}
			}
		}
		modifier = {
			factor = 0.5
			liege = { has_regent = yes }
		}
		modifier = {
			factor = 0.5
			relative_power_to_liege = 2.0
		}
		modifier = {
			factor = 0.1
			OR = {
				liege = { regent = { character = ROOT } }
				liege = { job_spymaster = { character = ROOT } }
			}
		}
		modifier = {
			factor = 1.5
			NOT = { plot_power = 1.0 }
		}
		modifier = {
			factor = 2.0
			NOT = { plot_power = 0.75 }
		}
		modifier = {
			factor = 2.0
			NOT = { plot_power = 0.50 }
		}
		modifier = {
			factor = 0.8
			plot_power = 1.0
		}
		modifier = {
			factor = 0.8
			plot_power = 1.25
		}
		modifier = {
			factor = 0.8
			plot_power = 1.5
		}
		modifier = {
			factor = 0.8
			plot_power = 1.75
		}
		modifier = {
			factor = 0.8
			plot_power = 2.0
		}
		modifier = {
			factor = 0.8
			plot_power = 2.25
		}
		modifier = {
			factor = 0.8
			plot_power = 2.5
		}
		modifier = {
			factor = 0.8
			plot_power = 2.75
		}
		modifier = {
			factor = 0.8
			plot_power = 3.0
		}
	}
	
	immediate = {
		random_list = {
			50 = {
				modifier = {
					factor = 0.25
					OR = {
						liege = { regent = { character = ROOT } }
						liege = { job_spymaster = { character = ROOT } }
					}
				}
				modifier = {
					factor = 0.5
					liege = { has_regent = yes }
				}
				modifier = {
					factor = 0.5
					relative_power_to_liege = 1.0
				}
				modifier = {
					factor = 0.5
					relative_power_to_liege = 2.0
				}
				modifier = {
					factor = 0.8
					liege = {
						job_spymaster = { attribute_diff = { character = ROOT attribute = intrigue value = 1 } }
					}
				}
				modifier = {
					factor = 0.8
					liege = {
						job_spymaster = { attribute_diff = { character = ROOT attribute = intrigue value = 3 } }
					}
				}
				modifier = {
					factor = 0.8
					liege = {
						job_spymaster = { attribute_diff = { character = ROOT attribute = intrigue value = 5 } }
					}
				}
				modifier = {
					factor = 0.8
					liege = {
						job_spymaster = { attribute_diff = { character = ROOT attribute = intrigue value = 7 } }
					}
				}
				modifier = {
					factor = 0.8
					liege = {
						job_spymaster = { attribute_diff = { character = ROOT attribute = intrigue value = 9 } }
					}
				}
				character_event = { id = Plus.291 } #Failure
			}
			50 = {
				modifier = {
					factor = 1.5
					trait = genius
				}
				modifier = {
					factor = 1.25
					OR = {
						trait = quick
						trait = shrewd
					}
				}
				modifier = {
					factor = 0.75
					OR = {
						trait = slow
						trait = dull
					}
				}
				modifier = {
					factor = 0.75
					NOT = { plot_power = 1.0 }
				}
				modifier = {
					factor = 0.75
					NOT = { plot_power = 0.75 }
				}
				modifier = {
					factor = 0.5
					NOT = { plot_power = 0.5 }
				}
				modifier = {
					factor = 1.1
					plot_power = 1.25
				}
				modifier = {
					factor = 1.1
					plot_power = 1.5
				}
				modifier = {
					factor = 1.1
					plot_power = 1.75
				}
				modifier = {
					factor = 1.1
					plot_power = 2.0
				}
				modifier = {
					factor = 1.1
					plot_power = 2.25
				}
				modifier = {
					factor = 1.1
					plot_power = 2.5
				}
				modifier = {
					factor = 1.1
					plot_power = 2.75
				}
				modifier = {
					factor = 1.1
					plot_power = 3.0
				}
				modifier = {
					factor = 1.5
					liege = {
						job_spymaster = { ROOT = { attribute_diff = { character = PREV 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 }
				}
				if = {
					limit = {
						liege = {
							NOT = { higher_real_tier_than = COUNT }
							independent = no
						}
					}
					liege = { liege = { save_event_target_as = new_liege } }
				}
				if = {
					limit = {
						liege = {
							NOT = { higher_real_tier_than = COUNT }
							independent = yes
						}
					}
					ROOT = { save_event_target_as = new_liege }
				}
				character_event = { id = Plus.292 } #Success
			}
		}
	}
}

# Attempt to usurp the county fails
character_event = {
	id = Plus.291
	
	hide_window = yes
	is_triggered_only = yes
	
	immediate = {
		set_character_flag = abort_plot
		prestige = -100
		liege = {
			opinion = { who = ROOT modifier = devious_plotter years = 20 }
		}
	}
}

# Attempt to usurp the county succeeds
character_event = {
	id = Plus.292
	
	hide_window = yes
	is_triggered_only = 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_tier_than = COUNT } }
					event_target:former_liege = {
						PREV = {
							remove_claim = PREV
							add_weak_pressed_claim = PREV
						}
					}
				}
			}
		}
		event_target:new_liege = {
			ROOT = {
				set_defacto_liege = PREV
				pf_liege_change_effect = yes
			}
		}
		#first attempt to marry the ruler
		if = {
			limit = {
				event_target:former_liege = {
					is_married = no
					is_betrothed = no
				}
			}
			if = {
				limit = {
					event_target:former_liege = {
						is_female = yes
						is_adult = yes
						religion = ROOT
						NOT = { age = 40 }
					}
					is_female = no
					is_married = no
					is_betrothed = no
				}
				event_target:former_liege = { add_spouse = ROOT }
				break = yes
			}
			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
				}
				event_target:former_liege = { add_betrothal = ROOT }
				break = yes
			}
			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
						NOT = { age = 40 }
					}
					if = {
						limit = {
							ROOT = {
								OR = {
									is_feminist_trigger = yes
									NOT = { has_law = agnatic_succession }
								}
							}
						}
						add_spouse_matrilineal = event_target:former_liege
						break = yes
					}
					add_spouse = event_target:former_liege
					break = yes
				}
			}
			if = {
				limit = {
					event_target:former_liege = {
						is_female = yes
						is_adult = no
						NOT = { age = 14 }
					}
				}
				random_child = {
					limit = {
						religion = event_target:former_liege
						dynasty = ROOT
						is_female = no
						is_married = no
						is_betrothed = no
						NOT = { age_diff = { who = event_target:former_liege years = 10 } }
					}
					add_betrothal = event_target:former_liege
					break = yes
				}
			}
		}
		#then attempt to marry a child of the ruler
		if = {
			limit = {
				event_target:former_liege = {
					any_child = {
						is_married = no
						is_betrothed = no
						religion = ROOT
					}
				}
			}
			if = {
				limit = {
					is_female = no
					is_married = no
					is_betrothed = no
				}
				event_target:former_liege = {
					random_child = {
						limit = {
							religion = ROOT
							is_female = yes
							is_adult = yes
							is_married = no
							is_betrothed = no
							NOT = { age = 40 }
						}
						add_spouse = ROOT
						break = yes
					}
				}
				event_target:former_liege = {
					random_child = {
						limit = {
							religion = ROOT
							is_female = yes
							is_adult = no
							is_betrothed = no
							age = 14
						}
						add_betrothal = ROOT
						break = yes
					}
				}
			}
			event_target:former_liege = {
				random_child = {
					limit = {
						religion = ROOT
						is_female = yes
						is_adult = yes
						is_married = no
						is_betrothed = no
						NOT = { age = 40 }
					}
					ROOT = {
						random_child = {
							limit = {
								religion = ROOT
								is_female = no
								is_adult = yes
								is_married = no
								is_betrothed = no
							}
							add_spouse = PREVPREV
							break = yes
						}
					}
				}
			}
			event_target:former_liege = {
				random_child = {
					limit = {
						religion = ROOT
						is_female = yes
						is_adult = no
						is_betrothed = no
					}
					ROOT = {
						random_child = {
							limit = {
								religion = PREVPREV
								is_female = no
								is_married = no
								is_betrothed = no
								NOT = { age_diff = { who = PREVPREV years = 10 } }
							}
							add_betrothal = PREVPREV
							break = yes
						}
					}
				}
			}
		}
		#then attempt to marry a relative
		event_target:former_liege = {
			random_dynasty_member = {
				limit = {
					religion = ROOT
					is_ruler = no
					is_female = yes
					is_adult = yes
					is_married = no
					is_betrothed = no
					NOR = {
						age = 40
						any_liege = { ai = no }
					}
				}
				if = {
					limit = {
						ROOT = {
							is_female = no
							is_married = no
							is_betrothed = no
						}
					}
					add_spouse = ROOT
					break = yes
				}
				ROOT = {
					random_child = {
						limit = {
							religion = PREVPREV
							is_female = no
							is_married = no
							is_betrothed = no
							is_adult = yes
						}
						add_spouse = PREVPREV
						break = yes
					}
				}
			}
		}
		#then imprison the ruler if possible
		if = {
			limit = { event_target:former_liege = { at_location = ROOT } }
			event_target:former_liege = { imprison = ROOT }
		}
	}
}

character_event = {
	id = Plus.293
	desc = "EVTDESC_Plus_293"
	picture = GFX_evt_spymaster
	
	is_part_of_plot = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		has_plot = plot_elope
		NOT = { has_character_flag = plot_in_action }
	}

	mean_time_to_happen = {
		months = 300
		modifier = {
			factor = 0.75
			has_character_modifier = plot_assisted_spying
		}
		modifier = {
			factor = 0.60
			has_character_modifier = plot_assisted_spying2
		}
		modifier = {
			factor = 0.45
			has_character_modifier = plot_assisted_spying3
		}
		modifier = {
			factor = 0.30
			has_character_modifier = plot_assisted_spying4
		}
		modifier = {
			factor = 0.15
			has_character_modifier = plot_assisted_spying5
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			has_character_flag = has_personal_spy_network
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 1
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 2
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 3
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 4
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 5
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 6
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 7
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 8
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 9
		}
		modifier = {
			factor = 0.95
			num_of_plot_backers = 10
		}
		modifier = {
			factor = 0.66
			plot_power = 0.5
		}
		modifier = {
			factor = 0.66
			plot_power = 1.0
		}
		modifier = {
			factor = 0.66
			plot_power = 1.5
		}
		modifier = {
			factor = 0.66
			plot_power = 2.0
		}
		modifier = {
			factor = 0.66
			plot_power = 3.0
		}
		modifier = {
			factor = 0.66
			plot_power = 4.0
		}
		modifier = {
			factor = 0.66
			plot_power = 6.0
		}
		modifier = {
			factor = 0.66
			plot_power = 8.0
		}
		modifier = {
			factor = 0.66
			plot_power = 10.0
		}
	}

	option = {
		name = "EVTOPTA_Plus_293" #We will elope!
		ai_chance = {
			factor = 10
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
		}
		trigger = {
			OR = {
				NOT = {
					plot_power = 0.5 
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
				AND = {
					NOT = { 
						plot_power = 0.7
					}
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		plot_target_char = {
			random_list = {
				20 = { character_event = { id = Plus.294 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				20 = { character_event = { id = Plus.297 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				60 = { character_event = { id = Plus.2900 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_293" #We will elope!
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
			modifier = {
				factor = 100
				trait = lunatic
			}
			modifier = {
				factor = 100
				trait = possessed
			}
		}
		trigger = {
			OR = {
				AND = {
					plot_power = 0.5
					NOT = {
						plot_power = 1.0 
						plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
					}
				}
				AND = {
					plot_power = 0.7
					NOT = { 
						plot_power = 1.2
					}
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		plot_target_char = {
			random_list = {
				30 = { character_event = { id = Plus.294 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				30 = { character_event = { id = Plus.297 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				40 = { character_event = { id = Plus.2900 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_293" #We will elope!
		ai_chance = {
			factor = 100
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
		}
		trigger = {
			OR = {
				AND = {
					plot_power = 1
					NOT = {
						plot_power = 1.5
						plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
					}
				}
				AND = {
					plot_power = 1.2
					NOT = { 
						plot_power = 1.7
					}
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		plot_target_char = {
			random_list = {
				50 = { character_event = { id = Plus.294 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				25 = { character_event = { id = Plus.297 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				25 = { character_event = { id = Plus.2900 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_293" #We will elope!
		ai_chance = {
			factor = 400
			modifier = {
				factor = 2
				trait = brave
			}
			modifier = {
				factor = 0.75
				trait = craven
			}
		}
		trigger = {
			OR = {
				AND = {
					plot_power = 1.5
					NOT = {
						plot_power = 2 
						plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
					}
				}
				AND = {
					plot_power = 1.7
					NOT = { 
						plot_power = 2.2
					}
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		plot_target_char = {
			random_list = {
				60 = { character_event = { id = Plus.294 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				25 = { character_event = { id = Plus.297 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				15 = { character_event = { id = Plus.2900 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	option = {
		name = "EVTOPTA_Plus_293" #We will elope!
		ai_chance = {
			factor = 1000
		}
		trigger = {
			OR = {
				AND = {
					plot_power = 2
					NOT = {
						plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
					}
				}
				AND = {
					plot_power = 2.2
					plot_target_char = { any_heir_title = { higher_tier_than = BARON } }
				}
			}
		}
		if = {
			limit = { trait = honest }
			remove_trait = honest
			
		}
		plot_target_char = {
			random_list = {
				80 = { character_event = { id = Plus.294 tooltip = "CUSTOMTOOLTIP33" days = 3 } } #succeeds
				15 = { character_event = { id = Plus.297 tooltip = "CUSTOMTOOLTIP34" days = 3 } } #fails, not discovered
				5 = { character_event = { id = Plus.2900 tooltip = "CUSTOMTOOLTIP35" days = 3 } } #fails, discovered
			}
		}
		hidden_tooltip = { activate_plot = yes }
		set_character_flag = plot_in_action
	}
	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
	
	hide_from = yes
	is_triggered_only = yes
	
	immediate = {
		hidden_tooltip = {
			FROM = { set_character_flag = plot_success }
		}
	}
	
	option = {
		name = "EVTOPTA_Plus_294" #Finally we are one
		FROM = {
			add_spouse = ROOT
		}
		hidden_tooltip = {
			#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

	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!
		FROMFROM = { # The elope plotter
			reverse_opinion = {
				modifier = opinion_eloped_plotter
				who = ROOT
				years = 20
			}
		}
		FROM = { # The elope target
			reverse_opinion = {
				modifier = opinion_eloped_target
				who = ROOT
				years = 10
			}
		}
	}
}

# Failure (not discovered) - notify target
character_event = {
	id = Plus.297
	desc = "EVTDESC_Plus_297"
	picture = "GFX_evt_spymaster"
	
	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "EVTOPTA_Plus_297" # It's almost like they knew
		hidden_tooltip = {
			#notify plotter
			FROM = { character_event = { id = Plus.298 } }
			#notify liege
			if = {
				limit = {
					liege = {
						NOT = { character = ROOT }
						NOT = { character = FROM }
					}
				}
				liege = { 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

	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...
		set_character_flag = abort_plot
	}
}

# 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 = { who = FROMFROM modifier = devious_plotter years = 5 }
		FROMFROM = { # The elope plotter
			reverse_opinion = {
				modifier = opinion_eloped_plotter
				who = ROOT
				years = 20
			}
		}
		FROM = { # The elope target
			reverse_opinion = {
				modifier = opinion_eloped_target
				who = ROOT
				years = 10
			}
		}
	}
}
