###########################################
#                                         #
# New Plot Events - characters in hiding  #
#                                         #
# ID CM.6000-CM.6999                      #
#                                         #
###########################################

# Written by Tobias Bodlund

namespace = CM

###########################################
# Hiding notifications                    #
###########################################


# Notify that character has gone into hiding
character_event = {
	id = CM.6000
	desc = EVTDESC_CM_6000
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6000
		trigger = {
			NOT = { FROM = { is_plot_target_of = ROOT } }
			NOT = {	FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { is_rival = FROM }
			OR = {
				any_spouse = { character = FROM }
				father = { character = FROM }
				mother = { character = FROM }
			}
		}
		tooltip = { FROM = { add_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6000
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }
				is_rival = FROM
			}
		}
		tooltip = { FROM = { add_trait = in_hiding } }
	}
}

# Notify that character has come out of hiding
character_event = {
	id = CM.6001
	desc = EVTDESC_CM_6001
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6001
		trigger = {
			NOT = { FROM = { is_plot_target_of = ROOT } }
			NOT = {	FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { is_rival = FROM }
			OR = {
				any_spouse = { character = FROM }
				father = { character = FROM }
				mother = { character = FROM }
			}
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6001
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }
				is_rival = FROM
			}
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
}

# Notify that character has sent spouse into hiding
character_event = {
	id = CM.6002
	desc = EVTDESC_CM_6002
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6002
		trigger = {
			NOT = { FROM = { is_plot_target_of = ROOT } }
			NOT = {	FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { FROM = { is_rival = ROOT } }
			FROM = { any_child  = { character = ROOT } }
		}
		tooltip = { FROM = { add_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6002
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT } } }
				FROM = { spouse = { is_rival = ROOT } }
			}
		}
		tooltip = { FROM = { add_trait = in_hiding } }
	}
}

# Notify that character has taken spouse out of hiding
character_event = {
	id = CM.6003
	desc = EVTDESC_CM_6003
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6003
		trigger = {
			NOT = { FROM = { is_plot_target_of = ROOT } }
			NOT = {	FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { FROM = { is_rival = ROOT } }
			FROM = { any_child  = { character = ROOT } }
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6003
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT } } }
				FROM = { is_rival = ROOT }
			}
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
}

# Notify that character has sent child into hiding
character_event = {
	id = CM.6004
	desc = EVTDESC_CM_6004
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6004
		trigger = {
			NOT = { FROMFROM = { is_plot_target_of = ROOT } }
			NOT = {	FROMFROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { FROMFROM = { is_rival = ROOT } }
			FROMFROM = { any_child  = { character = ROOT } }
		}
		tooltip = { FROMFROM = { add_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6004
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT } } }
				FROM = { spouse = { is_rival = ROOT } }
			}
		}
		tooltip = { FROM = { add_trait = in_hiding } }
	}
}

# Notify that character has taken child out of hiding
character_event = {
	id = CM.6005
	desc = EVTDESC_CM_6005
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	is_triggered_only = yes
	
	ai = no
	
	option = {
		name = EVTOPTA_CM_6005
		trigger = {
			NOT = { FROM = { is_plot_target_of = ROOT } }
			NOT = {	FROM = { any_known_plotter = { any_plot_backer = { character = ROOT }	} }	}
			NOT = { FROM = { is_rival = ROOT } }
			FROM = { any_child  = { character = ROOT } }
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
	option = {
		name = EVTOPTB_CM_6005
		trigger = {
			OR = {
				FROM = { is_plot_target_of = ROOT }
				FROM = { any_known_plotter = { any_plot_backer = { character = ROOT } } }
				FROM = { is_rival = ROOT }
			}
		}
		tooltip = { FROM = { remove_trait = in_hiding } }
	}
}


# To trigger notification events when a player comes out of hiding through event, for example when accepting a feast or tournament invitation
character_event = {
	id = CM.6400
	
	hide_window = yes
	
	is_triggered_only = yes
	
	immediate = {                    # Notify player and close family and plotters
			any_plotter = {
				target = ROOT
				limit = {
					OR = {
						has_plot = plot_kill_character
						has_plot = plot_kill_spouse
					}
				}
				character_event = { id = CM.6001 }
			}
		any_spouse = {
			limit = {
				ROOT = {
					NOT = { is_plot_target_of = PREV }
				}
			}
			character_event = { id = CM.6001 }
		}
		any_child = {
			limit = {
				ROOT = {
					NOT = { is_plot_target_of = PREV }
				}
			}
			character_event = { id = CM.6001 }
		}
		any_lover = {
			limit = {
				ROOT = {
					NOT = { is_plot_target_of = PREV }
				}
				NOT = { spouse = { character = ROOT } }
			}
			character_event = { id = CM.6001 }
		}
		any_sibling = {
			limit = {
				ROOT = {
					NOT = { is_plot_target_of = PREV }
				}
			}
			character_event = { id = CM.6001 }
		}
		any_rival = {
			limit = {
				ROOT = {
					NOT = { is_plot_target_of = PREV }
				}
			}
			character_event = { id = CM.6001 }
		}
	}
}


###########################################
# Negative effects of hiding              #
###########################################

# Goes insane
character_event = {
	id = CM.6100
	desc = EVTDESC_CM_6100
	picture = GFX_evt_lunatic
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = lunatic }
		OR = {
			trait = stressed
			trait = depressed
			trait = paranoid
		}
		age = 10
	}
	
	option = {
		name = EVTOPTA_CM_6100
		add_trait = lunatic
		hidden_tooltip = {
			spouse = {
				character_event = { id = CM.6101 }
			}
			any_child = {
				character_event = { id = CM.6101 }
			}
			father = {
				character_event = { id = CM.6101 }
			}
			mother = {
				character_event = { id = CM.6101 }
			}
			any_lover = {
				limit = { NOT = { spouse = { character = ROOT } } }
				character_event = { id = CM.6101 }
			}
		}
	}
}

