# Events for befriending someone who has a middling opinion of you

namespace = befriend_ongoing

# 0000-0999: Misc (?)
# 1000-1999: Positive, scheme owner based
# 2000-2999: Positive, scheme target based
# 3000-3999: Positive, agent based
# 4000-4999: Great personality match events
# 5000-5999: Bad personality match events
# 6000-6999: Trade something for progression
# 9000-9999: Early outcome events


# by Petter Vilberg, Tobias Bodlund, Stephen Arthur, and Linnéa Thimrén


#########################
# Special Scheme End Notifications
# 0900-0999
#########################

######
# Notification if your target dies :(
# by Petter Vilberg
######
befriend_ongoing.0901 = {
	type = character_event
	title = befriend_ongoing.0901.t
	desc = befriend_ongoing.0901.desc
	theme = befriend_scheme

	left_portrait = scope:target

	trigger = {
		NOR = {
			any_spouse = { this = scope:target }
			any_parent = { this = scope:target }
			any_child = { this = scope:target }
			any_sibling = { this = scope:target }
			any_relation = { type = lover this = scope:target }
			any_relation = { type = friend this = scope:target }
			any_relation = { type = rival this = scope:target }
		}
	}

	immediate = {
		if = {
			limit = {
				exists = scope:scheme
			}
			scope:scheme = {
				end_scheme = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.0901.a
		random = {
			chance = 50
			stress_impact = {
				base = medium_stress_gain
			}
		}
	}
}

###
# Befriend Scheme ends due to imprisonment
# by Sean Hughes
###
befriend_ongoing.0902 = {
	type = character_event
	title = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:imprisoner = root }
				desc = befriend_ongoing.0902.t
			}
			desc = befriend_ongoing.0902.t.other
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:imprisoner = root }
				desc = befriend_ongoing.0902.desc
			}
			desc = befriend_ongoing.0902.desc.other
		}
	}
	theme = befriend_scheme
	override_background = {
		event_background = dungeon
	}
	left_portrait = {
		character = scope:imprisoner
		animation = schadenfreude
	}
	right_portrait = {
		character = scope:target
		animation = boredom
	}

	trigger = {
		scope:target = {
			is_imprisoned = yes
		}
	}

	immediate = {
		custom_tooltip = befriend_ongoing.0903.a.tt
		scope:target = {
			imprisoner = {
				save_scope_as = imprisoner
			}
		}
	}

	option = {
		name = befriend_ongoing.0902.a
		trigger = { scope:imprisoner = root}
	}

	option = {
		name = befriend_ongoing.0902.a.other
		trigger = { NOT = { scope:imprisoner = root} }
	}
}

###
# Befriend Scheme ends due to war
# by Petter Vilberg
###
befriend_ongoing.0903 = {
	type = character_event
	title = befriend_ongoing.0903.t
	desc = befriend_ongoing.0903.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target

	trigger = {
		is_at_war_with = scope:target
	}

	immediate = {
		custom_tooltip = befriend_ongoing.0903.a.tt
	}

	option = {
		name = befriend_ongoing.0903.a
		stress_impact = {
			compassionate = minor_stress_gain
		}
	}
}


#########################
# Positive, scheme owner based
# 1000-1999
#########################

######
# Send them a poem about your deeds
# by Petter Vilberg and Linnéa Thimrén
######
befriend_ongoing.1001 = {
	type = character_event
	title = befriend_ongoing.1001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { has_trait = arrogant }
					OR = {
						has_personality_submissive_trigger = yes
						has_personality_introverted_trigger = yes
					}
				}
				desc = befriend_ongoing.1001.desc.starthumble
			}
			desc = befriend_ongoing.1001.desc.startnormal
		}
		desc = befriend_ongoing.1001.desc.end
	}
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_befriend_poem_event }
		}
	}

	weight_multiplier = {
		base = 0.75
		modifier = {
			add = 0.5
			has_trait = arrogant
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_befriend_poem_event
				value = yes
				days = 3650
			}
		}
	}

	option = { #Focus on me
		name = befriend_ongoing.1001.a
		add_prestige = minor_prestige_gain
		scope:scheme = {
			add_scheme_modifier = {
				type = prestigious_image_modifier
				days = 300
			}
		}

		stress_impact = {
			humble = medium_stress_impact_gain
			arrogant = minor_stress_impact_loss
		}

		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				has_trait = arrogant
			}
			modifier = {
				factor = 2
				has_personality_dominant_trigger = yes
			}
		}
	}

	option = { #Focus on them
		name = befriend_ongoing.1001.b
		reverse_add_opinion = {
			target = scope:target
			modifier = friendliness_opinion
			opinion = 10
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = humble
			}
			modifier = {
				factor = 2
				has_personality_submissive_trigger = yes
			}
		}
	}

	option = { #Go for prestige instead
		name = befriend_ongoing.1001.c
		add_character_modifier = {
			modifier = admiring_deeds_modifier
			years = 2
		}
		stress_impact = {
			arrogant = medium_stress_impact_loss
			humble = medium_stress_impact_gain
		}
	}
}

# Send a gift!
#by Petter Vilberg
befriend_ongoing.1002 = {
	type = character_event
	title = befriend_ongoing.1002.t
	desc = {
		desc = befriend_ongoing.1002.desc.start
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = {
						has_trait = greedy
						has_trait = arrogant
					}
				}
				desc = befriend_ongoing.1002.desc.greedy
			}
			triggered_desc = {
				trigger = { has_personality_malicious_trigger = yes }
				desc = befriend_ongoing.1002.desc.malicious
			}
			triggered_desc = {
				trigger = { has_personality_benevolent_trigger = yes }
				desc = befriend_ongoing.1002.desc.benevolent
			}
			desc = befriend_ongoing.1002.desc.generic
		}
	}
	
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = { exists = scope:scheme.var:had_befriend_gift_event }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_befriend_gift_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		trigger = { has_trait = generous }
		trait = generous
		name = befriend_ongoing.1002.d
		remove_short_term_gold = major_gold_value

		scope:scheme = {
			add_scheme_modifier = {
				type = magnificent_gift_modifier
				days = 300
			}
		}
		stress_impact = {
			generous = minor_stress_impact_loss
		}

		ai_chance = {
			base = 4
			modifier = {
				factor = 0.1
				short_term_gold < major_gold_value
			}
		}
	}

	option = {
		name = befriend_ongoing.1002.a
		remove_short_term_gold = medium_gold_value
		scope:scheme = {
			add_scheme_modifier = {
				type = exquisite_gift_modifier
				days = 300
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				factor = 6
				has_trait = generous
			}
			modifier = {
				factor = 2
				has_personality_benevolent_trigger = yes
			}
			modifier = {
				factor = 0.1
				short_term_gold < medium_gold_value_check
			}
			modifier = {
				factor = 1.5
				gold > major_gold_value_check
			}
		}
	}

	option = {
		name = befriend_ongoing.1002.b
		remove_short_term_gold = minor_gold_value
		scope:scheme = {
			add_scheme_modifier = {
				type = cheap_gift_modifier
				days = 300
			}
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 2
				has_trait = generous
			}
			modifier = {
				factor = 2
				has_personality_benevolent_trigger = yes
			}
			modifier = {
				factor = 0.1
				short_term_gold < minor_gold_value
			}
		}
	}

	option = {
		name = befriend_ongoing.1002.c

		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				has_trait = greedy
			}
			modifier = {
				factor = 2
				has_personality_malicious_trigger = yes
			}
		}
	}
}



#####
# Mutual Rival Chain
# 1003 -
# by Petter Vilberg
#####

befriend_ongoing.1003 = {
	type = character_event
	title = befriend_ongoing.1003.t
	desc = befriend_ongoing.1003.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:rival
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		any_relation = {
			type = rival
			this = scope:target
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_1003 }
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_1003
				value = yes
				days = 3650
			}
		}
		random_relation = {
			type = rival
			limit = {
				this = scope:target
			}
			save_scope_as = rival
		}
		capital_province = {
			barony = {
				save_scope_as = barony
			}
		}
	}

	option = {
		name = befriend_ongoing.1003.a
		remove_short_term_gold = minor_gold_value
		add_dread = minor_dread_gain
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_bonding_over_rival_modifier
				days = 730
			}
		}
		show_as_tooltip = {
			scope:target = {
				add_opinion = {
					target = scope:owner
					modifier = befriend_common_enemy_opinion
					days = 3650
				}
			}
			scope:rival = {
				add_prestige = minor_prestige_loss
				add_opinion = {
					target = scope:owner
					modifier = hate_opinion
					opinion = -15
				}
			}
		}
		scope:target = {
			trigger_event = befriend_ongoing.1004
		}
		scope:rival = {
			trigger_event = befriend_ongoing.1005
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
			}
			opinion_modifier = {
				opinion_target = scope:rival
				multiplier = -1
			}
		}
	}

	option = {
		name = befriend_ongoing.1003.b
		add_dread = minor_dread_loss
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		if = {
			limit = {
				scope:rival = { is_ai = yes }
			}
			scope:rival = {
				add_opinion = {
					target = scope:owner
					modifier = respect_opinion
					opinion = 10
				}
			}
		}
		stress_impact = {
			vengeful = medium_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 1
			ai_value_modifier = {
				ai_compassion = 1
			}
			modifier = {
				add = 100
				short_term_gold < minor_gold_value
			}
		}
	}
}

# Target: Bonding time
befriend_ongoing.1004 = {
	type = character_event
	title = befriend_ongoing.1004.t
	desc = befriend_ongoing.1004.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:rival

	trigger = {
		exists = scope:scheme
	}
	
	immediate = {
		hidden_effect = {
			scope:owner = {
				capital_barony = {
					save_scope_as = barony
				}
			}
		}
		show_as_tooltip = {
			scope:rival = {
				add_opinion = {
					target = scope:target
					modifier = hate_opinion
					opinion = -15
				}
			}
		}
	}

	option = {
		name = befriend_ongoing.1004.a
		add_prestige = minor_prestige_gain
		add_dread = minor_dread_gain
		add_opinion = {
			target = scope:owner
			modifier = befriend_common_enemy_opinion
			days = 3650
		}
	}
}

# Rival: Damn them!
befriend_ongoing.1005 = {
	type = character_event
	title = befriend_ongoing.1005.t
	desc = befriend_ongoing.1005.desc
	theme = befriend_scheme
	left_portrait = scope:rival
	right_portrait = scope:owner

	trigger = {
		exists = scope:scheme
	}

	option = {
		name = befriend_ongoing.1005.a
		add_prestige = minor_prestige_loss
		add_opinion = {
			target = scope:owner
			modifier = hate_opinion
			opinion = -15
		}
		add_opinion = {
			target = scope:target
			modifier = hate_opinion
			opinion = -15
		}
	}
}

### END BONDING OVER RIVAL CHAIN



#########################
# Positive, scheme target based
# 2000-2999
#########################

# A Gregarious target makes things a lot easier
#by Petter Vilberg
befriend_ongoing.2001 = {
	type = character_event
	title = befriend_ongoing.2001.t
	desc = befriend_ongoing.2001.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:target = {
			has_trait = gregarious
		}
		NOT = { exists = scope:scheme.var:had_gregarious_target_event }
		scope:scheme = {
			NOT = { has_scheme_modifier = befriend_gregarious_target_modifier }
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_gregarious_target_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		name = befriend_ongoing.2001.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		stress_impact = {
			shy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			compare_modifier = {
				value = ai_boldness
			}
			modifier = {
				has_personality_extroverted_trigger = yes
				add = 50
			}
		}
	}

	option = {
		name = befriend_ongoing.2001.a
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_gregarious_target_modifier
				days = 1200
			}
		}
		stress_impact = {
			shy = major_stress_impact_gain
			gregarious = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				has_personality_introverted_trigger = yes
				add = -50
			}
		}
	}
}

