murder = {
	
	skill = intrigue
	hostile = yes
	
	allow = {
		is_adult = yes
		is_imprisoned = no
		#Game rules
		OR = {
			is_ai = no
			has_game_rule = default_intrigue
			AND = {
				OR = {
					has_game_rule = less_intrigue
					has_game_rule = restricted_intrigue
				}
				#Must have one of these traits
				OR = {
					AND = {
						has_education_intrigue_trigger = yes
						has_game_rule = less_intrigue
					}
					has_trait = schemer
					has_trait = torturer
					has_trait = greedy
					has_trait = deceitful
					has_trait = paranoid
					has_trait = sadistic
					has_trait = vengeful
					has_trait = callous
				}
				#Cannot have one of these traits
				NOR = {
					has_trait = craven
					has_trait = compassionate
					has_trait = forgiving
				}
			}
		}
	}
	
	valid = {
		trigger_if = {
			limit = {
				is_parent_of = scope:target
				NOT = {
					has_trait_with_flag = can_murder_own_children
				}
			}
			NOT = { is_parent_of = scope:target }
		}
		custom_description = {
			object = scope:target
			text = "I_have_imprisoned_target"
			scope:target = {
				NOT = { imprisoner = scope:owner }
			}
		}
		custom_description = {
			object = scope:target
			text = i_have_been_caught_trying_to_murder_target
			scope:target = {
				NOT = {
					has_opinion_modifier = {
						target = prev
						modifier = murder_personal_grudge_opinion
					}
				}
			}
		}
		scope:target = {
			OR = {
				exists = location
				in_diplomatic_range = scope:owner
			}
		}
		# Special AI exceptions
		NOT = {
			scope:owner = {
				is_ai = yes
				has_opinion_modifier = {
					target = scope:target
					modifier = repentant_opinion
				}
			}
		}
	}

	valid_agent = {
		age >= 14
	}
	
	agent_join_chance = {
		base = 0
		
		# Base Reluctance, including negative AI Energy
		modifier = {
			add = {
				value = -20
				if = {
					limit = {
						ai_energy < 0
					}
					add = {
						value = ai_energy
						multiply = 0.5
					}
				}
			}
			desc = BASE_RELUCTANCE
		}

		#Is Owner sending a gift in the invite interaction?
		modifier = {
			add = bribe_acceptance_value
			exists = scope:gift
			always = scope:gift
			NOT = {
				OR = {
					scope:target = { is_parent_of = root }
					root = { is_parent_of = scope:target }
				}
			}
			desc = "SCHEME_WITH_GIFT"
		}

		#Default Hostile Scheme modifiers
		hostile_murder_agent_base_join_chance_modifier = yes

		#Special Modifier from events for couples that murder together
		modifier = {
			add = 50
			has_opinion_modifier = {
				target = scope:owner
				modifier = murder_partner_opinion
			}
			desc = "SCHEME_MURDER_COUPLE"
		}
		modifier = {
			add = -1000
			has_variable = murder_scheme_disinterest
			var:murder_scheme_disinterest = scope:target
			desc = "SCHEME_MURDER_DISINTERESTED"
		}
	}
	
	base_success_chance = {
		base = 0
		
		hostile_scheme_base_chance_modifier = yes

		modifier = {
			add = 10
			scope:owner = { has_trait = lifestyle_herbalist }
			desc = MURDER_HERBALIST_BONUS
		}

		modifier = {
			add = -50
			scope:target = {				
				has_opinion_modifier = {
					target = scope:owner
					modifier = attempted_murder_me_crime
				}
			}
			desc = HAS_ATTEMPTED_TO_MURDER_TARGET_BEFORE
		}
		# Spiritual Head of Faith
		modifier = {
			add = -25
			desc = "SCHEME_VS_SPIRITUAL_HOF"
			scope:target = {
				faith = scope:owner.faith
				faith = {
					has_doctrine = doctrine_spiritual_head
				}
				faith = {
					exists = religious_head
					religious_head = {
			 			this = scope:target
			 		}
				}
			}
		}
		
		# Spiritual Head of Faith
		modifier = {
			add = -50
			desc = "SCHEME_VS_SPIRITUAL_HOF"
			scope:target = {
				faith = scope:owner.faith
				faith = {
					has_doctrine = doctrine_spiritual_head
				}
				faith = {
					exists = religious_head
					religious_head = {
			 			this = scope:target
			 		}
				}
			}
		}
		
		# At War
		first_valid = {
			modifier = {
				add = -50
				desc = "SCHEME_AT_WAR"
				scope:target = {
					is_at_war_with = scope:owner
				}
			}
			modifier = {
				add = -25
				scope:target = {
					is_landed = no
					exists = liege
					liege = {
						is_at_war_with = scope:owner
					}
				}
				desc = "SCHEME_AT_WAR_WITH_LIEGE"
			}
			modifier = {
				add = -25
				scope:target = {
					is_landed = yes
					exists = liege
					liege = {
						is_at_war_with = scope:owner
					}
				}
				desc = "SCHEME_AT_WAR_WITH_LIEGE"
			}
		}
	}
	
	agent_success_chance = {
		base = 0
		
		hostile_scheme_agent_success_chance_modifier = yes #Adds a value depending on their "closeness" to target
	}
	
	agent_leave_threshold = -25
		
	cooldown = { years = 10 }
	is_secret = yes
	base_secrecy = 15

	on_ready = {
		scheme_owner = {
			if = {
				limit = {
					has_character_flag = is_in_event_murder_outcome_0001
				}
				trigger_event = {
					id = murder_outcome.0001
					days = 1
				}
			}
			else = {
				trigger_event = murder_outcome.0001
			}
		}
	}

	on_monthly = {
		hostile_scheme_discovery_chance_effect = yes
		if = {
			limit = {
				NOT = { exists = scope:discovery_event_happening }
			}			
			scheme_owner = {
				trigger_event = {
					on_action = murder_ongoing
				}
			}
		}
	}

	
	on_invalidated = {
		if = { #Did the character die in another way?
			limit = {
				scheme_target = {
					is_alive = no
					NOT = { killer = prev.scheme_owner }
				}
			}
			scheme_owner = {
				trigger_event = murder_outcome.2000
			}
		}
	}

	
	
	power_per_skill_point = 3.0
	resistance_per_skill_point = 1.0
	power_per_agent_skill_point = 2
	
	minimum_progress_chance = 10
	maximum_progress_chance = 90
	minimum_success = 5
	maximum_secrecy = 95
	maximum_success = 95
	
	success_desc = "MURDER_SUCCESS_DESC"
	discovery_desc = "MURDER_DISCOVERY_DESC"
}
