﻿namespace = bp1_house_feud

##############################
##############################
######## START EVENTS ########
##############################
##############################

# bp1_house_feud.0001 - existing House Head rivalry
# bp1_house_feud.0002 - existing close family rivalry
# bp1_house_feud.0003 - close family killed by another house (yearly)
# bp1_house_feud.0004 - old House Head rivalry inherited
# bp1_house_feud.0005 - close family killed by another house (on reveal)
# bp1_house_feud.0006 - competing claims with another house
# bp1_house_feud.0007 - house head imprisoned for a while
# bp1_house_feud.0008 - close family imprisoned for a while
# bp1_house_feud.0009 - previous house head killed by another
# bp1_house_feud.0010 - house head tortured/blinded/castrated
# bp1_house_feud.0011 - close family tortured/blinded/castrated
# bp1_house_feud.0012 - house head cuckolded (yearly)
# bp1_house_feud.0013 - house head cuckolded (on reveal)
# bp1_house_feud.0014 - close family cuckolded (on reveal)

# House Head has rival of another house
bp1_house_feud.0001 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0001.t
	desc = {
		desc = bp1_house_feud.0001.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		animation = boredom
		outfit_tags = { nightgown }
	}
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Someone to feud with
		any_relation = {
			type = rival
			save_temporary_scope_as = house_feud_victim_temp
			root = {
				house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp }
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			any_relation = {
				type = nemesis
				save_temporary_scope_as = house_feud_victim_temp
				root = {
					house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp }
				}
			}
		}
		modifier = {
			factor = 2
			any_relation = {
				type = rival
				primary_title.tier = root.primary_title.tier
				save_temporary_scope_as = house_feud_victim_temp
				root = {
					house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp }
				}
			}
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		random_relation = {
			type = rival
			limit = {
				save_temporary_scope_as = house_feud_victim_temp
				root = {
					house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp }
				}
			}
			weight = {
				base = 1
				modifier = {
					factor = 1000
					has_relation_nemesis = root
				}
				modifier = {
					factor = 2
					primary_title.tier = root.primary_title.tier
				}
			}
			save_scope_as = house_feud_rival
		}
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = { # Start Feud
		name = bp1_house_feud.0001.a
		house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_rival
			# Feud Reason
			REASON = head_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_rival
			# House Member victim if relevant
			VICTIM = root
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = { # Remain rivals
		name = bp1_house_feud.0001.b
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}
}

# House Head's close family has a rival of another house
bp1_house_feud.0002 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0002.t
	desc = {
		desc = bp1_house_feud.0002.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
	}
	right_portrait = {
		character = scope:house_feud_victim
		animation = worry
	}
	lower_center_portrait = scope:house_feud_attacker
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Someone to feud with
		any_close_family_member = {
			house_feud_member_trigger = yes
			any_relation = {
				type = rival
				save_temporary_scope_as = family_rival_temp
				root = {
					house_head_can_start_feud_against_trigger = { TARGET = scope:family_rival_temp }
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			any_close_family_member = {
				house_feud_member_trigger = yes
				any_relation = {
					type = nemesis
					save_temporary_scope_as = family_rival_temp
					root = {
						house_head_can_start_feud_against_trigger = { TARGET = scope:family_rival_temp }
					}
				}
			}
		}
		modifier = {
			factor = 2
			any_close_family_member = {
				house_feud_member_trigger = yes
				any_relation = {
					type = rival
					house.house_head.primary_title.tier ?= root.primary_title.tier
					save_temporary_scope_as = family_rival_temp
					root = {
						house_head_can_start_feud_against_trigger = { TARGET = scope:family_rival_temp }
					}
				}
			}
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		set_local_venomous_creature_effect = yes
		random_close_family_member = {
			limit = {
				house_feud_member_trigger = yes
				any_relation = {
					type = rival
					save_temporary_scope_as = family_rival_temp
					root = {
						house_head_can_start_feud_against_trigger = { TARGET = scope:family_rival_temp }
					}
				}
			}
			save_scope_as = house_feud_victim
			random_relation = {
				type = rival
				limit = {
					save_temporary_scope_as = family_rival_temp
					root = {
						house_head_can_start_feud_against_trigger = { TARGET = scope:family_rival_temp }
					}
				}
				weight = {
					base = 1
					modifier = {
						factor = 10
						has_relation_nemesis = scope:house_feud_victim
					}
					modifier = {
						factor = 2
						primary_title.tier = root.primary_title.tier
					}
				}
				house_feud_save_head_and_attacker_effect = yes
			}
		}
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0002.a
        house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = family_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			# House Member victim if relevant
			VICTIM = scope:house_feud_victim
		}
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_feud_opinion
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0002.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			involved_character = scope:house_feud_victim
			reason = rival_house_feud_close_relative
		}
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_rival_opinion
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0002.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0002.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_ignored_opinion
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# House Head's close family was killed by another house (yearly)
bp1_house_feud.0003 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0003.t
	desc = {
		desc = bp1_house_feud.0003.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		animation = anger
	}
	lower_left_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 5 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Someone to feud with
		house ?= {
			any_house_member = {
				only_if_dead = yes
				exists = killer
				killer = {
					trigger_if = {
						limit = {
							any_secret = {
								secret_type = secret_murder
								secret_target = scope:house_feud_victim_temp
							}
						}
						any_secret = {
							secret_type = secret_murder
							secret_target = scope:house_feud_victim_temp
							is_known_by = root
						}
					}
				}
				save_temporary_scope_as = house_feud_victim_temp
			}
		}
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp.killer }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			house ?= {
				any_house_member = {
					only_if_dead = yes
					exists = killer
					killer = {
						trigger_if = {
							limit = {
								any_secret = {
									secret_type = secret_murder
									secret_target = scope:house_feud_victim_temp
								}
							}
							any_secret = {
								secret_type = secret_murder
								secret_target = scope:house_feud_victim_temp
								is_known_by = root
							}
						}
						house ?= {
							any_house_member = { has_relation_rival = root }
						}
					}
					save_temporary_scope_as = house_feud_victim_temp
				}
			}
			house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp.killer }
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		house = {
			random_house_member = {
				only_if_dead = yes
				limit = {	
					exists = killer
					killer = {
						trigger_if = {
							limit = {
								any_secret = {
									secret_type = secret_murder
									secret_target = scope:house_feud_victim_temp
								}
							}
							any_secret = {
								secret_type = secret_murder
								secret_target = scope:house_feud_victim_temp
								is_known_by = root
							}
						}
					}
					save_temporary_scope_as = house_feud_victim_temp
					root = {
						house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_victim_temp.killer }
					}
				}
				save_scope_as = house_feud_victim
				killer = { house_feud_save_head_and_attacker_effect = yes }
			}
		}
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0003.a
		house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = family_killed
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			# House Member victim if relevant
			VICTIM = scope:house_feud_victim
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0003.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			reason = rival_house_feud_vengeance
			involved_character = scope:house_feud_victim
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0003.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0003.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# Inheriting House Head considers rivals of predecessor
bp1_house_feud.0004 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0004.t
	desc = {
		desc = bp1_house_feud.0004.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:old_house_head
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Age check
		age >= 9
		# Not already feuding
		NOT = {
			any_owned_story = { story_type = story_cycle_house_feud }
		}
		# Someone to feud with
		any_in_list = {
			list = old_house_head_rivals
			NOR = {
				is_close_family_of = root
				has_any_good_relationship_with_character_trigger = { CHARACTER = root }
			}
			save_temporary_scope_as = old_rival_temp
			root = {
				house_head_can_start_feud_against_trigger = { TARGET = scope:old_rival_temp }
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		random_in_list = {
			list = old_house_head_rivals
			limit = {
				NOR = {
					is_close_family_of = root
					has_any_good_relationship_with_character_trigger = { CHARACTER = root }
				}
				save_temporary_scope_as = old_rival_temp
				root = {
					house_head_can_start_feud_against_trigger = { TARGET = scope:old_rival_temp }
				}
			}
			weight = {
				modifier = {
					factor = 10
					exists = scope:old_house_head.killer.house
					this = scope:old_house_head.killer
				}
				modifier = {
					factor = 10
					has_relation_rival = root
				}
				modifier = {
					factor = 100
					has_relation_nemesis = root
				}
				modifier = {
					factor = 10
					exists = var:dead_nemesis
					var:dead_nemesis = scope:old_house_head
				}
			}
			save_scope_as = house_feud_rival
		}
		scope:old_house_head = { save_scope_as = house_feud_victim }
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0004.a
		house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_rival
			# Feud Reason
			REASON = inherited_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_rival
			# House Member victim if relevant 
			VICTIM = scope:old_house_head
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0004.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_rival }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_rival }
		}
		set_relation_rival = {
			target = scope:house_feud_rival
			reason = rival_house_feud_leadership
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0004.b
			trigger = { has_relation_rival = scope:house_feud_rival }
		}
		name = {
			text = bp1_house_feud.0005.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_rival }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# House Head's close family was killed by another house (on reveal)
bp1_house_feud.0005 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0005.t
	desc = {
		desc = bp1_house_feud.0005.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = anger
	}
	lower_left_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 5 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Age check
		age >= 9
		# Is valid feuder
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_rival }
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0005.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = family_killed
            # House Member attacker if relevant
            ATTACKER = scope:house_feud_attacker
            # House Member victim if relevant
            VICTIM = scope:house_feud_victim
	    }
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
			modifier = {
				factor = 1.25
				culture = {
					has_cultural_parameter = house_hostility_more_common
				}
			}
		}
	}

	option = {
		name = bp1_house_feud.0005.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			reason = rival_house_feud_vengeance
			involved_character = scope:house_feud_victim
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0005.c.rival
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0005.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

scripted_trigger house_feud_competing_claims_trigger = {
	save_temporary_scope_as = house_feud_claim_temp
	root = { has_strong_claim_on = scope:house_feud_claim_temp }
	tier >= root.primary_title.tier
	holder ?= {
		NOT = { is_at_war_with = root }
	}
	root = {
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_claim_temp.holder }
	}
}