####################
# Envoy Chain
# 3001-3003
###################
#by Petter Vilberg

# Should you send an envoy? (friend of friend)
befriend_ongoing.3001 = {
	type = character_event
	title = befriend_ongoing.3001.t
	desc = befriend_ongoing.3001.desc
	theme = befriend_scheme

	left_portrait = scope:befriend_envoy
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = { exists = scope:scheme.var:had_befriend_envoy_event }
		any_relation = {
			type = friend
			NOT = { is_close_or_extended_family_of = scope:scheme.scheme_target }
			has_relation_friend = scope:scheme.scheme_target
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_befriend_envoy_event
				value = yes
				days = 3650
			}
		}
		random_relation = {
			type = friend
			limit = {
				NOT = { is_close_or_extended_family_of = scope:scheme.scheme_target }
				has_relation_friend = scope:scheme.scheme_target
			}
			save_scope_as = befriend_envoy
		}
	}

	option = {
		name = befriend_ongoing.3001.a
		custom_tooltip = befriend_ongoing.3001.tt
		hidden_effect = {
			scope:target = {
				trigger_event = {
					id = befriend_ongoing.3002
					days = 3
				}
			}
		}

		ai_chance = {
			base = 100
			compare_modifier = {
				value = ai_boldness
			}
			modifier = {
				has_personality_extroverted_trigger = yes
				add = 50
			}
		}
	}

	option = {
		name = befriend_ongoing.3001.b
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_envoy_working_modifier
				days = 730
			}
		}
		ai_chance = {
			base = 50
			modifier = {
				has_personality_introverted_trigger = yes
				add = 200
			}
		}
	}
}


#Owner sent an envoy!
befriend_ongoing.3002 = {
	type = character_event
	title = befriend_ongoing.3002.t
	desc = befriend_ongoing.3002.desc
	theme = befriend_scheme
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
	}

	left_portrait = scope:befriend_envoy
	right_portrait = scope:owner

	option = {
		name = befriend_ongoing.3002.a
		add_opinion = {
			modifier = sent_charming_envoy_opinion
			target = scope:owner
		}
		ai_chance = {
			base = 75
			modifier = {
				factor = 3
				has_personality_extroverted_trigger = yes
			}
			modifier = {
				factor = 2
				has_personality_benevolent_trigger = yes
			}
			modifier = {
				factor = 1.5
				has_personality_submissive_trigger = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.3002.b
		ai_chance = {
			base = 100
			modifier = {
				factor = 4
				has_personality_malicious_trigger = yes
			}
			modifier = {
				factor = 3
				has_personality_introverted_trigger = yes
			}
			modifier = {
				factor = 2
				has_personality_dominant_trigger = yes
			}
		}
	}

	after = {
		hidden_effect = {
			scope:owner = {
				trigger_event = befriend_ongoing.3003
			}
		}
	}
}

#Response to envoy
befriend_ongoing.3003 = {
	type = character_event
	title = befriend_ongoing.3003.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:target = {
						has_opinion_modifier = {
							target = scope:owner
							modifier = sent_charming_envoy_opinion
						}
					}
				}
				desc = befriend_ongoing.3003.accepted_envoy
			}
			desc = befriend_ongoing.3003.dismissed_envoy
		}
	}
	theme = befriend_scheme
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
	}

	left_portrait = scope:befriend_envoy
	right_portrait = scope:target

	option = {
		name = befriend_ongoing.3003.a
		trigger = {
			scope:target = {
				has_opinion_modifier = {
					target = scope:owner
					modifier = sent_charming_envoy_opinion
				}
			}
		}
		show_as_tooltip = {
			scope:target = {
				add_opinion = {
					modifier = sent_charming_envoy_opinion
					target = scope:owner
				}
			}
		}
	}

	option = {
		name = befriend_ongoing.3003.b
		trigger = {
			NOT = {
				scope:target = {
					has_opinion_modifier = {
						target = scope:owner
						modifier = sent_charming_envoy_opinion
					}
				}
			}
		}
	}
}

# Have your friendship blessed by a friendly religious affiliate
#by Petter Vilberg
befriend_ongoing.3007 = {
	type = character_event
	title = befriend_ongoing.3007.t
	desc = {
		triggered_desc = {
			trigger = { has_strong_religious_conviction_trigger = yes }
			desc = befriend_ongoing.3007.desc.conviction
		}
		triggered_desc = {
			trigger = { has_strong_religious_conviction_trigger = no }
			desc = befriend_ongoing.3007.desc.doubt
		}
	}

	theme = befriend_scheme
	left_portrait = scope:agent_speaking_highly
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = { exists = scope:scheme.var:had_religious_friendship_event }
		any_relation = {
			type = friend
			has_strong_religious_conviction_trigger = yes
		}
		scope:scheme = {
			scheme_target = {
				NOR = {
					has_trait = cynical
					has_trait = excommunicated
				}
			}
		}
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				has_strong_religious_conviction_trigger = yes
			}
			save_scope_as = agent_speaking_highly
		}
		scope:scheme = {
			set_variable = {
				name = had_religious_friendship_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		name = befriend_ongoing.3007.a
		scope:scheme = {
			add_scheme_modifier = {
				type = friendship_with_blessing_modifier
				days = 730
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				add = 50
				OR = {
					has_trait = deceitful
					intrigue >= 14
				}
			}
			modifier = {
				add = 50
				has_personality_emotional_trigger = yes
			}
			modifier = {
				add = 50
				has_personality_extroverted_trigger = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.3007.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		add_piety = miniscule_piety_value
		ai_chance = {
			base = 60
			compare_modifier = {
				value = ai_zeal
			}
			modifier = {
				add = 60
				has_personality_levelheaded_trigger = yes
			}
			modifier = {
				add = 60
				has_personality_introverted_trigger = yes
			}
		}
	}
}

####
# Spouse Puts in a Good Word
# by Petter Vilberg
####
scripted_trigger befriend_ongoing_3009_spouse_trigger = {
	befriend_scope_is_close_to_target_trigger = yes
	NOT = { this = scope:target }
	is_ai = yes
	opinion = {
		target = root
		value > 50
	}
}

#Does owner want their spouse to speak on their behalf
befriend_ongoing.3009 = {
	type = character_event
	title = befriend_ongoing.3009.t
	desc = befriend_ongoing.3009.desc
	theme = befriend_scheme
	left_portrait = scope:spouse
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		NOT = {
			scope:scheme = {
				has_variable = had_event_befriend_ongoing_3009
			}
		}
		any_spouse = {
			befriend_ongoing_3009_spouse_trigger = yes
		}
		scope:scheme = {
			scheme_progress > 1
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_3009
				value = yes
				days = 1825
			}
		}
		random_spouse = {
			limit = {
				befriend_ongoing_3009_spouse_trigger = yes
			}
			save_scope_as = spouse
		}
	}

	option = { #Please do, dear
		name = befriend_ongoing.3009.a
		scope:spouse = {
			duel = {
				skill = diplomacy
				value = 10
				20 = {	
					desc = befriend_ongoing.3009.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 0.5
						min = -19
					}
					show_as_tooltip = {
						scope:owner = {
							reverse_add_opinion = {
								target = scope:target
								modifier = respect_opinion
								opinion = 15
							}
						}
						scope:scheme = {
							add_scheme_progress = scheme_progress_gain
						}
					}
					scope:target = {
						trigger_event = {
							id = befriend_ongoing.3010
							days = { 5 10 }
						}
					}
				}
				10 = {		
					desc = befriend_ongoing.3009.a.failure
					compare_modifier = {
						value = scope:duel_value
						multiplier = -0.5
						min = -9
					}
					show_as_tooltip = {
						scope:scheme = {
							add_scheme_progress = scheme_progress_loss
						}
					}
					trigger_event = {
						id = befriend_ongoing.3012
						days = { 5 10 }
					}
				}
			}
		}
		stress_impact = {
			humble = minor_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			compare_modifier = {
				target = scope:spouse
				value = diplomacy
				multiplier = 10
			}
			opinion_modifier = {
				opinion_target = scope:spouse
			}
			ai_value_modifier = {
				ai_boldness = 0.5
			}
		}
	}

	option = { #No
		name = befriend_ongoing.3009.b
		flavor = befriend_ongoing.3009.b.tt
		stress_impact = {
			trusting = medium_stress_impact_gain
			family_first = minor_stress_impact_gain
		}
		ai_chance = {
			base = 20
		}
	}
}


#Target: Owner's spouse spoke well of them
befriend_ongoing.3010 = {
	type = character_event
	title = befriend_ongoing.3010.t
	desc = befriend_ongoing.3010.desc
	theme = befriend_scheme
	left_portrait = scope:spouse
	right_portrait = scope:owner
	
	trigger = {
		exists = scope:scheme
	}

	option = {
		name = befriend_ongoing.3010.a
		add_opinion = {
			target = scope:owner
			modifier = respect_opinion
			opinion = 15
		}
		scope:owner = {
			trigger_event = befriend_ongoing.3011
		}
	}
}

#Owner: It went well!
befriend_ongoing.3011 = {
	type = character_event
	title = befriend_ongoing.3009.t
	desc = befriend_ongoing.3011.desc
	theme = befriend_scheme
	left_portrait = scope:spouse
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
	}
	
	immediate = {
		show_as_tooltip = {
			reverse_add_opinion = {
				target = scope:owner
				modifier = respect_opinion
				opinion = 15
			}
		}
	}
	
	option = {
		name = befriend_ongoing.3011.a
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
	}
}

#Owner: It went poorly
befriend_ongoing.3012 = {
	type = character_event
	title = befriend_ongoing.3009.t
	desc = befriend_ongoing.3012.desc
	theme = befriend_scheme
	left_portrait = scope:spouse
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		exists = scope:scheme
	}
	
	option = {
		name = befriend_ongoing.3012.a
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
	}
}

### END SPOUSE GOOD INTERVENTION CHAIN

######
# A Spouse with a close connection to target that dislikes Owner disrupts
# by Petter Vilberg
######
scripted_trigger befriend_ongoing_3013_spouse_trigger = {
	befriend_scope_is_close_to_target_trigger = yes
	is_ai = yes
	opinion = {
		target = root
		value < -20
	}
	reverse_opinion = {
		target = scope:target
		value > 0
	}
}


befriend_ongoing.3013 = {
	type = character_event

	hidden = yes

	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_3013 }
			scheme_progress >= 4
		}
		any_spouse = {
			befriend_ongoing_3013_spouse_trigger = yes
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_3013
				value = yes
				days = 1825
			}
		}
		random_spouse = {
			limit = {
				befriend_ongoing_3013_spouse_trigger = yes
			}
			save_scope_as = spouse
		}
		scope:target = {
			trigger_event = befriend_ongoing.3014
		}
	}
}


#Target: Hear unpleasant things about Owner
befriend_ongoing.3014 = {
	type = character_event
	title = befriend_ongoing.3014.t
	desc = befriend_ongoing.3014.desc
	theme = befriend_scheme
	left_portrait = scope:spouse
	right_portrait = scope:owner
	
	trigger = {
		exists = scope:scheme
	}
	
	option = {
		name = befriend_ongoing.3014.a
		add_opinion = {
			target = scope:owner
			modifier = respect_opinion
			opinion = -15
		}
		add_opinion = {
			target = scope:spouse
			modifier = pleased_opinion
			opinion = 10
		}
		scope:owner = {
			trigger_event = befriend_ongoing.3015
		}
	}
}