# Lunatic - notify close family
character_event = {
	id = CM.6101
	desc = EVTDESC_CM_6101
	picture = GFX_evt_lunatic
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6101
		trigger = {
			NOT = { trait = lunatic }
		}
	}
	option = {
		name = EVTOPTB_CM_6101
		trigger = {
			trait = lunatic
		}
	}
}

# Goes paranoid
character_event = {
	id = CM.6102
	desc = EVTDESC_CM_6102
	picture = GFX_evt_shadowy_cabal
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = paranoid }
		age = 10
	}
	
	option = {
		name = EVTOPTA_CM_6102
		add_trait = paranoid
	}
}

# Goes celibate
character_event = {
	id = CM.6104
	desc = EVTDESC_CM_6104
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = celibate }
		age = 16
	}
	
	option = {
		name = EVTOPTA_CM_6104
		add_trait = celibate
		any_spouse = {
			limit = {
				NOT = { trait = celibate }
			}
			opinion = {
				who = ROOT
				modifier = love_scorned
				years = 2
			}
			hidden_tooltip = { character_event = { id = CM.6105 } }
		}
		any_spouse = {
			limit = {
				trait = celibate
			}
			opinion = {
				who = ROOT
				modifier = opinion_relieved
				years = 2
			}
			hidden_tooltip = { character_event = { id = CM.6105 } }
		}
		any_lover = {
			limit = {
				NOT = { spouse = { character = ROOT } }
				NOT = { trait = celibate }
			}
			opinion = {
				who = ROOT
				modifier = love_scorned
				years = 2
			}
			hidden_tooltip = { character_event = { id = CM.6105 } }
		}
		any_lover = {
			limit = {
				NOT = { spouse = { character = ROOT } }
				trait = celibate
			}
			opinion = {
				who = ROOT
				modifier = opinion_relieved
				years = 2
			}
			hidden_tooltip = { character_event = { id = CM.6105 } }
		}
	}
}

# Celibate - notify wife or lover
character_event = {
	id = CM.6105
	desc = EVTDESC_CM_6105
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6105  # Argh!
		trigger = {
			NOT = { trait = celibate }
		}
		tooltip = {
			FROM = { add_trait = celibate }
			opinion = {
				who = FROM
				modifier = love_scorned
				years = 2
			}
		}
	}
	option = {
		name = EVTOPTB_CM_6105  # Finally she/he leaves me alone!
		trigger = {
			trait = celibate
		}
		tooltip = {
			FROM = { add_trait = celibate }
			opinion = {
				who = FROM
				modifier = opinion_relieved
				years = 2
			}
		}
	}
}

# Becomes zealous
character_event = {
	id = CM.6106
	desc = EVTDESC_CM_6106
	picture = GFX_evt_bishop
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { religion = buddhist }
		NOT = { trait = zealous }
		NOT = { trait = brave }
		OR = {
			NOT = { trait = cynical }
			trait = stressed
			trait = depressed
		}
		age = 10
	}
	
	option = {
		name = EVTOPTA_CM_6106
		add_trait = zealous
	}
}

# Becomes depressed
character_event = {
	id = CM.6108
	desc = EVTDESC_CM_6108
	picture = GFX_evt_bad_news
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = depressed }
		age = 10
	}
	
	option = {
		name = EVTOPTA_CM_6108
		add_trait = depressed
	}
}

# Becomes ill or pneumonic
character_event = {
	id = CM.6110
	desc = EVTDESC_CM_6110
	picture = GFX_evt_illness
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = pneumonic }
		NOR = {
			has_character_flag = disease_not_serious
			has_character_flag = developing_illness
		}
	}
	
	option = {
		name = EVTOPTA_CM_6110
		if = {
			limit = { trait = ill }
			add_trait = pneumonic
			hidden_tooltip = { remove_trait = ill }
		}
		if = {
			limit = { is_ill = no }
			if = {
				limit = {
					NOT = {
						has_dlc = "Reapers"
					}
				}
				add_trait = ill
			}
			if = {
				limit = {
					has_dlc = "Reapers"
				}
				add_symptom_effect = yes
			}
		}
	}
}