# Strong claims on land of another House
bp1_house_feud.0006 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0006.t
	desc = {
		desc = bp1_house_feud.0006.desc
		first_valid = {
		    triggered_desc = {
		        trigger = { scope:house_feud_claim.tier > root.primary_title.tier }
		        desc = bp1_house_feud.0006.higher
		    }
		    triggered_desc = {
		        trigger = { scope:house_feud_claim.tier = root.primary_title.tier }
		        desc = bp1_house_feud.0006.same
		    }
		    desc = bp1_house_feud.0006.multi
		}
		triggered_desc = {
	        trigger = { exists = scope:house_feud_previous }
	        desc = bp1_house_feud.0006.previous
	    }
	    triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = bp1_bonfire }
	left_portrait = {
		character = root
		animation = eyeroll
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 2 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Has claims on lands held by other House
		any_claim = { house_feud_competing_claims_trigger = yes }
	}

	weight_multiplier = {
		base = 1
		# Weight up for multiple claims
		modifier = {
			factor = 2
			any_claim = {
				house_feud_competing_claims_trigger = yes
				holder = {
					any_held_title = {
						count >= 3
						any_claimant = { this = root }
					}
				}
			}
		}
		# Weight up for neighboring claims
		modifier = {
			factor = 2
			any_claim = {
				house_feud_competing_claims_trigger = yes
				holder = { character_is_realm_neighbor = root }
			}
		}
		# Weight up for previously held by House
		modifier = {
			factor = 2
			any_claim = {
				house_feud_competing_claims_trigger = yes
				exists = previous_holder.house
				previous_holder.house = root.house
			}
		}
		# Weight up for rival claimant
		modifier = {
			factor = 2
			any_claim = {
				house_feud_competing_claims_trigger = yes
				holder = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
				}
			}
		}
		# Weight down for Humble/Content
		modifier = {
			factor = 0.5
			OR = {
				has_trait = humble
				has_trait = content
			}
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		random_claim = {
			limit = { house_feud_competing_claims_trigger = yes }
			weight = {
				# Weight up for multiple claims
				modifier = {
					factor = 2
					holder = {
						any_held_title = {
							count >= 3
							any_claimant = { this = root }
						}
					}
				}
				# Weight up for neighboring claims
				modifier = {
					factor = 2
					holder = { character_is_realm_neighbor = root }
				}
				# Weight up for previously held by House
				modifier = {
					factor = 2
					exists = previous_holder.house
					previous_holder.house = root.house
				}
				# Weight up for previously held by House
				modifier = {
					factor = 2
					holder = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
				}
			}
			holder = {
				save_scope_as = house_feud_rival
				ordered_held_title = {
					limit = {
						save_temporary_scope_as = house_feud_claim_temp
						root = { has_strong_claim_on = scope:house_feud_claim_temp }
						tier >= root.primary_title.tier
					}
					order_by = tier
					save_scope_as = house_feud_claim
					if = {
						limit = {
							exists = previous_holder.house
							previous_holder.house = root.house
						}
						previous_holder = { save_scope_as = house_feud_previous }
					}
				}
			}
		}
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0006.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = competing_claim
            # House Member attacker if relevant 
            ATTACKER = scope:house_feud_rival
            # House Member victim if relevant
            VICTIM = root
	    }
		stress_impact = { content = medium_stress_impact_gain }
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0006.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_rival }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_rival }
		}
		set_relation_rival = {
			target = scope:house_feud_rival
			reason = rival_house_feud_land
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = bp1_house_feud.0006.c
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# Imprisoned for a while
bp1_house_feud.0007 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0007.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					imprisoner = { is_landless_adventurer = yes }
				}
				desc = bp1_house_feud.0007.camp
			}
			triggered_desc = {
				trigger = { is_in_prison_type = house_arrest }
				desc = bp1_house_feud.0007.house_arrest
			}
			desc = bp1_house_feud.0007.dungeon
		}
		desc = bp1_house_feud.0007.desc
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}

	theme = rival_relation
	override_background = {
		trigger = { is_in_prison_type = house_arrest }
		reference = sitting_room
	}
	override_background = {
		trigger = { is_in_prison_type = dungeon }
		reference = dungeon
	}
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { is_in_prison_type = house_arrest }
			animation = prisonhouse
		}
		triggered_outfit = {
			trigger = { is_in_prison_type = dungeon }
			outfit_tags = { beggar_rags }
		}
	}
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_alive = yes
		is_imprisoned = yes
		# Imprisoned for a while
		NOT = { is_at_war_with = imprisoner }
		time_in_prison = { weeks >= 2 }
		house_head_can_start_feud_against_trigger = { TARGET = imprisoner }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			time_in_prison = { years >= 2 }
		}
		modifier = {
			factor = 2
			is_in_prison_type = dungeon
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		imprisoner = { house_feud_save_head_and_attacker_effect = yes }
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0007.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = head_imprisoned
            # House Member attacker if relevant
            ATTACKER = scope:house_feud_rival
            # House Member victim if relevant
            VICTIM = root
	    }
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0007.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			reason = rival_house_feud_imprisonment
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0007.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0007.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

scripted_trigger house_feud_close_family_prison_trigger = {
	house = root.house
	NOT = {
		has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
	}
	is_imprisoned = yes
	time_in_prison = { months >= 6 }
	imprisoner = {
		NOT = { is_at_war_with = root }
	}
	save_temporary_scope_as = close_family_temp
	root = {
		house_head_can_start_feud_against_trigger = { TARGET = scope:close_family_temp.imprisoner }
	}
}

# Close family imprisoned for a while
bp1_house_feud.0008 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0008.t
	desc = {
		desc = bp1_house_feud.0008.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:house_feud_victim.imprisoner = { is_landless_adventurer = yes }
				}
				desc = bp1_house_feud.0008.camp
			}
			triggered_desc = {
				trigger = {
					scope:house_feud_victim = { is_in_prison_type = house_arrest }
				}
				desc = bp1_house_feud.0008.house_arrest
			}
			desc = bp1_house_feud.0008.dungeon
		}
		desc = bp1_house_feud.0008.closing
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = bp1_kitchen_western }
	left_portrait = {
		character = root
		animation = anger
	}
	lower_left_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Close family member imprisoned
		any_close_family_member = { house_feud_close_family_prison_trigger = yes }
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			any_close_family_member = {
				house_feud_close_family_prison_trigger = yes
				time_in_prison = { years >= 2 }
			}
		}
		modifier = {
			factor = 2
			any_close_family_member = {
				house_feud_close_family_prison_trigger = yes
				is_in_prison_type = dungeon
			}
		}
		modifier = {
			factor = 1.25
			culture = {
				has_cultural_parameter = house_hostility_more_common
			}
		}
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		random_close_family_member = {
			limit = { house_feud_close_family_prison_trigger = yes }
			weight = {
				base = 10
				modifier = {
					add = 10
					time_in_prison = { years >= 2 }
				}
				modifier = {
					add = 10
					is_in_prison_type = dungeon
				}
			}
			save_scope_as = house_feud_victim
			imprisoner = { house_feud_save_head_and_attacker_effect = yes }
		}
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0008.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = family_imprisoned
            # House Member attacker if relevant
            ATTACKER = scope:house_feud_rival
            # House Member victim if relevant
            VICTIM = scope:house_feud_victim
	    }
		if = {
			limit = {
				scope:house_feud_victim = { is_ai = yes }
			}
			reverse_add_opinion = {
				target = scope:house_feud_victim
				modifier = house_feud_victim_feud_opinion
			}
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0008.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			reason = rival_house_feud_imprisonment
		}
		if = {
			limit = {
				scope:house_feud_victim = { is_ai = yes }
			}
			reverse_add_opinion = {
				target = scope:house_feud_victim
				modifier = house_feud_victim_rival_opinion
			}
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0008.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0008.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		if = {
			limit = {
				scope:house_feud_victim = { is_ai = yes }
			}
			reverse_add_opinion = {
				target = scope:house_feud_victim
				modifier = house_feud_victim_ignored_opinion
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# House Head killed by another house (inheritor)
bp1_house_feud.0009 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0009.t
	desc = {
		first_valid = {
		    triggered_desc = {
		        trigger = { has_character_flag = house_feud_too_young_heir }
		        desc = bp1_house_feud.0009.child
		    }
		    desc = bp1_house_feud.0009.adult
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:house_feud_rival = {
						existing_feud_against_target_trigger = { TARGET = root }
					}
				}
				desc = bp1_house_feud.0009.reciprocate
			}
			desc = bp1_house_feud.0009.new
		}
		desc = bp1_house_feud.0009.closing
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = terrain }
	left_portrait = {
		character = root
		animation = anger
	}
	lower_left_portrait = scope:old_house_head
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Age check
		age >= 9
		# Is valid feuder
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_rival }
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	}

	option = {
		name = bp1_house_feud.0009.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = head_killed
            # House Member attacker if relevant
            ATTACKER = scope:old_house_head.killer
            # House Member victim if relevant
            VICTIM = scope:old_house_head
	    }
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
			modifier = {
				factor = 1.25
				culture = { has_cultural_parameter = house_hostility_more_common }
			}
		}
	}

	option = {
		name = bp1_house_feud.0009.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		set_relation_rival = {
			target = scope:house_feud_attacker
			reason = rival_house_feud_death_of_house_head_vengeance
			involved_character = scope:old_house_head
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0009.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0009.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}

	after = {
		# Clear up flags
		if = {
			limit = { has_character_flag = house_feud_too_young_heir }
			remove_character_flag = house_feud_too_young_heir
		}
	}
}

scripted_effect house_feud_torture_flag_cleanup_effect = {
	if = {
		limit = { has_character_flag = house_feud_castration_flag }
		remove_character_flag = house_feud_castration_flag
	}
	else_if = {
		limit = { has_character_flag = house_feud_blinding_flag }
		remove_character_flag = house_feud_blinding_flag
	}
}

# House head tortured/blinded/castrated
bp1_house_feud.0010 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0010.t
	desc = {
		first_valid = {
			triggered_desc = {
		        trigger = { has_character_flag = house_feud_blinding_flag }
		        desc = bp1_house_feud.0010.blinding
		    }
		    triggered_desc = {
		        trigger = { has_character_flag = house_feud_castration_flag }
		        desc = bp1_house_feud.0010.castration
		  	}
		  	desc = bp1_house_feud.0010.torture
		}
		first_valid = {
		    triggered_desc = {
		        trigger = {	is_in_prison_type = house_arrest }
		        desc = bp1_house_feud.0010.house_arrest
		    }
		    triggered_desc = {
		        trigger = { is_in_prison_type = dungeon }
		        desc = bp1_house_feud.0010.dungeon
		    }
		    desc = bp1_house_feud.0010.free
		}
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = {
		trigger = { is_in_prison_type = house_arrest }
		reference = sitting_room
	}
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { is_in_prison_type = house_arrest }
			animation = prisonhouse
		}
	}
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		# Is valid feuder
		is_house_head = yes
		is_playable_character = yes
		house_feud_house_any_end_modifier_trigger = no
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
		house_feud_existing_feud_effect = yes
	}

	option = {
		name = bp1_house_feud.0010.a
		trigger = {
			NOT = { exists = scope:house_feud_existing }
		}
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = head_tortured
            # House Member attacker if relevant
            ATTACKER = scope:house_feud_rival
            # House Member victim if relevant
            VICTIM = root
	    }
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
			modifier = {
				factor = 1.25
				culture = { has_cultural_parameter = house_hostility_more_common }
			}
		}
	}

	option = { # Swap feud
		name = bp1_house_feud.0501.b
		trigger = {
			exists = scope:house_feud_existing
			NOT = { exists = var:house_feud_swapped_house }
		}
		house_feud_swap_feud_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = head_tortured
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			 # House Member victim if relevant
			VICTIM = root
		}
		stress_impact = {
			just = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_honor = -0.5
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0010.c
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		if = {
			limit = { has_character_flag = house_feud_blinding_flag }
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_house_head_blinded
			}
		}
		else_if = {
			limit = { has_character_flag = house_feud_castration_flag }
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_house_head_castrated
			}
		}
		else = {
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_house_head_tortured
			}
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0010.c
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0010.d
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
				ai_compassion = 0.5
			}
		}
	}

	after = { house_feud_torture_flag_cleanup_effect = yes }
}