#Owner: Target has heard unpleasant things
befriend_ongoing.3015 = {
	type = character_event
	title = befriend_ongoing.3015.t
	desc = befriend_ongoing.3015.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:spouse
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		exists = scope:scheme
	}
	
	immediate = {
		show_as_tooltip = {
			scope:target = {
				add_opinion = {
					target = scope:owner
					modifier = respect_opinion
					opinion = -15
				}
			}
		}	
	}

	option = {
		name = befriend_ongoing.3015.a
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		add_opinion = {
			target = scope:spouse
			modifier = cruelty_opinion
			opinion = -15
		}
	}
}

### END SPOUSE DISRUPTION CHAIN

### Both have Lifestyle General
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4000 = {
	type = character_event
	title = befriend_ongoing.4000.t
	desc = befriend_ongoing.4000.desc
	theme = befriend_scheme
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	left_portrait = root
	right_portrait = scope:target

	trigger = {
		has_martial_lifestyle_trait_trigger = yes
		scope:target = { has_martial_lifestyle_trait_trigger = yes }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4000 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4000
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4000.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4002 }
	}
}

# Scheme target responds
befriend_ongoing.4002 = {
	type = character_event
	title = befriend_ongoing.4002.t
	desc = befriend_ongoing.4002.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4002.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = minor_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4004 }
		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				has_personality_dominant_trigger = yes
			}
			compare_modifier = {
				target = scope:owner
				value = martial
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4002.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4002_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4004 }
		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				has_personality_introverted_trigger = yes
			}
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4004 = {
	type = character_event
	title = befriend_ongoing.4000.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4002_negative
				}
				desc = befriend_ongoing.4004.b.desc
			}
			desc = befriend_ongoing.4004.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4004.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4002_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = minor_stress_loss
	}

	option = {
		name = befriend_ongoing.4004.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4002_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4002_negative
		}
	}
}

### Both have Lifestyle Diplomat
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4010 = {
	type = character_event
	title = befriend_ongoing.4010.t
	desc = befriend_ongoing.4010.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_diplomacy_lifestyle_trait_trigger = yes
		scope:target = { has_diplomacy_lifestyle_trait_trigger = yes }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4010 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4010
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4010.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4012 }
	}
}

# Scheme target responds
befriend_ongoing.4012 = {
	type = character_event
	title = befriend_ongoing.4012.t
	desc = befriend_ongoing.4012.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4012.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4014 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = intrigue
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4012.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4012_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4014 }
		ai_chance = {
			base = 50
			modifier = {
				factor = 2
				has_personality_dominant_trigger = yes
			}
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4014 = {
	type = character_event
	title = befriend_ongoing.4010.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4012_negative
				}
				desc = befriend_ongoing.4014.b.desc
			}
			desc = befriend_ongoing.4014.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4014.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4012_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4014.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4012_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4012_negative
		}
	}
}

### Both have Lifestyle Administrator
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4020 = {
	type = character_event
	title = befriend_ongoing.4020.t
	desc = befriend_ongoing.4020.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_stewardship_lifestyle_trait_trigger = yes
		scope:target = { has_stewardship_lifestyle_trait_trigger = yes }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4020 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4020
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4020.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4022 }
	}
}

# Scheme target responds
befriend_ongoing.4022 = {
	type = character_event
	title = befriend_ongoing.4022.t
	desc = befriend_ongoing.4022.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4022.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4024 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = stewardship
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4022.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4022_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4024 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4024 = {
	type = character_event
	title = befriend_ongoing.4020.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4022_negative
				}
				desc = befriend_ongoing.4024.b.desc
			}
			desc = befriend_ongoing.4024.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4024.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4022_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4024.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4022_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4022_negative
		}
	}
}

### Both have Lifestyle Schemer
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4030 = {
	type = character_event
	title = befriend_ongoing.4030.t
	desc = befriend_ongoing.4030.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_intrigue_lifestyle_trait_trigger = yes
		scope:target = { has_intrigue_lifestyle_trait_trigger = yes }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4030 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4030
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4030.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4032 }
	}
}

# Scheme target responds
befriend_ongoing.4032 = {
	type = character_event
	title = befriend_ongoing.4032.t
	desc = befriend_ongoing.4032.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4032.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4034 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = intrigue
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4032.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4032_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4034 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4034 = {
	type = character_event
	title = befriend_ongoing.4030.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4032_negative
				}
				desc = befriend_ongoing.4034.b.desc
			}
			desc = befriend_ongoing.4034.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4034.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4032_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4034.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4032_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4032_negative
		}
	}
}

### Both have Lifestyle Scholar
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4040 = {
	type = character_event
	title = befriend_ongoing.4040.t
	desc = befriend_ongoing.4040.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_learning_lifestyle_trait_trigger = yes
		scope:target = { has_learning_lifestyle_trait_trigger = yes }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4040 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4040
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4040.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4042 }
	}
}

# Scheme target responds
befriend_ongoing.4042 = {
	type = character_event
	title = befriend_ongoing.4042.t
	desc = befriend_ongoing.4042.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4042.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4044 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = learning
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4042.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4042_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4044 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4044 = {
	type = character_event
	title = befriend_ongoing.4040.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4042_negative
				}
				desc = befriend_ongoing.4044.b.desc
			}
			desc = befriend_ongoing.4044.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4044.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4042_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4044.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4042_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4042_negative
		}
	}
}

### Both have Lifestyle Seducer
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4050 = {
	type = character_event
	title = befriend_ongoing.4050.t
	desc = befriend_ongoing.4050.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_trait = seducer
		scope:target = { has_trait = seducer }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4050 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4050
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4050.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4052 }
	}
}

# Scheme target responds
befriend_ongoing.4052 = {
	type = character_event
	title = befriend_ongoing.4052.t
	desc = befriend_ongoing.4052.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4052.a.wine	# Yes, respect
		trigger = {
			drinks_alcohol_trigger = yes
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4054 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = intrigue
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4052.a.tee	# Yes, respect
		trigger = {
			drinks_alcohol_trigger = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4054 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = intrigue
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4052.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4052_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4054 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4054 = {
	type = character_event
	title = befriend_ongoing.4050.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4052_negative
				}
				desc = befriend_ongoing.4054.b.desc
			}
			desc = befriend_ongoing.4054.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4054.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4052_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4054.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4052_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4052_negative
		}
	}
}

### Both have Lifestyle Blademaster
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4060 = {
	type = character_event
	title = befriend_ongoing.4060.t
	desc = befriend_ongoing.4060.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_trait = lifestyle_blademaster
		scope:target = { has_trait = lifestyle_blademaster }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4060 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4060
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4060.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4062 }
	}
}

# Scheme target responds
befriend_ongoing.4062 = {
	type = character_event
	title = befriend_ongoing.4062.t
	desc = befriend_ongoing.4062.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4062.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4064 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = martial
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4062.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4062_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4064 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4064 = {
	type = character_event
	title = befriend_ongoing.4060.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4062_negative
				}
				desc = befriend_ongoing.4064.b.desc
			}
			desc = befriend_ongoing.4064.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4064.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4062_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4064.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4062_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4062_negative
		}
	}
}

### Both have Lifestyle Hunter
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4070 = {
	type = character_event
	title = befriend_ongoing.4070.t
	desc = befriend_ongoing.4070.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_trait = lifestyle_hunter
		scope:target = { has_trait = lifestyle_hunter }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4070 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4070
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4070.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4072 }
	}
}

# Scheme target responds
befriend_ongoing.4072 = {
	type = character_event
	title = befriend_ongoing.4072.t
	desc = befriend_ongoing.4072.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner

	option = {
		name = befriend_ongoing.4072.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4074 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = martial
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4072.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4072_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4074 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4074 = {
	type = character_event
	title = befriend_ongoing.4070.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4072_negative
				}
				desc = befriend_ongoing.4074.b.desc
			}
			desc = befriend_ongoing.4074.a.desc
		}
	}
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4074.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4072_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4074.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4072_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4072_negative
		}
	}
}

### Both have Lifestyle Reveler
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4080 = {
	type = character_event
	title = befriend_ongoing.4080.t
	desc = befriend_ongoing.4080.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_trait = lifestyle_reveler
		scope:target = { has_trait = lifestyle_reveler }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4080 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4080
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4080.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4082 }
	}
}

# Scheme target responds
befriend_ongoing.4082 = {
	type = character_event
	title = befriend_ongoing.4082.t
	desc = befriend_ongoing.4082.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4082.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4084 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = diplomacy
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4082.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4082_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4084 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4084 = {
	type = character_event
	title = befriend_ongoing.4080.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4082_negative
				}
				desc = befriend_ongoing.4084.b.desc
			}
			desc = befriend_ongoing.4084.a.desc
		}
	}
	theme = befriend_scheme
	override_background = {
		trigger = {
			NOT = {
				exists = scope:scheme.var:befriend_ongoing_4082_negative
			}
		}
		event_background = tavern
	}
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4084.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4082_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4084.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4082_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4082_negative
		}
	}
}

### Both have Lifestyle Torturer
# by Tobias Bodlund
# Scheme owner takes initiative
befriend_ongoing.4090 = {
	type = character_event
	title = befriend_ongoing.4090.t
	desc = befriend_ongoing.4090.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_trait = torturer
		scope:target = { has_trait = torturer }
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4090 }
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4090
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4090.a	# Contact them
		custom_tooltip = befriend_ongoing.4000.a.tt
		scope:target = { trigger_event = befriend_ongoing.4092 }
	}
}

# Scheme target responds
befriend_ongoing.4092 = {
	type = character_event
	title = befriend_ongoing.4092.t
	desc = befriend_ongoing.4092.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4092.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
		scope:owner = { trigger_event = befriend_ongoing.4094 }
		ai_chance = {
			base = 50
			compare_modifier = {
				target = scope:owner
				value = intrigue
				multiplier = 10
			}
		}
	}

	option = {
		name = befriend_ongoing.4092.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}
		add_prestige = minor_prestige_gain
		stress_impact = {
			arrogant = major_stress_impact_loss
			gregarious = minor_stress_impact_gain
			shy = medium_stress_impact_loss
		}
		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4092_negative
				value = yes
			}
		}
		scope:owner = { trigger_event = befriend_ongoing.4094 }
		ai_chance = {
			base = 50
		}
	}
}

# Scheme owner gets result
befriend_ongoing.4094 = {
	type = character_event
	title = befriend_ongoing.4090.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4092_negative
				}
				desc = befriend_ongoing.4094.b.desc
			}
			desc = befriend_ongoing.4094.a.desc
		}
	}
	theme = befriend_scheme
	override_background = {
		trigger = {
			NOT = {
				exists = scope:scheme.var:befriend_ongoing_4092_negative
			}
		}
		event_background = dungeon
	}
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	option = {
		name = befriend_ongoing.4094.a	# This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4092_negative }
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		add_stress = major_stress_loss
	}

	option = {
		name = befriend_ongoing.4094.b	# Target wasn't interested
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4092_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4092_negative
		}
	}
}

### At war with same enemy
# by Tobias Bodlund
# Scheme owner
befriend_ongoing.4100 = {
	type = character_event
	title = befriend_ongoing.4100.t
	desc = befriend_ongoing.4100.desc
	theme = befriend_scheme

	left_portrait = scope:target
	right_portrait = scope:befriend_ongoing_4100_enemy
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4100 }
		any_war_enemy = {
			any_war_enemy = { this = scope:target }
		}
	}

	immediate = {
		scope:target = {
			save_scope_as = befriend_ongoing_4100_text_scope
		}
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4100
				value = yes
			}
		}
		random_war_enemy = {
			limit = {
				any_war_enemy = { this = scope:target }
			}
			save_scope_as = befriend_ongoing_4100_enemy
		}
	}

	option = {
		name = befriend_ongoing.4100.a	# We are brothers in arms
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = comrades_in_arms_opinion
				years = 5
			}
		}
		scope:target = { trigger_event = befriend_ongoing.4102 }
	}
}

