code:
# Demand Manumission
carn_demand_free_illegal_slaves_interaction = {
	category = interaction_category_religion

	ai_maybe = yes
	ai_min_reply_days = 4
	ai_max_reply_days = 9
	can_send_despite_rejection = yes
	ai_accept_negotiation = yes
	popup_on_receive = yes

	ai_targets = {
		ai_recipients = vassals
	}
	ai_target_quick_trigger = {
		adult = yes
	}
	ai_frequency = 12

	desc = {
		desc = carn_demand_free_slaves_interaction_desc
		desc = line_break
		triggered_desc = {
			trigger = {
				NOT = { scope:recipient = { is_imprisoned_by = scope:actor } }
			}
			desc = might_ask_for_something_in_return_warning
		}
		desc = carn_demand_free_illegal_slaves_is_crime
	}

	on_decline_summary = stop_attacker_vassal_war_decline_summary

	is_shown = {
		scope:recipient = {
			target_is_liege_or_above = scope:actor
			is_ai = yes
			OR = {
				AND = {
					faith = {
						has_doctrine = carn_doctrine_same_slavery_crime
					}
					any_relation = {
						type = slave
						scope:recipient.faith = {
							faith_hostility_level = {
								target = prev.faith
								value < faith_hostile_level
							}
						}
					}
				}
				AND = {
					faith = {
						has_doctrine = carn_doctrine_other_slavery_crime
					}
					any_relation = {
						type = slave
						scope:recipient.faith = {
							faith_hostility_level = {
								target = prev.faith
								value >= faith_hostile_level
							}
						}
					}
				}
			}
    	}
  	}

	cooldown_against_recipient = { years = 5 }

	auto_accept = {
		OR = {
			scope:recipient = { is_imprisoned_by = scope:actor }
			custom_description = {
				text = "spending_hook"
				subject = scope:actor
				object = scope:recipient
				scope:hook = yes
				scope:actor = { has_strong_hook = scope:recipient }
			}
		}
	}

	on_send = {
	}

	on_accept = {
		scope:actor = {
			trigger_event = carn_slavery_doctrine.0001
		}
    	carn_free_illegal_slaves_effect = yes
  	}

	on_decline = {
		scope:recipient = {
			hidden_effect = {
				random_list = {
					40 = { #They ask for gold
						ai_value_modifier = {
							ai_greed = 0.5
						}
						scope:actor = {
							trigger_event = {
								id = carn_slavery_doctrine.0002
							}
						}
					}
					40 = { #They ask for a favor
						trigger = {
							NOT = {
								has_hook = scope:actor
								exists = scope:recipient.capital_county
							}
						}
						modifier = {
							add = 50
							NOT = { scope:actor.gold > medium_gold_value }
						}
						scope:actor = {
							trigger_event = {
								id = carn_slavery_doctrine.0003
							}
						}
					}
					20 = { #Full refuse
						modifier = {
							add = 20
							scope:recipient.demand_free_illegal_slaves_likelihood_calculation < 40
						}
						modifier = {
							add = 20
							scope:recipient.demand_free_illegal_slaves_likelihood_calculation < 20
						}
						modifier = {
							add = 50
							scope:recipient.demand_free_illegal_slaves_likelihood_calculation < 0
						}
						scope:actor = {
							trigger_event = {
								id = carn_slavery_doctrine.0004
							}
						}
					}
				}
			}
			custom_tooltip = demand_conversion_vassal_ruler_does_not_convert
			show_as_tooltip = {
				#Negative opinions
				add_opinion = {
					modifier = carn_demanded_manumission_opinion
					target = scope:actor
					opinion = -10
				}
			}
		}
	}

	ai_potential = {
		is_adult = yes
	}

	# Use hook
	send_option = {
		is_valid = {
			scope:actor = {
				has_usable_hook = scope:recipient
			}
			NOT = {
				scope:recipient = { is_imprisoned_by = scope:actor }
			}
		}
		flag = hook
		localization = SCHEME_HOOK
	}
	should_use_extra_icon = {
		scope:actor = { has_usable_hook = scope:recipient }
	}
	extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds"

	send_options_exclusive = no

	ai_will_do = {
		base = 100

		modifier = { # Make sure the AI uses hooks for this as it's % based
			scope:hook = yes
			add = 1
		}

		modifier = {
			factor = 0
			scope:recipient.demand_free_illegal_slaves_likelihood_calculation < 10
		}
	}
	ai_accept = {
		base = 0
		religion_demand_conversion_default_modifier = yes

		modifier = {
			desc = might_ask_for_something_in_return_warning_line_break
			add = 0
		}
	}
}