# Close family tortured/blinded/castrated
bp1_house_feud.0011 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0011.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:house_feud_victim = { has_character_flag = house_feud_blinding_flag }
				}
				desc = bp1_house_feud.0011.blinding
			}
			triggered_desc = {
				trigger = {
					scope:house_feud_victim = { has_character_flag = house_feud_castration_flag }
				}
				desc = bp1_house_feud.0011.castration
			}
			desc = bp1_house_feud.0011.torture
		}
		first_valid = {
			triggered_desc = {
				trigger = {	
					scope:house_feud_attacker = { is_landless_adventurer = yes }
				}
				desc = bp1_house_feud.0011.camp
			}
			triggered_desc = {
				trigger = {	
					scope:house_feud_victim = { is_in_prison_type = house_arrest }
				}
				desc = bp1_house_feud.0011.house_arrest
			}
			triggered_desc = {
				trigger = {
					scope:house_feud_victim = { is_in_prison_type = dungeon }
				}
				desc = bp1_house_feud.0011.dungeon
			}
			desc = bp1_house_feud.0011.free
		}
		desc = bp1_house_feud.0011.closing
		triggered_desc = {
			trigger = { exists = scope:other_house_feud_story }
			desc = bp1_house_feud.0001.target
		}
	}
	theme = rival_relation
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Age check
		age >= 9
		# Is valid feuder
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_rival }
	}

	immediate = {
		play_music_cue = "mx_cue_negative"
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
		house_feud_existing_feud_effect = yes
	}

	option = {
		name = bp1_house_feud.0011.a
		house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_rival
            # Feud Reason
            REASON = family_tortured
            # House Member attacker if relevant
            ATTACKER = scope:house_feud_rival
            # House Member victim if relevant
            VICTIM = scope:house_feud_victim
	    }
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_feud_opinion
		}
		# Stress effects in scripted_effect
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
			modifier = {
				factor = 1.25
				culture = { has_cultural_parameter = house_hostility_more_common }
			}
		}
		
	}

	option = {
		name = bp1_house_feud.0011.b
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_attacker }
			can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		}
		if = {
			limit = {
				scope:house_feud_victim = { has_character_flag = house_feud_blinding_flag }
			}
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_blinding
				involved_character = scope:house_feud_victim
			}
		}
		else_if = {
			limit = {
				scope:house_feud_victim = { has_character_flag = house_feud_castration_flag }
			}
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_castrated
				involved_character = scope:house_feud_victim
			}
		}
		else =	{
			set_relation_rival = {
				target = scope:house_feud_attacker
				reason = rival_house_feud_torture
				involved_character = scope:house_feud_victim
			}
		}
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_rival_opinion
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0011.b
			trigger = { has_relation_rival = scope:house_feud_attacker }
		}
		name = {
			text = bp1_house_feud.0011.c
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_attacker }
			}
		}
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_ignored_opinion
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
				ai_compassion = 0.5
			}
		}
	}

	after = {
		scope:house_feud_victim = { house_feud_torture_flag_cleanup_effect = yes }
	}
}

# # House Head cuckolded (yearly)
# bp1_house_feud.0012 = {
	# type = character_event
	# content_source = dlc_006
	# title = {
		# first_valid = {
			# triggered_desc = {
				# trigger = { is_female = yes }
				# desc = bp1_house_feud.0012.t.female
			# }
			# desc = bp1_house_feud.0012.t
		# }
	# }
	# desc = {
		# desc = bp1_house_feud.0012.desc
		# first_valid = {
			# triggered_desc = {
				# trigger = {
					# has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:house_feud_victim }
				# }
				# desc = bp1_house_feud.0012.bad
			# }
			# desc = bp1_house_feud.0012.good
		# }
		# triggered_desc = {
			# trigger = { exists = scope:other_house_feud_story }
			# desc = bp1_house_feud.0001.target
		# }
	# }
	# theme = rival_relation
	# override_background = { reference = relaxing_room }
	# left_portrait = {
		# character = root
		# animation = rage
	# }
	# lower_left_portrait = scope:house_feud_spouse
	# lower_right_portrait = scope:house_feud_attacker
	# cooldown = { years = 10 }

	# trigger = {
		# #DLC check
		# has_bp1_dlc_trigger = yes
		# #Standard checks
		# is_available_adult = yes
		# # Is valid feuder
		# is_house_head = yes
		# is_playable_character = yes
		# house_feud_house_any_end_modifier_trigger = no
		# # Someone to feud with
		# any_spouse = {
			# any_targeting_secret = {
				# secret_type = secret_lover
				# is_known_by = root
				# secret_owner = { save_temporary_scope_as = cuckolder_temp }
				# root = {
					# house_head_can_start_feud_against_trigger = { TARGET = scope:cuckolder_temp }
					# NOT = {
						# any_owned_story = {
							# story_type = story_cycle_house_feud
							# var:house_feud_house.house_head = scope:cuckolder_temp.house.house_head
						# }
					# }
				# }
			# }
		# }
	# }

	# weight_multiplier = {
		# base = 1
		# modifier = {
			# factor = 2
			# any_spouse = {
				# any_targeting_secret = {
					# secret_type = secret_lover
					# is_known_by = root
					# secret_owner = {
						# has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
						# save_temporary_scope_as = cuckolder_temp
					# }
				# }
				# root = {
					# house_head_can_start_feud_against_trigger = { TARGET = scope:cuckolder_temp }
					# NOT = {
						# any_owned_story = {
							# story_type = story_cycle_house_feud
							# var:house_feud_house.house_head = scope:cuckolder_temp.house.house_head
						# }
					# }
					
				# }
			# }

		# }
		# modifier = {
			# factor = 1.25
			# culture = { has_cultural_parameter = house_hostility_more_common }
		# }
	# }

	# immediate = {
		# play_music_cue = "mx_cue_negative"
		# save_scope_as = house_feud_victim
		# random_spouse = {
			# limit = {	
				# any_targeting_secret = {
					# secret_type = secret_lover
					# is_known_by = root
					# secret_owner = { save_temporary_scope_as = cuckolder_temp }
					# root = {
						# house_head_can_start_feud_against_trigger = { TARGET = scope:cuckolder_temp }
						# NOT = {
							# any_owned_story = {
								# story_type = story_cycle_house_feud
								# var:house_feud_house.house_head = scope:cuckolder_temp.house.house_head
							# }
						# }
					# }
				# }
			# }
			# weight = {
				# modifier = {
					# factor = 10
					# this = root.primary_spouse
				# }
			# }
			# save_scope_as = house_feud_spouse
			# random_targeting_secret = {
				# limit = {
					# secret_type = secret_lover
					# is_known_by = root
					# secret_owner = { save_temporary_scope_as = cuckolder_temp }
					# root = {
						# house_head_can_start_feud_against_trigger = { TARGET = scope:cuckolder_temp }
						# NOT = {
							# any_owned_story = {
								# story_type = story_cycle_house_feud
								# var:house_feud_house.house_head = scope:cuckolder_temp.house.house_head
							# }
						# }
					# }
				# }
				# secret_owner = { house_feud_save_head_and_attacker_effect = yes }
			# }
		# }
		# save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
		# house_feud_existing_feud_effect = yes
	# }

	# option = {
		# name = bp1_house_feud.0012.a
		# trigger = {
			# NOT = { exists = scope:house_feud_existing }
		# }
		# house_feud_start_effect = {
            # # Feuding House Head
            # ACTOR = root
            # # Target House Head
            # TARGET = scope:house_feud_rival
            # # Feud Reason
            # REASON = head_cuckolded
            # # House Member attacker if relevant
            # ATTACKER = scope:house_feud_attacker
            # # House Member victim if relevant
            # VICTIM = root
	    # }
		# # Stress effects in scripted_effect
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = 1
				# ai_vengefulness = 1
			# }
		# }
	# }

	# option = { # Swap feud
		# name = bp1_house_feud.0501.b
		# trigger = {
			# exists = scope:house_feud_existing
			# NOT = { exists = var:house_feud_swapped_house }
		# }
		# house_feud_swap_feud_effect = {
			# # Feuding House Head
			# ACTOR = root
			# # Target House Head
			# TARGET = scope:house_feud_attacker
			# # Feud Reason
			# REASON = head_cuckolded
			# # House Member attacker if relevant
			# ATTACKER = scope:house_feud_attacker
			 # # House Member victim if relevant
			# VICTIM = root
		# }
		# stress_impact = {
			# just = medium_stress_impact_gain
			# forgiving = medium_stress_impact_gain
		# }
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_honor = -0.5
				# ai_boldness = 1
				# ai_vengefulness = 1
			# }
		# }
	# }

	# option = {
		# name = bp1_house_feud.0012.c
		# trigger = {
			# NOT = { has_relation_rival = scope:house_feud_attacker }
			# can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		# }
		# set_relation_rival = {
			# target = scope:house_feud_attacker
			# reason = rival_house_feud_cuckold
			# involved_character = scope:house_feud_spouse
		# }
		# stress_impact = {
			# forgiving = minor_stress_impact_gain
		# }
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -0.5
				# ai_vengefulness = 0.5
			# }
		# }
	# }

	# option = {
		# name = {
			# text = bp1_house_feud.0012.c
			# trigger = { has_relation_rival = scope:house_feud_attacker }
		# }
		# name = {
			# text = bp1_house_feud.0012.d
			# trigger = {
				# NOT = { has_relation_rival = scope:house_feud_attacker }
			# }
		# }
		# house_feud_vengeful_stress_effect = yes
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -1
				# ai_vengefulness = -1
			# }
		# }
	# }