# Scheme target
befriend_ongoing.4102 = {
	type = character_event
	title = befriend_ongoing.4100.t
	desc = befriend_ongoing.4100.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = scope:befriend_ongoing_4100_enemy

	immediate = {
		scope:owner = {
			save_scope_as = befriend_ongoing_4100_text_scope
		}
	}

	option = {
		name = befriend_ongoing.4100.a	# We are brothers in arms
		scope:owner = {
			add_opinion = {
				target = root
				modifier = comrades_in_arms_opinion
				years = 5
			}
		}
	}
}

### In the same faction - a common goal helps in forming bonds
# by Tobias Bodlund

# Scheme owner
befriend_ongoing.4110 = {
	type = character_event
	title = befriend_ongoing.4110.t
	desc = befriend_ongoing.4110.desc
	theme = befriend_scheme

	left_portrait = scope:target
	right_portrait = scope:befriend_ongoing_4110_enemy
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4110 }
		exists = liege
		liege = {
			any_targeting_faction = {
				any_faction_member = {
					this = scope:target
				}
				any_faction_member = {
					this = scope:owner
				}
			}
		}
	}

	immediate = {
		scope:target = {
			save_scope_as = befriend_ongoing_4110_text_scope
		}
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4110
				value = yes
			}
		}
		liege = {
			save_scope_as = befriend_ongoing_4110_enemy
		}
	}

	option = {
		name = befriend_ongoing.4110.a	# We have a common objective
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = faction_common_goals_opinion
				years = 5
			}
		}
		scope:target = { trigger_event = befriend_ongoing.4112 }
	}
}

# Scheme target
befriend_ongoing.4112 = {
	type = character_event
	title = befriend_ongoing.4110.t
	desc = befriend_ongoing.4110.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = scope:befriend_ongoing_4110_enemy

	immediate = {
		scope:owner = {
			save_scope_as = befriend_ongoing_4100_text_scope
		}
	}

	option = {
		name = befriend_ongoing.4110.a	# We have a common objective
		scope:owner = {
			add_opinion = {
				target = root
				modifier = faction_common_goals_opinion
				years = 5
			}
		}
	}
}

### Both have Dread
# by Stephen Arthur
# Scheme owner takes initiative: invite to execution
befriend_ongoing.4300 = {
	type = character_event
	title = befriend_ongoing.4300.t
	desc = befriend_ongoing.4300.desc
	theme = befriend_scheme
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:owner = { dread >= medium_dread }
		scope:target = { dread >= medium_dread }
		scope:owner = {
			any_prisoner = {
				count > 1
			}
		}
		NOT = { exists = scope:scheme.var:had_event_befriend_ongoing_4300 }

	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_4300
				value = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.4300.a	# Contact them
		custom_tooltip = befriend_ongoing.4300.a.tt
		scope:target = {
			trigger_event = { id = befriend_ongoing.4302 days = 10 }
		}
		stress_impact = {
			sadistic = minor_stress_impact_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}			
	}		

	option = {
		name = befriend_ongoing.4300.b	# Do Not Contact them
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			sadistic = medium_stress_impact_gain
			callous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}		
	}
}

# Scheme target responds
befriend_ongoing.4302 = {
	type = character_event
	title = befriend_ongoing.4302.t
	desc = befriend_ongoing.4302.desc
	theme = befriend_scheme

	trigger = {
		exists = scope:scheme
	}
	
	left_portrait = scope:owner
	right_portrait = root

	option = {
		name = befriend_ongoing.4302.c	#  No, paranoia

		trigger = {
			has_trait = paranoid
		}

		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}			
		}

		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4302_negative
				value = yes
			}
		}

		scope:owner = {
			trigger_event = {
				id = befriend_ongoing.4304
				days = 10
			}
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_honor = -0.5
			}
		}

	}	

	option = {
		name = befriend_ongoing.4302.a	# Yes, respect
		scope:owner = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		scope:owner = {
			trigger_event = { id = befriend_ongoing.4304 days = 10 }
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}		
	}

	option = {
		name = befriend_ongoing.4302.b	# Not interested
		trigger = {
			is_ai = no
		}
		scope:owner = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -10
			}
		}

		scope:scheme = {
			set_variable = {
				name = befriend_ongoing_4302_negative
				value = yes
			}
		}

		scope:owner = {
			trigger_event = { id = befriend_ongoing.4304 days = 10 }
		}	
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_energy = -0.25
			}
		}				
	}
}

# Scheme owner picks a prisoner to execute
# by Stephen Arthur
befriend_ongoing.4304 = {

	type = character_event
	title = befriend_ongoing.4304.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:scheme.var:befriend_ongoing_4302_negative
				}
				desc = befriend_ongoing.4304.b.desc
			}
			desc = befriend_ongoing.4304.a.desc
		}
	}
	theme = befriend_scheme
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	

	left_portrait = scope:target
	right_portrait = scope:prisoner_a
	lower_right_portrait = scope:prisoner_b
	#right_portrait = scope:prisoner_c

	trigger = {
		exists = scope:scheme
		scope:target = { is_alive = yes }
	}

	immediate = {
		random_prisoner = {
			save_scope_as = prisoner_a
		}
		random_prisoner = {
			limit = { NOT = { this = scope:prisoner_a } }
			save_scope_as = prisoner_b
		}
		random_prisoner = {
			limit = {
				NOT = { this = scope:prisoner_a }
				NOT = { this = scope:prisoner_b }
			}
			save_scope_as = prisoner_c
		}
	}	

	option = {
		name = befriend_ongoing.4304.a	# Execute this prisoner. This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4302_negative }
			scope:prisoner_a = { is_imprisoned = yes }
		}

		scope:prisoner_a = {
			death = {
				death_reason = death_execution
				killer = root
			}

		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}	
		add_dread = minor_dread_gain
	}

	option = {
		name = befriend_ongoing.4304.b	# Execute this prisoner. This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4302_negative }
			scope:prisoner_b = { is_imprisoned = yes }
		}

		scope:prisoner_b = {
			death = {
				death_reason = death_execution
				killer = root
			}

		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}			

		add_dread = minor_dread_gain
	}

	option = {
		name = befriend_ongoing.4304.c	# Execute this prisoner. This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4302_negative }
			scope:prisoner_c = { is_imprisoned = yes }
		}

		scope:prisoner_c = {
			death = {
				death_reason = death_execution
				killer = root
			}

		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}	
		add_dread = minor_dread_gain
	}

	option = {
		name = befriend_ongoing.4304.f	# Kill Them All! This went well
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4302_negative }
			scope:prisoner_a = { is_imprisoned = yes }
			scope:prisoner_b = { is_imprisoned = yes }
			scope:prisoner_c = { is_imprisoned = yes }
		}
		scope:prisoner_a = {
			death = {
				death_reason = death_execution
				killer = root
			}
		}
		scope:prisoner_b = {
			death = {
				death_reason = death_execution
				killer = root
			}
		}
		scope:prisoner_c = {
			death = {
				death_reason = death_execution
				killer = root
			}
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = shared_interests_opinion
				years = 5
			}
		}
		stress_impact = {
			base = major_stress_impact_loss
		}	
		add_dread = medium_dread_gain
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 1
			}
		}		
	}

	option = {
		name = befriend_ongoing.4304.d	# No prisoners shall be executed today.
		custom_tooltip = befriend_ongoing.4304.d.tt
		trigger = {
			NOT = { exists = scope:scheme.var:befriend_ongoing_4302_negative }
		}

		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}

		scope:target = {
			add_opinion = {
				modifier = respect_opinion
				target = scope:owner
				opinion = -10
			}		
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}			
	}

	option = {
		name = befriend_ongoing.4304.e	# Not interested
		custom_tooltip = befriend_ongoing.4304.e.tt
		trigger = {
			exists = scope:scheme.var:befriend_ongoing_4302_negative
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
			remove_variable = befriend_ongoing_4302_negative
		}	
	}
}



############################################
# PERSONALITY MISMATCH
# 5000-5999
############################################

#####
# Cynical Owner tries to befriend Zealous Target
# by Petter Vilberg
#####
befriend_ongoing.5001 = {
	type = character_event
	title = befriend_ongoing.5001.t
	desc = befriend_ongoing.5001.desc
	theme = befriend_scheme

	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme.scheme_owner = {
			has_trait = cynical
		}
		scope:scheme.scheme_target = {
			has_trait = zealous
		}
		scope:scheme = {
			NOT = { exists = var:had_cynical_zealous_event }
		}
	}

	weight_multiplier = {
		base = 50
		modifier = {
			add = -0.5
			scope:scheme = {
				scheme_progress < 3
			}
		}
		modifier = {
			add = 0.5
			scope:scheme = {
				scheme_progress > 7
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_cynical_zealous_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		name = befriend_ongoing.5001.a
		stress_impact = {
			base = medium_stress_gain
		}
		scope:scheme.scheme_target = {
			add_opinion = {
				modifier = cynical_vs_zealous_befriend_opinion
				target = scope:owner
			}
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 4
				has_personality_submissive_trigger = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.5001.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}

		ai_chance = {
			base = 50
			modifier = {
				factor = 5
				has_personality_dominant_trigger = yes
			}
		}
	}
}

#####
# Trusting Owner tries to befriend Cynical Target
# by Petter Vilberg
#####
befriend_ongoing.5002 = {
	type = character_event
	title = befriend_ongoing.5002.t
	desc = befriend_ongoing.5002.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme.scheme_owner = {
			has_trait = trusting
		}
		scope:scheme.scheme_target = {
			has_trait = cynical
		}
		scope:scheme = {
			NOT = { exists = var:had_trusting_cynical_event }
		}
	}

	weight_multiplier = {
		base = 50
		modifier = {
			add = -0.5
			scope:scheme = {
				scheme_progress < 3
			}
		}
		modifier = {
			add = 0.5
			scope:scheme = {
				scheme_progress > 7
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_trusting_cynical_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		name = befriend_ongoing.5002.a
		scope:scheme.scheme_target = {
			add_opinion = {
				modifier = trusting_vs_cynical_befriend_opinion
				target = scope:owner
			}
		}

		ai_chance = {
			base = 100
		}
	}

	option = {
		name = befriend_ongoing.5002.b
		stress_impact = {
			base = medium_stress_gain
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				stress > 50
				factor = 0.1
			}
		}
	}
}


#####
# Gregarious Owner tries to befriend Depressed Target
# by Petter Vilberg
#####
befriend_ongoing.5003 = {
	type = character_event
	title = befriend_ongoing.5003.t
	desc = befriend_ongoing.5003.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme.scheme_owner = {
			has_trait = gregarious
		}
		scope:scheme.scheme_target = {
			has_trait = depressed
		}
		scope:scheme = {
			NOT = { exists = var:had_gregarious_depressed_event }
		}
	}

	weight_multiplier = {
		base = 50
		modifier = {
			add = -0.5
			scope:scheme = {
				scheme_progress < 3
			}
		}
		modifier = {
			add = 0.5
			scope:scheme = {
				scheme_progress > 7
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_gregarious_depressed_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		trigger = { has_trait = compassionate }
		name = befriend_ongoing.5003.c
		trait = compassionate

		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}

		ai_chance = {
			base = 5
		}
	}

	option = {
		name = befriend_ongoing.5003.a
		scope:scheme.scheme_target = {
			add_opinion = {
			modifier = gregarious_vs_depressed_befriend_opinion
				target = scope:owner
			}
		}

		ai_chance = {
			base = 50
			modifier = {
				factor = 5
				has_personality_malicious_trigger = yes
			}
			modifier = {
				factor = 2
				has_personality_extroverted_trigger = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.5003.b
		stress_impact = {
			base = medium_stress_gain
		}
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 5
				has_personality_benevolent_trigger = yes
			}
			modifier = {
				factor = 2
				has_personality_introverted_trigger = yes
			}
		}
	}
}


#####
# Gluttonous Owner tries to befriend Temperate Target
# by Petter Vilberg
#####
befriend_ongoing.5004 = {
	type = character_event
	title = befriend_ongoing.5004.t
	desc = befriend_ongoing.5004.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme.scheme_owner = {
			has_trait = gluttonous
		}
		scope:scheme.scheme_target = {
			has_trait = temperate
		}
		scope:scheme = {
			NOT = { exists = var:had_gluttonous_temperate_event }
		}
	}

	weight_multiplier = {
		base = 50
		modifier = {
			add = -0.5
			scope:scheme = {
				scheme_progress < 3
			}
		}
		modifier = {
			add = 0.5
			scope:scheme = {
				scheme_progress > 7
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_gluttonous_temperate_event
				value = yes
				days = 3650
			}
		}
		set_favorite_treat_effect = yes
	}

	option = {
		name = befriend_ongoing.5004.a
		stress_impact = {
			base = medium_stress_gain
		}
		scope:scheme.scheme_target = {
			add_opinion = {
				modifier = gluttonous_vs_temperate_befriend_opinion
				target = scope:owner
			}
		}

		ai_chance = {
			base = 3
			modifier = {
				factor = 4
				has_personality_benevolent_trigger = yes
			}
		}
	}

	option = {
		name = befriend_ongoing.5004.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}

		ai_chance = {
			base = 50
			modifier = {
				factor = 6
				has_personality_malicious_trigger = yes
			}
		}
	}
}