# Eats for consolation and becomes a glutton
character_event = {
	id = CM.6112
	desc = EVTDESC_CM_6112
	picture = GFX_evt_pope_feast
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = gluttonous }
		age = 6
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.2
			trait = temperate
		}
	}
	
	option = {
		name = EVTOPTA_CM_6112
		add_trait = gluttonous
	}
}

# Becomes lethargic
character_event = {
	id = CM.6114
	desc = EVTDESC_CM_6114
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = slothful }
		age = 10
	}
	
	option = {
		name = EVTOPTA_CM_6114
		add_trait = slothful
	}
}

# Becomes shy
character_event = {
	id = CM.6116
	desc = EVTDESC_CM_6116
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = shy }
		age = 8
	}
	
	option = {
		name = EVTOPTA_CM_6116
		add_trait = shy
	}
}

# Becomes craven
character_event = {
	id = CM.6118
	desc = EVTDESC_CM_6118
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = craven }
		NOT = { trait = berserker }
		age = 12
	}
	
	option = {
		name = EVTOPTA_CM_6118
		add_trait = craven
	}
}

# Becomes content
character_event = {
	id = CM.6120
	desc = EVTDESC_CM_6120
	picture = GFX_evt_recovery
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { trait = content }
		age = 12
	}
	
	option = {
		name = EVTOPTA_CM_6120
		add_trait = content
	}
}

# Vows to live life to the fullest henceforth
character_event = {
	id = CM.6122
	desc = EVTDESC_CM_6122
	picture = GFX_evt_brothel
	
	lacks_dlc = "Way of Life"
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { lifestyle_traits = 1 }
		age = 14
	}
	
	option = {
		name = EVTOPTA_CM_6122
		add_trait = hedonist
	}
}

# Spends time poring over books
character_event = {
	id = CM.6124
	desc = EVTDESC_CM_6124
	picture = GFX_evt_book_carolingian_script
	
	lacks_dlc = "Way of Life"
	
	min_age = 10
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { lifestyle_traits = 1 }
	}
	
	option = {
		name = EVTOPTA_CM_6124
		add_trait = scholar
	}
}

# Spends time contemplating mystical and weird things
character_event = {
	id = CM.6126
	desc = EVTDESC_CM_6126
	picture = GFX_evt_library
	
	min_age = 13
	lacks_dlc = "Way of Life"
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { lifestyle_traits = 1 }
	}
	
	option = {
		name = EVTOPTA_CM_6126
		add_trait = mystic
	}
}

# Takes up writing poetry
character_event = {
	id = CM.6128
	desc = EVTDESC_CM_6128
	picture = GFX_evt_monk
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		NOT = { lifestyle_traits = 1 }
		age = 13
	}
	
	option = {
		name = EVTOPTA_CM_6128
		add_trait = poet
	}
}

# Becomes possessed
character_event = {
	id = CM.6130
	desc = EVTDESC_CM_6130
	picture = GFX_evt_lunatic
	
	is_triggered_only = yes

	trigger = {
		trait = in_hiding
		OR = {
			trait = zealous
			trait = lunatic
		}
		NOT = { trait = possessed }
		age = 13
	}
	
	option = {
		name = EVTOPTA_CM_6130
		add_trait = possessed
	}
}

# Starts drinking...
character_event = {
	id = CM.6132
	desc = EVTDESC_CM_6132
	picture = GFX_evt_drunk
	
	is_triggered_only = yes

	
	
	trigger = {
		trait = in_hiding
		NOT = { trait = drunkard }
		age = 16
	}
	
	weight_multiplier = {
		days = 1
		modifier = {
			factor = 0.2
			trait = temperate
		}
		modifier = {
			factor = 3
			trait = gluttonous
		}
	}

	option = {
		name = EVTOPTA_CM_6132
		add_trait = drunkard
	}
}

#################################################################
# Normal murder attempt broken off when target goes into hiding #
#################################################################

character_event = {
	id = CM.6180
	desc = EVTDESC_CM_6180
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_CM_6180
		clr_character_flag = murder_in_motion
		custom_tooltip = {
			text = cancel_murder_attempt
		}
	}
}

#############################################################
# Clear plotters' murder flags if you die of other causes   #
#############################################################

# On action: on_death
character_event = {
	id = CM.6185

	hide_window = yes
	
	is_triggered_only = yes
	
	trigger = {
		any_plotter = {
			OR = {
				has_plot = plot_kill_character
				has_plot = plot_kill_spouse
				has_plot = plot_take_revenge
			}
		}
	}
	
	immediate = {
		any_plotter = {
			limit = {
				OR = {
					has_plot = plot_kill_character
					has_plot = plot_kill_spouse
					has_plot = plot_take_revenge
				}
			}
			clr_character_flag = hiding_murder_in_motion
			clr_character_flag = murder_in_motion
		}
	}
}



##########################
# Suspecting murder plot #
##########################