# }

# # House Head cuckolded (on reveal)
# bp1_house_feud.0013 = {
	# type = character_event
	# content_source = dlc_006
	# title = bp1_house_feud.0013.t
	# desc = {
		# desc = bp1_house_feud.0013.desc
		# first_valid = {
			# triggered_desc = {
				# trigger = {
					# has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:house_feud_victim }
				# }
				# desc = bp1_house_feud.0012.bad
			# }
			# desc = bp1_house_feud.0012.good
		# }
		# triggered_desc = {
			# trigger = { exists = scope:other_house_feud_story }
			# desc = bp1_house_feud.0001.target
		# }
	# }
	# theme = rival_relation
	# override_background = { reference = relaxing_room }
	# left_portrait = {
		# character = root
		# animation = anger
	# }
	# lower_left_portrait = scope:house_feud_spouse
	# lower_right_portrait = scope:house_feud_attacker
	# cooldown = { years = 5 }

	# trigger = {
		# #DLC check
		# has_bp1_dlc_trigger = yes
		# # Is valid feuder
		# is_available_adult = yes
		# is_house_head = yes
		# is_playable_character = yes
		# house_feud_house_any_end_modifier_trigger = no
	# }

	# immediate = {
		# play_music_cue = "mx_cue_negative"
		# save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
		# house_feud_existing_feud_effect = yes
	# }

	# option = {
		# name = bp1_house_feud.0013.a
		# trigger = {
			# NOT = { exists = scope:house_feud_existing }
		# }
		# house_feud_start_effect = {
            # # Feuding House Head
            # ACTOR = root
            # # Target House Head
            # TARGET = scope:house_feud_rival
            # # Feud Reason
            # REASON = head_cuckolded
            # # House Member attacker if relevant
            # ATTACKER = scope:house_feud_attacker
            # # House Member victim if relevant
            # VICTIM = root
	    # }
		# # Stress effects in scripted_effect
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = 1
				# ai_vengefulness = 1
			# }
			# modifier = {
				# factor = 1.25
				# culture = { has_cultural_parameter = house_hostility_more_common }
			# }
		# }
	# }

	# option = { # Swap feud
		# name = bp1_house_feud.0501.b
		# trigger = {
			# exists = scope:house_feud_existing
			# NOT = { exists = var:house_feud_swapped_house }
		# }
		# house_feud_swap_feud_effect = {
			# # Feuding House Head
			# ACTOR = root
			# # Target House Head
			# TARGET = scope:house_feud_attacker
			# # Feud Reason
			# REASON = head_cuckolded
			# # House Member attacker if relevant
			# ATTACKER = scope:house_feud_attacker
			 # # House Member victim if relevant
			# VICTIM = root
		# }
		# stress_impact = {
			# just = medium_stress_impact_gain
			# forgiving = medium_stress_impact_gain
		# }
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_honor = -0.5
				# ai_boldness = 1
				# ai_vengefulness = 1
			# }
		# }
	# }

	# option = {
		# name = bp1_house_feud.0013.c
		# trigger = {
			# NOT = { has_relation_rival = scope:house_feud_attacker }
			# can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		# }
		# set_relation_rival = {
			# target = scope:house_feud_attacker
			# reason = rival_house_feud_cuckold
			# involved_character = scope:house_feud_spouse
		# }
		# stress_impact = {
			# forgiving = minor_stress_impact_gain
		# }
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -0.5
				# ai_vengefulness = 0.5
			# }
		# }
	# }

	# option = {
		# name = {
			# text = bp1_house_feud.0013.c
			# trigger = { has_relation_rival = scope:house_feud_attacker }
		# }
		# name = {
			# text = bp1_house_feud.0013.d
			# trigger = {
				# NOT = { has_relation_rival = scope:house_feud_attacker }
			# }
		# }
		# house_feud_vengeful_stress_effect = yes
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -1
				# ai_vengefulness = -1
			# }
		# }
	# }
# }

# # Close family of House Head cuckolded (on reveal)
# bp1_house_feud.0014 = {
	# type = character_event
	# content_source = dlc_006
	# title = bp1_house_feud.0014.t
	# desc = {
		# desc = bp1_house_feud.0014.desc
		# triggered_desc = {
			# trigger = { exists = scope:other_house_feud_story }
			# desc = bp1_house_feud.0001.target
		# }
	# }
	# theme = rival_relation
	# override_background = { reference = bp1_wine_cellar }
	# left_portrait = {
		# character = root
		# animation = worry
	# }
	# right_portrait = {
		# character = scope:house_feud_victim
		# animation = rage
	# }
	# lower_left_portrait = scope:house_feud_spouse
	# lower_right_portrait = scope:house_feud_attacker
	# cooldown = { years = 5 }

	# trigger = {
		# #DLC check
		# has_bp1_dlc_trigger = yes
		# # Is valid feuder
		# is_available_adult = yes
		# house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_attacker }
	# }

	# immediate = {
		# play_music_cue = "mx_cue_negative"
		# save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_rival SELF = root }
	# }

	# option = {
		# name = bp1_house_feud.0014.a
		# house_feud_start_effect = {
            # # Feuding House Head
            # ACTOR = root
            # # Target House Head
            # TARGET = scope:house_feud_rival
            # # Feud Reason
            # REASON = family_cuckolded
            # # House Member attacker if relevant
            # ATTACKER = scope:house_feud_attacker
            # # House Member victim if relevant
            # VICTIM = scope:house_feud_victim
	    # }
		# reverse_add_opinion = {
			# target = scope:house_feud_victim
			# modifier = house_feud_victim_feud_opinion
		# }
		# # Stress effects in scripted_effect
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = 1
				# ai_vengefulness = 1
			# }
			# modifier = {
				# factor = 1.25
				# culture = { has_cultural_parameter = house_hostility_more_common }
			# }
		# }
	# }

	# option = {
		# name = bp1_house_feud.0014.b
		# trigger = {
			# NOT = { has_relation_rival = scope:house_feud_attacker }
			# can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_attacker }
		# }
		# set_relation_rival = {
			# target = scope:house_feud_attacker
			# reason = rival_house_feud_cuckold_family
			# involved_character = scope:house_feud_victim
		# }
		# reverse_add_opinion = {
			# target = scope:house_feud_victim
			# modifier = house_feud_victim_rival_opinion
		# }
		# stress_impact = {
			# forgiving = minor_stress_impact_gain
		# }
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -0.5
				# ai_vengefulness = 0.5
			# }
		# }
	# }

	# option = {
		# name = {
			# text = bp1_house_feud.0014.b
			# trigger = { has_relation_rival = scope:house_feud_attacker }
		# }
		# name = {
			# text = bp1_house_feud.0014.c
			# trigger = {
				# NOT = { has_relation_rival = scope:house_feud_attacker }
			# }
		# }
		# reverse_add_opinion = {
			# target = scope:house_feud_victim
			# modifier = house_feud_victim_ignored_opinion
		# }
		# house_feud_vengeful_stress_effect = yes
		# ai_chance = {
			# base = 25
			# ai_value_modifier = {
				# ai_boldness = -1
				# ai_vengefulness = -1
			# }
		# }
	# }
# }

##############################
##############################
####### ONGOING EVENTS #######
##############################
##############################

# bp1_house_feud.0100 - feud house is higher rank
# bp1_house_feud.0110 - feud house is lower rank
# bp1_house_feud.0200 - losing feud, start scheme
# bp1_house_feud.0210 - more deaths and recent one
# bp1_house_feud.0220 - more kills
# bp1_house_feud.0300 - long running feud
# bp1_house_feud.0410 - house members pleading to stop feud
# bp1_house_feud.0420 - liege tries to be a peacemaker

# Jealous of higher rank
bp1_house_feud.0100 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0100.t
	desc = bp1_house_feud.0100.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = worry
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 25 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Other house is higher overall rank
		exists = scope:story.var:house_feud_house.house_head
		scope:story = {
			OR = {
				var:house_feud_house.house_head.primary_title.tier > root.primary_title.tier
				AND = {
					var:house_feud_house.house_head = { is_landed = yes }
					root = { is_landed = no }
				}
			}
			var:house_feud_length_counter >= 5
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			tier_difference = {
				target = scope:story.var:house_feud_house.house_head
				value <= -2
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_trait = content
				has_trait = humble
			}
		}
	}

	option = {
		name = bp1_house_feud.0100.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		stress_impact = {
			base = minor_stress_impact_gain
			humble = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			content = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0100.b
		add_prestige = medium_prestige_loss
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		stress_impact = {
			base = minor_stress_impact_loss
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# Scorning lower rank
bp1_house_feud.0110 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0110.t
	desc = bp1_house_feud.0110.desc
	theme = rival_relation
	override_background = { reference = garden }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 25 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Other house is lower overall rank
		exists = scope:story.var:house_feud_house.house_head
		scope:story = {
			var:house_feud_house.house_head = {
				OR = {
					primary_title.tier < root.primary_title.tier
					is_landed = no
				}
			}
			var:house_feud_length_counter >= 5
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			OR = {
				scope:story.var:house_feud_house.house_head = { is_landed = no }
				tier_difference = {
					target = scope:story.var:house_feud_house.house_head
					value >= 2
				}
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_trait = arrogant
				has_trait = ambitious
			}
		}
	}

	option = { # Justice must be served
		name = bp1_house_feud.0110.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		stress_impact = {
			base = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = { # They are beneath our energies
		name = bp1_house_feud.0110.b
		add_prestige = medium_prestige_gain
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		stress_impact = {
			base = minor_stress_impact_loss
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
			}
		}
	}
}

# Feud house has killed more members than we have, start scheme?
bp1_house_feud.0200 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0200.t
	desc = bp1_house_feud.0200.desc
	theme = rival_relation
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_center_portrait = scope:house_feud_target
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# We have more deaths than kills
		scope:story = {
			exists = var:house_feud_death_counter
			exists = var:house_feud_kill_counter
			house_feud_death_counter_value > house_feud_kill_counter_value
			# Eligible scheme target exists
			exists = var:house_feud_house
			var:house_feud_house = {
				any_house_member = { house_feud_scheme_target_trigger = yes }
			}
		}
	}

	immediate = {
		scope:house_feud_rival.house = {
			while = {
				limit = {
					any_in_list = {
						list = house_feud_scheme_targets
						count < 2
					}
					any_house_member = {
						is_available_healthy_adult = yes
						house_feud_scheme_target_trigger = yes
					}
				}
				random_house_member = {
					limit = { house_feud_scheme_target_trigger = yes }
					weight = {
						modifier = {
							factor = 2
							exists = scope:house_feud_rival.primary_heir
							this = scope:house_feud_rival.primary_heir
						}
						modifier = {
							factor = 2
							age < 50
						}
					}
					add_to_list = house_feud_scheme_targets
				}
			}
			ordered_in_list = {
				list = house_feud_scheme_targets
				order_by = age
				save_scope_as = house_feud_target
			}
		}
	}

	option = {
		name = bp1_house_feud.0200.a
		trigger = {
			NOT = {
				is_scheming_against = { target = scope:house_feud_rival }
			}
			can_start_scheme = {
				type = murder
				target_character = scope:house_feud_rival
			}
		}
		start_scheme = {
			target_character = scope:house_feud_rival
			type = murder
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
				ai_honor = -1
			}
		}
	}

	option = {
		name = bp1_house_feud.0200.b
		start_scheme = {
			target_character = scope:house_feud_target
			type = murder
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
				ai_honor = -1
			}
		}
	}

	option = {
		name = bp1_house_feud.0200.c
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_vengefulness = 0.5
				ai_honor = 0.5
			}
		}
	}

	option = {
		name = bp1_house_feud.0200.d
		add_prestige = medium_prestige_loss
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
				ai_honor = -0.5
			}
		}
	}
}