#####
# Ambitious Owner tries to befriend Content Target
# by Petter Vilberg
#####
befriend_ongoing.5005 = {
	type = character_event
	title = befriend_ongoing.5005.t
	desc = befriend_ongoing.5005.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme.scheme_owner = {
			has_trait = ambitious
		}
		scope:scheme.scheme_target = {
			has_trait = content
		}
		scope:scheme = {
			NOT = { exists = var:had_ambitious_content_event }
		}
	}

	weight_multiplier = {
		base = 50
		modifier = {
			add = -0.5
			scope:scheme = {
				scheme_progress < 3
			}
		}
		modifier = {
			add = 0.5
			scope:scheme = {
				scheme_progress > 7
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_ambitious_content_event
				value = yes
				days = 3650
			}
		}
	}

	option = {
		name = befriend_ongoing.5005.a
		stress_impact = {
			base = medium_stress_gain
		}
		scope:scheme.scheme_target = {
			add_opinion = {
				modifier = ambitious_vs_content_befriend_opinion
				target = scope:owner
			}
		}

		ai_chance = {
			base = 120
			
			compare_modifier = {
				trigger = { stress > 30 }
				target = ROOT
				value = stress
				multiplier = -0.8
			}
		}
	}

	option = {
		name = befriend_ongoing.5005.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}

		ai_chance = {
			base = 50
			modifier = {
				add = 150
				has_personality_malicious_trigger = yes
			}
		}
	}
}


####
# Nothing in common
# by Petter Vilberg
####
befriend_ongoing.5006 = {
	type = character_event
	title = befriend_ongoing.5006.t
	desc = befriend_ongoing.5006.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			NOT = {
				has_variable = had_event_befriend_ongoing_5006
			}
			NOT = {	has_scheme_modifier = befriend_making_effort_modifier }
			NOT = { has_scheme_modifier = befriend_studious_modifier }
			NOT = { has_scheme_modifier = befriend_bad_studious_modifier }
			scheme_progress >= 1
		}
		number_of_traits_in_common = {
			target = scope:target
			value = 0
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_5006
				value = yes
				days = 1825
			}
		}
	}

	option = {
		name = befriend_ongoing.5006.a
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_making_effort_modifier
				days = 730
			}
		}
		stress_impact = {
			base = medium_stress_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	option = {
		name = befriend_ongoing.5006.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		ai_chance = {
			base = 10
		}
	}
}

######
# High Learning lets you overcome differences
# by Petter Vilberg
######

befriend_ongoing.5007 = {
	type = character_event
	title = befriend_ongoing.5007.t
	desc = {
		desc = befriend_ongoing.5007.opening
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:target = { has_trait = education_martial }
				}
				desc = befriend_ongoing.5007.martial
			}
			triggered_desc = {
				trigger = {
					scope:target = { has_trait = education_diplomacy }
				}
				desc = befriend_ongoing.5007.diplomacy
			}
			triggered_desc = {
				trigger = {
					scope:target = { has_trait = education_intrigue }
				}
				desc = befriend_ongoing.5007.intrigue
			}
			triggered_desc = {
				trigger = {
					scope:target = { has_trait = education_stewardship }
				}
				desc = befriend_ongoing.5007.stewardship
			}
			triggered_desc = {
				trigger = {
					scope:target = { has_trait = education_learning }
				}
				desc = befriend_ongoing.5007.learning
			}
		}
	}
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		learning >= high_skill_rating
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_5007 }
			NOT = { has_scheme_modifier = befriend_studious_modifier }
			NOT = { has_scheme_modifier = befriend_bad_studious_modifier }
			scheme_progress >= 3
		}
		NOR = {
			AND = {
				scope:owner = { has_trait = education_martial }
				scope:target = { has_trait = education_martial }
			}
			AND = {
				scope:owner = { has_trait = education_diplomacy }
				scope:target = { has_trait = education_diplomacy }
			}
			AND = {
				scope:owner = { has_trait = education_intrigue }
				scope:target = { has_trait = education_intrigue }
			}
			AND = {
				scope:owner = { has_trait = education_stewardship }
				scope:target = { has_trait = education_stewardship }
			}
			AND = {
				scope:owner = { has_trait = education_learning }
				scope:target = { has_trait = education_learning }
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_5007
				value = yes
				days = 1825
			}
		}
	}

	option = { #Study
		name = befriend_ongoing.5007.a
		skill = learning
		if = {
			limit = {
				scope:target = { has_trait = education_martial }
			}
			add_character_modifier = {
				modifier = befriend_martial_study_modifier
				days = 1825
			}
		}
		else_if = {
			limit = {
				scope:target = { has_trait = education_diplomacy }
			}
			add_character_modifier = {
				modifier = befriend_diplomacy_study_modifier
				days = 1825
			}
		}
		else_if = {
			limit = {
				scope:target = { has_trait = education_intrigue }
			}
			add_character_modifier = {
				modifier = befriend_intrigue_study_modifier
				days = 1825
			}
		}
		else_if = {
			limit = {
				scope:target = { has_trait = education_stewardship }
			}
			add_character_modifier = {
				modifier = befriend_stewardship_study_modifier
				days = 1825
			}
		}
		else_if = {
			limit = {
				scope:target = { has_trait = education_learning }
			}
			add_character_modifier = {
				modifier = befriend_learning_study_modifier
				days = 1825
			}
		}
		duel = {
			skill = learning
			value = 10
			20 = { 	
				desc = befriend_ongoing.5007.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 1
					min = -19
				}
				send_interface_toast = {
					title = befriend_ongoing.5007.a.success
					scope:scheme = {
						add_scheme_modifier = {
							type = befriend_studious_modifier
							days = 365
						}
					}
				}
			}
			10 = {
				desc = befriend_ongoing.5007.a.failure		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -1
					min = -9
				}
				send_interface_toast = {	
					title = befriend_ongoing.5007.a.failure
					scope:scheme = {
						add_scheme_modifier = {
							type = befriend_bad_studious_modifier
							days = 365
						}
					}
				}
			}
		}
		stress_impact = {
			lazy = medium_stress_impact_gain
		}
	}

	option = { #I'd rather take it easy
		name = befriend_ongoing.5007.b
		add_stress = minor_stress_loss
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			diligent = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}
	}
}


#################################
# Trades
# 6000-6999
#################################

####
# Release a Prisoner for Better Relations - Chain
# 6001-6008
# by Petter Vilberg
####
scripted_trigger befriend_ongoing_6001_prisoner_trigger = {
	OR = {
		is_close_or_extended_family_of = scope:target
		has_relation_friend = scope:target
		has_relation_lover = scope:target
		reverse_opinion = {
			target = scope:target
			value > 10
		}
		NOT = {
			this = scope:target
		}
		AND = {
			liege = scope:target
			reverse_opinion = {
				target = scope:target
				value > 50
			}
		}
	}
}

#Find a suitable prisoner
befriend_ongoing.6001 = {
	hidden = yes

	trigger = {
		NOT = {
			scope:scheme = {
				has_variable = had_event_befriend_ongoing_6001
			}
		}
		any_prisoner = {
			befriend_ongoing_6001_prisoner_trigger = yes
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_6001
				value = yes
				days = 3650
			}
		}
		random_prisoner = {
			limit = {
				befriend_ongoing_6001_prisoner_trigger = yes
			}
			save_scope_as = prisoner
		}
		scope:target = {
			trigger_event = befriend_ongoing.6002
		}
	}
}

#Target wonders about requesting their release
befriend_ongoing.6002 = {
	type = character_event
	title = befriend_ongoing.6002.t
	desc = befriend_ongoing.6002.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:prisoner

	option = { #Request their release
		name = befriend_ongoing.6002.a
		custom_tooltip = befriend_ongoing.6002.a.tt
		show_as_tooltip = {
			scope:prisoner = {
				release_from_prison = yes
			}
			scope:prisoner = {
				add_opinion = {
					target = root
					modifier = pleased_opinion
					opinion = 30
				}
			}
		}
		scope:owner = {
			trigger_event = {
				id = befriend_ongoing.6003
				days = { 5 10 }
			}
		}
		ai_chance = {
			base = 100
			opinion_modifier = {	
				trigger = {
					NOT = { root = scope:prisoner }
				}
				who = root
				opinion_target = scope:prisoner
			}
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_boldness = 0.5
			}
		}
	}

	option = { #Nah
		name = befriend_ongoing.6002.b
		custom_tooltip = befriend_ongoing.6002.b.tt
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_honor = 0.25
			}
		}
	}
}


#Check that the prisoner is still alive and the Scheme still exists
befriend_ongoing.6003 = {
	hidden = yes

	immediate = {
		if = {
			limit = {
				scope:prisoner = {
					is_alive = yes
				}
				exists = scope:scheme
			}
			trigger_event = befriend_ongoing.6004
		}
	}
}


#Target requests the release of prisoner
befriend_ongoing.6004 = {
	type = character_event
	title = befriend_ongoing.6001.t
	desc = befriend_ongoing.6004.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:prisoner
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	immediate = {
		scope:target = {
			if = {
				limit = { root = { is_ai = no }	}
				assign_quirk_effect = yes
			}
		}
	}
	
	option = { #Let them go
		name = befriend_ongoing.6004.a
		show_as_tooltip = {
			scope:prisoner = {
				release_from_prison = yes
			}
		}
		scope:target = {	
			show_as_tooltip = {
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 25
				}
			}
			trigger_event = befriend_ongoing.6005
		}
		if = {
			limit = {
				exists = scope:scheme
			}
			scope:scheme = {
				add_scheme_progress = scheme_progress_gain
			}
		}
		stress_impact = {
			stubborn = minor_stress_impact_gain
			sadistic = medium_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			compare_modifier = {
				value = ai_rationality
				trigger = {
					tier_difference = {
						target = scope:prisoner
						value > 1
					}
				}
			}
		}
	}

	option = {
		name = befriend_ongoing.6004.b
		trigger = {
			is_in_prison_type = dungeon
		}
		scope:prisoner = {
			change_prison_type = house_arrest
		}
		scope:target = {
			show_as_tooltip = {
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 5
				}
			}
			trigger_event = befriend_ongoing.6007
		}
		stress_impact = {
			sadistic = medium_stress_impact_gain
			callous = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_honor = 0.5
			}
		}
	}

	option = { #No
		name = befriend_ongoing.6004.c
		scope:target = {
			show_as_tooltip = {
				add_opinion = {
					target = scope:owner
					modifier = disappointed_opinion
					opinion = -15
				}
			}
			trigger_event = befriend_ongoing.6006
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_compassion = -0.5
			}
		}
	}
}