code:
carn_enslave_interaction = {
	interface_priority = 100
	common_interaction = yes
	category = interaction_category_prison

	desc = carn_enslave_interaction_desc

	ai_targets = {
		ai_recipients = prisoners
	}

	ai_frequency = 12

	ai_potential = {
		is_at_war = no
	}

	is_shown = {
		NOT = { has_game_rule = carn_slavery_content_disabled }
		scope:recipient = {
			OR = {
				is_courtier_of = scope:actor
				is_imprisoned_by = scope:actor
			}
			NOR = {
				has_trait = slave
				has_character_flag = carn_cannot_be_enslaved
				has_trait_with_flag = carn_cannot_be_enslaved
			}
		}
		trigger_if = { # never enslave player unless player can't refuse
			limit = {
				scope:recipient = { is_ai = no }
			}
			has_game_rule = carn_slavery_content_enabled
			scope:recipient = { is_imprisoned_by = scope:actor }
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = { is_busy_in_events_localised = yes }
		scope:recipient = { NOT = { has_strong_hook = scope:actor } }
		scope:recipient = {
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
		scope:recipient = {
			custom_description = {
				text = "carn_slavery_is_illegal"
				NOT = {
					scope:actor.faith = {
						has_doctrine = carn_doctrine_same_slavery_crime
						faith_hostility_level = {
							target = scope:recipient.faith
							value < faith_hostile_level
						}
					}
				}
				NOT = {
					scope:actor.faith = {
						has_doctrine = carn_doctrine_other_slavery_crime
						faith_hostility_level = {
							target = scope:recipient.faith
							value >= faith_hostile_level
						}
					}
				}
			}
		}
	}

	ai_accept = {
		base = 0
		modifier = {
			desc = carn_wants_to_be_your_slave
			add = 1000
			scope:recipient = {
				OR = {
					has_character_flag = carn_wants_to_be_a_slave
					has_trait_with_flag = carn_wants_to_be_a_slave
					has_opinion_modifier = {
						target = scope:actor
						modifier = carn_wants_to_be_your_slave_opinion
					}
				}
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_your_prisoner
			add = 100
			scope:recipient = {
				is_imprisoned_by = scope:actor
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
		}
		opinion_modifier = {
			opinion_target = scope:actor
			who = scope:recipient
			multiplier = 1
		}
		modifier = {
			desc = carn_enslave_actor_diplomacy
			add = {
				value = scope:actor.diplomacy
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_contrite
			add = 50
			scope:recipient = {
				has_trait = contrite
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_humble
			add = 20
			scope:recipient = {
				has_trait = humble
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_arrogant
			add = -100
			scope:recipient = {
				has_trait = arrogant
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_noble
			add = -10
			scope:recipient = {
				is_lowborn = no
			}
		}
		modifier = {
			desc = carn_enslave_recipient_would_lose_titles
			add = -50
			scope:recipient = {
				is_ruler = yes
			}
		}
		modifier = {
			desc = carn_enslave_shunned_in_recipient_faith
			add = -25
			scope:recipient.faith = {
				has_doctrine = carn_doctrine_same_slavery_shunned
			}
		}
		modifier = {
			desc = carn_enslave_crime_in_recipient_faith
			add = -50
			scope:recipient.faith = {
				has_doctrine = carn_doctrine_same_slavery_crime
			}
		}
		modifier = {
			desc = carn_enslave_you_have_no_reason
			add = -50
			scope:actor = {
				NOT = { has_execute_reason = scope:recipient }
			}
		}
		modifier = {
			add = 10
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 1
				}
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
			desc = INTIMIDATED_REASON
		}
		modifier = {
			add = 20
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 2
				}
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
			desc = COWED_REASON
		}
	}

	auto_accept = {
		scope:recipient = { is_imprisoned_by = scope:actor }
		has_game_rule = carn_slavery_content_enabled
	}

	on_accept = {
		if = {
			limit = {
				scope:actor = { is_ai = yes }
				scope:recipient = { is_ai = no }
			}
			scope:recipient = { trigger_event = carn_slave.0001 } # Give players a chance to see what's about to happen
			show_as_tooltip = {
				carn_enslave_effect = {
					SLAVE = scope:recipient
					OWNER = scope:actor
					DRAMA = yes
				}
			}
		}
		else = {
			scope:recipient = { trigger_event = carn_slave.0001 }
			carn_enslave_effect = {
				SLAVE = scope:recipient
				OWNER = scope:actor
				DRAMA = yes
			}
		}
	}

	ai_will_do = {
		base = 0

		opinion_modifier = {
			opinion_target = scope:recipient
			multiplier = -1
		}

		ai_value_modifier = {
			ai_compassion = -1
		}
		modifier = {
			add = -75
			OR = {
				faith = {
					has_doctrine = carn_doctrine_same_slavery_shunned
					faith_hostility_level = {
						target = scope:recipient.faith
						value < faith_hostile_level
					}
				}
				faith = {
					has_doctrine = carn_doctrine_other_slavery_shunned
					faith_hostility_level = {
						target = scope:recipient.faith
						value >= faith_hostile_level
					}
				}
			}
		}
		modifier = {
			add = -20
			ai_compassion >= low_positive_ai_value
			scope:recipient = { is_adult = no }
		}
		# Avoid enslaving family or dynasty members.
		modifier = {
			add = -20
			scope:actor.dynasty = scope:recipient.dynasty
		}
		modifier = {
			add = -20
			is_close_or_extended_family_of = scope:recipient
		}
		modifier = {
			add = -20
			is_close_family_of = scope:recipient
		}
		modifier = {
			add = 50
			has_execute_reason = scope:recipient
			OR = {
				has_trait = sadistic
				has_trait = lunatic
			}
		}
		modifier = { # Executing your way to new titles is a worthy cause...
			add = 20
			scope:actor = {
				has_execute_reason = scope:recipient
				ai_greed > 0
				any_heir_title = { # Execute rulers you can inherit land from
					exists = holder
					holder = scope:recipient
					place_in_line_of_succession = {
						target = scope:actor
						value > 2
					}
				}
			}
		}
		modifier = { # Vengeful characters enjoy executing their rivals
			add = 20
			scope:actor = {
				has_execute_reason = scope:recipient
				ai_vengefulness >= medium_positive_ai_value
				OR = {
					has_relation_rival = scope:recipient # Execute rivals
					has_relation_nemesis = scope:recipient # Execute rivals
					scope:recipient = {
						is_spouse_of = scope:actor
						exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
					}
				}
			}
		}
		modifier = { # Executing your way to new titles is a worthy cause... and very greedy characters need no execution reason
			add = 35
			scope:actor = {
				ai_greed >= very_high_positive_ai_value
				any_heir_title = { # Execute rulers you can inherit land from
					exists = holder
					holder = scope:recipient
					place_in_line_of_succession = {
						target = scope:actor
						value > 2
					}
				}
			}
		}
		modifier = { # Vengeful characters enjoy executing their rivals, and very vengeful characters need no execution reason
			add = 35
			scope:actor = {
				ai_vengefulness >= very_high_positive_ai_value
				OR = {
					has_relation_rival = scope:recipient # Execute rivals
					has_relation_nemesis = scope:recipient # Execute rivals
					scope:recipient = {
						is_spouse_of = scope:actor
						exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
					}
				}
			}
		}
		modifier = {
			factor = 0
			scope:actor = {
				NOR = { # Do not execute unless you have some sort of reason to do it
					has_execute_reason = scope:recipient
					has_relation_rival = scope:recipient # Execute rivals
					has_relation_nemesis = scope:recipient # Execute rivals
					scope:recipient = {
						is_spouse_of = scope:actor
						exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
					}
					any_heir_title = { # Execute rulers you can inherit land from
						exists = holder
						holder = scope:recipient
						place_in_line_of_succession = {
							target = scope:actor
							value > 2
						}
					}
					has_trait = lunatic # Self explanatory
				}
			}
		}
	}
}

repo_name: Synthael/carnalitas

license: mit


code:
carn_force_start_prostitution_interaction = {
	interface_priority = 32
	common_interaction = yes
	category = interaction_category_prison

	desc = carn_force_start_prostitution_interaction_desc

	is_shown = {
		scope:actor = {
			has_relation_slave = scope:recipient
			NOT = { faith = { has_doctrine = carn_doctrine_prostitution_crime } }
		}
		scope:recipient = {
			carn_can_be_prostitute_trigger = yes
			carn_is_working_as_prostitute_trigger = no
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = {
			is_busy_in_events_localised = yes
			carn_can_have_sex_trigger = yes
		}
	}

	is_valid = {
		scope:recipient = {
			effective_age < carn_prostitution_age_cutoff
		}
		scope:actor = {
			custom_description = {
				text = "carn_cannot_have_max_number_of_slave_prostitutes"
				any_relation = {
					type = slave
					carn_is_working_as_prostitute_trigger = yes
					count < carn_max_slave_prostitutes_per_owner
				}
			}
		}
	}

	on_accept = {
		scope:actor = {
			if = {
				limit = {
					carn_is_prostitute_trigger = no
					carn_accepts_prostitution_trigger = no
				}
				add_piety_level = -1
			}
			send_interface_toast = {
				type = event_generic_neutral
				title = msg_carn_started_working_as_prostitute
				right_icon = scope:recipient
				scope:recipient = {
					if = {
						limit = {
							carn_is_prostitute_trigger = no
							NOT = {
								carn_has_fetish_trigger = {
									FETISH = submission
								}
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = carn_forced_me_into_prostitution_opinion
						}
					}
					carn_start_working_as_prostitute_effect = yes
				}
			}
			stress_impact = {
				generous = medium_stress_impact_gain
				compassionate = major_stress_impact_gain
			}
		}
	}

	auto_accept = yes

}


code:
carn_force_stop_prostitution_interaction = {
	interface_priority = 32
	# common_interaction = yes
	category = interaction_category_prison

	desc = carn_force_stop_prostitution_interaction_desc

	is_shown = {
		scope:actor = {
			has_relation_slave = scope:recipient
		}
		scope:recipient = {
			carn_is_working_as_prostitute_trigger = yes
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = {
			is_busy_in_events_localised = yes
			is_available_adult = yes
		}
	}

	on_accept = {
		scope:actor = {
			send_interface_message = {
				type = event_generic_neutral
				title = msg_carn_stopped_working_as_prostitute
				right_icon = scope:recipient
				scope:recipient = {
					carn_stop_working_as_prostitute_effect = yes
				}
			}
			stress_impact = {
				greedy = medium_stress_impact_gain
				compassionate = major_stress_impact_loss
			}
		}
	}

	auto_accept = yes

}


code:
carn_free_slave_interaction = {
	interface_priority = 30
	common_interaction = yes
	category = interaction_category_prison

	desc = carn_free_slave_interaction_desc

	ai_min_reply_days = 0
	ai_max_reply_days = 0

	notification_text = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:gold = no
					scope:current_gold = no
					scope:demand_conversion = no
					scope:renounce_claims = no
					scope:gain_hook = no
				}
				desc = carn_free_slave_offer
			}
			desc = carn_free_slave_offer_conditional
		}
	}

	is_shown = {
		scope:actor = {
			has_relation_slave = scope:recipient
		}
		scope:recipient = {
			NOR = {
				has_character_flag = carn_slave_cannot_be_freed
				has_trait_with_flag = carn_slave_cannot_be_freed
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = { is_busy_in_events_localised = yes }
		scope:recipient = {
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
	}

	on_accept = {
		if = {
			limit = { scope:actor = { has_relation_slave = scope:recipient } }
			scope:actor = { save_scope_as = owner }
			scope:recipient = { save_scope_as = slave }
			carn_free_slave_interaction_effect = yes
		}
	}

	# should never happen, since players can't be slaves
	#on_decline = {
	#	scope:actor = {
	#		trigger_event = carn_slave.0010
	#	}
	#}

	# Pay me what they're worth!
	send_option = {
		flag = gold
		localization = "RANSOM_GOLD_OPTION"
		is_shown = {
			scope:recipient = {
				gold >= scope:recipient.carn_slave_price_value
				carn_slave_can_be_sold_trigger = yes
			}
		}
	}

	# If you don't have what they're worth, pay me what you have!
	send_option = {
		flag = current_gold
		localization = "RANSOM_CURRENT_GOLD_OPTION"
		is_shown = {
			scope:recipient = {
				gold < scope:recipient.carn_slave_price_value
				gold > 0
				carn_slave_can_be_sold_trigger = yes
			}
		}
	}

	send_option = {
		flag = demand_conversion
		localization = "RELEASE_DEMAND_CONVERSION"
		is_valid = {
			trigger_if = {
				limit = {
					scope:actor = { is_ai = yes }
				}
				scope:recipient = {
					OR = {
						is_close_or_extended_family_of = scope:actor
						is_vassal_of = scope:actor
					}
				}
			}
			NOT = {
				scope:recipient.faith = scope:actor.faith
			}
			# Cannot ask Religious Heads to convert
			custom_description = {
				text = cannot_demand_religious_head_conversion
				subject = scope:actor
				NOT = {
					AND = {
						exists = scope:recipient.faith.religious_head
						scope:recipient.faith.religious_head = scope:recipient
					}
				}
			}
		}
	}

	send_option = {
		flag = renounce_claims
		localization = RELEASE_RENOUNCE_CLAIMS
		is_shown = {
			custom_description = {
				text = "release_renounce_claims"
				subject = scope:recipient
				scope:recipient = {
					any_claim = {
						explicit = yes
						save_temporary_scope_as = temp_claim
						OR = {
							holder = scope:actor
							AND = {
								NOT = { prev = { target_is_liege_or_above = scope:actor } }
								trigger_if = {
									limit = {
										exists = holder
									}
									holder = { target_is_liege_or_above = scope:actor }
								}
							}
							scope:actor = {
								any_held_title = {
									is_de_jure_liege_or_above_target = scope:temp_claim
								}
							}
						}
					}
				}
			}
		}
		current_description = {
			desc = RELEASE_RENOUNCE_CLAIMS_DESC
		}
	}

	send_option = {
		flag = gain_hook
		localization = "RELEASE_GAIN_HOOK"
		is_valid = {
			trigger_if = {
				limit = {
					scope:actor = { is_ai = yes }
				}
				scope:recipient = {
					OR = {
						is_vassal_of = scope:actor
						AND = {
							exists = liege
							liege = scope:actor
						}
					}
				}
			}
			#scope:actor = {
			#	can_add_hook = {
			#		type = favor_hook #Matches the hook added in the on_accept
			#		target = scope:recipient
			#	}
			#}
		}
	}

	send_options_exclusive = no

	auto_accept = {
		scope:recipient = {
			NOR = {
				has_character_flag = carn_wants_to_be_a_slave
				has_trait_with_flag = carn_wants_to_be_a_slave
				has_opinion_modifier = {
					target = scope:actor
					modifier = carn_wants_to_be_your_slave_opinion
				}
			}
		}
		scope:gold = no
		scope:current_gold = no
		scope:demand_conversion = no
		scope:renounce_claims = no
		scope:gain_hook = no
	}

	ai_accept = {
		base = 0
		modifier = {
			trigger = {
				scope:recipient = {
					NOR = {
						has_character_flag = carn_wants_to_be_a_slave
						has_trait_with_flag = carn_wants_to_be_a_slave
						has_opinion_modifier = {
							target = scope:actor
							modifier = carn_wants_to_be_your_slave_opinion
						}
					}
				}
			}
			add = 100
			desc = "WANTS_FREEDOM_REASON"
		}
		modifier = {
			trigger = {
				scope:recipient = { ai_zeal <= 20 }
				scope:demand_conversion = yes
			}
			add = -20
			desc = "CONVERSION_NEGATIVE_REASON"
		}
		modifier = {
			trigger = {
				scope:recipient = { ai_zeal > 20 }
				scope:demand_conversion = yes
			}
			add = {
				value = ai_zeal
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value = faith_astray_level
							}
						}
					}
					multiply = -1
				}
				else = {
					multiply = -2
				}
			}
			desc = "CONVERSION_NEGATIVE_REASON"
		}
		modifier = {
			add = -25
			trigger = {
				scope:renounce_claims = yes
				ai_greed < 0
			}
			desc = "RENOUNCE_CLAIMS_REASON"
		}
		modifier = {
			add = -50
			trigger = {
				scope:renounce_claims = yes
				ai_greed >= 0
				ai_greed < 26
			}
			desc = "RENOUNCE_CLAIMS_REASON"
		}
		modifier = {
			add = -75
			trigger = {
				scope:renounce_claims = yes
				ai_greed >= 26
				ai_greed < 51
			}
			desc = "RENOUNCE_CLAIMS_REASON"
		}
		modifier = {
			add = -95
			trigger = {
				scope:renounce_claims = yes
				ai_greed >= 51
			}
			desc = "RENOUNCE_CLAIMS_REASON"
		}
		modifier = {
			add = {
				value = -50
				if = {
					limit = {
						scope:recipient = {
							ai_vengefulness > 0
						}
					}
					subtract = ai_vengefulness
				}
			}
			trigger = {
				scope:gain_hook = yes
			}
			desc = "GAIN_HOOK_NEGATIVE_REASON"
		}
	}

	# AI
	ai_targets = {
		ai_recipients = courtiers
	}
	ai_frequency = 12

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 0

		modifier = {
			add = 20
			scope:demand_conversion = yes
		}
		modifier = {
			add = 30
			scope:renounce_claims = yes
		}
		modifier = { # Rivals can rot
			add = -40
			scope:actor = {
				NOT = {
					has_trait = forgiving
				}
			}
			scope:recipient = {
				OR = {
					has_relation_rival = scope:actor
					has_relation_nemesis = scope:actor
					scope:recipient = {
						is_spouse_of = scope:actor
						exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
					}
				}
			}
		}
		modifier = { # Rivals can rot FOREVER if vengeful
			add = -100
			scope:actor = {
				NOT = {
					has_trait = forgiving
				}
			}
			scope:actor.ai_vengefulness >= very_high_positive_ai_value
			scope:recipient = {
				OR = {
					has_relation_rival = scope:actor
					has_relation_nemesis = scope:actor
					scope:recipient = {
						is_spouse_of = scope:actor
						exposed_cheating_on_spouse_trigger = { SPOUSE = scope:actor }
					}
				}
			}
		}
		modifier = { # Compassionate characters will free children
			add = 10
			scope:actor = {
				is_at_war = no
				ai_compassion >= low_positive_ai_value
			}
			scope:recipient = {
				is_adult = no
			}
		}
		modifier = { # Very compassionate characters tend to free any slave
			add = 10
			scope:actor = {
				is_at_war = no
				ai_compassion >= very_high_positive_ai_value
			}
		}
		modifier = { # Most AI characters will free family, friends, lovers...
			add = 10
			scope:actor = {
				is_at_war = no
				OR = {
					ai_compassion >= very_high_positive_ai_value
					AND = {
						ai_compassion >= high_negative_ai_value
						opinion = {
							target = scope:recipient
							value >= low_negative_opinion
						}
					}
				}
			}
			scope:recipient = {
				OR = {
					is_close_family_of = scope:actor
					has_relation_friend = scope:actor
					has_relation_lover = scope:actor
					has_relation_soulmate = scope:actor
					has_relation_crush = scope:actor
				}
			}
		}
		modifier = { # Almost all will free their own children
			add = 40
			scope:actor = {
				is_at_war = no
				ai_compassion >= very_high_negative_ai_value
			}
			scope:recipient = {
				is_child_of = scope:actor
			}
		}
	}
}


code:
carn_mass_enslave_interaction = {
	category = interaction_category_prison
	is_shown = {
		NOT = { has_game_rule = carn_slavery_content_disabled }
		exists = scope:secondary_actor # to prevent the interaction from appearing except via ui button
	}

	on_accept = {
		custom_tooltip = carn_mass_enslave_interaction_tooltip_1
		custom_tooltip = carn_mass_enslave_interaction_tooltip_2
		scope:actor = {
			hidden_effect = {
				every_prisoner = {
					limit = {
						scope:actor = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = carn_enslave_interaction
							}
						}
						OR = {
							scope:actor.faith = {
								has_doctrine = carn_doctrine_same_slavery_accepted
								faith_hostility_level = {
									target = prev.faith
									value < faith_hostile_level
								}
							}
							scope:actor.faith = {
								has_doctrine = carn_doctrine_other_slavery_accepted
								faith_hostility_level = {
									target = prev.faith
									value >= faith_hostile_level
								}
							}
						}
					}
					trigger_event = carn_slave.0001
					carn_enslave_effect = {
						SLAVE = this
						OWNER = scope:actor
						DRAMA = yes
					}
				}
			}
		}
	}
}


code:
carn_rape_interaction = {
	category = interaction_category_prison

	desc = carn_rape_interaction_desc
	interface_priority = 30
	use_diplomatic_range = no

	is_shown = {
        NOT = { has_game_rule = carn_sex_interaction_disabled }
		has_game_rule = carn_content_consent_noncon
		scope:actor = {
			is_adult = yes
            NOR = {
                has_trait_with_flag = carn_block_send_sex_interaction
                has_character_flag = carn_block_send_sex_interaction
                has_opinion_modifier = {
                    target = scope:recipient
                    modifier = carn_block_sex_interaction_to_opinion
                }
            }
		}
		scope:recipient = {
			is_adult = yes
			is_imprisoned_by = scope:actor
            NOR = {
                has_trait_with_flag = carn_block_receive_sex_interaction
                has_character_flag = carn_block_receive_sex_interaction
                has_opinion_modifier = {
                    target = scope:actor
                    modifier = carn_block_sex_interaction_from_opinion
                }
            }
		}
	}

	cooldown = { months = carn_sex_interaction_cooldown }

	is_valid_showing_failures_only = {
		scope:actor = {
			carn_can_have_sex_trigger = yes
		}
		scope:recipient = {
            carn_can_be_raped_trigger = yes
		}
		scope:recipient = {
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
	}

	on_accept = {
		scope:actor = {
			if = {
				limit = {
					NOT = { has_character_flag = carn_sex_interaction_effect_cd }
				}

				#Show possible Effects from sex scene
				show_as_tooltip = {
					carn_had_sex_with_effect_v2 = {
						PARTNER = scope:recipient
					}
				}

				#executing the effect rather than only showing, so no need to rerun it from the events
				carn_rape_effect_v2 = {
					VICTIM = scope:recipient
				}

				add_character_flag = {
					flag = carn_sex_interaction_effect_cd
					months = carn_sex_interaction_cooldown_base
				}
			}
			else = {
				custom_tooltip = carn_sex_interaction_effect_cd_tt
			}

			hidden_effect = {
				if = {
					limit = { is_ai = no }
					carn_sex_scene_is_noncon_effect = yes
					carn_sex_scene_character_is_giving_player_effect = yes
					carn_sex_scene_character_is_dom_player_effect = yes
					random_list = {
						60 = {
							carn_sex_scene_is_vaginal_effect = yes
							carn_sex_scene_is_cum_inside_effect = yes
						}
						20 = {
							carn_sex_scene_is_vaginal_effect = yes
							carn_sex_scene_is_cum_outside_effect = yes
						}
						10 = {
							trigger = { has_game_rule = carn_content_anal_enabled }
							carn_sex_scene_is_anal_effect = yes
						}
						10 = {
							carn_sex_scene_is_oral_effect = yes
						}
					}
					carn_sex_scene_effect_v2 = {
						PARTNER = scope:recipient
					}
				}
				if = {
					limit = { scope:recipient = { is_ai = no } }
					scope:recipient = {
						carn_sex_scene_is_noncon_effect = yes
						carn_sex_scene_character_is_receiving_player_effect = yes
						carn_sex_scene_character_is_sub_player_effect = yes
						random_list = {
							60 = {
								carn_sex_scene_is_vaginal_effect = yes
								carn_sex_scene_is_cum_inside_effect = yes
							}
							20 = {
								carn_sex_scene_is_vaginal_effect = yes
								carn_sex_scene_is_cum_outside_effect = yes
							}
							10 = {
								trigger = { has_game_rule = carn_content_anal_enabled }
								carn_sex_scene_is_anal_effect = yes
							}
							10 = {
								carn_sex_scene_is_oral_effect = yes
							}
						}
						# actually fire the sex scene
						carn_sex_scene_effect_v2 = {
							PARTNER = scope:actor
						}
					}
				}
			}
		}
	}

	auto_accept = yes

	# AI
	ai_targets = {
		ai_recipients = prisoners
	}

	ai_frequency = 24

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = -50

		modifier = {
			has_trait = lustful
			add = 30
		}
		modifier = {
			has_trait = sadistic
			add = 30
		}
		ai_value_modifier = {
			ai_compassion = tiny_chance_impact_negative_ai_value #Adds +50 for highly uncompassionate characters, -50 for highly compassionate characters
		}
		opinion_modifier = {
			opinion_target = scope:recipient
			multiplier = -0.25
		}
	}
}


code:
# taking someone else's slave
carn_seize_slave_interaction = {
	interface_priority = 100
	common_interaction = yes
	category = interaction_category_prison

	desc = carn_seize_slave_interaction_desc

	ai_min_reply_days = 0
	ai_max_reply_days = 0

	ai_targets = {
		ai_recipients = prisoners
	}

	ai_frequency = 12

	ai_potential = {
		is_at_war = no
	}

	is_shown = {
		NOT = { has_game_rule = carn_slavery_content_disabled }
		scope:recipient = {
			has_trait = slave
			is_imprisoned_by = scope:actor
			NOT = { has_relation_slave_owner = scope:actor }
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = { is_busy_in_events_localised = yes }
		scope:recipient = { NOT = { has_strong_hook = scope:actor } }
		scope:recipient = {
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
	}

	ai_accept = {
		base = 0
		modifier = {
			add = -1000
			desc = carn_wants_to_be_liege_slave
			scope:recipient = {
				has_opinion_modifier = {
					target = scope:recipient.liege
					modifier = carn_wants_to_be_your_slave_opinion
				}
			}
		}
		modifier = {
			add = 1000
			desc = carn_wants_to_be_your_slave
			scope:recipient = {
				has_opinion_modifier = {
					target = scope:actor
					modifier = carn_wants_to_be_your_slave_opinion
				}
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_your_prisoner
			add = 100
			scope:recipient = {
				is_imprisoned_by = scope:actor
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
		}
		opinion_modifier = {
			opinion_target = scope:actor
			who = scope:recipient
			multiplier = 1
		}
		opinion_modifier = {
			opinion_target = scope:recipient.liege
			who = scope:recipient
			multiplier = -1
		}
		modifier = {
			desc = carn_enslave_actor_diplomacy
			add = {
				value = scope:actor.diplomacy
			}
		}
		modifier = {
			desc = carn_enslave_recipient_is_fickle
			add = 20
			scope:recipient = {
				has_trait = fickle
			}
		}
		modifier = {
			add = 10
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 1
				}
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
			desc = INTIMIDATED_REASON
		}
		modifier = {
			add = 20
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 2
				}
			}
			NOT = { has_game_rule = carn_slavery_content_consensual_only }
			desc = COWED_REASON
		}
	}

	auto_accept = {
		has_game_rule = carn_slavery_content_enabled
	}

	on_accept = {
		scope:recipient = {
			every_relation = {
				type = slave_owner
				hidden_effect = {
					remove_relation_slave = prev
					add_opinion = {
						target = prev
						modifier = carn_former_slave_or_slave_owner_opinion
					}
					reverse_add_opinion = {
						target = prev
						modifier = carn_former_slave_or_slave_owner_opinion
					}
				}
				add_opinion = {
					target = scope:actor
					modifier = carn_stole_my_slave_opinion
				}
			}
			set_relation_slave_owner = scope:actor
		}
		scope:actor = {
			hidden_effect = {
				send_interface_message = {
					type = event_generic_neutral
					title = carn_msg_enslave
					right_icon = scope:recipient
					custom_tooltip = carn_msg_scope_recipient_becomes_your_slave_desc
				}
			}
		}
	}

	ai_will_do = {
		base = 0
		opinion_modifier = {
			opinion_target = scope:recipient.liege
			multiplier = -1
		}
		ai_value_modifier = {
			ai_compassion = -1
		}
		ai_value_modifier = {
			ai_honor = -1
		}
	}
}


code:
# sell a slave by right clicking them
carn_sell_slave_interaction = {
	interface_priority = 31
	common_interaction = yes
	category = interaction_category_prison

	desc = carn_sell_slave_interaction_desc

	redirect = { # open to the richest possible recipient to sell to
		scope:actor = {
			every_neighboring_and_across_water_top_liege_realm_owner = {
				limit = { carn_candidate_to_sell_slave_to_trigger = yes }
				add_to_list = possible_suggested_buyers
			}
			if = {
				limit = { exists = liege }
				liege = {
					every_vassal = {
						limit = { carn_candidate_to_sell_slave_to_trigger = yes }
						add_to_list = possible_suggested_buyers
					}
				}
			}
			every_vassal = {
				limit = { carn_candidate_to_sell_slave_to_trigger = yes }
				add_to_list = possible_suggested_buyers
			}
		}
		ordered_in_list = {
			list = possible_suggested_buyers
			order_by = gold
			max = 1
			check_range_bounds = no
			save_scope_as = secondary_recipient
		}
	}

	populate_recipient_list = {
		scope:actor = {
			every_neighboring_and_across_water_top_liege_realm_owner = {
				limit = { carn_candidate_to_sell_slave_to_trigger = yes }
				add_to_list = characters
			}
			if = {
				limit = { exists = liege }
				liege = {
					every_vassal = {
						limit = { carn_candidate_to_sell_slave_to_trigger = yes }
						add_to_list = characters
					}
				}
			}
			every_vassal = {
				limit = { carn_candidate_to_sell_slave_to_trigger = yes }
				add_to_list = characters
			}
		}
	}

	is_shown = {
		scope:actor = {
			has_relation_slave = scope:recipient
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = {
			is_busy_in_events_localised = yes
			carn_slave_can_be_sold_trigger = yes
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
	}

	on_accept = {
		if = {
			limit = { scope:actor = { has_relation_slave = scope:recipient } }
			scope:actor = { save_scope_as = seller }
			scope:recipient = { save_scope_as = slave }
			scope:secondary_recipient = { save_scope_as = buyer }
			carn_buy_slave_effect = {
				SLAVE_PRICE = scope:recipient.carn_slave_price_value
			}
		}
	}

	auto_accept = yes

}


code:
carn_sex_interaction = {
    category = interaction_category_friendly

    desc = carn_sex_interaction_desc
    interface_priority = 40
    use_diplomatic_range = no

    is_shown = {
        NOR = {
            has_game_rule = carn_sex_interaction_disabled
            scope:actor = scope:recipient
        }
        scope:actor = {
            is_adult = yes
            NOR = {
                has_trait_with_flag = carn_block_send_sex_interaction
                has_character_flag = carn_block_send_sex_interaction
                has_opinion_modifier = {
                    target = scope:recipient
                    modifier = carn_block_sex_interaction_to_opinion
                }
            }
        }
        scope:recipient = {
            is_adult = yes
            NOR = {
                has_trait_with_flag = carn_block_receive_sex_interaction
                has_character_flag = carn_block_receive_sex_interaction
                has_opinion_modifier = {
                    target = scope:actor
                    modifier = carn_block_sex_interaction_from_opinion
                }
            }
        }
        OR = {
            scope:actor = {
                carn_relationship_allows_free_sex_trigger = {
                    PARTNER = scope:recipient
                }
            }
            scope:recipient = {
                carn_is_working_as_prostitute_trigger = yes
            }
        }
    }

	cooldown = { months = carn_sex_interaction_cooldown }

    is_valid_showing_failures_only = {
        scope:actor = {
            carn_can_have_sex_trigger = yes
        }
        scope:recipient = {
            carn_can_have_sex_trigger = yes
        }

        # if this is a paid transaction, actor needs the gold
        trigger_if = {
            limit = {
                scope:recipient = {
                    carn_is_working_as_prostitute_trigger = yes
                }
                NOT = {
                    scope:actor = {
                        carn_relationship_allows_free_sex_trigger = {
                            PARTNER = scope:recipient
                        }
                    }
                }
            }
            scope:actor.gold >= scope:recipient.carn_prostitute_sex_interaction_price_value
        }
    }

    on_accept = {
        scope:actor = {

            # pay money for prostitution, and possibly lose piety if your faith dislikes this
            if = {
                limit = {
                    scope:recipient = {
                        carn_is_working_as_prostitute_trigger = yes
                    }
                    NOT = {
                        carn_relationship_allows_free_sex_trigger = {
                            PARTNER = scope:recipient
                        }
                    }
                }
                pay_short_term_gold = {
                    target = scope:recipient
                    gold = scope:recipient.carn_prostitute_sex_interaction_price_value
                }
                if = {
                    limit = {
                        faith = { NOT = { has_doctrine = carn_doctrine_prostitution_accepted } }
                    }
                    add_piety = minor_piety_loss
                }
            }

            if = {
                limit = {
                    NOT = { has_character_flag = carn_sex_interaction_effect_cd }
                }

				# show possible effects from sex scene
                show_as_tooltip = {
                    carn_had_sex_with_effect_v2 = {
                        PARTNER = scope:recipient
                    }
                }

                ### STRESS ###
                if = {
                    limit = {
                        is_attracted_to_gender_of = scope:recipient
                    }
                    stress_impact = {
                        base = minor_stress_impact_loss
                        chaste = activity_stress_gain_impact
                    }
                }
                else = {
                    custom_tooltip = carn_sex_interaction_not_attracted_to_warning_tt
                    stress_impact = {
                        base = major_stress_impact_gain
                    }
                }

                add_character_flag = {
                    flag = carn_sex_interaction_effect_cd
                    months = carn_sex_interaction_cooldown_base
                }
            }
            else = {
                custom_tooltip = carn_sex_interaction_effect_cd_tt
            }

            # request the sex scene
            hidden_effect = {

                # lovers and soulmates always consensual
                if = {
                    limit = {
                        scope:actor = {
                            OR = {
                                has_relation_lover = scope:recipient
                                has_relation_soulmate = scope:recipient
                            }
                        }
                    }
                    carn_sex_scene_is_consensual_effect = yes
                }
                # for slaves and concubines, get scenes ranging from consensual to noncon
                else_if = {
                    limit = {
                        scope:actor = {
                            OR = {
                                is_concubine_of = scope:recipient
                                has_relation_slave_owner = scope:recipient
                            }
                        }
                    }
                    # Consensual: I'm into you, and I either like you or you're super hot
                    if = {
                        limit = {
                            scope:recipient = {
                                OR = {
                                    opinion = {
                                        target = scope:actor
                                        value >= 50
                                    }
                                    scope:actor = { attraction >= 20 } # if you're hot enough they'll happily hatefuck you
                                }
                                is_attracted_to_gender_of = scope:actor
                            }
                        }
                        carn_sex_scene_is_consensual_effect = yes
                    }
                    # dubcon: Either I'm into you but not that into you, or I don't swing that way but I like you enough to humor you
                    else_if = {
                        limit = {
                            scope:recipient = {
                                OR = {
                                    AND = {
                                        is_attracted_to_gender_of = scope:actor
                                        OR = {
                                            opinion = {
                                                target = scope:actor
                                                value > 0
                                            }
                                            scope:actor = { attraction >= 10 } # if you're hot enough they'll be kinda ok with it
                                        }
                                    }
                                    AND = {
                                        NOT = { is_attracted_to_gender_of = scope:actor }
                                        opinion = {
                                            target = scope:actor
                                            value >= 75
                                        }
                                    }
                                }
                            }
                        }
                        carn_sex_scene_is_dubcon_effect = yes
				        carn_sex_scene_character_is_dom_player_effect = yes
                    }
                    # Noncon: I either hate you or I don't swing this way, get me outta here
                    else = {
                        carn_sex_scene_is_noncon_effect = yes
				        carn_sex_scene_character_is_dom_player_effect = yes
                    }
                }
                # get dubcon for characters that dislike you / are not attracted to you (but accept sex with you for some reason, like being a prostitute)
                else_if = {
                    limit = {
                        scope:recipient = {
                            OR = {
                                opinion = {
                                    target = scope:actor
                                    value < 0
                                }
                                NOT = { is_attracted_to_gender_of = scope:actor }
                            }
                        }
                    }
                    carn_sex_scene_is_dubcon_effect = yes
                    carn_sex_scene_character_is_dom_player_effect = yes
                }
                # fallback to consensual scene
                else = {
                    carn_sex_scene_is_consensual_effect = yes
                }

				random_list = {
					60 = {
						carn_sex_scene_is_vaginal_effect = yes
						carn_sex_scene_is_cum_inside_effect = yes
					}
					20 = {
						carn_sex_scene_is_vaginal_effect = yes
						carn_sex_scene_is_cum_outside_effect = yes
					}
					10 = {
						trigger = { has_game_rule = carn_content_anal_enabled }
						carn_sex_scene_is_anal_effect = yes
					}
					10 = {
						carn_sex_scene_is_oral_effect = yes
					}
				}
				carn_sex_scene_character_is_giving_player_effect = yes
                # actually fire the sex scene
				carn_sex_scene_effect_v2 = {
						PARTNER = scope:recipient
				}
            }
        }
    }

    auto_accept = yes
}


code:
# actually, since slaves can't own titles (and thus can't be Ai controlled), i'm not sure when this will ever happen
# but might as well leave the file in

carn_slave_negotiate_freedom_interaction = {
	interface_priority = 50
	common_interaction = yes
	use_diplomatic_range = no
	category = interaction_category_prison

	greeting = positive
	notification_text = carn_slave_negotiate_freedom_offer

	desc = ransom_me_interaction_desc

	is_shown = {
		scope:actor = {
			has_relation_slave_owner = scope:recipient
		}
	}

	is_valid_showing_failures_only = {
		scope:recipient = { is_busy_in_events_localised = yes } #Imprisoner
		scope:actor = { is_busy_in_events_localised = yes } #Prisoner
		scope:recipient = {
			custom_description = {
				text = "currently_being_tortured"
				NOT = { has_character_flag = is_being_tortured }
			}
		}
	}

	on_accept = {
		if = {
			limit = { scope:actor = { has_relation_slave_owner = scope:recipient } }
			scope:actor = { save_scope_as = slave }
			scope:recipient = { save_scope_as = owner }
			carn_free_slave_interaction_effect = yes
			if = {
				limit = { always = scope:hook }
				scope:actor = {
					use_hook = scope:recipient
				}
			}
		}
	}

	#on_decline = {
	#	scope:actor = {
	#		trigger_event = carn_slave.0011
	#	}
	#}

	send_option = {
		is_valid = {
			scope:actor = {
				gold >= carn_slave_price_value
				carn_slave_can_be_sold_trigger = yes
			}
		}
		flag = gold
		localization = "RANSOM_GOLD_OPTION"
	}

	# If you don't have what they're worth, pay me what you have!
	send_option = {
		is_shown = {
			scope:actor = {
				gold < carn_slave_price_value
				gold > 0
				carn_slave_can_be_sold_trigger = yes
			}
		}
		flag = current_gold
		localization = "RANSOM_CURRENT_GOLD_OPTION"
	}

	send_option = {
		flag = demand_conversion
		localization = "carn_slave_negotiate_freedom_convert_faith"
		is_valid = {
			NOT = {
				scope:actor.faith = scope:recipient.faith
			}
			NAND = {
				exists = scope:actor.faith.religious_head
				scope:actor.faith.religious_head = scope:actor
			}
		}
	}

	send_option = {
		is_shown = {
			custom_description = {
				text = "release_renounce_claims"
				subject = scope:actor
				scope:actor = {
					any_claim = {
						explicit = yes
						save_temporary_scope_as = temp_claim
						OR = {
							holder = scope:recipient
							AND = {
								NOT = { prev = { target_is_liege_or_above = scope:recipient } }
								trigger_if = {
									limit = {
										exists = holder
									}
									holder = { target_is_liege_or_above = scope:recipient }
								}
							}
							scope:recipient = {
								any_held_title = {
									is_de_jure_liege_or_above_target = scope:temp_claim
								}
							}
						}
					}
				}
			}
		}
		flag = renounce_claims
		localization = "release_renounce_claims"
		current_description = {
			desc = carn_slave_negotiate_freedom_renounce_claims
		}
	}

	send_option = {
		is_valid = {
			scope:recipient = {
				can_add_hook = { #To match the hook added through ransom_interaction_effect
					target = scope:actor
					type = favor_hook
				}
			}
		}
		flag = gain_hook
		localization = "RANSOM_FAVOR_OPTION"
	}

	#Use hook
	send_option = {
		is_valid = {
			scope:actor = {
				has_usable_hook = scope:recipient
			}
		}
		flag = hook
		localization = SCHEME_HOOK
	}
	should_use_extra_icon = {
		scope:actor = { has_usable_hook = scope:recipient }
	}
	extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds"

	send_options_exclusive = no

	localization_values = {
		RANSOM_COST = scope:actor.ransom_cost_value
		CURRENT_GOLD = scope:actor.gold
	}

	ai_accept = {
		base = 0
		modifier = {
			add = 50
			scope:gold = yes
			desc = "GOLD_POSITIVE_REASON"
		}

		modifier = {
			add = 50
			scope:gain_hook = yes
			scope:recipient.top_liege = scope:actor.top_liege
			desc = "FAVOR_POSITIVE_REASON"
		}

		modifier = {
			add = -50
			scope:gain_hook = yes
			NOT = {
				scope:gold = yes
			}
			OR = {
				NOT = { scope:recipient.top_liege = scope:actor.top_liege }
				scope:recipient.ai_greed >= medium_positive_ai_value
			}
			desc = "NO_USE_FOR_A_FAVOR_REASON"
		}

		#opinion_modifier = { # A lot more likely if Recipient likes Actor
		#	who = scope:recipient
		#	opinion_target = scope:actor
		#	multiplier = 1.0
		#	desc = AI_OPINION_REASON
		#}

		modifier = { # Say no to rivals
			add = -55
			scope:recipient = {
				has_relation_rival = scope:actor
			}
			desc = "ACTOR_RIVAL_TO_ME_REASON"
		}
		modifier = { # Say no to rivals
			add = -300
			scope:recipient = {
				has_relation_nemesis = scope:actor
			}
			desc = "ACTOR_NEMESIS_TO_ME_REASON"
		}

		modifier = { # At war
			add = -300
			scope:recipient = {
				is_at_war_with = scope:actor
			}
			desc = "IS_AT_WAR_REASON"
		}

		modifier = {
			scope:hook = yes
			add = 100
			desc = SCHEME_WEAK_HOOK_USED
		}
	}

	auto_accept = {
		custom_description = {
			text = "spending_hook"
			subject = scope:actor
			object = scope:recipient
			scope:hook = yes
			scope:actor = { has_strong_hook = scope:recipient }
		}
	}

	# AI
	ai_frequency = 120 # slaves shouldn't ask for their freedom too often

	ai_targets = {
		ai_recipients = self
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}