# Losing, cut losses?
bp1_house_feud.0210 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0210.t
	desc = {
		desc = bp1_house_feud.0210.desc
		triggered_desc = {
			trigger = { exists = scope:house_feud_recent_death }
			desc = bp1_house_feud.0210.recent
		}
	}
	theme = rival_relation
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:house_feud_recent_death
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Losing feud which has been going at least 5 years
		scope:story = {
			exists = var:house_feud_length_counter
			var:house_feud_length_counter >= 5
			exists = var:house_feud_death_counter
			exists = var:house_feud_kill_counter
			house_feud_death_counter_value > house_feud_kill_counter_value
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 10
			scope:story = { exists = var:house_feud_recent_death }
		}
	}

	immediate = {		
		scope:story = {
			if = {
				limit = { exists = var:house_feud_recent_death }
				var:house_feud_recent_death = { save_scope_as = house_feud_recent_death }
			}
		}
	}

	option = { # Continue feud
		name = bp1_house_feud.0210.a
		stress_impact = {
			base = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = 1
				ai_vengefulness = 1
			}
		}
	}

	option = { # End feud
		name = bp1_house_feud.0210.b
		add_prestige = medium_prestige_loss
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1
				ai_vengefulness = -1
				ai_honor = -0.5
			}
		}
	}
}

# Winning, end it?
bp1_house_feud.0220 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0220.t
	desc = {
		desc = bp1_house_feud.0220.desc
		triggered_desc = {
			trigger = { exists = scope:house_feud_recent_kill }
			desc = bp1_house_feud.0220.recent
		}
	}
	theme = rival_relation
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:house_feud_recent_kill
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Winning feud which has been going at least 5 years
		scope:story = {
			exists = var:house_feud_length_counter
			var:house_feud_length_counter >= 5
			exists = var:house_feud_death_counter
			exists = var:house_feud_kill_counter
			house_feud_death_counter_value < house_feud_kill_counter_value
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			scope:story = { exists = var:house_feud_recent_kill }
		}
	}

	immediate = {
		scope:story = {
			if = {
				limit = { exists = var:house_feud_recent_kill }
				var:house_feud_recent_kill = { save_scope_as = house_feud_recent_kill }
			}
		}
	}

	option = {
		name = bp1_house_feud.0220.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		stress_impact = {
			base = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0220.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# End long running feud?
bp1_house_feud.0300 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0300.t
	desc = bp1_house_feud.0300.desc
	theme = rival_relation
	override_background = { reference = sitting_room }
	left_portrait = {
		character = root
		animation = boredom
	}
	lower_left_portrait = scope:house_feud_attacker
	lower_center_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Not the original feud starter
		any_owned_story = {
			story_type = story_cycle_house_feud
			var:house_feud_length_counter >= 5
			var:house_feud_first_owner = { is_alive = no }
			var:house_feud_first_rival = { is_alive = no }
			var:house_feud_attacker = { is_alive = no }
			var:house_feud_victim = { is_alive = no }
		}
	}

	immediate = {
		scope:story.var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
		scope:story.var:house_feud_attacker = { save_scope_as = house_feud_attacker }
		scope:story.var:house_feud_victim = { save_scope_as = house_feud_victim }
	}

	option = {
		name = bp1_house_feud.0300.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		stress_impact = {
			base = minor_stress_impact_gain
			forgiving = major_stress_impact_gain
			just = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
				ai_honor = -0.5
			}
		}
	}

	option = {
		name = bp1_house_feud.0300.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
				ai_honor = 0.5
			}
		}
	}
}

# House members pleading to stop feud
bp1_house_feud.0410 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0410.t
	desc = bp1_house_feud.0410.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = disapproval
	}
	right_portrait = {
		character = scope:house_feud_victim
		animation = beg
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		scope:story.var:house_feud_length_counter >= 3
		# House member is friendly with feuding house member
		exists = house
		house = {
			any_house_member = {
				is_available_ai_adult = yes
				NOT = { this = root }
				NOT = {
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
				}
				NOT = { has_trait = vengeful }
				AND = {
					exists = scope:story.var:house_feud_house.house_head
					NOT = {
						has_opinion_modifier = {
							target = scope:story.var:house_feud_house.house_head
							modifier = house_feud_opinion
						}
					}
				}
			}
		}
	}

	immediate = {
		house = {
			random_house_member = {
				limit = {
					is_available_ai_adult = yes
					NOT = {
						this = root
					}
					NOT = {
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
					NOT = { has_trait = vengeful }
					AND = {
						exists = scope:story.var:house_feud_house.house_head
						NOT = {
							has_opinion_modifier = {
								target = scope:story.var:house_feud_house.house_head
								modifier = house_feud_opinion
							}
						}
					}
				}
				weight = {
					modifier = {
						factor = 2
						has_trait = paranoid
					}
					modifier = {
						factor = 10
						is_powerful_vassal_of = root
					}
					modifier = {
						factor = 10
						is_landed = yes
					}
				}
				save_scope_as = house_feud_victim
			}
		}
		scope:house_feud_victim = {
			stress_impact = {
				base = medium_stress_impact_gain
				paranoid = medium_stress_impact_gain
			}
		}
		scope:story.var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
	}

	option = {
		name = bp1_house_feud.0410.a
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_liege_cancelled_opinion
		}
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}

	option = {
		name = bp1_house_feud.0410.b
		custom_tooltip = story_cycle_house_feud_continue_tt
		reverse_add_opinion = {
			target = scope:house_feud_victim
			modifier = house_feud_victim_ignored_opinion
		}
		stress_impact = {
			paranoid = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}
}