#Target notification: Prisoner has been released!
befriend_ongoing.6005 = {
	type = character_event
	title = befriend_ongoing.6001.t
	desc = befriend_ongoing.6005.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:prisoner

	trigger = {
		exists = scope:scheme
		scope:prisoner = { is_imprisoned = yes }
	}
	
	immediate = {
		scope:prisoner = {
			release_from_prison = yes
		}
		scope:prisoner = {
			trigger_event = befriend_ongoing.6008
		}
	}
	
	option = {
		name = befriend_ongoing.6005.a
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 20
		}
		show_as_tooltip = {
			scope:prisoner = {
				add_opinion = {
					target = root
					modifier = pleased_opinion
					opinion = 30
				}
			}
		}
	}
}

#Target notification: Owner refused the release!
befriend_ongoing.6006 = {
	type = character_event
	title = befriend_ongoing.6001.t
	desc = befriend_ongoing.6006.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:prisoner
	
	trigger = {
		exists = scope:scheme
	}
	
	option = {
		name = befriend_ongoing.6006.a
		add_opinion = {
			target = scope:owner
			modifier = disappointed_opinion
			opinion = -15
		}
	}
}

#Target notification: Prisoner was moved from dungeon to house arrest
befriend_ongoing.6007 = {
	type = character_event
	title = befriend_ongoing.6001.t
	desc = befriend_ongoing.6007.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:prisoner

	trigger = {
		exists = scope:scheme
	}
	
	immediate = {
		show_as_tooltip = {
			scope:prisoner = {
				change_prison_type = house_arrest
			}
		}
	}
	
	option = {
		name = befriend_ongoing.6007.a
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 5
		}
	}
}

#Prisoner notification: I have been released because of scope:target
befriend_ongoing.6008 = {
	type = character_event
	title = befriend_ongoing.6001.t
	desc = befriend_ongoing.6008.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:target
	
	trigger = {
		exists = scope:scheme
	}
	
	option = {
		name = befriend_ongoing.6008.a
		add_opinion = {
			target = scope:target
			modifier = pleased_opinion
			opinion = 30
		}
	}
}

### END OF PRISONER RELEASE CHAIN

#####
# Offer a Favor to Target
# by Petter Vilberg and Linnéa Thimrén
#####

# Owner can offer favor
befriend_ongoing.6009 = {
	type = character_event
	title = befriend_ongoing.6009.t
	desc = befriend_ongoing.6009.desc
	theme = befriend_scheme
	left_portrait = root
	right_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_6009 }
			scheme_progress > 0
			NOT = { has_scheme_modifier = befriend_indebted_myself_modifier }
		}
		scope:target = {
			NOT = {
				has_hook = scope:owner
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_6009
				value = yes
				days = 3650
			}
		}
	}

	option = { #Offer a favor, short term benefit
		name = befriend_ongoing.6009.a
		scope:target = {
			show_as_tooltip = {
				add_hook = {
					type = favor_hook
					target = scope:owner
				}
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 20
				}
			}
			trigger_event = befriend_ongoing.6010
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = offered_favor_modifier
			}
			add_scheme_progress = scheme_progress_gain
		}
		stress_impact = {
			patient = medium_stress_impact_gain
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
			}
			modifier = {
				add = 100
				scope:scheme = {
					scheme_progress >= 6
				}
			}
		}
	}

	option = { #Offer a favor, long term benefit
		name = befriend_ongoing.6009.b
		scope:target = {
			show_as_tooltip = {
				add_hook = {
					type = favor_hook
					target = scope:owner
				}
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 20
				}
			}
			trigger_event = befriend_ongoing.6010
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_indebted_myself_modifier
				days = 730
			}
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			modifier = {
				add = 100
				scope:scheme = {
					scheme_progress < 5
				}
			}
		}
	}
	
	option = { #Decline
		name = befriend_ongoing.6009.c
		custom_tooltip = befriend_ongoing.6009.c.tt
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			generous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
			modifier = {
				add = 200
				exists = root.liege
				scope:target = root.liege
			}
			modifier = {
				add = 100
				scope:target = {
					target_is_liege_or_above = root
				}
			}
		}
	}
}


#Target receives favor from owner
befriend_ongoing.6010 = {
	type = character_event
	title = befriend_ongoing.6010.t
	desc = befriend_ongoing.6010.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = root
	
	option = {
		name = befriend_ongoing.6010.a
		add_hook = {
			type = favor_hook
			target = scope:owner
		}
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 20
		}
	}
}

### END OFFER FAVOR CHAIN

#####
# Cancel a Favor the Target Owes Owner
# 6011 - 6012
# by Petter Vilberg
####

#Do you want to cancel a Favor the Target owes you?
befriend_ongoing.6011 = {
	type = character_event
	title = befriend_ongoing.6009.t
	desc = befriend_ongoing.6011.desc
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_6011 }
			NOT = { has_scheme_modifier = befriend_offered_leniency_modifier }
		}
		has_hook_of_type = {
			target = scope:target
			type = favor_hook
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_6011
				value = yes
				days = 3650
			}
		}
	}

	option = { #Yes, give it up
		name = befriend_ongoing.6011.a
		show_as_tooltip = {
			remove_hook = {
				target = scope:target
				type = favor_hook
			}
			scope:target = {
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 20
				}
			}
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_offered_leniency_modifier
				days = 730
			}
		}
		scope:target = {
			trigger_event = befriend_ongoing.6012
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			modifier = { #Less likely the more useful a favor is
				add = -75
				scope:target = root.liege
			}
			modifier = {
				add = -50
				scope:target = {
					target_is_liege_or_above = root
				}
			}
		}
	}

	option = {
		name = befriend_ongoing.6011.b
		custom_tooltip = befriend_ongoing.6011.b.tt
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
			generous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}
}

# Target: Owner has given up a hook on you
befriend_ongoing.6012 = {
	type = character_event
	title = befriend_ongoing.6010.t
	desc = befriend_ongoing.6012.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = root
	
	immediate = {
		scope:owner = {
			remove_hook = {
				target = scope:target
				type = favor_hook
			}
		}
	}

	option = {
		name = befriend_ongoing.6012.a
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 20
		}
	}
}

### END GIVING UP FAVOR CHAIN

#####
# Cancel a Blackmail Hook on the Target
# 6013 - 6014
# by Petter Vilberg
####

#Do you want to cancel a Blackmail hook the Target owes you?
befriend_ongoing.6013 = {
	type = character_event
	title = befriend_ongoing.6009.t
	desc = befriend_ongoing.6013.desc
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_6013 }
			NOT = { has_scheme_modifier = befriend_offered_leniency_modifier }
		}
		OR = {
			has_hook_of_type = {
				target = scope:target
				type = weak_blackmail_hook
			}
			has_hook_of_type = {
				target = scope:target
				type = strong_blackmail_hook
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_6013
				value = yes
				days = 3650
			}
		}
	}

	option = { #Yes, give it up
		name = befriend_ongoing.6013.a
		show_as_tooltip = {
			remove_hook = {
				target = scope:target
			}
			scope:target = {
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 30
				}
			}
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_offered_leniency_modifier
				days = 730
			}
		}
		scope:target = {
			trigger_event = befriend_ongoing.6014
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
			}
			modifier = { #Less likely the more useful a favor is
				add = -75
				scope:target = root.liege
			}
			modifier = {
				add = -50
				scope:target = {
					target_is_liege_or_above = root
				}
			}
		}
	}

	option = {
		name = befriend_ongoing.6013.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			gregarious = minor_stress_impact_gain
			generous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}
}

# Target: Owner has given up a hook on you
befriend_ongoing.6014 = {
	type = character_event
	title = befriend_ongoing.6010.t
	desc = befriend_ongoing.6014.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = root
	
	immediate = {
		scope:owner = {
			remove_hook = {
				target = scope:target
			}
		}
	}

	option = {
		name = befriend_ongoing.6014.a
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 30
		}
	}
}

### END GIVING UP BLACKMAIL CHAIN

######
# Take on some of Target's Stress in exchange for progress
# 6015 - 6016
# by Petter Vilberg
#####

#Owner: Take on Stress?
befriend_ongoing.6015 = {
	type = character_event
	title = befriend_ongoing.6015.t
	desc = {
		desc = befriend_ongoing.6015.opening
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_malicious_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.malicious
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_benevolent_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.benevolent
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_dominant_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.dominant
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_submissive_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.submissive
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_extroverted_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.extroverted
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_introverted_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.introverted
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_emotional_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.emotional
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_levelheaded_trigger = yes
					}
				}
				desc = befriend_ongoing.6015.levelheaded
			}
		}
	}
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		scope:scheme = {
			scheme_progress >= 5
			NOT = { has_variable = had_event_befriend_ongoing_6015 }
		}
		stress < high_medium_stress
		scope:target = {
			NOT = { has_relation_friend = scope:owner }
			NOT = { has_relation_lover = scope:owner }
			NOT = { is_consort_of = scope:owner }
			is_landed = yes
			stress >= normal_baseline_stress
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 1
			stress <= normal_baseline_stress
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_6015
				value = yes
				days = 1825
			}
		}
		scope:target = {
			capital_barony = {
				save_scope_as = barony
			}
		}
	}

	option = {
		name = befriend_ongoing.6015.a
		scope:target = {
			show_as_tooltip = {
				add_stress = medium_stress_loss
				add_opinion = {
					target = scope:target
					modifier = pleased_opinion
					opinion = 10
				}
			}
			trigger_event = befriend_ongoing.6016
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = helpful_hand_modifier
			}
			add_scheme_progress = scheme_progress_gain
		}
		stress_impact = {
			base = medium_stress_gain
			callous = medium_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
			}
			modifier = { #Just to be sure the AI doesn't kill itself over this
				factor = 0
				stress > medium_stress_gain_threshold
			}
			modifier ={
				add = -80
				stress > scope:target.stress
			}
		}
	}

	option = {
		name = befriend_ongoing.6015.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 50
		}
	}
}

#Target: Owner has helped you calm down!
befriend_ongoing.6016 = {
	type = character_event
	title = befriend_ongoing.6016.t
	desc = {
		desc = befriend_ongoing.6016.opening
		random_valid = {
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_malicious_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.malicious
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_benevolent_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.benevolent
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_dominant_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.dominant
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_submissive_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.submissive
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_extroverted_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.extroverted
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_introverted_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.introverted
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_emotional_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.emotional
			}
			triggered_desc = {
				trigger = {
					scope:target = {
						has_personality_levelheaded_trigger = yes
					}
				}
				desc = befriend_ongoing.6016.levelheaded
			}
		}
	}
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:owner
	
	immediate = {
		show_as_tooltip = {
			scope:owner = {
				add_stress = medium_stress_gain
			}
		}	
	}

	option = {
		name = befriend_ongoing.6016.a
		add_stress = medium_stress_loss
		add_opinion = {
			target = scope:target
			modifier = pleased_opinion
			opinion = 10
		}
	}
}

### END TAKING ON STRESS CHAIN

######
# Pay for Increasing Development Growth in Target's County
# 6017 - 6018
# by Petter Vilberg
######
scripted_trigger befriend_ongoing_6017_suitable_county_trigger = {
	holder = scope:target
	NOT = {
		has_county_modifier = befriend_irrigation_project_modifier
	}
	save_temporary_scope_as = county
	scope:owner = {
		capital_county = {
			development_level > scope:county.development_level
		}
	}
}