# Gets whiff of murder plot against self
character_event = {
	id = CM.6200
	desc = EVTDESC_CM_6200
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		NOT = { has_character_modifier = suspected_murder_plot }
		OR = {
			trait = paranoid
			any_unknown_plotter = {
				num_of_plot_backers = 1
				OR = {
					has_plot = plot_kill_character
					has_plot = plot_kill_spouse
					has_plot = plot_take_revenge
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {   # If no real plot is afoot, the paranoia doesn't set in too often
			factor = 10
			trait = paranoid
			NOT = {
				any_unknown_plotter = {
					OR = {
						has_plot = plot_kill_character
						has_plot = plot_kill_spouse
						has_plot = plot_take_revenge
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_plotter = {
				target = ROOT
				OR = {
					NOT = { intrigue = 3 }
					any_plot_backer = {
						NOT = { intrigue = 3 }
					}
				}
			}
		}
		modifier = {
			factor = 0.5
			any_plotter = {
				target = ROOT
				OR = {
					trait = imbecile
					any_plot_backer = {
						trait = imbecile
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_plotter = {
				target = ROOT
				OR = {
					OR = {
						trait = slow
						trait = dull
					}
					any_plot_backer = {
						OR = {
							trait = slow
							trait = dull
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_plotter = {
				target = ROOT
				OR = {
					trait = lunatic
					any_plot_backer = {
						trait = lunatic
					}
				}
			}
		}
		modifier = {
			factor = 0.95
			any_plotter = { 
				target = ROOT
				num_of_plot_backers = 2 
			}
		}
		modifier = {
			factor = 0.95
			any_plotter = { 
				target = ROOT
				num_of_plot_backers = 4 
			}
		}
		modifier = {
			factor = 0.85
			any_plotter = { 
				target = ROOT
				num_of_plot_backers = 6
			}
		}
		modifier = {
			factor = 0.85
			any_plotter = { 
				target = ROOT
				num_of_plot_backers = 8
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6200
		add_character_modifier = {
			name = suspected_murder_plot
			months = 48
			hidden = yes
		}
	}
}

# Gets whiff of murder plot against child
character_event = {
	id = CM.6201

	hide_window = yes
	
	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		any_child = {
			is_alive = yes
			NOT = { has_character_modifier = suspected_murder_plot }
			OR = {
				ROOT = { trait = paranoid }
				any_unknown_plotter = {
					num_of_plot_backers = 1
					OR = {
						has_plot = plot_kill_character
						has_plot = plot_kill_spouse
						has_plot = plot_take_revenge
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {   # If no real plot is afoot, the paranoia doesn't set in too often
			factor = 10
			trait = paranoid
			NOT = {
				any_child = {
					any_unknown_plotter = {
						OR = {
							has_plot = plot_kill_character
							has_plot = plot_kill_spouse
							has_plot = plot_take_revenge
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_child = {
				any_plotter = {
					OR = {
						NOT = { intrigue = 3 }
						any_plot_backer = {
							NOT = { intrigue = 3 }
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.5
			any_child = {
				any_plotter = {
					OR = {
						trait = imbecile
						any_plot_backer = {
							trait = imbecile
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_child = {
				any_plotter = {
					OR = {
						OR = {
							trait = slow
							trait = dull
						}
						any_plot_backer = {
							OR = {
								trait = slow
								trait = dull
							}
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_child = {
				any_plotter = {
					OR = {
						trait = lunatic
						any_plot_backer = {
							trait = lunatic
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.95
			any_child = {
				any_plotter = { num_of_plot_backers = 2 }
			}
		}
		modifier = {
			factor = 0.95
			any_child = {
				any_plotter = { num_of_plot_backers = 4 }
			}
		}
		modifier = {
			factor = 0.85
			any_child = {
				any_plotter = { num_of_plot_backers = 6 }
			}
		}
		modifier = {
			factor = 0.85
			any_child = {
				any_plotter = { num_of_plot_backers = 8 }
			}
		}
	}
	
	immediate = {
		random_child = {
			limit = {
				is_alive = yes
				NOT = { has_character_modifier = suspected_murder_plot }
				OR = {
					ROOT = { trait = paranoid }
					any_unknown_plotter = {
						num_of_plot_backers = 1
						OR = {
							has_plot = plot_kill_character
							has_plot = plot_kill_spouse
							has_plot = plot_take_revenge
						}
					}
				}
			}
			character_event = { id = CM.6205 }
		}
	}
}

# Gets whiff of murder plot against spouse
character_event = {
	id = CM.6202

	hide_window = yes
	
	only_rulers = yes
	min_age = 16
	capable_only = yes
	prisoner = no

	trigger = {
		trait = paranoid
		any_spouse = {
			NOT = { has_character_modifier = suspected_murder_plot }
			OR = {
				ROOT = { trait = paranoid }
				any_unknown_plotter = {
					num_of_plot_backers = 1
					OR = {
						has_plot = plot_kill_character
						has_plot = plot_kill_spouse
						has_plot = plot_take_revenge
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {   # If no real plot is afoot, the paranoia doesn't set in too often
			factor = 10
			trait = paranoid
			NOT = {
				any_spouse = {
					any_unknown_plotter = {
						OR = {
							has_plot = plot_kill_character
							has_plot = plot_kill_spouse
							has_plot = plot_take_revenge
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_spouse = {
				any_plotter = {
					OR = {
						NOT = { intrigue = 3 }
						any_plot_backer = {
							NOT = { intrigue = 3 }
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.5
			any_spouse = {
				any_plotter = {
					OR = {
						trait = imbecile
						any_plot_backer = {
							trait = imbecile
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_spouse = {
				any_plotter = {
					OR = {
						OR = {
							trait = slow
							trait = dull
						}
						any_plot_backer = {
							OR = {
								trait = slow
								trait = dull
							}
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.8
			any_spouse = {
				any_plotter = {
					OR = {
						trait = lunatic
						any_plot_backer = {
							trait = lunatic
						}
					}
				}
			}
		}
		modifier = {
			factor = 0.95
			any_spouse = {
				any_plotter = { num_of_plot_backers = 2 }
			}
		}
		modifier = {
			factor = 0.95
			any_spouse = {
				any_plotter = { num_of_plot_backers = 4 }
			}
		}
		modifier = {
			factor = 0.85
			any_spouse = {
				any_plotter = { num_of_plot_backers = 6 }
			}
		}
		modifier = {
			factor = 0.85
			any_spouse = {
				any_plotter = { num_of_plot_backers = 8 }
			}
		}
	}
	
	immediate = {
		random_spouse = {
			limit = {
				NOT = { has_character_modifier = suspected_murder_plot }
				OR = {
					ROOT = { trait = paranoid }
					any_unknown_plotter = {
						num_of_plot_backers = 1
						OR = {
							has_plot = plot_kill_character
							has_plot = plot_kill_spouse
							has_plot = plot_take_revenge
						}
					}
				}
			}
			character_event = { id = CM.6205 }
		}
	}
}

# Notify of rumored murder plot against child or spouse
character_event = {
	id = CM.6205

	hide_window = yes

	is_triggered_only = yes
	
	immediate = {
		FROM = { character_event = { id = CM.6210 } }
	}
}

character_event = {
	id = CM.6210
	desc = EVTDESC_CM_6210
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_CM_6210
		trigger = {
			NOT = { is_rival = FROM }
			opinion = { who = FROM value = -30 }
		}
		FROM = {
			add_character_modifier = {
				name = suspected_murder_plot
				months = 48
				hidden = yes
			}
		}
	}
	option = {
		name = EVTOPTB_CM_6210
		trigger = {
			OR = {
				is_rival = FROM
				NOT = { opinion = { who = FROM value = -30 } }
			}
		}
		FROM = {
			add_character_modifier = {
				name = suspected_murder_plot
				months = 48
				hidden = yes
			}
		}
	}
}

##############################################
# Murder attempts on character in hiding...  #
##############################################

# Assassin ninja-style
character_event = {
	id = CM.6300
	desc = EVTDESC_CM_6300
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 1000
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6300 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6301 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6302 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6300 # Go - extra investment
		trigger = {
			scaled_wealth = 1.5
		}
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6301 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6302 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6300 # Wait...
	}
}

# Ninja - notify backers of plan
character_event = {
	id = CM.6301
	desc = EVTDESC_CM_6301
	picture = GFX_evt_shadow
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6301 # Excellent.
	}
}

# Ninja - outcome (target)
character_event = {
	id = CM.6302

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6303 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6305 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6307 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6309 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6303 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6305 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6307 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6309 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Ninja - target dies, plotter unknown
narrative_event = {
	id = CM.6303
	title = EVTTITLE_CM_6303
	desc = EVTDESC_CM_6303
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6303
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6304 }
			}
		}
	}
}

# Ninja - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6304
	desc = EVTDESC_CM_6304
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6304
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Ninja - target dies, plotter revealed
narrative_event = {
	id = CM.6305
	title = EVTTITLE_CM_6303
	desc = EVTDESC_CM_6303
	picture = GFX_evt_death
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			
			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim
			
			death = {
				death_reason = death_murder
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6303
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}

			death = {
				death_reason = death_murder
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6306 }
			}
		}
	}
}

# Ninja - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6306
	desc = EVTDESC_CM_6306
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6306
	}
}

# Ninja - target lives, plotter unknown
narrative_event = {
	id = CM.6307
	title = EVTTITLE_CM_6303
	desc = EVTDESC_CM_6307
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6307
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6308 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6308 }	} }
		}
	}
}

# Ninja - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6308
	desc = EVTDESC_CM_6308
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6308
	}
}

# Ninja - target lives, plotter revealed
narrative_event = {
	id = CM.6309
	title = EVTTITLE_CM_6303
	desc = EVTDESC_CM_6307
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6307
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63099 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Ninja - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63099
	desc = EVTDESC_CM_63099
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63099
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

# Poisoned food
character_event = {
	id = CM.6310
	desc = EVTDESC_CM_6310
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	only_capable = yes
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 1000
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}		
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6310 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6311 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6312 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6310 # Go - extra investment
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6311 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6312 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6310 # Wait...
	}
}

# Poisoned food - notify backers of plan
character_event = {
	id = CM.6311
	desc = EVTDESC_CM_6311
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6311 # Excellent.
	}
}

# Poisoned food - outcome (target)
character_event = {
	id = CM.6312

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6313 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6315 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6317 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6319 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6313 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6315 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6317 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6319 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Poisoned food - target dies, plotter unknown
narrative_event = {
	id = CM.6313
	title = EVTTITLE_CM_6313
	desc = EVTDESC_CM_6313
	picture = GFX_evt_bad_news
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown_poison
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6313
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown_poison
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6314 }
			}
		}
	}
}

# Poisoned food - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6314
	desc = EVTDESC_CM_6314
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6314
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Poisoned food - target dies, plotter revealed
narrative_event = {
	id = CM.6315
	title = EVTTITLE_CM_6313
	desc = EVTDESC_CM_6313
	picture = GFX_evt_bad_news
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			
			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim
			

			death = {
				death_reason = death_murder_poison
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6313
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}
	
			death = {
				death_reason = death_murder_poison
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6316 }
			}
		}
	}
}

# Poisoned food - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6316
	desc = EVTDESC_CM_6316
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6316
	}
}

# Poisoned food - target lives, plotter unknown
narrative_event = {
	id = CM.6317
	title = EVTTITLE_CM_6313
	desc = EVTDESC_CM_6317
	picture = GFX_evt_recovery
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6317
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6318 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6318 }	} }
		}
	}
}

# Poisoned food - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6318
	desc = EVTDESC_CM_6318
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6318
	}
}

# Poisoned food - target lives, plotter revealed
narrative_event = {
	id = CM.6319
	title = EVTTITLE_CM_6313
	desc = EVTDESC_CM_6317
	picture = GFX_evt_recovery
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6317
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63199 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Poisoned food - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63199
	desc = EVTDESC_CM_63199
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63199
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

# Bribed guard to kill target
character_event = {
	id = CM.6320
	desc = EVTDESC_CM_6320
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 1000
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}		
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6320 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6321 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6322 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6320 # Go - extra investment
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6321 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6322 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6320 # Wait...
	}
}

# Bribed guard to kill target - notify backers of plan
character_event = {
	id = CM.6321
	desc = EVTDESC_CM_6321
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6321 # Excellent.
	}
}

# Bribed guard to kill target - outcome (target)
character_event = {
	id = CM.6322

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6323 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6325 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6327 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6329 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6323 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6325 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6327 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6329 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Bribed guard to kill target - target dies, plotter unknown
narrative_event = {
	id = CM.6323
	title = EVTTITLE_CM_6323
	desc = EVTDESC_CM_6323
	picture = GFX_evt_recieve_letter
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6323
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6324 }
			}
		}
	}
}

# Bribed guard to kill target - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6324
	desc = EVTDESC_CM_6324
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6324
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Bribed guard to kill target - target dies, plotter revealed
narrative_event = {
	id = CM.6325
	title = EVTTITLE_CM_6323
	desc = EVTDESC_CM_6323
	picture = GFX_evt_recieve_letter
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}

			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim

			death = {
				death_reason = death_murder
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6323
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}

			death = {
				death_reason = death_murder
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6326 }
			}
		}
	}
}

# Bribed guard to kill target - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6326
	desc = EVTDESC_CM_6326
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6326
	}
}

# Bribed guard to kill target - target lives, plotter unknown
narrative_event = {
	id = CM.6327
	title = EVTTITLE_CM_6323
	desc = EVTDESC_CM_6327
	picture = GFX_evt_recieve_letter
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6327
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6328 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6328 }	} }
		}
	}
}

# Bribed guard to kill target - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6328
	desc = EVTDESC_CM_6328
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6328
	}
}

# Bribed guard to kill target - target lives, plotter revealed
narrative_event = {
	id = CM.6329
	title = EVTTITLE_CM_6323
	desc = EVTDESC_CM_6327
	picture = GFX_evt_recieve_letter
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6327
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63299 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Bribed guard to kill target - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63299
	desc = EVTDESC_CM_63299
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63299
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

# Snake charmer
character_event = {
	id = CM.6330
	desc = EVTDESC_CM_6330
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			NOT = { trait = incapable }
			is_adult = yes
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 1000
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}	
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6330 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6331 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6332 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6330 # Go - extra investment
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6331 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6332 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6330 # Wait...
	}
}

# Snake charmer - notify backers of plan
character_event = {
	id = CM.6331
	desc = EVTDESC_CM_6331
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6331 # Excellent.
	}
}

# Snake charmer - outcome (target)
character_event = {
	id = CM.6332

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6333 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6335 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6337 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6339 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6333 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6335 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6337 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6339 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Snake charmer - target dies, plotter unknown
narrative_event = {
	id = CM.6333
	title = EVTTITLE_CM_6333
	desc = EVTDESC_CM_6333
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown_snakes
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6333
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown_snakes
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6334 }
			}
		}
	}
}