# Liege attempts to negotiate peace
bp1_house_feud.0420 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0420.t
	desc = bp1_house_feud.0420.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = eyeroll
	}
	lower_left_portrait = scope:house_feud_liege
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		scope:story.var:house_feud_length_counter >= 3
		exists = liege
		exists = scope:story.var:house_feud_house.house_head
		exists = scope:story.var:house_feud_house.house_head.liege
		liege = scope:story.var:house_feud_house.house_head.liege
		liege = {
			is_available_ai_adult = yes
			NOT = {
				has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
			}
			NOT = {
				has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:story.var:house_feud_house.house_head }
			}
		}
	}

	immediate = {
		liege = { save_scope_as = house_feud_liege }
		scope:story.var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
	}

	option = {
		name = bp1_house_feud.0420.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		reverse_add_opinion = {
			target = scope:house_feud_liege
			modifier = house_feud_liege_maintained_opinion
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
			craven = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0420.b
		reverse_add_opinion = {
			target = scope:house_feud_liege
			modifier = house_feud_liege_cancelled_opinion
		}
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

#############################
#############################
####### TARGET EVENTS #######
#############################
#############################

# bp1_house_feud.0500 - decide to start feud with feuders ongoing
# bp1_house_feud.0501 - informed of feud starting against you
# bp1_house_feud.0502 - informed of feud against you ending

# Feud targets decide whether to reciprocate during
bp1_house_feud.0500 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0500.t
	desc = bp1_house_feud.0500.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = worry
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 2 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		# Ensure feud exists
		scope:house_feud_rival = {
			existing_feud_against_target_trigger = { TARGET = root }
		}
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_rival }
	}

	immediate = {		
		set_variable = {
			name = house_feud_reciprocate_cooldown
			value = scope:house_feud_rival.house
			years = 10
		}
	}

	option = {
		name = bp1_house_feud.0500.a
		house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_rival
			# Feud Reason
			REASON = reciprocated_rivalry
			# House Member attacker if relevant 
			ATTACKER = scope:house_feud_rival
			# House Member victim if relevant
			VICTIM = root
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0500.b
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Feud target informed of feud at outset
bp1_house_feud.0501 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0501.t
	desc = {
		first_valid = {
		    triggered_desc = {
		       trigger = {
					existing_feud_against_target_trigger = { TARGET = scope:house_feud_rival }
				}
		        desc = bp1_house_feud.0501.reciprocating
		    }
		    desc = bp1_house_feud.0501.new
		}
		desc = bp1_house_feud.0501.desc
	}
	theme = rival_relation
	override_background = { reference = sitting_room }
	left_portrait = {
		character = root
		animation = eyeroll
	}
	lower_right_portrait = scope:story.story_owner
	cooldown = { months = 6 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		is_playable_character = yes
		NOR = {
			# Only one Feud can be started per lifetime
			has_character_flag = had_house_feud_story
			exists = var:house_feud_reciprocate_cooldown
		}
		house_feud_house_any_end_modifier_trigger = no
		house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_attacker }
	}

	immediate = {
		save_targeting_house_feud_story_effect = { RIVAL = scope:house_feud_attacker SELF = root }
		show_as_tooltip = {
			if = {
				limit = { has_relation_nemesis = scope:house_feud_attacker }
				set_relation_nemesis = scope:house_feud_attacker #Show as tooltip does not require reason
			}
			else = { set_relation_rival = scope:house_feud_attacker } #Show as tooltip does not require reason
			if = {
				limit = {
					scope:story.story_owner = { is_ai = yes }
				}
				reverse_add_opinion = {
					target = scope:house_feud_attacker
					modifier = house_feud_opinion
				}
			}
		}
		house_feud_existing_feud_effect = yes
		set_variable = {
			name = house_feud_reciprocate_cooldown
			value = scope:house_feud_attacker.house
			years = 5
		}
	}

	option = { # Reciprocate
		name = bp1_house_feud.0501.a
		trigger = {
			NOT = { exists = scope:house_feud_existing }
		}
	    house_feud_start_effect = {
            # Feuding House Head
            ACTOR = root
            # Target House Head
            TARGET = scope:house_feud_attacker
            # Feud Reason
            REASON = reciprocated_rivalry
            # House Member attacker if relevant 
            ATTACKER = scope:house_feud_attacker
            # House Member victim if relevant
            VICTIM = root
        }
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = { # Swap feud
		name = bp1_house_feud.0501.b
		trigger = {
			exists = scope:house_feud_existing
			NOT = { exists = var:house_feud_swapped_house }
		}
		house_feud_swap_feud_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = reciprocated_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			 # House Member victim if relevant
			VICTIM = root
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_rationality = -1
			}
		}
	}

	option = { # Who cares
		name = {
			text = bp1_house_feud.0501.c.busy
			trigger = { exists = scope:house_feud_existing }
		}
		name = {
			text = bp1_house_feud.0501.c.existing
			trigger = {
				existing_feud_against_target_trigger = { TARGET = scope:house_feud_rival }
			}
		}
		name = {
			text = bp1_house_feud.0501.c
			trigger = {
				NOR = {
					exists = scope:house_feud_existing
					existing_feud_against_target_trigger = { TARGET = scope:house_feud_rival }
				}
			}
		}
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Feud target informed of feud end
bp1_house_feud.0502 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0502.t
	desc = {
		desc = bp1_house_feud.0502.desc
		first_valid = {
		    triggered_desc = {
		        trigger = { exists = scope:house_feud_new }
		        desc = bp1_house_feud.0502.another
		    }
		    desc = bp1_house_feud.0502.peace
		}
	}
	theme = rival_relation
	left_portrait = {
		character = root
		animation = worry
	}
	lower_right_portrait = scope:house_feud_attacker

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		NAND = {
			exists = house
			house = { exists = var:house_feud_ended }
		}
	}

	immediate = {		
		house_feud_existing_feud_effect = yes
		scope:house_feud_attacker = {
			house.house_head = { save_scope_as = house_feud_rival }
			if = {
				limit = {
					any_owned_story = {
						story_type = story_cycle_house_feud
						exists = var:house_feud_house
					}
				}
				random_owned_story = {
					limit = {
						story_type = story_cycle_house_feud
						exists = var:house_feud_house
					}
					var:house_feud_house.house_head = { save_scope_as = house_feud_new }
				}
			}
		}
	}

	option = { # Start feud
		name = bp1_house_feud.0502.a
		trigger = {
			NOT = { exists = scope:house_feud_existing }
			house_head_can_start_feud_against_trigger = { TARGET = scope:house_feud_attacker }
		}
		house_feud_start_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = reciprocated_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			# House Member victim if relevant
			VICTIM = root
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = { # End feud too
		name = bp1_house_feud.0502.b
		trigger = {
			existing_feud_against_target_trigger = { TARGET = scope:house_feud_attacker }
		}
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_boldness = 0.5
			}
		}
	}

	option = { # Swap feud
		name = bp1_house_feud.0502.c
		trigger = {
			exists = scope:house_feud_existing
			NOT = { exists = var:house_feud_swapped_house }
		}
		house_feud_swap_feud_effect = {
			# Feuding House Head
			ACTOR = root
			# Target House Head
			TARGET = scope:house_feud_attacker
			# Feud Reason
			REASON = reciprocated_rivalry
			# House Member attacker if relevant
			ATTACKER = scope:house_feud_attacker
			 # House Member victim if relevant
			VICTIM = root
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -0.5
				ai_boldness = 0.5
			}
		}
	}
	
	option = { # Ok
		name = bp1_house_feud.0502.d
		stress_impact = {
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

#############################
#############################
#### NOTIFICATION EVENTS ####
#############################
#############################

# bp1_house_feud.0600 - house members decide to adopt feud too

# House Member decides whether to adopt feud
bp1_house_feud.0600 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0600.t
	desc = bp1_house_feud.0600.desc
	theme = rival_relation
	override_background = { reference = relaxing_room }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:house_head_scope
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 10 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		#
		is_adult = yes
		in_diplomatic_range = scope:house_feud_rival
		NOR = {
			this = this.house.house_head
			has_opinion_modifier = {
				target = scope:house_feud_rival
				modifier = house_feud_opinion
			}
		}
	}

	immediate = {
		house.house_head = { save_scope_as = house_head_scope }
	}

	option = {
		name = bp1_house_feud.0600.a
		trigger = {
			NOT = { has_relation_rival = scope:house_feud_rival }
		}
		if = {
			limit = {
				is_ai = yes
				scope:house_feud_rival = { is_alive = yes }
			}
			add_opinion = {
				target = scope:house_feud_rival
				modifier = house_feud_opinion
			}
		}
		if = {
			limit = {
				scope:house_head_scope = {
					is_ai = yes
					is_alive = yes
				}
			}
			reverse_add_opinion = {
				target = scope:house_head_scope
				modifier = house_feud_followed_opinion
			}
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_boldness = 0.5
			}
		}
	}

	option = {
		name = bp1_house_feud.0600.b
		trigger = { has_relation_rival = scope:house_feud_rival }
		if = {
			limit = {
				is_ai = yes
				scope:house_feud_rival = { is_alive = yes }
			}
			add_opinion = {
				target = scope:house_feud_rival
				modifier = house_feud_opinion
			}
		}
		if = {
			limit = {
				scope:house_head_scope = {
					is_ai = yes
					is_alive = yes
				}
			}
			reverse_add_opinion = {
				target = scope:house_head_scope
				modifier = house_feud_enthusiast_opinion
			}
		}
		stress_impact = {
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0600.c
		if = {
			limit = {
				scope:house_head_scope = {
					is_ai = yes
					is_alive = yes
				}
			}
			reverse_add_opinion = {
				target = scope:house_head_scope
				modifier = house_feud_ignored_opinion
			}
		}
		stress_impact = {
			vengeful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

#############################
#############################
####### SCHEME EVENTS #######
#############################
#############################

# bp1_house_feud.0700 - seduction hard rejection choice for feuders
# bp1_house_feud.0701 - seduction hard rejection ping for seducer

#Target: hard reject choice
#by Joe Parkin, based on seduce_outcome.8101 by Linnéa Thimrén
bp1_house_feud.0700 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0700.t
	desc = {
		desc = bp1_house_feud.0700.desc
		first_valid = {
			#It's love!
			triggered_desc = {
				trigger = { has_relation_potential_lover = scope:owner }
				desc = bp1_house_feud.0700.desc_positive
			}
			#I hate them / it's forbidden!
			triggered_desc = {
				trigger = {
					OR = {
						opinion = {
							target = scope:owner
							value < 0
						}
						has_relation_rival = scope:owner
					}
				}
				desc = bp1_house_feud.0700.desc_negative
			}
			#Neutral
			desc = bp1_house_feud.0700.desc_neutral
		}
	}
	
	theme = seduce_scheme
	left_portrait = scope:owner

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes  
		exists = scope:scheme
		scope:owner = { is_alive = yes }
	}

	immediate = {
		scope:owner = { save_scope_as = house_feud_rival }
		hidden_effect = {
			#For clearer and more controllable ai outcomes, we determine the outcome here:

			#HARD REJECT OR NOT?
			if = { #Guaranteed acceptance
				limit = { scope:owner = { has_perk = subtle_desire_perk } }
				save_scope_value_as = {
					name = house_feud_seduction_outcome
					value = flag:accept
				}
			}
			else = { #Randomization
				random = {
					chance = 50
					simple_attraction_modifier = {
						WHO = scope:target
						TARGET = scope:owner
						MAX_PERSONALITY = 150 # -150 at low trait combatibility, +150 at high trait combatibility.
						MAX_PHYSICAL = 150 # Will be -25 by default (due to Rakish) but can vary from between -150 and +150 due to other Attraction modifiers.
					}
					save_scope_value_as = {
						name = house_feud_seduction_outcome
						value = flag:accept
					}					
				}	
				if = {
					limit = { NOT = { exists = scope:house_feud_seduction_outcome } }
					save_scope_value_as = {
						name = house_feud_seduction_outcome
						value = flag:reject
					}
				}
			}
		}
	}

	option = { #Ew, get out of here
		name = bp1_house_feud.0700.a
		trigger = {
			trigger_if = {
				limit = {
					scope:owner = { has_perk = graceful_recovery_perk }
			    }
			    is_ai = no
			}
		}
		reverse_add_opinion = {
			target = scope:owner
			modifier = refusal_opinion
			opinion = -20
		}
		seduction_block_character_effect = { CHARACTER = scope:owner }
		scope:owner = {
			trigger_event = bp1_house_feud.0701
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 100
				exists = scope:incest_outcome
				scope:incest_outcome = flag:reject_no_reveal
			}
		}
	}

	option = { #This is more important than family!
		name = bp1_house_feud.0700.b
		custom_tooltip = seduce_outcome.8101.b.tt
		ai_chance = {
			base = 0
			modifier = {
				add = 100
				exists = scope:house_feud_seduction_outcome
				scope:house_feud_seduction_outcome = flag:accept
			}
		}
	}
}

#Seducer: hard reject ping
#by Joe Parkin, based on seduce_outcome.8103 by Linnéa Thimrén
bp1_house_feud.0701 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0701.t
	desc = bp1_house_feud.0701.desc
	
	theme = seduce_scheme
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	immediate = {
		scope:target = {
			if = {
				limit = { root = { is_ai = no }	}
				assign_quirk_effect = yes
			}
		}
	}

	option = {
		name = bp1_house_feud.0701.a
		custom_tooltip = seduce_outcome.blocked_from_seduction

		scope:target = { seduction_block_character_effect = { CHARACTER = scope:owner } }

		if = {
			limit = { exists = scope:scheme }
			scope:scheme = {
				end_scheme = yes
			}
		}
		
		reverse_add_opinion = {
			target = scope:target
			modifier = respect_opinion
			opinion = -25
		}
	}
}

##############################
##############################
####### REVENGE EVENTS #######
##############################
##############################

# bp1_house_feud.7000 - original claim achieved
# bp1_house_feud.7001 - original killer killed
# bp1_house_feud.7002 - original torturer tortured
# bp1_house_feud.7003 - original cuckolder cuckolded