#Owner: Do you want to fund this plan?
befriend_ongoing.6017 = {
	type = character_event
	title = befriend_ongoing.6017.t
	desc = befriend_ongoing.6017.desc
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}
	
	trigger = {
		is_landed = yes
		highest_held_title_tier >= tier_county
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_6017 }
			scheme_progress >= 2
		}
		scope:target = {
			any_sub_realm_county = {
				befriend_ongoing_6017_suitable_county_trigger = yes
			}
		}
		OR = { #Make sure that the two characters are in the same realm
			target_is_liege_or_above = scope:target
			scope:target = { target_is_liege_or_above = scope:owner }
			top_liege = scope:target.top_liege
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_event_befriend_ongoing_6017
				value = yes
				days = 3650
			}
		}
		scope:target = {
			random_sub_realm_county = {
				limit = {
					befriend_ongoing_6017_suitable_county_trigger = yes
				}
				save_scope_as = county
			}
		}
		capital_province = {
			county = {
				save_scope_as = owner_county
			}
		}
	}

	option = { # Fund the project
		name = befriend_ongoing.6017.a
		remove_short_term_gold = medium_gold_value
		show_as_tooltip = {
			scope:county = {
				add_county_modifier = {
					modifier = befriend_irrigation_project_modifier
					days = 3650
				}
			}
			scope:target = {
				add_opinion = {
					target = scope:owner
					modifier = pleased_opinion
					opinion = 25
				}
			}
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = cheap_gift_modifier
				days = 720
			}
			add_scheme_progress = scheme_progress_gain
		}
		scope:target = {
			trigger_event = befriend_ongoing.6018
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 0.5
				ai_boldness = 0.5
			}
			modifier = {
				add = 200
				any_sub_realm_county = {
					this = scope:county
				}
			}
			modifier = {
				factor = 0
				short_term_gold < medium_gold_value
				NOT = { has_trait = generous }
			}
			modifier = {
				factor = 0.2
				short_term_gold < medium_gold_value
				has_trait = generous
			}
		}
	}

	option = { # Forget it
		name = befriend_ongoing.6017.b
		custom_tooltip = befriend_ongoing.6017.b.tt
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}
}

# Target: Owner is funding an irrigation project!
befriend_ongoing.6018 = {
	type = character_event
	title = befriend_ongoing.6018.t
	desc = befriend_ongoing.6018.desc
	theme = befriend_scheme
	left_portrait = scope:owner	
	right_portrait = root

	option = {
		name = befriend_ongoing.6018.a
		scope:county = {
			add_county_modifier = {
				modifier = befriend_irrigation_project_modifier
				days = 3650
			}
		}
		add_opinion = {
			target = scope:owner
			modifier = pleased_opinion
			opinion = 25
		}
	}
}

### END INCREASE COUNTY DEVELOPMENT CHAIN

##########################
# Give up opinion with other character to benefit them
# by Linnéa Thimrén
# Statecraft lifestyle event

scripted_trigger valid_liege_befriend_ongoing_6019_trigger = {
	is_ai = yes
	NOR = { 
		this = root 
		this = scope:target 
	}
	OR = {
		this = root.liege
		is_vassal_of = root
	}
}
scripted_trigger valid_vassal_befriend_ongoing_6019_trigger = {
	is_ai = yes
	NOT = { liege = root }
	OR = {
		this = root.liege
		top_liege = root
	}
}

befriend_ongoing.6019 = {
	type = character_event
	title = befriend_ongoing.6019.t
	desc = befriend_ongoing.6019.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:opinion_target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		has_lifestyle = diplomacy_lifestyle
		NOT = { exists = scope:scheme.var:had_befriend_statecraft_event }
		scope:target = {
			OR = {
				AND = {
					exists = liege
					liege = {
						valid_liege_befriend_ongoing_6019_trigger = yes
					}
				}
				any_vassal = {
					valid_vassal_befriend_ongoing_6019_trigger = yes
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #Less likely if they have the same education (to avoid awkward loc)
			add = -0.5
			scope:target = {
				has_same_education_as_root_trigger = yes
			}
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {
				name = had_befriend_statecraft_event
				value = yes
				days = 3650
			}
		}
		scope:target = {
			if = {
				limit = {
					liege = {
						valid_liege_befriend_ongoing_6019_trigger = yes
					}
				}
				liege = {
					save_scope_as = opinion_target
				}
			}
			else_if = {
				limit = {
					any_vassal = {
						valid_vassal_befriend_ongoing_6019_trigger = yes
					}
				}
				random_vassal = {
					limit = {
						is_ai = yes
						NOT = { liege = root }
						this = root.liege
					}
					alternative_limit = {
						is_ai = yes
						NOT = { liege = root }
						top_liege = root
					}
					save_scope_as = opinion_target
				}
			}
		}
	}

	option = { #They should explain it!
		name = befriend_ongoing.6019.a
		add_prestige = minor_prestige_loss
		scope:scheme = {
			add_scheme_progress = scheme_progress_gain
		}
		scope:opinion_target = {
			add_opinion = {
				target = scope:target
				modifier = respect_opinion
				opinion = 25
			}
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			honest = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = 0.5
			}
		}
	}

	option = { #I want to be loved!!
		name = befriend_ongoing.6019.b
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		scope:opinion_target = {
			add_opinion = {
				target = root
				modifier = respect_opinion
				opinion = 15
			}
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_greed = 0.5
			}
		}
	}

	option = {
		name = befriend_ongoing.6019.c
		trigger = {
			has_trait = gregarious
		}
		trait = gregarious
		scope:scheme = {
			add_scheme_modifier = {
				type = settled_differences_modifier
			}
		}
	}
}


##Special Variations
#By Flavio Verna

# Your rival starts spreading rumours that you're only befriending your target to stab him in the back later.
scripted_trigger potential_rival_befriend_ongoing_9100_trigger = {
	NOT = {
		this = scope:target
	}
	is_alive = yes
	is_available_ai_adult = yes
}

befriend_ongoing.9100 = {
	type = character_event
	title = befriend_ongoing.9100.t
	desc = befriend_ongoing.9100.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:scoped_rival
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme = {
			scheme_progress > 3
			scheme_progress < 9
		}
		num_of_relation_rival >= 1
		any_relation = {
			type = rival
			potential_rival_befriend_ongoing_9100_trigger = yes
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_9100 }
		}
	}

	immediate = {
		random_relation = {
			type = rival
			limit = {
				potential_rival_befriend_ongoing_9100_trigger = yes
			}
			save_scope_as = scoped_rival
		}
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_9100
				value = yes
				days = 3650
			}
		}
	}
	
	#Special option
	option = {
		name = befriend_ongoing.9100.a
		trigger = {
			has_diplomacy_lifestyle_trait_trigger = yes
		}
		trait = diplomat
		trait = family_first
		trait = august
		scope:scoped_rival = {
			add_prestige = minor_prestige_loss
		}
		ai_chance = {
			base = 40
		}
	}

	#Diplo duel
	option = {
		name = befriend_ongoing.9100.b
		duel = {
			skill = diplomacy
			target = scope:scoped_rival
			10 = { #Success.
				desc = befriend_ongoing.9100.b.success.desc.tt
					compare_modifier = {
						value = scope:duel_value
					multiplier = 1
					min = 0
					}
				send_interface_toast = {
					left_icon = scope:target
					right_icon = scope:scoped_rival
					title = befriend_ongoing.9100.b.success.desc.toast
					add_prestige = minor_prestige_gain
				}
				scope:scheme = {
					add_scheme_modifier = {
						type = unfortunate_misunderstanding_modifier
					}
				}
				scope:scoped_rival = {
					add_prestige = medium_prestige_loss
					stress_impact = {
						base = minor_stress_impact_gain
						wrathful = minor_stress_impact_gain
					}
				}
			}
			8 = { #Fail.
				desc = befriend_ongoing.9100.b.failure.desc.tt
				compare_modifier = {
					value = scope:duel_value
					multiplier = -1
				}
				send_interface_toast = {
					left_icon = scope:target
					right_icon = scope:scoped_rival
					title = befriend_ongoing.9100.b.failure.desc.tt
						add_prestige = medium_prestige_loss
				}
				scope:scheme = {
					add_scheme_progress = scheme_progress_loss
				}
				stress_impact = {
					base = minor_stress_impact_gain
					wrathful = minor_stress_impact_gain
				}
			}
		}
		ai_chance = {
			base = 40
		}
	}

	#Take malus
	option = {
		name = befriend_ongoing.9100.c
		scope:scheme = {
			add_scheme_modifier = {
				type = befriend_slanderous_rumors_modifier
				days = 730
			}
		}
		ai_chance = {
			base = 20
		}
	}
}

# A friend with a common trait with your target tells you how best to appease him.
scripted_trigger potential_friend_befriend_ongoing_9101_trigger = {
	NOR = {
		this = scope:target
		has_hook = scope:owner
		has_relation_rival = scope:target
	}
	is_alive = yes
	is_available_adult = yes
	number_of_personality_traits_in_common = {
		target = scope:target
		value >= 1
	}
}

befriend_ongoing.9101 = {
	type = character_event
	title = befriend_ongoing.9101.t
	desc = befriend_ongoing.9101.desc
	theme = befriend_scheme
	left_portrait = scope:target
	right_portrait = scope:scoped_friend
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme = {
			scheme_progress > 2
			scheme_progress < 7
		}
		any_relation = {
			type = friend
			potential_friend_befriend_ongoing_9101_trigger = yes
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_9101 }
		}
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				potential_friend_befriend_ongoing_9101_trigger = yes
			}
			save_scope_as = scoped_friend
		}
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_9101
				value = yes
				days = 3650
			}
		}
	}
	
	#Accept
	option = {
		name = befriend_ongoing.9101.a
		scope:scheme = { add_scheme_progress = scheme_progress_gain }
		show_as_tooltip = {
			scope:scoped_friend = {
				if = {
					limit = {
						scope:owner = { has_hook_of_type = { target = scope:scoped_friend type = favor_hook } }
					}
					scope:owner = { use_hook = scope:scoped_friend }
				}
				else = {
					add_hook = {
						target = scope:owner
						type = favor_hook
					}
				}
			}
			add_opinion = {
				target = scope:scoped_friend
				modifier = grateful_opinion
				opinion = 10
			}
		}
		scope:scoped_friend = {
			trigger_event = { #Notify friend.
				id = befriend_ongoing.9102
			}
		}
		ai_chance = {
			base = 90
		}
	}

	#Refuse
	option = {
		name = befriend_ongoing.9101.b
		ai_chance = {
			base = 10
		}
	}
}

#Friend notified of help.
befriend_ongoing.9102 = {
	type = character_event
	title = befriend_ongoing.9101.t
	desc = befriend_ongoing.9102.desc
	theme = befriend_scheme
	left_portrait = scope:owner
	right_portrait = scope:target

	immediate = {
		scope:scoped_friend = {
			if = {
				limit = {
					has_usable_hook = scope:owner
				}
				use_hook = scope:owner
			}
			else = {
				add_hook = {
					target = scope:owner
					type = favor_hook
				}
			}
		}
		scope:owner = {
			add_opinion = {
				target = scope:scoped_friend
				modifier = grateful_opinion
				opinion = 10
			}
		}
	}
	
	option = {
		name = befriend_ongoing.9102.a
	}
}