# Snake charmer - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6334
	desc = EVTDESC_CM_6334
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6334
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Snake charmer - target dies, plotter revealed
narrative_event = {
	id = CM.6335
	title = EVTTITLE_CM_6333
	desc = EVTDESC_CM_6333
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			
			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim

			death = {
				death_reason = death_murder_snakes
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6333
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}

			death = {
				death_reason = death_murder_snakes
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6336 }
			}
		}
	}
}

# Snake charmer - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6336
	desc = EVTDESC_CM_6336
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6336
	}
}

# Snake charmer - target lives, plotter unknown
narrative_event = {
	id = CM.6337
	title = EVTTITLE_CM_6333
	desc = EVTDESC_CM_6337
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6337
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6338 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6338 }	} }
		}
	}
}

# Snake charmer - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6338
	desc = EVTDESC_CM_6338
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6338
	}
}

# Snake charmer - target lives, plotter revealed
narrative_event = {
	id = CM.6339
	title = EVTTITLE_CM_6333
	desc = EVTDESC_CM_6337
	picture = GFX_evt_shadow
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6337
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63399 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Snake charmer - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63399
	desc = EVTDESC_CM_63399
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63399
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

# Incapable
character_event = {
	id = CM.6340
	desc = EVTDESC_CM_6340
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	only_capable = yes
	prisoner = no
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			trait = incapable
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 250
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}		
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6340 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6341 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6342 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6340 # Go - extra investment
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6341 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6342 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6340 # Wait...
	}
}