# Original claim achieved
bp1_house_feud.7000 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.7000.t
	desc = bp1_house_feud.7000.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = war_over_win
	}
	lower_left_portrait = {
		character = scope:previous_holder_scope
		trigger = {
			NOT = { scope:previous_holder_scope = scope:house_feud_rival }
		}
	}
	lower_right_portrait = scope:house_feud_rival
	cooldown = { years = 100 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		# Story still going
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = {
		random_owned_story = {
			limit = { story_type = story_cycle_house_feud }
			change_variable = {
				name = house_feud_kill_counter
				add = house_feud_big_counter_value
			}
			var:house_feud_title = {
				save_scope_as = house_feud_title
				if = {
					limit  = { exists = previous_holder }
					previous_holder = { save_scope_as = previous_holder_scope }
				}
			}
			save_scope_as = story
		}
		hidden_effect = {
			house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_them_message
						left_icon = scope:house_feud_title.holder
						right_icon = scope:previous_holder_scope
						custom_tooltip = house_feud_tipped_scales_pos_big
					}
				}
			}
			scope:house_feud_rival.house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_us_message
						left_icon = scope:previous_holder_scope
						right_icon = scope:house_feud_title.holder
						custom_tooltip = house_feud_tipped_scales_neg_big
					}
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
		create_character_memory = {
			type = feud_vengeance_title
			
			participants = {
				previous_holder = scope:previous_holder_scope
			}
		}
		random_memory = {
			limit = {
				has_memory_type = feud_vengeance_title
				has_memory_participant  = scope:previous_holder_scope
				NOT = { exists = var:feud_vengeance_title }
			}
			set_variable = {
				name = feud_vengeance_title
				value = scope:story.var:house_feud_title
			}
		}
		stress_impact = { base = medium_stress_impact_loss }
	}

	option = {
		name = bp1_house_feud.7000.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.7000.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Original killer killed
bp1_house_feud.7001 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.7001.t
	desc = bp1_house_feud.7001.desc
	theme = rival_relation
	left_portrait = {
		character = root
		animation = war_over_win
	}
	lower_left_portrait = scope:house_feud_victim
	lower_right_portrait = scope:house_feud_attacker
	cooldown = { years = 100 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		# Story still going
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = {
		random_owned_story = {
			limit = { story_type = story_cycle_house_feud }
			change_variable = {
				name = house_feud_kill_counter
				add = house_feud_big_counter_value
			}
			var:house_feud_victim = { save_scope_as = house_feud_victim }
			var:house_feud_attacker = { save_scope_as = house_feud_attacker }
			save_scope_as = story
		}
		hidden_effect = {
			house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_them_message
						left_icon = scope:house_feud_victim
						right_icon = scope:house_feud_attacker
						custom_tooltip = house_feud_tipped_scales_pos_big
					}
				}
			}
			scope:house_feud_rival.house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_us_message
						left_icon = scope:house_feud_attacker
						right_icon = scope:house_feud_victim
						custom_tooltip = house_feud_tipped_scales_neg_big
					}
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
		create_character_memory = {
			type = feud_vengeance_killer
			
			participants = {
				dead_relation = scope:house_feud_victim
				relation_killer = scope:house_feud_attacker
				relation_avenger = scope:house_feud_attacker.killer
			}
		}
		stress_impact = { base = medium_stress_impact_loss }
	}

	option = {
		name = bp1_house_feud.7001.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.7001.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Original torturer tortured
bp1_house_feud.7002 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.7002.t
	desc = {
		first_valid = {
		    triggered_desc = {
		        trigger = { root = scope:house_feud_victim }
		        desc = bp1_house_feud.7002.opening_self
		    }
		    desc = bp1_house_feud.7002.opening
		}
		desc = bp1_house_feud.7002.desc
	}
	theme = rival_relation
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = war_over_win
	}
	lower_left_portrait = {
		character = scope:house_feud_victim
		trigger = {
			NOT = { root = scope:house_feud_victim }
		}
	}
	lower_right_portrait = scope:house_feud_attacker
	cooldown = { years = 100 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		# Story still going
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = {
		random_owned_story = {
			limit = { story_type = story_cycle_house_feud }
			change_variable = {
				name = house_feud_kill_counter
				add = house_feud_big_counter_value
			}
			var:house_feud_victim = { save_scope_as = house_feud_victim }
			var:house_feud_attacker = { save_scope_as = house_feud_attacker }
			var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
			save_scope_as = story
		}
		hidden_effect = {
			house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_them_message
						left_icon = scope:actor
						right_icon = scope:house_feud_attacker
						custom_tooltip = house_feud_tipped_scales_pos_big
						show_as_tooltip = {
							dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
						}
					}
				}
			}
			scope:house_feud_rival.house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_us_message
						left_icon = scope:house_feud_attacker
						right_icon = scope:actor
						custom_tooltip = house_feud_tipped_scales_neg_big
					}
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
		create_character_memory = {
			type = feud_vengeance_torture
			
			participants = {
				relation_victim = scope:house_feud_victim
				relation_torturer = scope:house_feud_attacker
				relation_avenger = scope:actor
			}
		}
		stress_impact = { base = medium_stress_impact_loss }
	}

	option = {
		name = bp1_house_feud.7002.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.7002.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Original cuckolder cuckolded
bp1_house_feud.7003 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.7003.t
	desc = {
		first_valid = {
		    triggered_desc = {
		        trigger = { root = scope:house_feud_victim }
		        desc = bp1_house_feud.7003.opening_self
		    }
		    desc = bp1_house_feud.7003.opening
		}
		desc = bp1_house_feud.7003.desc
	}
	theme = rival_relation
	left_portrait = {
		character = root
		animation = war_over_win
	}
	lower_left_portrait = {
		character = scope:house_feud_victim
		trigger = {
			NOT = { root = scope:house_feud_victim }
		}
	}
	lower_right_portrait = scope:house_feud_attacker
	cooldown = { years = 100 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		# Story still going
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = {
		random_owned_story = {
			limit = { story_type = story_cycle_house_feud }
			change_variable = {
				name = house_feud_kill_counter
				add = house_feud_big_counter_value
			}
			var:house_feud_spouse = { save_scope_as = house_feud_spouse }
			var:house_feud_victim = { save_scope_as = house_feud_victim }
			var:house_feud_attacker = { save_scope_as = house_feud_attacker }
			var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
			save_scope_as = story
		}
		hidden_effect = {
			house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_them_message
						left_icon = scope:sex_partner
						right_icon = scope:house_feud_attacker
						custom_tooltip = house_feud_tipped_scales_pos_big
						show_as_tooltip = {
							dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
						}
					}
				}
			}
			scope:house_feud_rival.house = {
				every_house_member = {
					send_interface_message = {
						type = house_feud_avenged_us_message
						left_icon = scope:house_feud_attacker
						right_icon = scope:sex_partner
						custom_tooltip = house_feud_tipped_scales_neg_big
					}
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
		create_character_memory = {
			type = feud_vengeance_cuckold
			
			participants = {
				relation_cuckolded = scope:house_feud_victim
				relation_cuckolder = scope:house_feud_attacker
				relation_avenger = scope:sex_partner
			}
		}
		stress_impact = { base = medium_stress_impact_loss }
	}

	option = {
		name = bp1_house_feud.7003.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.7003.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

############################
############################
#### MAINTENANCE EVENTS ####
############################
############################

# bp1_house_feud.0810 - fued inherited by new house head
# bp1_house_feud.0830 - wiped out target house
# bp1_house_feud.0840 - make rivalry with target house head if not existing
# bp1_house_feud.9000 - save rivals on death and fire inheritance on action
# bp1_house_feud.9001 - 0009 setup
# bp1_house_feud.9002 - 0004 setup
# bp1_house_feud.9003 - 0009 fallback
# bp1_house_feud.9004 - 0810 fallback

# Feud inherited ping for new House Head
bp1_house_feud.0810 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0810.t
	desc = {
		first_valid = {
		    triggered_desc = {
		        trigger = { has_character_flag = house_feud_too_young_inheritor }
		        desc = bp1_house_feud.0810.child
		    }
		    desc = bp1_house_feud.0810.adult
		}
		desc = bp1_house_feud.0810.desc
	}
	theme = rival_relation
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_left_portrait = scope:old_house_head
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		age >= 9
		#DLC check
		has_bp1_dlc_trigger = yes
		house = { has_house_modifier = house_feud_story_modifier }
	}

	option = {
		name = bp1_house_feud.0810.a
		custom_tooltip = story_cycle_house_feud_continue_tt
		if = {
			limit = {
				NOT = { has_relation_nemesis = scope:house_feud_rival }
				can_set_relation_nemesis_trigger = { CHARACTER = scope:house_feud_rival }
			}
			set_relation_nemesis = {
				target = scope:house_feud_rival
				reason = rival_house_feud_old_rivalry
			}
		}
		else = {
			set_relation_rival = {
				target = scope:house_feud_rival
				reason = rival_house_feud_old_rivalry
			}
		}
		house_feud_send_continues_message_effect = yes
		house_feud_forgiving_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = {
			text = bp1_house_feud.0810.b.rival
			trigger = { has_relation_rival = scope:house_feud_rival }
		}
		name = {
			text = bp1_house_feud.0810.b
			trigger = {
				NOT = { has_relation_rival = scope:house_feud_rival }
			}
		}
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}

	after = {
		if = {
			limit = { has_character_flag = house_feud_too_young_inheritor }
			remove_character_flag = house_feud_too_young_inheritor
		}
	}
}

# No enemy members left
bp1_house_feud.0830 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0830.t
	desc = {
		first_valid = {
		    triggered_desc = {
		        trigger = {
					OR = {
						faith = { trait_is_sin = drunkard }
						is_adult = no
					}
		        }
		        desc = bp1_house_feud.0830.opening
		    }
		    desc = bp1_house_feud.0830.opening_drink
		}
		desc = bp1_house_feud.0830.desc
		first_valid = {
		    triggered_desc = {
		        trigger = {
		        	scope:story = { house_feud_balance_value <= -2 }
		        }
		        desc = bp1_house_feud.0830.losing
		    }
		    triggered_desc = {
		        trigger = {
		        	scope:story = { house_feud_balance_value >= 2 }
		        }
		        desc = bp1_house_feud.0830.winning
		    }
		    desc = bp1_house_feud.0830.even
		}
		first_valid = {
		    triggered_desc = {
		        trigger = {
		        	NOT = { exists = scope:first_owner }
		        }
		        desc = bp1_house_feud.0830.first_owner
		    }
		    desc = bp1_house_feud.0830.fallback
		}
	}
	theme = rival_relation
	override_background = { reference = feast }
	left_portrait = {
		character = root
		animation = toast_goblet
		triggered_animation = {
			trigger = {
				faith = { trait_is_sin = drunkard }
			}
			animation = happiness
		}
		triggered_animation = {
			trigger = {
				NOT = {
					faith = { trait_is_sin = drunkard }
				}
			}
			animation = toast_goblet
		}
	}
	right_portrait = { character = scope:first_owner }
	lower_right_portrait = {
		trigger = { exists = scope:first_rival }
		character = scope:first_rival
	}
	cooldown = { years = 1 }

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
	}

	immediate = {
		scope:story = {
			if = {
				limit = {
					exists = var:house_feud_first_owner
					NOT = { var:house_feud_first_owner = root }
				}
				var:house_feud_first_owner = { save_scope_as = first_owner }
			}
			if = {
				limit = { exists = var:house_feud_first_rival }
				var:house_feud_first_rival = { save_scope_as = first_rival }
			}
		}
		stress_impact = { base = medium_stress_impact_loss }
	}

	option = {
		name = bp1_house_feud.0830.a
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
	}
}