# Preparing surprise for vassal/courtier target who is shy/paranoid results in him thinking it was a murder attempt.
# Dreaded character's attempt at diplomacy is perceived as threat by smaller ruler.
befriend_ongoing.9103 = {
	type = character_event
	title = befriend_ongoing.9103.t
	desc = {
		first_valid = { #Circumstances
			triggered_desc = {
				trigger = {
					scope:target = {
						NOT = { target_is_liege_or_above = scope:owner }
						is_landed = yes
						primary_title = {
							is_mercenary_company = no
							is_holy_order = no
						}
					}
				}
				desc = befriend_ongoing.9103.ruler.desc
			}
			desc = befriend_ongoing.9103.vassal.desc
		}
	}
	theme = befriend_scheme
	right_portrait = root
	left_portrait = scope:target
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		scope:scheme = {
			scheme_progress > 2
			scheme_progress < 7
		}
		scope:target = {
			OR = {
				has_trait = shy
				has_trait = craven
				has_trait = paranoid
				scope:owner = { dread >= medium_dread }
			}
			OR = {
				is_ruler = no
				scope:owner = {
					tier_difference = {
						target = scope:target
						value >= 1
					}
				}
			}
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_9103 }
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_9103
				value = yes
				days = 3650
			}
		}
	}

	#Just roll with it.
	option = {
		name = befriend_ongoing.9103.a
		add_dread = minor_dread_gain
		scope:scheme = {
			add_scheme_progress = scheme_progress_loss
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			just = minor_stress_impact_gain
			generous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_compassion = -1.0
			}
		}
	}

	option = {
		name = befriend_ongoing.9103.b
		scope:scheme = {
			add_scheme_modifier = {
				type = unfortunate_misunderstanding_modifier
				days = 900
			}
		}
		scope:target = {
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = 10
			}
		}
		stress_impact = {
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
		}
	}
}

# Befriending theocrat by making an offering.
scripted_trigger potential_child_befriend_ongoing_9104_trigger = {
	is_alive = yes
	is_available_ai = yes
	liege = scope:owner
	is_ruler = no
	is_adult = no
	NOT = {
		is_player_heir_of_trigger = { CHARACTER = scope:owner }
	}
}
scripted_trigger potential_mate_befriend_ongoing_9104_trigger = {
	is_alive = yes
	is_available_ai = yes
	liege = scope:owner
	is_ruler = no
	is_adult = yes
	is_married = no
	mgr_can_seduce = yes
	OR = {
		sex_opposite_of = scope:target
		scope:target = {
			faith = {
				has_doctrine = doctrine_homosexuality_accepted
			}
		}
	}
	age < 30
	NOT = {
		is_player_heir_of_trigger = { CHARACTER = scope:owner }
	}
	OR = {
		NOT = {
			is_close_or_extended_family_of = scope:target
		}
		scope:target = {
			faith = {
				has_doctrine = tenet_divine_marriage
			}
		}
	}
}

scripted_trigger potential_owner_mate_befriend_ongoing_9104_trigger = {
	is_adult = yes
	is_married = no
	OR = {
		sex_opposite_of = scope:target
		scope:target = {
			faith = {
				has_doctrine = doctrine_homosexuality_accepted
			}
		}
	}
	age < 30
	OR = {
		NOT = {
			is_close_or_extended_family_of = scope:target
		}
		scope:target = {
			faith = {
				has_doctrine = tenet_divine_marriage
			}
		}
	}
}

scripted_trigger potential_monk_befriend_ongoing_9104_trigger = {
	is_alive = yes
	is_available_ai = yes
	exists = liege
	liege = scope:owner
	is_ruler = no
	is_adult = yes
	is_married = no
	NOR = {
		is_player_heir_of_trigger = { CHARACTER = scope:owner }
		has_trait = celibate
		has_trait = devoted
	}
	opinion = { #The child should like you enough to comply.
		target = scope:owner
		value >= 30
	}
}

befriend_ongoing.9104 = {
	type = character_event
	title = befriend_ongoing.9104.t
	desc = befriend_ongoing.9104.desc

	theme = befriend_scheme
	right_portrait = scope:target
	left_portrait = root
	lower_left_portrait = scope:scoped_child
	lower_center_portrait = scope:scoped_monk
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = {
			has_trait = cynical
		}
		scope:scheme = {
			scheme_progress > 3
			scheme_progress < 9
		}
		scope:target = {
			faith = scope:owner.faith
			OR = {
				has_government = theocracy_government
				has_council_position = councillor_court_chaplain
			}
			faith = {
				has_doctrine = doctrine_theocracy_temporal
				OR = {
					has_doctrine = tenet_mendicant_preachers
					has_doctrine = tenet_vows_of_poverty
					AND = {
						has_doctrine = tenet_monasticism
						scope:owner = {
							OR = {
								AND = {
									NOR = {
										has_trait = celibate
										has_trait = devoted
									}
									OR = {
										has_trait = chaste
										has_trait = zealous
									}
								}
								any_child = {
									potential_monk_befriend_ongoing_9104_trigger = yes
								}
							}
						}
					}
				}
			}
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_9104 }
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_9104
				value = yes
				days = 7300
			}
		}
		if = {
			limit = { faith = { has_doctrine = tenet_monasticism } }
			random_child = {
				limit = {
					reverse_opinion = {
						target = scope:owner
						value <= -25
					}
					potential_monk_befriend_ongoing_9104_trigger = yes
				}
				alternative_limit = {
					potential_monk_befriend_ongoing_9104_trigger = yes
				}
				save_scope_as = scoped_monk
			}
		}
	}
	# Public humiliation. (mendicant preachers)
	# Large donation. (default)
	# Add pick vow of celibacy (monasticism)
	# Add send child to monastery (monasticism)
	# Never mind... (default)

	#Public humiliation.
	option = {
		name = befriend_ongoing.9104.a
		trigger = {
			faith = { has_doctrine = tenet_mendicant_preachers }
		}
		add_piety = miniscule_piety_gain
		add_prestige = major_prestige_loss
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_boldness = -1.0
			}
		}
	}
	#Large donation.
	option = {
		name = befriend_ongoing.9104.b
		add_piety = miniscule_piety_gain
		pay_short_term_gold = {
			target = scope:target
			gold = root.major_gold_value
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_greed = -1.0
			}
		}
	}

	# Add pick vow of celibacy
	option = {
		name = befriend_ongoing.9104.g
		trigger = {
			faith = { has_doctrine = tenet_monasticism }
			NOT = { has_trait = celibate }
			OR = {
				has_trait = chaste
				has_trait = zealous
			}
		}
		trait = chaste
		trait = zealous
		add_piety = miniscule_piety_gain
		add_trait = celibate
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			lustful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_boldness = -1.0
			}
		}
	}
	# Add send child to monastery
	option = {
		name = befriend_ongoing.9104.h
		trigger = {
			faith = { has_doctrine = tenet_monasticism }
			exists = scope:scoped_monk
		}
		add_piety = miniscule_piety_gain
		scope:scoped_monk = { add_trait = devoted }
		remove_courtier_or_guest = scope:scoped_monk
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_compassion = -1.0
			}
		}
	}

	option = { #Never mind...
		name = befriend_ongoing.9104.z
		stress_impact = {
			zealous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 5
		}
	}
}

#Second variation.
befriend_ongoing.9105 = {
	type = character_event
	title = befriend_ongoing.9104.t
	desc = befriend_ongoing.9104.desc

	theme = befriend_scheme
	right_portrait = scope:target
	left_portrait = scope:scoped_child
	lower_left_portrait = scope:scoped_mate
	widget = {
		gui = "event_window_widget_scheme"
		container = "custom_widgets_container"
	}

	trigger = {
		NOT = {
			has_trait = cynical
		}
		scope:scheme = {
			scheme_progress > 3
			scheme_progress < 9
		}
		scope:target = {
			faith = scope:owner.faith
			OR = {
				has_government = theocracy_government
				has_council_position = councillor_court_chaplain
			}
			faith = {
				has_doctrine = doctrine_theocracy_temporal
				OR = {
					AND = {
						has_doctrine = tenet_human_sacrifice
						scope:owner = {
							any_child = {
								potential_child_befriend_ongoing_9104_trigger = yes
							}
						}
					}
					AND = {
						has_doctrine = tenet_carnal_exaltation
						scope:owner = {
							OR = {
								potential_owner_mate_befriend_ongoing_9104_trigger = yes
								any_child = {
									potential_mate_befriend_ongoing_9104_trigger = yes
								}
							}
						}
					}
					AND = {
						has_doctrine = tenet_exaltation_of_pain
						scope:owner = {
							NOT = { has_trait = wounded_3 }
						}
					}
				}
			}
		}
		scope:scheme = {
			NOT = { has_variable = had_event_befriend_ongoing_9104 }
		}
	}

	immediate = {
		scope:scheme = {
			set_variable = {	
				name = had_event_befriend_ongoing_9104
				value = yes
				days = 7300
			}
		}
		if = {
			limit = { faith = { has_doctrine = tenet_human_sacrifice } }
			random_child = {
				limit = {
					reverse_opinion = {
						target = scope:owner
						value <= -25
					}
					potential_child_befriend_ongoing_9104_trigger = yes
				}
				alternative_limit = {
					potential_child_befriend_ongoing_9104_trigger = yes
				}
				save_scope_as = scoped_child
			}
		}
		if = {
			limit = { faith = { has_doctrine = tenet_carnal_exaltation } }
			random_child = {
				limit = {
					reverse_opinion = {
						target = scope:owner
						value <= -25
					}
					potential_mate_befriend_ongoing_9104_trigger = yes
				}
				alternative_limit = {
					potential_mate_befriend_ongoing_9104_trigger = yes
				}
				save_scope_as = scoped_mate
			}
		}
	}

	# Baby burn. (ritual sacrifice)
	# Personal maiming (pain exaltation)
	# Carnal offering - Personal (carnal exaltation)
	# Carnal offering - Child (carnal exaltation)
	# Never mind... (default)

	#Baby burn.
	option = {
		name = befriend_ongoing.9104.c
		trigger = {
			faith = { has_doctrine = tenet_human_sacrifice }
			exists = scope:scoped_child
		}
		add_piety = miniscule_piety_gain
		sacrifice_prisoner_effect = {
			VICTIM = scope:scoped_child
			EXECUTIONER = root
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_compassion = -1.0
			}
		}
	}
	#Personal maiming
	option = {
		name = befriend_ongoing.9104.d
		trigger = {
			faith = { has_doctrine = tenet_exaltation_of_pain }
			NOT = { has_trait = wounded_3 }
		}
		add_piety = miniscule_piety_gain
		increase_wounds_no_death_effect = { REASON = scarified }
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			cynical = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			ai_value_modifier = {
				ai_boldness = 1.0
			}
		}
	}
	#Carnal offering - Personal
	option = {
		name = befriend_ongoing.9104.e
		trigger = {
			faith = { has_doctrine = tenet_carnal_exaltation }
			potential_owner_mate_befriend_ongoing_9104_trigger = yes
		}
		add_piety = miniscule_piety_gain
		custom_tooltip = befriend_ongoing.9104.e.tt
		scope:owner = {
			had_sex_with_effect = {
				CHARACTER = scope:target
				PREGNANCY_CHANCE = pregnancy_chance
			}
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			chaste = minor_stress_impact_gain
		}
		ai_chance = {
			base = 15
			ai_value_modifier = {
				ai_honor = -1.0
			}
		}
	}
	#Carnal offering - Child
	option = {
		name = befriend_ongoing.9104.f
		trigger = {
			faith = { has_doctrine = tenet_carnal_exaltation }
			exists = scope:scoped_mate
		}
		add_piety = miniscule_piety_gain
		custom_tooltip = befriend_ongoing.9104.f.tt
		scope:scoped_mate = {
			had_sex_with_effect = {
				CHARACTER = scope:target
				PREGNANCY_CHANCE = pregnancy_chance
			}
		}
		scope:scheme = {
			add_scheme_modifier = {
				type = auspicious_offering_modifier
			}
		}
		stress_impact = {
			chaste = minor_stress_impact_gain
		}
		ai_chance = {
			base = 25
			ai_value_modifier = {
				ai_honor = -1.0
			}
		}
	}

	option = { #Never mind...
		name = befriend_ongoing.9104.z
		stress_impact = {
			zealous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 5
		}
	}
}