# Incapable - notify backers of plan
character_event = {
	id = CM.6341
	desc = EVTDESC_CM_6341
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6341 # Excellent.
	}
}

# Incapable - outcome (target)
character_event = {
	id = CM.6342

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6343 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6345 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6347 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6349 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6343 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6345 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6347 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6349 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Incapable - target dies, plotter unknown
narrative_event = {
	id = CM.6343
	title = EVTTITLE_CM_6343
	desc = EVTDESC_CM_6343
	picture = GFX_evt_illness
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown_strangle
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6343
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown_strangle
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6344 }
			}
		}
	}
}

# Incapable - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6344
	desc = EVTDESC_CM_6344
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6344
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Incapable - target dies, plotter revealed
narrative_event = {
	id = CM.6345
	title = EVTTITLE_CM_6343
	desc = EVTDESC_CM_6343
	picture = GFX_evt_illness
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			
			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim

			death = {
				death_reason = death_murder_strangle
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6343
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}

			death = {
				death_reason = death_murder_strangle
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6346 }
			}
		}
	}
}

# Incapable - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6346
	desc = EVTDESC_CM_6346
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6346
	}
}

# Incapable - target lives, plotter unknown
narrative_event = {
	id = CM.6347
	title = EVTTITLE_CM_6343
	desc = EVTDESC_CM_6347
	picture = GFX_evt_illness
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6347
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6348 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6348 }	} }
		}
	}
}