# Not rival with feud house head
bp1_house_feud.0840 = {
	type = character_event
	content_source = dlc_006
	title = bp1_house_feud.0840.t
	desc = {
		desc = bp1_house_feud.0840.desc
	    triggered_desc = {
	        trigger = {
	        	scope:house_feud_rival = { is_adult = no }
	        }
	        desc = bp1_house_feud.0840.child
	    }
	    desc = bp1_house_feud.0840.closing
	}
	theme = rival_relation
	override_background = { reference = feast }
	left_portrait = {
		character = root
		animation = worry
	}
	lower_right_portrait = scope:house_feud_rival

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
	}

	immediate = {
		set_variable = {
			name = house_feud_next_cooldown
			value = scope:house_feud_rival
			years = 9
		}
	}

	option = {
		name = bp1_house_feud.0840.a
		if = {
			limit = {
				NOT = { has_relation_rival = scope:house_feud_rival }
				can_set_relation_rival_trigger = { CHARACTER = scope:house_feud_rival }
			}
			set_relation_rival = {
				target = scope:house_feud_rival
				reason = rival_house_feud_feud_lives_on
			}
		}
		custom_tooltip = story_cycle_house_feud_continue_tt
		house_feud_send_continues_message_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_boldness = 1
			}
		}
	}

	option = {
		name = bp1_house_feud.0840.b
		show_as_tooltip = { house_feud_end_modifier_effect = yes }
		house_feud_end_story_effect = yes
		# Stress for being Vengeful characters
		house_feud_vengeful_stress_effect = yes
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_boldness = -1
			}
		}
	}
}

# Save rivals to list on death for .9002, and trigger inheritance on action
bp1_house_feud.9000 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		#DLC check
		has_bp1_dlc_trigger = yes
		age >= 9
		is_house_head = yes
		exists = player_heir
		NOT = {
			any_owned_story = {story_type = story_cycle_house_feud }
		}
	}

	immediate = {
		save_scope_as = old_house_head	
		every_relation = {
			type = rival
			limit = {
				this = this.house.house_head
				NOT = { house = root.house }
			}
			add_to_list = old_house_head_rivals
			if = {
				limit = { has_relation_nemesis = root }
				set_variable = {
					name = dead_nemesis
					value = root
					months = 1
				}
			}
		}
		primary_heir = {
			trigger_event = {
				on_action = house_feud_inheritance_events
				days = { 5 15 }
			}
		}
	}
}

# Check if heir wants to consider retaliation in .0009
bp1_house_feud.9001 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		NOR = {
			any_owned_story = { story_type = story_cycle_house_feud }
			has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:old_house_head }
		}
		scope:old_house_head.killer ?= {
			trigger_if = {
				limit = {
					any_secret = {
						secret_type = secret_murder
						secret_target = scope:old_house_head
					}
				}
				any_secret = {
					secret_type = secret_murder
					secret_target = scope:old_house_head
					is_known_by = root
				}
			}
			save_temporary_scope_as = killer_temp
		}
		house_head_can_start_feud_against_trigger = { TARGET = scope:killer_temp }
	}

	immediate = {
		scope:old_house_head = {
			save_scope_as = house_feud_victim
			killer = { house_feud_save_head_and_attacker_effect = yes }
		}
		if = {
			limit = { age < 9 }
			add_character_flag = house_feud_too_young_heir
		}
		else = {
			random = {
				chance = 50
				modifier = {
					add = 25
					has_trait = vengeful
				}
				modifier = {
					add = -25
					has_trait = forgiving
				}
				trigger_event = bp1_house_feud.0009
			}
		}
	}
}

# Check if heir can consider starting feud in .0004
bp1_house_feud.9002 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		is_adult = yes
		is_house_head = yes
		NOR = {
			exists = scope:old_house_head.killer
			any_owned_story = { story_type = story_cycle_house_feud }
		}
		any_in_list = {
			list = old_house_head_rivals
			this = this.house.house_head
			NOT = { house = root.house }
		}
	}

	immediate = {
		random = {
			chance = 50
			modifier = {
				add = 25
				has_trait = vengeful
			}
			modifier = {
				add = 10
				culture = { has_cultural_parameter = house_hostility_more_common }
			}
			modifier = {
				add = -25
				has_trait = forgiving
			}
			modifier = {
				add = 50
				any_in_list = {
					list = old_house_head_rivals
					exists = var:dead_nemesis
					var:dead_nemesis = root
				}
			}
			modifier = {
				add = 25
				any_in_list = {
					list = old_house_head_rivals
					this = this.house.house_head
					NOT = { house = root.house }
					has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
				}
			}
			trigger_event = bp1_house_feud.0004
		}
	}
}

# 10th birthday event to fire .0009
bp1_house_feud.9003 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		has_character_flag = house_feud_too_young_heir
		is_house_head = yes
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = { trigger_event = bp1_house_feud.0009 }
}

# 10th birthday event to fire .0810
bp1_house_feud.9004 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		has_character_flag = house_feud_too_young_inheritor
		is_house_head = yes
		any_owned_story = { story_type = story_cycle_house_feud }
	}

	immediate = {
		random_owned_story = {
			limit = { story_type = story_cycle_house_feud }
			var:house_feud_house.house_head = { save_scope_as = house_feud_rival }
		}
		trigger_event = bp1_house_feud.0810
	}
}

# AI murder scheme joiner
bp1_house_feud.9500 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		house_feud_ai_murder_join_trigger = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = sadistic
		}
		modifier = {
			factor = 5
			has_trait = callous
		}
		modifier = {
			factor = 5
			has_trait = vengeful
		}
		modifier = {
			factor = 0.2
			has_trait = forgiving
		}
	}

	immediate = {
		house = {
			random_house_member = {
				limit = {
					any_scheme = {
						scheme_type = murder
						exists = scheme_target_character.house
						scheme_target_character.house = scope:story.var:house_feud_house
						NOR = {
							scheme_owner = root
							any_scheme_agent_character = { this = root }
						}
						save_temporary_scope_as = murder_scheme_temp
					}
					root = {
						char_can_fit_into_scheme_trigger = { SCHEME = scope:murder_scheme_temp }
						NOR = {
							is_scheming_against = { target = scope:murder_scheme_temp.scheme_target_character }
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:murder_scheme_temp.scheme_target_character }
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
				}
				random_scheme = {
					limit = {
						scheme_type = murder
						exists = scheme_target_character.house
						scheme_target_character.house = scope:story.var:house_feud_house
						NOR = {
							scheme_owner = root
							any_scheme_agent_character = { this = root }
						}
						save_temporary_scope_as = murder_scheme_temp
						root = {
							char_can_fit_into_scheme_trigger = { SCHEME = scope:murder_scheme_temp }
							NOR = {
								is_scheming_against = { target = scope:murder_scheme_temp.scheme_target_character }
								has_any_good_relationship_with_character_trigger = { CHARACTER = scope:murder_scheme_temp.scheme_target_character }
							}
						}
					}
					save_scope_as = murder_scheme
				}
			}
		}
		if = {
			limit = {
				exists = scope:murder_scheme
			}
			save_scope_as = rolled_char
		}
		force_assign_character_to_random_agent_slot_effect = {
			SCHEME = scope:murder_scheme
			CHAR = scope:rolled_char
			YEARS = 5
		}
	}
}

# AI murder scheme starter
bp1_house_feud.9501 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		house_feud_ai_murder_start_trigger = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = sadistic
		}
		modifier = {
			factor = 5
			has_trait = callous
		}
	}

	immediate = {
		scope:story.var:house_feud_house = {
			random_house_member = {
				limit = {
					save_temporary_scope_as = murder_victim_temp
					root = {
						NOT = {
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:murder_victim_temp }
						}
						can_start_scheme = {
							type = murder
							target_character = scope:murder_victim_temp
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
				}
				save_scope_as = murder_victim
			}
		}
		start_scheme = {
			type = murder
			target_character = scope:murder_victim
		}
	}
}

# AI seduce scheme starter
bp1_house_feud.9502 = {
	type = character_event
	content_source = dlc_006
	hidden = yes

	trigger = {
		has_bp1_dlc_trigger = yes
		house_feud_ai_seduce_start_trigger = yes
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 2
			has_trait = lustful
		}
		modifier = {
			factor = 2
			has_trait = rakish
		}
		modifier = {
			factor = 5
			has_trait = seducer
		}
	}

	immediate = {
		scope:story.var:house_feud_house = {
			random_house_member = {
				limit = {				
					is_married = yes
					save_temporary_scope_as = seduce_victim_temp
					any_spouse = {
						trigger_if = {
							limit = {
								exists = house
								NOT = { house = scope:seduce_victim_temp.house }
							}								
						}
						NOT = {
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:seduce_victim_temp }
						}
						save_temporary_scope_as = seduce_spouse_temp
					}
					root = {
						NOR = {
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:seduce_victim_temp }
							has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:seduce_spouse_temp }
						}
						can_start_scheme = {
							type = seduce
							target_character = scope:seduce_spouse_temp
						}
					}
				}
				weight = {
					base = 1
					modifier = {
						add = 10
						has_any_bad_relationship_with_character_trigger = { CHARACTER = root }
					}
				}
				save_scope_as = seduce_victim
				random_spouse = {
					limit = {
						trigger_if = {
							limit = {
								exists = house
								NOT = { house = scope:seduce_victim.house }
							}
						}
						NOT = {
							has_any_good_relationship_with_character_trigger = { CHARACTER = scope:seduce_victim }
						}					
						save_temporary_scope_as = seduce_spouse_temp
						root = {
							NOR = {
								has_any_good_relationship_with_character_trigger = { CHARACTER = scope:seduce_victim }
								has_any_bad_relationship_with_character_trigger = { CHARACTER = root }		
							}
							can_start_scheme = {
								type = seduce
								target_character = scope:seduce_spouse_temp
							}
						}	
					}
					save_scope_as = seduce_spouse
				}
			}
		}
		start_scheme = {
			type = seduce
			target_character = scope:seduce_spouse
		}
	}
}