# Incapable - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6348
	desc = EVTDESC_CM_6348
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6348
	}
}

# Incapable - target lives, plotter revealed
narrative_event = {
	id = CM.6349
	title = EVTTITLE_CM_6343
	desc = EVTDESC_CM_6347
	picture = GFX_evt_illness
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6347
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63499 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Incapable - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63499
	desc = EVTDESC_CM_63499
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63499
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

# Child
character_event = {
	id = CM.6350
	desc = EVTDESC_CM_6350
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue
	
	capable_only = yes
	prisoner = no
	min_age = 16
	is_part_of_plot = yes
	
	trigger = {
		OR = {
			has_plot = plot_kill_character
			has_plot = plot_kill_spouse
			has_plot = plot_take_revenge
		}
		plot_power = 1.0
		plot_target_char = {
			is_inaccessible_trigger = yes
			prisoner = no
			NOT = { trait = incapable }
			is_adult = no
		}
		NOT = { has_character_flag = hiding_murder_in_motion }
	}
	
	mean_time_to_happen = {
		months = 250
		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
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 10 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 20 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 30 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 40 } }
		}
		modifier = {
			factor = 1.1
			plot_target_char = { has_character_flag = has_personal_spy_network }
			plot_target_char = { check_variable = { which = "personal_spy_network" value = 50 } }
		}		
		modifier = {
			factor = 0.7
			plot_power = 1.5
		}
		modifier = {
			factor = 0.7
			plot_power = 2.0
		}
		modifier = {
			factor = 0.7
			plot_power = 3.0
		}
		modifier = {
			factor = 0.7
			plot_power = 4.0
		}
	}
	
	immediate = {
		plot_target_char = { save_event_target_as = plot_target }
	}
	
	option = {
		name = EVTOPTA_CM_6350 # Go
		scaled_wealth = -0.5
		set_character_flag = hiding_murder_in_motion
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6351 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6352 days = 30 random = 12 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTB_CM_6350 # Go - extra investment
		scaled_wealth = -1.5
		set_character_flag = hiding_murder_in_motion
		set_character_flag = murder_extra_investment
		hidden_tooltip = {
			any_plot_backer = {
				character_event = { id = CM.6351 } # Notify backers
			}
			event_target:plot_target = { character_event = { id = CM.6352 } } # Target - outcome...
		}
	}
	option = {
		name = EVTOPTC_CM_6350 # Wait...
	}
}

# Child - notify backers of plan
character_event = {
	id = CM.6351
	desc = EVTDESC_CM_6351
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6351 # Excellent.
	}
}

# Child - outcome (target)
character_event = {
	id = CM.6352

	hide_window = yes
	
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { NOT = { has_character_flag = murder_extra_investment } }
			random_list = {
				10 = { narrative_event = { id = CM.6353 } } # dies - plotter unknown
				10 = { narrative_event = { id = CM.6355 } } # dies - plotter revealed
				30 = { narrative_event = { id = CM.6357 } } # lives - plotter unknown
				60 = { narrative_event = { id = CM.6359 } } # lives - plotter revealed
			}
		}
		if = {
			limit = { has_character_flag = murder_extra_investment }
			random_list = {
				15 = { narrative_event = { id = CM.6353 } } # dies - plotter unknown
				15 = { narrative_event = { id = CM.6355 } } # dies - plotter revealed
				25 = { narrative_event = { id = CM.6357 } } # lives - plotter unknown
				55 = { narrative_event = { id = CM.6359 } } # lives - plotter revealed
			}
			clr_character_flag = murder_extra_investment
		}
	}
}

# Child - target dies, plotter unknown
narrative_event = {
	id = CM.6353
	title = EVTTITLE_CM_6353
	desc = EVTDESC_CM_6353
	picture = GFX_evt_child_play
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			death = {
				death_reason = death_murder_unknown_poison
				killer = FROMFROM
			}
		}
	}
	
	option = {
		name = EVTOPTA_CM_6353
		if = {
			limit = { multiplayer = no	}
			death = {
				death_reason = death_murder_unknown_poison
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6354 }
			}
		}
	}
}

# Child - target dies, plotter unknown - notify plotters
character_event = {
	id = CM.6354
	desc = EVTDESC_CM_6354
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6354
		if = {
			limit = {
				trait = honest
			}
			remove_trait = honest
			
		}
		if = {
			limit = {
				trait = kind
			}
			remove_trait = kind
		}
	}
}

# Child - target dies, plotter revealed
narrative_event = {
	id = CM.6355
	title = EVTTITLE_CM_6353
	desc = EVTDESC_CM_6353
	picture = GFX_evt_child_play
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	immediate = {
		if = {
			limit = { multiplayer = yes	}
			
			save_event_target_as = target_victim
			FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
			clear_event_target = target_victim

			death = {
				death_reason = death_murder_poison
				killer = FROMFROM
			}
		}
	}

	option = {
		name = EVTOPTA_CM_6353
		if = {
			limit = { multiplayer = no	}
			
			hidden_tooltip = {
				save_event_target_as = target_victim
				FROMFROM = { character_event = { id = 10 } } # Consequences of discovery
				clear_event_target = target_victim
			}

			death = {
				death_reason = death_murder_poison
				killer = FROMFROM
			}
		}
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6356 }
			}
		}
	}
}

# Child - target dies, plotter revealed - notify plotters
character_event = {
	id = CM.6356
	desc = EVTDESC_CM_6356
	picture = GFX_evt_death
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6356
	}
}

# Child - target lives, plotter unknown
narrative_event = {
	id = CM.6357
	title = EVTTITLE_CM_6353
	desc = EVTDESC_CM_6357
	picture = GFX_evt_child_play
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6357
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.6358 }
				clr_character_flag = hiding_murder_in_motion
			}
			FROMFROM = { any_plot_backer = { character_event = { id = CM.6358 }	} }
		}
	}
}

# Child - target lives, plotter unknown - notify plotters
character_event = {
	id = CM.6358
	desc = EVTDESC_CM_6358
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_6358
	}
}

# Child - target lives, plotter revealed
narrative_event = {
	id = CM.6359
	title = EVTTITLE_CM_6353
	desc = EVTDESC_CM_6357
	picture = GFX_evt_child_play
	border = GFX_event_narrative_frame_intrigue

	is_triggered_only = yes
	
	immediate = {
		save_event_target_as = target_victim
		FROMFROM = { character_event = { id = 11 } } # Consequences of discovery
		clear_event_target = target_victim
	}

	option = {
		name = EVTOPTA_CM_6357
		hidden_tooltip = {
			FROMFROM = {
				character_event = { id = CM.63599 }
				clr_character_flag = hiding_murder_in_motion
			}
		}
	}
}

# Child - target lives, plotter revealed - notify plotters
character_event = {
	id = CM.63599
	desc = EVTDESC_CM_63599
	picture = GFX_evt_spymaster
	border = GFX_event_normal_frame_intrigue

	is_triggered_only = yes

	option = {
		name = EVTOPTA_CM_63599
		reveal_plot = yes
		set_character_flag = abort_plot
	}
}

