namespace = ep3_interactions_events

# Favor
ep3_interactions_events.0001 = {
	type = letter_event
	opening = ep3_interactions_events.0001.opening
	desc = {
		desc = ep3_interactions_events.0001.desc
		desc = ep3_interactions_events.0001.favor
	}
	sender = scope:recipient

	trigger = {
		exists = scope:demanded_administration
		scope:recipient.primary_title = scope:demanded_administration
		scope:recipient = { target_is_liege_or_above = scope:actor }
	}

	#Accept
	option = {
		name = ep3_interactions_events.0001.a
		scope:recipient = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = ep3_interactions_events.0001.accept_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				add_hook = {
					target = scope:actor
					type = favor_hook
				}
				change_to_administrative_interaction_effect = yes
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_gain
		}
		ai_chance = {
			base = 75
			opinion_modifier = {
				opinion_target = scope:recipient
				multiplier = 0.5
			}
		}
	}

	#Refuse
	option = {
		name = ep3_interactions_events.0001.b
		scope:recipient = {
			send_interface_toast = {
				type = event_toast_effect_bad
				title = ep3_interactions_events.0001.refuse_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				# In Japan, this starts a war
				if = {
					limit = {
						scope:actor = { government_has_flag = government_is_japan_administrative }
						scope:recipient = { government_has_flag = government_is_japan_feudal }
					}
					tgp_japan_demand_administrative_refusal_effect = yes
				}
				# Elsewhere it does not
				else = { custom_tooltip = demand_admin_interaction_vassal_refuses }
				# Opinion
				if = {
					limit = {
						scope:actor = { is_ai = yes }
					}
					reverse_add_opinion = {
						target = scope:actor
						modifier = angry_opinion
						opinion = -25
					}
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	#Use a Hook to force it through
	option = {
		name = religious_interaction.2012.c
		trigger = { has_strong_usable_hook = scope:recipient }
		scope:recipient = {	
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = ep3_interactions_events.0001.force_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				scope:actor = { use_hook = scope:recipient }
				change_to_administrative_interaction_effect = yes
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

# Gold
ep3_interactions_events.0002 = {
	type = letter_event
	opening = ep3_interactions_events.0001.opening
	desc = {
		desc = ep3_interactions_events.0001.desc
		desc = ep3_interactions_events.0002.gold
	}
	sender = scope:recipient
	
	trigger = {
		exists = scope:demanded_administration
		scope:recipient.primary_title = scope:demanded_administration
		scope:recipient = { target_is_liege_or_above = scope:actor }
	}

	immediate = {
	}

	#Accept
	option = {
		name = ep3_interactions_events.0002.a
		scope:recipient = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = ep3_interactions_events.0001.accept_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				change_to_administrative_interaction_effect = yes
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 75
			ai_value_modifier = {
				ai_greed = -1
				ai_rationality = 0.5
			}
			modifier = {
				factor = 0.2
				gold <= 0
			}
			opinion_modifier = {
				opinion_target = scope:recipient
				multiplier = 0.5
			}
		}
	}

	#Refuse
	option = {
		name = ep3_interactions_events.0001.b
		scope:recipient = {
			send_interface_toast = {
				type = event_toast_effect_bad
				title = ep3_interactions_events.0001.refuse_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				custom_tooltip = demand_admin_interaction_vassal_refuses
				if = {
					limit = {
						scope:actor = { is_ai = yes }
					}
					reverse_add_opinion = {
						target = scope:actor
						modifier = angry_opinion
						opinion = -25
					}
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 100
				gold < medium_gold_value
			}
		}
	}

	#Use a Hook to force it through
	option = {
		name = religious_interaction.2011.c
		trigger = { has_strong_usable_hook = scope:recipient }
		save_scope_value_as = { # Cancel extra gold
			name = gold
			value = no
		}
		scope:recipient = {	
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = ep3_interactions_events.0001.force_toast
				left_icon = scope:actor
				right_icon = scope:demanded_administration
				scope:actor = { use_hook = scope:recipient }
				change_to_administrative_interaction_effect = yes
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

# Recipient Player event
ep3_interactions_events.0005 = {
	type = letter_event
	opening = ep3_interactions_events.0005.opening
	desc = {
		desc = ep3_interactions_events.0005.desc
		first_valid = {
			triggered_desc = {
				trigger = { scope:hereditary = yes }
				desc = ep3_interactions_events.0005.hereditary
			}
			desc = ep3_interactions_events.0005.fallback
		}
	}
	sender = scope:actor
	
	trigger = {
		exists = scope:demanded_administration
		scope:recipient.primary_title = scope:demanded_administration
		scope:recipient = { target_is_liege_or_above = scope:actor }
	}

	#Accept
	option = {
		name = ep3_interactions_events.0005.a
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_good
				title = demand_admin_interaction_accept
				left_icon = scope:recipient
				change_to_administrative_interaction_effect = yes
			}
		}
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 0
			demand_admin_acceptance_modifier = yes
			modifier = { # We increase the value to compensate for the potentially high AI values in the other options
				factor = 2
				always = yes
			}
		}
	}

	#Favor
	option = {
		name = ep3_interactions_events.0005.b
		trigger = {
			NOT = {
				has_hook_of_type = {
					target = scope:actor
					type = favor_hook
				}
			}
			scope:hook = no
		}
		show_as_unavailable = { scope:hook = yes }
		custom_description_no_bullet = {
			text = if_actor_accepts_desc
			object = scope:actor
		}
		show_as_tooltip = {
			add_hook = {
				target = scope:actor
				type = favor_hook
			}
			change_to_administrative_interaction_effect = yes
		}
		scope:actor = {
			trigger_event = {
				id = ep3_interactions_events.0001
				days = 5
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				add = {
					value = 50
					# This goes double for your Powerful Vassals. A better contract is likely to be much more important than a short-term payout.
					if = {
						limit = { is_powerful_vassal_of = scope:actor }
						add = 100
					}
				}
				this.liege = scope:actor
			}
			modifier = {
				has_trait = ambitious
				add = 50
			}
		}
	}

	#Gold
	option = {
		name = ep3_interactions_events.0005.c
		trigger = { scope:hook = no }
		show_as_unavailable = { scope:hook = yes }
		save_scope_value_as = {
			name = gold
			value = yes
		}
		custom_description_no_bullet = {
			text = if_actor_accepts_desc
			object = scope:actor
		}
		show_as_tooltip = {
			change_to_administrative_interaction_effect = yes
		}
		scope:actor = {
			trigger_event = {
				id = ep3_interactions_events.0002
				days = 5
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				add = 50 # More likely to ask for gold if they're poor
				scope:recipient.short_term_gold < medium_gold_value
			}
			modifier = {
				add = { # Much more likely to ask for gold if involved in one of their own wars (they want to win).
					value = 50
					if = {
						# Especially true if they're in debt!
						limit = { gold < 0 }
						add = 150
					}
				}
				is_at_war = yes
				any_character_war = { is_war_leader = scope:recipient }
			}
			modifier = {
				has_trait = greedy
				add = 50
			}
			modifier = {
				ai_greed < high_negative_ai_value
				add = -50
			}
		}
	}

	#Refuse
	option = {
		name = ep3_interactions_events.0005.d
		trigger = { scope:hook = no }
		show_as_unavailable = { scope:hook = yes }
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_bad
				title = demand_admin_interaction_refuse
				left_icon = scope:recipient
				custom_tooltip = demand_admin_interaction_vassal_refuses
			}
			if = {
				limit = { is_ai = yes }
				add_opinion = {
					modifier = angry_opinion
					target = scope:recipient
					opinion = -15
				}
			}
		}
		ai_chance = {
			base = 20
			opinion_modifier = {
				opinion_target = scope:actor
				multiplier = -0.5
			}
			modifier = {
				has_dread_level_towards = {
					target = scope:actor
					level = 1
				}
				add = -15
			}
			modifier = {
				has_dread_level_towards = {
					target = scope:actor
					level = 2
				}
				add = -30
			}
			modifier = {
				has_trait = stubborn
				add = 25
			}
			modifier = {
				has_trait = arrogant
				add = 25
			}
			modifier = {
				has_trait = ambitious
				add = -25
			}
		}
	}
}

ep3_interactions_events.0010 = {
	type = letter_event
	opening = ep3_interactions_events.0010.opening
	desc = ep3_interactions_events.0010.desc
	sender = scope:intermediary

	immediate = {
		custom_tooltip = ep3_interactions_events.0010.tt
	}

	option = { name = ep3_interactions_events.0010.a }
}

ep3_interactions_events.0011 = {
	type = letter_event
	opening = ep3_interactions_events.0011.opening
	desc = ep3_interactions_events.0011.desc
	sender = scope:intermediary

	immediate = {
		custom_tooltip = ep3_interactions_events.0011.tt
	}

	option = { name = ep3_interactions_events.0011.a }
}

ep3_interactions_events.0012 = {
	type = letter_event
	opening = ep3_interactions_events.0012.opening
	desc = ep3_interactions_events.0012.desc
	sender = scope:intermediary

	immediate = {

	}

	option = { name = ep3_interactions_events.0012.a }
}

ep3_interactions_events.0013 = {
	type = letter_event
	opening = ep3_interactions_events.0013.opening
	desc = ep3_interactions_events.0013.desc
	sender = scope:recipient

	immediate = {

	}

	option = {
		name = char_interaction.0263.a
	}
}

ep3_interactions_events.0014 = {
	type = letter_event
	opening = ep3_interactions_events.0014.opening
	desc = ep3_interactions_events.0014.desc
	sender = scope:recipient

	immediate = {
	}

	option = {
		name = ep3_interactions_events.0014.a
	}
}

ep3_interactions_events.0020 = {
	type = letter_event
	opening = ep3_interactions_events.0020.opening
	desc = ep3_interactions_events.0020.desc
	sender = scope:recipient
	
	immediate = {
		# Refund the influence cost
		change_influence = {
			value = admin_council_cost_value
			multiply = 0.5
		}
	}

	option = {
		name = ep3_interactions_events.0020.a
	}
}

ep3_interactions_events.0021 = {
	type = letter_event
	opening = ep3_interactions_events.0021.opening
	desc = ep3_interactions_events.0021.desc
	sender = scope:recipient
	
	option = {
		name = ep3_interactions_events.0021.a
	}
}

scripted_trigger ep3_interactions_events_0030_callous_trigger = {
	OR = {
		has_trait = sadistic
		has_trait = callous
		has_trait = zealous
		has_relation_rival = scope:recipient
		has_relation_nemesis = scope:recipient
		has_relation_victim = scope:recipient
		has_relation_bully = scope:recipient
	}
}

#You castrate a child-aged family member
ep3_interactions_events.0030 = { # By Jason Cantalini
	type = character_event
	title = ep3_interactions_events.0030.t
	desc = {
		desc = ep3_interactions_events.0030.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					age < 12
				}
				desc = ep3_interactions_events.0030.desc.child_address
			}
			desc = ep3_interactions_events.0030.desc.normal_address
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					culture = { has_cultural_pillar = language_greek }
					OR = {
						has_title = title:e_byzantium
						top_liege = {
							has_title = title:e_byzantium
						}
					}
				}
				desc = ep3_interactions_events.0030.desc.greek
			}
			desc = ep3_interactions_events.0030.desc.non_greek
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:recipient = {
						has_character_flag = accepted_castration_child
					}
				}
				desc = ep3_interactions_events.0030.desc.accepted_child
			}
			triggered_desc = {
				trigger = {
					scope:recipient = {
						has_character_flag = accepted_castration_youth
					}
				}
				desc = ep3_interactions_events.0030.desc.accepted_youth
			}
			triggered_desc = {
				trigger = {
					age < 12
				}
				desc = ep3_interactions_events.0030.desc.child_resents_castration
			}
			desc = ep3_interactions_events.0030.desc.resents_castration
		}
		desc = ep3_interactions_events.0030.desc
	}
	theme = administrative
	override_background = {
		reference = physicians_study
	}
	left_portrait = {
		character = scope:actor
		triggered_animation = {
			trigger = {
				scope:recipient = { has_character_flag = resents_castration }
			}
			animation = go_to_your_room
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:recipient = { has_character_flag = resents_castration }
				}
			}
			animation = personality_forgiving
		}
	}
	right_portrait = {
		character = scope:recipient
		triggered_animation = {
			trigger = {
				scope:recipient = { has_character_flag = resents_castration }
			}
			animation = fear
		}
		triggered_animation = {
			trigger = {
				NOT = {
					scope:recipient = { has_character_flag = resents_castration }
				}
			}
			animation = crying
		}
	}

	immediate = {
		hidden_effect = {
			#For the text
			save_court_physician_as_effect = { SCOPE_NAME = physician }
		}
	}

	option = {
		name = {
			trigger = {
				ep3_interactions_events_0030_callous_trigger = yes
			}
			text = ep3_interactions_events.0030_callous
		}
		name = {
			trigger = {
				ep3_interactions_events_0030_callous_trigger = no
			}
			text = ep3_interactions_events.0030_kind
		}
		scope:actor = { change_influence = minor_influence_gain }
		if = {
			limit = {
				scope:recipient = {
					has_character_flag = accepted_castration_child
				}
			}
			scope:recipient = {
				ep3_child_castration_effect = yes
				add_stress = medium_stress_gain
				custom_tooltip = castration_better_before_maturity
			}
		}
		else_if = {
			limit = {
				scope:recipient = {
					has_character_flag = accepted_castration_youth
				}
			}
			scope:recipient = {
				ep3_youth_castration_effect = yes
				add_stress = major_stress_gain
			}
		}
		else = {
			scope:recipient = {
				ep3_child_castration_effect = yes
				add_opinion = {
					modifier = castration_opinion
					target = scope:actor
					opinion = -50
				}
				add_stress = major_stress_gain
			}
		}
		scope:recipient = {
			create_character_memory = {
				type = family_castration_memory
				participants = {
					castrator = scope:actor
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}
	after = {
		if = {
			limit = {
				scope:recipient = {
					has_character_flag = accepted_castration_child
				}
			}
			scope:recipient = {
				remove_character_flag = accepted_castration_child
			}
		}
		if = {
			limit = {
				scope:recipient = {
					has_character_flag = accepted_castration_youth
				}
			}
			scope:recipient = {
				remove_character_flag = accepted_castration_youth
			}
		}
		if = {
			limit = {
				scope:recipient = {
					has_character_flag = resents_castration
				}
			}
			scope:recipient = {
				remove_character_flag = resents_castration
			}
		}
		if = {
			limit = {
				scope:recipient = {
					has_character_modifier = brutal_castration_modifier
				}
			}
			send_interface_toast = {
				type = event_generic_bad_text
				title = ep3_interactions_events.0030.bad_castration.t
				desc = ep3_interactions_events.0030.bad_castration
				left_icon = scope:physician
				right_icon = scope:recipient

				show_as_tooltip = {
					scope:recipient = {
						add_character_modifier = brutal_castration_modifier
					}
				}
			}
		}
		else = {
			send_interface_toast = {
				type = event_generic_good_text
				title = ep3_interactions_events.0030.good_castration.t
				desc = ep3_interactions_events.0030.good_castration
				left_icon = scope:physician
				right_icon = scope:recipient
			}
		}
	}
}

#The family member you wish castrated flees!
ep3_interactions_events.0031 = { # By Jason Cantalini
	type = character_event
	title = ep3_interactions_events.0031.t
	desc =  ep3_interactions_events.0031.desc
	theme = healthcare
	override_background = {
		trigger = {
			culture = {
				OR = {
					has_graphical_mediterranean_culture_group_trigger = yes
					has_graphical_mena_culture_group_trigger = yes
					has_graphical_african_culture_group_trigger = yes
					has_building_gfx = indian_building_gfx
				}
			}
			NOT = { government_has_flag = government_is_tribal }
		}
		reference = ep3_city_gate
	}
	override_background = {
		trigger = {
			OR = {
				culture = {
					NOR = {
						has_graphical_mediterranean_culture_group_trigger = yes
						has_graphical_mena_culture_group_trigger = yes
						has_graphical_african_culture_group_trigger = yes
						has_building_gfx = indian_building_gfx
					}
				}
				government_has_flag = government_is_tribal
			}
		}
		reference = market
	}
	left_portrait = {
		character = scope:actor
		triggered_animation = {
			trigger = {
				OR = {
					ep3_interactions_events_0030_callous_trigger = yes
					has_trait = vengeful
					has_trait = just
					has_trait = wrathful
				}
			}
			animation = anger
		}
		triggered_animation = {
			trigger = {
				NOR = {
					ep3_interactions_events_0030_callous_trigger = yes
					has_trait = vengeful
					has_trait = just
					has_trait = wrathful
				}
			}
			animation = survey
		}
		
	}
	lower_right_portrait = scope:recipient

	immediate = {
		if = {
			limit = {
				has_hook = scope:recipient
			}
			remove_hook  =  { target = scope:recipient }
		}
		if = {
			limit = {
				OR = {
					is_landed = yes
					is_landless_ruler = yes
					is_governor = yes
				}
			}
			remove_courtier_or_guest = scope:recipient
		}
		scope:recipient = {
			set_relation_rival = {
				target = scope:actor
				reason = rival_attempted_castration
			}
			add_stress = medium_stress_gain
		}
		scope:recipient = {
			create_character_memory = {
				type = family_castration_fled_memory
				participants = {
					castrator = scope:actor
				}
			}
		}
	}

	#Have him found and castrated NOW!
	option = {
		name = ep3_interactions_events.0031.a

		if = {
			limit = {
				influence >= medium_influence_value
			}
			change_influence = medium_influence_loss
		}
		else = {
			add_prestige = medium_prestige_loss
		}
		

		duel = {
			skill = intrigue
			target = scope:recipient
			45 = { #The boy is found and dealt with
				desc = ep3_interactions_events.0031.a_success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -44
				}
				modifier = {
					highest_held_title_tier >= tier_empire
					add = 30
				}
				modifier = {
					highest_held_title_tier >= tier_duchy
					add = 10
				}
				modifier = {
					exists = cp:councillor_spymaster
					cp:councillor_spymaster = {
						intrigue > very_high_skill_rating 
					}
					add = 15
				}
				modifier = {
					exists = cp:councillor_spymaster
					cp:councillor_spymaster = {
						intrigue >= high_skill_rating 
					}
					add = 10
				}
				modifier = {
					dread > 70
					add = 10
				}
				
				send_interface_toast = {
					title = ep3_interactions_events.0031.a_success
					left_icon = root
					right_icon = scope:recipient
					
					if = {
						limit = {
							OR = {
								is_landed = yes
								is_landless_ruler = yes
							}
						}
						add_courtier = scope:recipient
					}
					scope:actor = { change_influence = minor_influence_gain }
					scope:recipient = {
						ep3_youth_castration_effect = yes
						add_opinion = {
							target = scope:actor
							modifier = angry_opinion
							opinion = -50
						}
					}
					scope:recipient = {
						create_character_memory = {
							type = family_castration_memory
							participants = {
								castrator = scope:actor
							}
						}
					}
				}
			}
			55 = { #The boy eludes your searchers
				desc = ep3_interactions_events.0031.a_failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -54
				}
				send_interface_toast = {
					title = ep3_interactions_events.0031.a_failure
					left_icon = root
					right_icon = scope:recipient
				}
			}
		}
		stress_impact = {
			compassionate = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			arbitrary = miniscule_stress_impact_gain
			content = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
			generous = miniscule_stress_impact_gain
		}
		ai_chance = {
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_zeal = 1
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = forgiving
					has_trait = content
					has_trait = fickle
					AND = {
						influence < medium_influence_value
						prestige < medium_prestige_value
					}
				}
			}
		}
	}
	#He won't sacrifice for us - he should indeed be gone
	option = {
		name = {
			trigger = {
				OR = {
					ep3_interactions_events_0030_callous_trigger = yes
					has_trait = vengeful
					has_trait = just
					has_trait = wrathful
				}
			}
			text = ep3_interactions_events.0031_callous
		}
		name = {
			trigger = {
				NOR = {
					ep3_interactions_events_0030_callous_trigger = yes
					has_trait = vengeful
					has_trait = just
					has_trait = wrathful
				}
			}
			text = ep3_interactions_events.0031_kind
		}
		stress_impact = {
			just = miniscule_stress_impact_gain
			ambitious = miniscule_stress_impact_gain
			stubborn = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
			sadistic = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
		}
		ai_chance = {
			ai_value_modifier = {
				ai_compassion = 1
				ai_energy = -1
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = stubborn
					has_trait = vengeful
					has_trait = wrathful
					has_trait = sadistic
				}
			}
		}
	}
	after = {
		hidden_effect = {
			if = {
				limit = {
					scope:recipient = {
						NOT = { is_courtier_of = root }
					}
				}
				if = {
					limit = {
						any_relation = {
							type = rival
							OR = {
								is_landed = yes
								is_landless_ruler = yes
							}
						}
					}
					random_relation = {
						type = rival
						limit = {
							OR = {
								is_landed = yes
								is_landless_ruler = yes
							}
						}
						save_scope_as = rival
					}
					scope:recipient = {
						visit_court_of = scope:rival	
					}
				}
				else_if = {
					limit = {
						exists = root.top_liege
					}
					scope:recipient = { set_location = root.top_liege.capital_province }
				}
				else_if = {
					limit = {
						any_neighboring_top_liege_realm_owner = {
							NOT = {
								government_has_flag = government_is_tribal
							}
						}
					}
					random_neighboring_top_liege_realm_owner = {
						limit = {
							NOT = {
								government_has_flag = government_is_tribal
							}
						}
						save_scope_as = destination_owner
					}
					scope:recipient = {
						visit_court_of = scope:destination_owner	
					}
				}
				else_if = {
					limit = {
						any_neighboring_top_liege_realm_owner = {
							exists = this
						}
					}
					random_neighboring_top_liege_realm_owner = {
						save_scope_as = destination_owner
					}
					scope:recipient = {
						visit_court_of = scope:destination_owner	
					}
				}
			}
		}
	}
}

#The emperor sends a reward for your governorship skills
ep3_interactions_events.0040 = {
	type = letter_event
	opening = ep3_interactions_events.0040.opening
	desc = ep3_interactions_events.0040.desc
	sender = scope:emperor

	immediate = {
		random_list = {
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value < 90
					}
				}
				change_influence = major_influence_gain
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value >= 90
					}
				}
				change_influence = massive_influence_gain
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value < 90
					}
				}
				add_gold = medium_gold_value
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value >= 90
					}
				}
				add_gold = major_gold_value
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value < 95
					}
				}
				add_trait_xp = {
					trait = governor
					value = 5
				}
				add_prestige = medium_prestige_gain
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value < 90
					}
				}
				change_influence = medium_influence_gain
				add_prestige = minor_prestige_gain
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value >= 90
					}
				}
				change_influence = major_influence_gain
				add_prestige = medium_prestige_gain
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value >= 90
					}
				}
				add_character_modifier = {
					modifier = ep3_efforts_recognized_modifier
					years = 10
				}
			}
			10 = {
				trigger = {
					has_trait_xp = {
						trait = governor
						value < 95
					}
				}
				add_character_modifier = {
					modifier = ep3_publicly_recognized_modifier
					years = 10
				}
			}
		}
	}

	option = {
		name = ep3_interactions_events.0040.a
		scope:emperor = {
			add_hook = {
				target = root
				type = loyalty_hook
				years = 5
			}
		}
		if = {
			limit = {
				is_ai = yes
			}
			add_opinion = {
				target = scope:emperor
				modifier = feeling_appreciated_opinion
				opinion = 30
			}
		}
		if = {
			limit = {
				scope:emperor = { is_ai = yes }
			}
			scope:emperor = {
				add_opinion = {
					target = root
					modifier = appreciation_opinion
					opinion = 30
				}
			}
		}
	}
}

scripted_effect ep3_rent_knight_effect = {
	$KNIGHT_TO_RENT$ = {
		liege = {
			save_scope_as = og_liege
		}
		add_opinion = {
			modifier = recruited_me_opinion
			target = root
		}
		save_scope_as = rented_knight
	}
	custom_tooltip = ep3_rent_knight_effect.tt
	hidden_effect = {
		add_courtier = $KNIGHT_TO_RENT$
		$KNIGHT_TO_RENT$ = {
			add_character_flag = blocked_from_leaving
			set_knight_status = force
		}
		#return event
		trigger_event = {
			id = ep3_interactions_events.0102
			years = 5
		}
	}
}

ep3_interactions_events.0101 = {
	type = character_event
	title = ep3_interactions_events.0101.t
	desc = {
		desc = ep3_interactions_events.0101.desc
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:cool_trait_1 }
				desc = ep3_interactions_events.0101.desc_knight_1_trait
			}
			triggered_desc = {
				trigger = { exists = scope:knight_to_rent_1 }
				desc = ep3_interactions_events.0101.desc_knight_1
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:cool_trait_2 }
				desc = ep3_interactions_events.0101.desc_knight_2_trait
			}
			triggered_desc = {
				trigger = { exists = scope:knight_to_rent_2 }
				desc = ep3_interactions_events.0101.desc_knight_2
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = { exists = scope:cool_trait_3 }
				desc = ep3_interactions_events.0101.desc_knight_3_trait
			}
			triggered_desc = {
				trigger = { exists = scope:knight_to_rent_3 }
				desc = ep3_interactions_events.0101.desc_knight_3
			}
		}
	}
	theme = war

	left_portrait = {
		character = scope:actor
	}
	right_portrait = {
		character = scope:recipient
	}
	lower_left_portrait = {
		trigger = { exists = scope:knight_to_rent_1 }
		character = scope:knight_to_rent_1
	}
	lower_center_portrait = {
		trigger = { exists = scope:knight_to_rent_2 }
		character = scope:knight_to_rent_2
	}
	lower_right_portrait = {
		trigger = { exists = scope:knight_to_rent_3 }
		character = scope:knight_to_rent_3
	}
	immediate = {
		scope:recipient = {
			every_knight = {
				limit = {
					is_landed = no
				}
				add_to_list = potential_knights
			}
		}
		#remove the very top guy
		ordered_in_list = {
			list = potential_knights
			order_by = prowess
			remove_from_list = potential_knights
		}
		if = {
			limit = {
				list_size:potential_knights > 2
			}
			ordered_in_list = {
				list = potential_knights
				order_by = prowess
				save_scope_as = knight_to_rent_1
				remove_from_list = potential_knights
			}
		}
		if = {
			limit = {
				list_size:potential_knights > 1
			}
			ordered_in_list = {
				list = potential_knights
				order_by = prowess
				save_scope_as = knight_to_rent_2
				remove_from_list = potential_knights
			}
		}
		if = {
			limit = {
				list_size:potential_knights > 0
			}
			ordered_in_list = {
				list = potential_knights
				order_by = prowess
				save_scope_as = knight_to_rent_3
				remove_from_list = potential_knights
			}
		}
		if = {
			limit = {
				scope:knight_to_rent_3 = {
					any_character_trait = {
						has_trait_category = commander
					}
				}
			}
			scope:knight_to_rent_3 = {
				random_character_trait = {
					limit = {
						has_trait_category = commander
					}
					save_scope_as = cool_trait_3
				}
			}
		}
		if = {
			limit = {
				scope:knight_to_rent_2 ?= {
					any_character_trait = {
						has_trait_category = commander
					}
				}
			}
			scope:knight_to_rent_2 = {
				random_character_trait = {
					limit = {
						has_trait_category = commander
					}
					save_scope_as = cool_trait_2
				}
			}
		}
		if = {
			limit = {
				scope:knight_to_rent_1 ?= {
					any_character_trait = {
						has_trait_category = commander
					}
				}
			}
			scope:knight_to_rent_1 = {
				random_character_trait = {
					limit = {
						has_trait_category = commander
					}
					save_scope_as = cool_trait_1
				}
			}
		}
	}

	option = {
		name = ep3_interactions_events.0101.a
		trigger = { exists = scope:knight_to_rent_1 }
		ep3_rent_knight_effect = {
			KNIGHT_TO_RENT = scope:knight_to_rent_1
		}
	}
	option = {
		name = ep3_interactions_events.0101.b
		trigger = { exists = scope:knight_to_rent_2 }
		ep3_rent_knight_effect = {
			KNIGHT_TO_RENT = scope:knight_to_rent_2
		}
	}
	option = {
		name = ep3_interactions_events.0101.c
		trigger = { exists = scope:knight_to_rent_3 }
		ep3_rent_knight_effect = {
			KNIGHT_TO_RENT = scope:knight_to_rent_3
		}
	}
	option = {
		name = ep3_interactions_events.0101.d
	}
}

ep3_interactions_events.0102 = {
	type = letter_event
	opening = ep3_interactions_events.0102.opening
	desc = ep3_interactions_events.0102.desc
	sender = scope:rented_knight

	trigger = {
		scope:rented_knight ?= {
			is_alive = yes
		}
	}
	immediate = {
		scope:rented_knight = {
			remove_character_flag = blocked_from_leaving
		}
		if = {
			limit = {
				scope:og_liege ?= {
					is_alive = yes
				}
			}
			scope:og_liege = {
				show_as_tooltip = {
					scope:rented_knight = {
						return_to_court = yes
					}
				}
				hidden_effect = {
					add_courtier = scope:rented_knight
				}
			}
		}
		else = {
			remove_courtier_or_guest = scope:rented_knight
		}
	}
	
	option = {
		name = ep3_interactions_events.0102.a
		add_hook = {
			type = loyalty_hook
			target = scope:rented_knight
		}
	}
}

#if recipient (laamp) declines hire_laamp_mercenaries_interaction he gets this event to pick smth to negotiate
ep3_interactions_events.0111 = {
	type = character_event
	title = ep3_interactions_events.0111.t
	desc = ep3_interactions_events.0111.desc
	theme = war
	left_portrait = {
		character = scope:recipient
		animation = thinking
	}
	right_portrait = {
		character = scope:actor
		animation = bribing
	}
	artifact = {
		target = scope:actor_artifact
		position = lower_center_portrait
		trigger = { exists = scope:actor_artifact }
	}

	immediate = {
		scope:recipient = { save_scope_as = adventurer }
		if = {
			limit = {
				scope:recipient.prestige_level > 1
				scope:recipient.prestige_level < 3
			}
			scope:actor = {
				random_held_title = {
					title_tier = county
					limit = {
						NOR = {
							scope:actor.primary_title ?= this
							scope:actor.capital_county ?= this
							scope:actor.capital_county.duchy ?= this.duchy
						}
						is_noble_family_title = no
						is_landless_type_title = no
					}
					add_to_list = purchased_titles
				}
			}
		}
		else_if = {
			limit = {
				scope:recipient.prestige_level > 2
				scope:actor = {
					any_held_title = {
						title_tier = duchy
						NOR = {
							scope:actor.primary_title ?= this
							scope:actor.capital_county.de_jure_liege ?= this
						}
						is_noble_family_title = no
						is_landless_type_title = no
					}
				}
			}
			scope:actor = {
				random_held_title = {
					title_tier = duchy
					limit = {
						NOR = {
							scope:actor.primary_title ?= this
							scope:actor.capital_county.de_jure_liege ?= this
						}
						is_noble_family_title = no
						is_landless_type_title = no
					}
					add_to_list = purchased_titles
					if = {
						limit = { tier = tier_duchy }
						every_de_jure_county = {
							limit = { ep3_purchase_land_valid_county_trigger = yes }
							add_to_list = purchased_titles
						}
					}
				}
			}
		}
		else = {
			scope:actor = {
				random_held_title = {
					title_tier >= county
					limit = {
						NOR = {
							scope:actor.primary_title ?= this
							scope:actor.capital_county ?= this
							scope:actor.capital_county.duchy ?= duchy
							any_in_de_jure_hierarchy = { scope:actor.capital_county ?= this }
						}
						is_noble_family_title = no
						is_landless_type_title = no
					}
					add_to_list = purchased_titles
					if = {
						limit = { tier = tier_duchy }
						every_de_jure_county = {
							limit = { ep3_purchase_land_valid_county_trigger = yes }
							add_to_list = purchased_titles
						}
					}
				}
			}
		}
		ordered_in_list = {
			list = purchased_titles
			limit = {
				is_noble_family_title = no
				is_landless_type_title = no
			}
			save_scope_as = new_primary_title
		}

		scope:actor = {
			every_character_war = {
				add_to_list = actor_wars
			}
			random_character_artifact = {
				limit = {
					scope:recipient = { can_equip_artifact = prev }
				}
				save_scope_as = actor_artifact
			}
		}
		every_in_list = {
			list = actor_wars
			limit = {
				primary_defender = scope:actor
			}
			add_to_list = join_as_defender
			remove_from_list = actor_wars
		}
		every_in_list = {
			list = actor_wars
			limit = {
				primary_attacker = scope:actor
			}
			add_to_list = join_as_attacker
			remove_from_list = actor_wars
		}
	}
	
	#Ask for land
	option = {
		name = ep3_interactions_events.0111.a
		trigger = {
			exists = scope:new_primary_title
			prestige_level >= 2
			scope:new_primary_title = {
				NOR = {
					this = scope:actor.primary_title
					this = scope:actor.capital_county
					duchy = scope:actor.capital_county.duchy
				}
			}
		}
		custom_tooltip = ep3_interactions_events.0111.actor_decides
		save_scope_value_as = {
			name = negotiation_offer
			value = flag:land
		}
		show_as_tooltip = {
			# Determine hierarchy
			ep3_become_landed_save_liege_effect = {
				TITLE_GIVER = scope:actor
				ALWAYS_INDEPENDENT = no
				TITLE_LIST = purchased_titles
			}
			# Resolve title, liege, government changes
			ep3_become_landed_transfer_effect = {
				TITLE_RECEIVER = scope:recipient
				TITLE_LIST = purchased_titles
				TYPE = granted
				REASON = flag:purchased
			}
		}
		scope:actor = {
			trigger_event = ep3_interactions_events.0112
		}
		custom_tooltip = ep3_interactions_events.0111.join_wars

		ai_chance = {
			base = 0
			modifier = { # Province value
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = scope:new_primary_title.development_level
						scope:new_primary_title = {
							every_county_province = { add = num_buildings }
						}
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = { ep3_purchase_land_valid_county_trigger = yes }
								add = development_level
								every_county_province = { add = num_buildings }
							}
						}
					}
					multiply = -1
				}
			}
			modifier = { # Land is foreign
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = -10
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									culture != scope:recipient.culture
								}
								add = -10
							}
						}
					}
					max = -30
				}
				trigger_if = {
					limit = { scope:new_primary_title.tier = tier_county }
					scope:new_primary_title.culture != scope:recipient.culture
				}
				trigger_else = {
					scope:new_primary_title = {
						any_de_jure_county = {
							ep3_purchase_land_valid_county_trigger = yes
							culture != scope:recipient.culture
						}
					}
				}
			}
			modifier = { # Different faith
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = -10
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = -10
							}
						}
					}
					max = -30
				}
				trigger_if = {
					limit = { scope:new_primary_title.tier = tier_county }
					scope:new_primary_title.faith != scope:recipient.faith
				}
				trigger_else = {
					scope:new_primary_title = {
						any_de_jure_county = {
							ep3_purchase_land_valid_county_trigger = yes
							faith != scope:recipient.faith
						}
					}
				}
			}
			modifier = { # My culture's lands
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = 15
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = 15
							}
						}
					}
					if = {
						limit = { scope:acceptance != 0 }
						divide = scope:acceptance
					}
					min = 50
				}
				scope:actor.culture != scope:recipient.culture
				trigger_if = {
					limit = { scope:new_primary_title.tier = tier_county }
					scope:new_primary_title.culture = scope:recipient.culture
				}
				trigger_else = {
					scope:new_primary_title = {
						any_de_jure_county = {
							ep3_purchase_land_valid_county_trigger = yes
							culture = scope:recipient.culture
						}
					}
				}
				scope:recipient.culture = {
					save_temporary_scope_value_as = {
						name = acceptance
						value = {
							value = "cultural_acceptance(scope:actor.culture)"
							divide = 25
							ceiling = yes
						}
					}
				}
			}
			modifier = { # My faith's lands
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = 15
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = 15
							}
						}
					}
					if = {
						limit = { scope:hostility != 0 }
						multiply = scope:hostility
					}
					min = 50
				}
				scope:actor.faith != scope:recipient.faith
				trigger_if = {
					limit = { scope:new_primary_title.tier = tier_county }
					scope:new_primary_title.faith = scope:recipient.faith
				}
				trigger_else = {
					scope:new_primary_title = {
						any_de_jure_county = {
							ep3_purchase_land_valid_county_trigger = yes
							faith = scope:recipient.faith
						}
					}
				}
				scope:recipient.faith = {
					save_temporary_scope_value_as = {
						name = hostility
						value = "faith_hostility_level(scope:actor.faith)"
					}
				}
			}
			modifier = {
				factor = 0
				NOR = {
					current_military_strength < 1000 # You can do better
					global_variable_list_size = {
						name = laamps_tally
						value >= too_many_laamps_value
					}
				}
				NOR = {
					AND = {
						has_character_modifier = ep3_lust_for_land_modifier
						ai_greed >= 25
						ai_boldness >= 25
						ai_rationality <= -25
					}
					AND = {
						has_trait = greedy
						ai_rationality <= -50
					}
					global_variable_list_size = {
						name = laamps_tally
						value >= too_many_laamps_value
					}
				}
			}
		}
	}

	#Ask for artifact
	option = {
		name = ep3_interactions_events.0111.b
		trigger = {
			exists = scope:actor_artifact
		}
		custom_tooltip = ep3_interactions_events.0111.actor_decides
		show_as_tooltip = {
			scope:actor_artifact = {
				set_owner = scope:recipient
			}
		}
		save_scope_value_as = {
			name = negotiation_offer
			value = flag:artifact
		}
		scope:actor = {
			trigger_event = ep3_interactions_events.0112
		}
		custom_tooltip = ep3_interactions_events.0111.join_wars
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
			}
		}
	}

	#Ask for alliance
	option = {
		name = ep3_interactions_events.0111.c
		trigger = {
			scope:actor = {
				NOT = { is_allied_to = scope:recipient }
			}
		}
		custom_tooltip = ep3_interactions_events.0111.actor_decides
		show_as_tooltip = {
			scope:actor = {
				create_alliance = {
				 	target = scope:recipient
				 	allied_through_owner = scope:actor
				 	allied_through_target = scope:recipient
				 }
			}
			scope:recipient = {
				add_opinion = {
					target = scope:actor
					modifier = event_negotiated_alliance_opinion
				}
			}
		}
		save_scope_value_as = {
			name = negotiation_offer
			value = flag:alliance
		}
		scope:actor = {
			trigger_event = ep3_interactions_events.0112
		}
		custom_tooltip = ep3_interactions_events.0111.join_wars
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	#Ask for adding to contact list
	option = {
		name = ep3_interactions_events.0111.d
		trigger = {
			scope:actor = {
				NOT = { is_contact_of = scope:recipient }
			}
		}
		custom_tooltip = ep3_interactions_events.0111.actor_decides
		show_as_tooltip = {
			scope:recipient = {
				add_contact = scope:actor
			}
		}
		save_scope_value_as = {
			name = negotiation_offer
			value = flag:contact_list
		}
		scope:actor = {
			trigger_event = ep3_interactions_events.0112
		}
		custom_tooltip = ep3_interactions_events.0111.join_wars
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}

	#Ask for provisions
	option = {
		name = ep3_interactions_events.0111.e
		trigger = {
			scope:recipient.domicile.provisions < scope:recipient.domicile.max_provisions
		}
		save_scope_value_as = {
			name = negotiation_offer
			value = flag:provisions
		}
		custom_tooltip = ep3_interactions_events.0111.actor_decides
		show_as_tooltip = {
			scope:recipient.domicile = {
				change_provisions = {
					value = {
						value = 0
						add = scope:recipient.domicile.max_provisions
						subtract = scope:recipient.domicile.provisions
					}
				}
			}
		}
		scope:actor = {
			trigger_event = ep3_interactions_events.0112
		}
		custom_tooltip = ep3_interactions_events.0111.join_wars
		ai_chance = {
			base = 100
			modifier = {
				scope:recipient.domicile.provisions = scope:recipient.domicile.max_provisions
				factor = 0
			}
			ai_value_modifier = {
				ai_compassion = 1
			}
		}
	}

	#Refuse
	option = {
		name = ep3_interactions_events.0111.f
		scope:actor = {
			send_interface_toast = {
				left_icon = scope:actor
				right_icon = scope:recipient
				title = ep3_interactions_events.0111.refuse
				scope:actor = {
					add_opinion = {
						target = scope:recipient
						modifier = rejected_hiring_as_mercenaries
					}
				}
			}
		}

		ai_chance = {
			base = 1
			ai_value_modifier = {
				ai_energy = -1
			}
		}
	}
}

#actor has to respond to the laamp offer
ep3_interactions_events.0112 = {
	type = letter_event
	opening = ep3_interactions_events.0112.opening
	desc = {
		desc = ep3_interactions_events.0112.desc
		first_valid = {
			triggered_desc = {
				trigger = { scope:negotiation_offer = flag:land }
				desc = ep3_interactions_events.0112.desc_land
			}
			triggered_desc = {
				trigger = { scope:negotiation_offer = flag:artifact }
				desc = ep3_interactions_events.0112.desc_artifact
			}
			triggered_desc = {
				trigger = { scope:negotiation_offer = flag:alliance }
				desc = ep3_interactions_events.0112.desc_alliance
			}
			triggered_desc = {
				trigger = { scope:negotiation_offer = flag:provisions }
				desc = ep3_interactions_events.0112.desc_provisions
			}
			triggered_desc = {
				trigger = { scope:negotiation_offer = flag:contact_list }
				desc = ep3_interactions_events.0112.desc_contact_list
			}
		}
	}
	sender = scope:recipient
	
	#Accept
	option = {
		name = ep3_interactions_events.0112.a
		scope:actor = {
			pay_treasury_or_gold = {
				target = scope:recipient
				value = ep3_hire_laamp_mercs_cost_value
			}
			add_to_variable_list = {
				name = hired_mercenaries
				target = scope:recipient
			}
		}
		switch = {
			trigger = scope:negotiation_offer
			flag:land = {
				# Determine hierarchy
				ep3_become_landed_save_liege_effect = {
					TITLE_GIVER = scope:actor
					ALWAYS_INDEPENDENT = no
					TITLE_LIST = purchased_titles
				}
				# Resolve title, liege, government changes
				ep3_become_landed_transfer_effect = {
					TITLE_RECEIVER = scope:recipient
					TITLE_LIST = purchased_titles
					TYPE = granted
					REASON = flag:purchased
				}
				# Extra purchase land specific
				scope:actor = {
					stress_impact = {
						greedy = minor_stress_impact_gain
						lazy = minor_stress_impact_loss
					}
				}
				# Effects on land giver
				scope:actor = { add_legitimacy = -15 }
				# Messages for nearby players
				create_landed_ruler_message_effect = {
					LANDED = scope:recipient
					FLAVOR_CHAR = scope:actor
					FLAVOR_TITLE = scope:new_primary_title
					REASON = flag:purchased
				}
			}
			flag:artifact = {
				scope:actor_artifact = {
					set_owner = scope:recipient
				}
			}
			flag:alliance = {
				scope:actor = {
					create_alliance = {
					 	target = scope:recipient
					 	allied_through_owner = scope:actor
					 	allied_through_target = scope:recipient
					}
				}
				scope:recipient = {
					add_opinion = {
						target = scope:actor
						modifier = event_negotiated_alliance_opinion
					}
				}
			}
			flag:provisions = {
				scope:recipient = {
					domicile = {
						change_provisions = {
							value = {
								value = 0
								add = scope:recipient.domicile.max_provisions
								subtract = scope:recipient.domicile.provisions
							}
						}
					}
				}
				scope:actor = {
					remove_short_term_gold = minor_gold_value
				}
			}
			flag:contact_list = {
				scope:recipient = {
					add_contact = scope:actor
				}
			}
		}
		every_in_list = {
			list = join_as_attacker
			add_attacker = scope:recipient
		}
		every_in_list = {
			list = join_as_defender
			add_defender = scope:recipient
		}
		scope:recipient = {
			add_character_flag = joined_as_mercenary
		}

		ai_chance = {
			base = 4
			modifier = { # Land is foreign
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = 10
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									culture != scope:recipient.culture
								}
								add = 10
							}
						}
					}
					max = 30
				}
				scope:negotiation_offer = flag:land
			}
			modifier = { # Different faith
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = 10
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = 10
							}
						}
					}
					max = 30
				}
				scope:negotiation_offer = flag:land
			}
			modifier = { # My culture's lands
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = -15
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = -15
							}
						}
					}
					if = {
						limit = { scope:acceptance != 0 }
						divide = scope:acceptance
					}
					min = -50
				}
				scope:negotiation_offer = flag:land
				scope:recipient.culture = {
					save_temporary_scope_value_as = {
						name = acceptance
						value = {
							value = "cultural_acceptance(scope:actor.culture)"
							divide = 25
							ceiling = yes
						}
					}
				}
			}
			modifier = { # My faith's lands
				add = {
					value = 0
					if = {
						limit = { scope:new_primary_title.tier = tier_county }
						add = -15
					}
					else = {
						scope:new_primary_title = {
							every_de_jure_county = {
								limit = {
									ep3_purchase_land_valid_county_trigger = yes
									faith != scope:recipient.faith
								}
								add = -15
							}
						}
					}
					if = {
						limit = { scope:hostility != 0 }
						multiply = scope:hostility
					}
					min = -50
				}
				scope:negotiation_offer = flag:land
				scope:recipient.faith = {
					save_temporary_scope_value_as = {
						name = hostility
						value = "faith_hostility_level(scope:actor.faith)"
					}
				}
			}
			modifier = {
				factor = 0
				scope:negotiation_offer = flag:provisions
				scope:actor = {
					short_term_gold < minor_gold_value
				}
			}
			modifier = {
				factor = 0
				scope:recipient = {
					is_ai = yes
					NOR = {
						current_military_strength < 1000 # You can do better
						global_variable_list_size = {
							name = laamps_tally
							value >= too_many_laamps_value
						}
					}
					NOR = {
						AND = {
							has_character_modifier = ep3_lust_for_land_modifier
							ai_greed >= 25
							ai_boldness >= 25
							ai_rationality <= -25
						}
						AND = {
							has_trait = greedy
							ai_rationality <= -50
						}
						global_variable_list_size = {
							name = laamps_tally
							value >= too_many_laamps_value
						}
					}
				}
			}
		}
	}
	#Refuse
	option = {
		name = ep3_interactions_events.0112.b
		scope:recipient = {
			send_interface_message = {
				type = event_diplomacy_bad
				title = ep3_interactions_events.0112.refuse
				left_icon = scope:actor
				add_opinion = {
					target = scope:actor
					modifier = insulted_opinion
				}
			}
		}
		ai_chance = {
			base = 1
		}
	}

	#Use a Hook to force it through
	option = {
		name = ep3_interactions_events.0112.c
		trigger = {
			has_strong_usable_hook = scope:recipient
			scope:recipient = {
				is_ai = yes
			}
		}
		use_hook = scope:recipient
		
		every_in_list = {
			list = join_as_attacker
			add_attacker = scope:recipient
		}
		every_in_list = {
			list = join_as_defender
			add_defender = scope:recipient
		}
		scope:recipient = {
			add_character_flag = joined_as_mercenary
		}
		ai_chance = {
			base = 1000
			modifier = {
				factor = 0
				OR = {
					scope:actor = {
						is_ai = no
					}
					scope:recipient = {
						is_ai = no
					}
				}
			}
		}
	}
}

#event to pay off all laamp mercenaries for a war leader
ep3_interactions_events.0121 = {
	type = letter_event
	opening = ep3_interactions_events.0121.opening
	desc = ep3_interactions_events.0121.desc
	sender = scope:laamp

	trigger = {
		any_in_list = {
			list = laamp_mercenaries
			is_alive = yes
		}
	}

	immediate = {
		ordered_in_list = {
			list = laamp_mercenaries
			limit = {
				is_alive = yes
			}
			order_by = {
				save_temporary_scope_as = char_temp
				add = "scope:war.war_contribution(scope:char_temp)"
			}
			save_scope_as = laamp
		}
		save_scope_value_as = {
			name = war_contribution_value
			value = "scope:war.war_contribution(scope:laamp)"
		}
	}
	
	#Accept
	option = {
		name = ep3_interactions_events.0121.a
		save_scope_value_as = {
			name = next_payment
			value = flag:accept
		}
		every_in_list = {
			list = laamp_mercenaries
			limit = {
				is_alive = yes
			}
			save_temporary_scope_as = laamp_temp
			scope:employer = {
				pay_treasury_or_gold = {
					target = prev
					value = ep3_hire_laamp_mercs_payment_value
				}
			}
			if = {
				limit = {
					is_ai = no
				}
				trigger_event = ep3_interactions_events.0122
			}
			if = {
				limit = {
					NOT = { is_contact_of = scope:laamp }
				}
				scope:laamp = {
					add_contact = root
				}
			}
		}

		ai_chance = {
			base = 100
		}
	}
	#Accept, but give them less gold
	option = {
		name = ep3_interactions_events.0121.b
		save_scope_value_as = {
			name = next_payment
			value = flag:pay_less
		}
		every_in_list = {
			list = laamp_mercenaries
			limit = {
				is_alive = yes
			}
			save_temporary_scope_as = laamp_temp
			save_scope_value_as = {
				name = war_contribution_value
				value = "scope:war.war_contribution(scope:laamp_temp)"
			}
			scope:employer = {
				pay_treasury_or_gold = {
					target = prev
					value = {
						add = ep3_hire_laamp_mercs_payment_value
						divide = 2
					}
				}
			}
			add_opinion = {
				modifier = laamp_skimmed_opinion
				target = scope:employer
			}
			if = {
				limit = {
					can_add_hook = {
						target = scope:employer
						type = indebted_hook
					}
				}
				add_hook = {
					type = indebted_hook
					target = scope:employer
				}
			}
			if = {
				limit = {
					is_ai = no
				}
				trigger_event = ep3_interactions_events.0122
			}
			if = {
				limit = {
					NOT = { is_contact_of = scope:laamp }
				}
				scope:laamp = {
					add_contact = root
				}
			}
		}
		ai_chance = {
			base = 0
			modifier = {
				add = 20
				has_trait = greedy
			}
			modifier = {
				add = 100
				short_term_gold < minor_gold_value
			}
		}
	}

	#Refuse
	option = {
		name = ep3_interactions_events.0121.c
		save_scope_value_as = {
			name = next_payment
			value = flag:refuse
		}
		every_in_list = {
			list = laamp_mercenaries
			limit = {
				is_alive = yes
			}
			progress_towards_rival_effect = {
				REASON = rival_unpayed_laamp
				CHARACTER = scope:employer
				OPINION = -100
			}
			if = {
				limit = {
					can_add_hook = {
						target = scope:employer
						type = strong_favor_hook
					}
				}
				add_hook = {
					type = strong_favor_hook
					target = scope:employer
				}
			}
			if = {
				limit = {
					is_ai = no
				}
				trigger_event = ep3_interactions_events.0122
			}
		}
		ai_chance = {
			base = 0
			#refuse only if you don't have gold
			modifier = {
				add = 100
				short_term_gold < minor_gold_value
			}
			#and none of the mercenaries are human players
			modifier = {
				factor = 0
				any_in_list = {
					list = laamp_mercenaries
					is_ai = no
				}
			}
		}
	}
}

#event to inform laamp mercenaries if they got payed
ep3_interactions_events.0122 = {
	type = letter_event
	opening = ep3_interactions_events.0122.opening
	desc = {
		desc = ep3_interactions_events.0122.desc
		first_valid = {
			triggered_desc = {
				trigger = { scope:next_payment = flag:accept }
				desc = ep3_interactions_events.0122.desc_accept
			}
			triggered_desc = {
				trigger = { scope:next_payment = flag:pay_less }
				desc = ep3_interactions_events.0122.desc_pay_less
			}
			triggered_desc = {
				trigger = { scope:next_payment = flag:refuse }
				desc = ep3_interactions_events.0122.desc_not_pay
			}
		}
	}			
	sender = scope:employer

	immediate = {
		#set scope for the ep3_hire_laamp_mercs_payment_value scripted value to work
		save_scope_as = laamp_temp
		save_scope_value_as = {
			name = war_contribution_value
			value = "scope:war.war_contribution(scope:laamp_temp)"
		}
		switch = {
			trigger = scope:next_payment
			flag:accept = {
				show_as_tooltip = {
					scope:employer = {
						pay_treasury_or_gold = {
							target = prev
							value = ep3_hire_laamp_mercs_payment_value
						}
					}
				}
			}
			flag:pay_less = {
				show_as_tooltip = {
					scope:employer = {
						pay_treasury_or_gold = {
							target = prev
							value = {
								add = ep3_hire_laamp_mercs_payment_value
								divide = 2
							}
						}
					}
					add_opinion = {
						modifier = laamp_skimmed_opinion
						target = scope:employer
					}
					if = {
						limit = {
							can_add_hook = {
								target = scope:employer
								type = indebted_hook
							}
						}
						add_hook = {
							type = indebted_hook
							target = scope:employer
						}
					}	
				}
			
			}
			flag:refuse = {
				show_as_tooltip = {
					if = {
						limit = {
							can_add_hook = {
								target = scope:employer
								type = strong_favor_hook
							}
						}
						add_hook = {
							type = strong_favor_hook
							target = scope:employer
						}
					}
				}
			}
		}
		if = {
			limit = {
				scope:employer = {
					NOT = { is_contact_of = root }
				}
			}
			add_contact = scope:employer
		}
	}

	option = {
		name = {
			trigger = { scope:next_payment = flag:accept }
			text = ep3_interactions_events.0122.a
		}
		name = {
			trigger = { scope:next_payment = flag:pay_less }
			text = ep3_interactions_events.0122.b
		}
		name = {
			trigger = { scope:next_payment = flag:refuse }
			text = ep3_interactions_events.0122.c
		}
	}
}

# Admin - Request Support Interaction
# Accepted notification event
ep3_interactions_events.0201 = {
	type = letter_event
	opening = ep3_interactions_events.0201.opening
	desc = ep3_interactions_events.0201.desc
	sender = scope:recipient

	immediate = {
		show_as_tooltip = {
			scope:target = {
				change_appointment_investment = {
					target = scope:secondary_recipient
					investor = scope:recipient
					value = scope:request_support_score
				}
			}
		}
	}

	option = {
		name = ep3_interactions_events.0201.a
	}
}

# Refused notification event
ep3_interactions_events.0202 = {
	type = letter_event
	opening = ep3_interactions_events.0202.opening
	desc = ep3_interactions_events.0202.desc
	sender = scope:recipient

	option = {
		name = ep3_interactions_events.0202.a
	}
}

# Accepted Coax to War interaction
ep3_interactions_events.0210 = {
	type = letter_event
	opening = ep3_interactions_events.0210.opening
	desc = ep3_interactions_events.0210.desc
	sender = scope:recipient

	immediate = {
		show_as_tooltip = {
			scope:recipient = {
				change_influence = {
					value = massive_influence_gain
					multiply = 2
				}
				start_war = {
					cb = influence_war_cb
					target = scope:secondary_recipient
					claimant = scope:recipient.top_liege
					target_title = scope:target
				}
				custom_tooltip = frontier_influence_war_interaction_target_title_tt
			}
		}
	}

	option = { 
		name = ep3_interactions_events.0210.a
	}
}

# Declined Coax to War interaction
ep3_interactions_events.0211 = {
	type = letter_event
	opening = {
		desc = yearly.1020.opening
		desc = ep3_interactions_events.0211.opening
	}
	desc = ep3_interactions_events.0211.desc
	sender = scope:recipient

	immediate = {
		show_as_tooltip = {
			change_influence = {
				value = massive_influence_gain
			}
			reverse_add_opinion = {
				modifier = refused_summons_to_war_opinion
				target = scope:actor
			}
		}
	}

	option = { 
		name = ep3_interactions_events.0211.a
	}
}

# Adoption accepted
ep3_interactions_events.0400 = {
	type = letter_event
	opening = ep3_interactions_events.0400.opening
	desc = ep3_interactions_events.0400.desc
	sender = scope:recipient

	immediate = {
		noble_family_adoption_effect = {
			ADOPTEE = scope:recipient
			ADOPTER = scope:actor
		}
		create_character_memory = {
			type = noble_family_adopted
			participants = { adoptee = scope:recipient }
		}
		scope:new_memory = {
			set_variable = {
				name = adopted_house
				value = scope:actor.house
			}
		}
		scope:recipient = {
			create_character_memory = {
				type = was_noble_family_adopted
				participants = { house_head = scope:actor }
			}
			scope:new_memory = {
				set_variable = {
					name = adopted_house
					value = scope:actor.house
				}
			}
		}
	}

	option = {
		name = ep3_interactions_events.0400.a
	}

	after = {
		if = {
			limit = { exists = var:adopted_house } # Error suppression
		}
	}
}

# Raid Remit accepted
ep3_interactions_events.0421 = {
	type = letter_event
	opening = ep3_interactions_events.0421.opening
	desc = ep3_interactions_events.0421.desc
	sender = scope:recipient

	immediate = {
		scope:actor = {
			set_variable = {
				name = raid_estate_permission
				value = scope:secondary_recipient.house
			}
			if = {
				limit = { scope:gold = yes }
				pay_short_term_gold = {
					target = scope:recipient
					gold = scope:actor.minor_gold_value
				}
			}
		}
	}

	option = {
		name = ep3_interactions_events.0421.a
		scope:recipient = { custom_tooltip = request_raid_remit_interaction_effect_tt }
	}

	after = {
		if = {
			limit = { exists = var:adopted_house } # Error suppression
		}
	}
}

# Eviction events
ep3_interactions_events.0500 = {
	type = letter_event
	opening = ep3_interactions_events.0500.opening
	desc = ep3_interactions_events.0500.desc
	sender = scope:actor

	trigger = { is_ai = no }

	option = {
		name = ep3_interactions_events.0500.a
		trigger = {
			custom_tooltip = {
				text = ep3_interactions_events.0500.a.tt.need_soldiers
				current_military_strength >= ep3_interactions_events_0500_troops_count_value
			}
		}
		show_as_unavailable = { always = yes }
		custom_description_no_bullet = {
			text = evict_adventurer_consequences_tt
			object = scope:recipient
			subject = scope:actor
		}
		custom_tooltip = evict_adventurer_casus_belli_tt
		show_as_tooltip = {
			reverse_add_opinion = {
				target = scope:actor
				modifier = eviction_ignored_opinion
			}
		}
	}

	option = {
		name = ep3_interactions_events.0500.b
		trigger = {
			current_military_strength < ep3_interactions_events_0500_troops_count_value
		}
		custom_description_no_bullet = {
			text = evict_adventurer_consequences_tt
			object = scope:recipient
			subject = scope:actor
		}
		custom_tooltip = evict_adventurer_forced_tt
		custom_tooltip = evict_adventurer_forced_tt.part_2
		show_as_tooltip = {
			reverse_add_opinion = {
				target = scope:actor
				modifier = eviction_ignored_opinion
			}
		}
	}

	after = { trigger_event = ep3_interactions_events.0502 }
}

ep3_interactions_events.0501 = {
	hidden = yes
	type = character_event

	trigger = {
		var:adventurer_expeller ?= {
			is_alive = yes
			is_landed = yes
			save_temporary_scope_as = expeller_temp
		}
		is_alive = yes
		government_has_flag = government_is_landless_adventurer
		domicile.domicile_location.county.holder ?= {
			OR = {
				scope:expeller_temp ?= this
				any_liege_or_above = { scope:expeller_temp ?= this }
			}
		}
		NOR = {
			is_at_war_with = var:adventurer_expeller
			is_spouse_of = var:adventurer_expeller
			has_relation_friend = var:adventurer_expeller
			has_relation_lover = var:adventurer_expeller
		}
	}

	immediate = {
		save_scope_as = adventurer
		var:adventurer_expeller = {
			save_scope_as = expeller
			send_interface_message = {
				type = msg_landless_adventurer_expulsion_consequences
				title = expel_adventurer_consequences_title
				left_icon = scope:adventurer
				scope:adventurer = {
					send_interface_message = {
						type = msg_landless_adventurer_expulsion_consequences_adventurer
						title = expel_adventurer_consequences_title
						left_icon = scope:expeller
						custom_tooltip = evict_adventurer_casus_belli_tt
						reverse_add_opinion = {
							target = scope:expeller
							modifier = eviction_ignored_opinion
						}
					}
				}
			}
			if = {
				limit = {
					is_ai = yes
					is_character_interaction_valid = {
						recipient = scope:adventurer
						interaction = imprison_interaction
					}
					scope:adventurer = {
						NOT = {
							current_travel_plan ?= {
								is_travel_with_domicile = yes
								final_destination_province.county.holder = {
									OR = {
										this = scope:expeller
										any_liege_or_above = { this = scope:expeller }
									}
								}
							}
						}
					}
				}
				run_interaction = {
					interaction = imprison_interaction
					actor = scope:expeller
					recipient = scope:adventurer
					execute_threshold = decline
				}
			}
		}
		remove_variable = adventurer_expeller
		trigger_event = ep3_interactions_events.0502
	}
}

ep3_interactions_events.0502 = {
	hidden = yes
	type = character_event

	trigger = { is_ai = yes }

	immediate = {
		save_scope_as = adventurer
		random_list = {
			10 = { # Stay
				trigger = { current_military_strength > scope:expeller.military_strength_25_percent_value }
				modifier = {
					add = {
						value = current_strength_with_allies_value
						multiply = 0.1
					}
				}
				modifier = {
					scope:expeller = {
						any_held_title = {
							any_claimant = { this = scope:adventurer }
						}
					}
					factor = 2
				}
				opinion_modifier = {
					who = scope:expeller
					opinion_target = root
					multiplier = -0.2
				}
			}
			10 = { # Leave
				modifier = {
					add = {
						value = scope:expeller.current_strength_with_allies_value
						multiply = 0.1
					}
				}
				scope:expeller = {
					random_neighboring_and_across_water_top_liege_realm_owner = {
						limit = {
							NOR = {
								has_imprisonment_reason = scope:adventurer
								has_execute_reason = scope:adventurer
								has_banish_reason = scope:adventurer
							}
						}
						save_scope_as = destination_realm_owner
					}
				}
				start_travel_plan = {
					destination = scope:destination_realm_owner.capital_province
					return_trip = no
				}
			}
		}
	}
}

scripted_trigger ep3_interactions_events_0600_nice_option_trigger = {
	scope:supporter = {
		is_ruler = yes
	}
	NOT = {
		is_allied_to = scope:supporter
	}
	OR = {
		has_relation_friend = scope:supporter
		has_relation_lover = scope:supporter
		has_relation_soulmate = scope:supporter
		has_trait = loyal
		has_trait = schemer
		has_trait = diplomat
		AND = {
			has_trait = governor
			has_trait_xp = {
				trait = governor
				value >= 75
			}
		}
	}
}

scripted_trigger ep3_interactions_events_0600_hate_option_trigger = {
	scope:supporter = {
		is_ruler = yes
	}
	NOR = {
		is_allied_to = scope:supporter
		has_relation_friend = scope:supporter
		has_relation_potential_friend = scope:supporter
		has_relation_best_friend = scope:supporter
		has_trait = loyal
	}
	OR = {
		has_relation_potential_rival = scope:supporter
		has_relation_rival = scope:supporter
		has_relation_nemesis = scope:supporter
		has_trait = disloyal
		has_trait = arrogant
		has_trait = arbitrary
		has_trait = paranoid
		has_trait = fickle
		has_trait = wrathful
	}
}

scripted_effect ep3_interactions_events_0601_ally_success = {
	custom_tooltip = negotiate_alliance_effect_tooltip
	create_alliance = {
		target = scope:supporter
		allied_through_owner = scope:new_landed_admin
		allied_through_target = scope:supporter
	}
	scope:supporter = {
		add_hook = {
			type = favor_hook
			target = scope:new_landed_admin
		}
	}
	add_hook = {
		type = favor_hook
		target = scope:supporter
	}
	reverse_add_opinion = {
		target = scope:supporter
		modifier = trust_opinion
		opinion = 25
	}
	random_list = {
		66 = {
			increase_governance_effect = { VALUE = 10 }
		}
		33 = {
			trigger = {
				NOT = {
					has_trait = loyal
				}
			}
			add_trait = loyal
		}
	}
}

scripted_effect ep3_interactions_events_0601_ally_fail = {
	reverse_add_opinion = {
		target = scope:supporter
		modifier = disappointed_opinion
		opinion = -25
	}
}

scripted_effect ep3_interactions_events_0601_insult = {
	change_influence = medium_influence_gain
	add_prestige = minor_prestige_gain
	if = {
		limit = {
			has_trait = disloyal
		}
		add_piety = minor_piety_loss
	}
	else = { add_trait = disloyal }
	if = {
		limit = {
			scope:supporter = {
				can_set_relation_rival_trigger = { CHARACTER = scope:new_landed_admin }
			}
		}
		set_relation_rival = {
			target = scope:supporter
			reason = rival_ignored_candidacy_support
		}
	}
	else_if = {
		limit = {
			scope:supporter = {
				can_set_relation_nemesis_trigger = { CHARACTER = scope:new_landed_admin }
			}
		}
		set_relation_nemesis = {
			target = scope:supporter
			reason = rival_ignored_candidacy_support
		}
	}
	else = {
		reverse_add_opinion = {
			modifier = hate_opinion
			target = scope:supporter
			opinion = -50
		}
		
	}
}

scripted_effect ep3_interactions_events_0601_hook = {
	random_list = {
		75 = {
			increase_governance_effect = { VALUE = 10 }
		}
		25 = {
			trigger = {
				NOT = {
					has_trait = loyal
				}
			}
			add_trait = loyal
		}
	}
	reverse_add_opinion = {
		target = scope:supporter
		modifier = trust_opinion
		opinion = 30
	}
	scope:supporter = {
		add_hook = {
			type = loyalty_hook
			target = scope:new_landed_admin
		}
	}
}

scripted_effect ep3_interactions_events_0601_friendship = {
	if = {
		limit = {
			can_set_relation_friend_trigger = { CHARACTER = scope:supporter}
		}
		progress_towards_friend_effect = {
			REASON = friend_supported_candidacy
			CHARACTER = scope:supporter
			OPINION = 10
		}
	}
	else = {
		reverse_add_opinion = {
			modifier = friendliness_opinion
			target = scope:supporter
			opinion = 30
		}
	}
	change_influence = minor_influence_loss
}

scripted_effect ep3_interactions_events_0601_gift = {
	change_influence = minor_influence_gain
	pay_short_term_gold = {
		target = scope:supporter
		gold = medium_gold_value
	}
}

scripted_effect ep3_interactions_events_0601_ignore = {
	progress_towards_rival_effect = {
		REASON = rival_ignored_candidacy_support
		CHARACTER = scope:supporter
		OPINION = 0
	}
	reverse_add_opinion = {
		target = scope:supporter
		modifier = disrespect_opinion
		opinion = -20
	}
}

# You used promote candidate on someone and they got the title! Time to reward top contributor
ep3_interactions_events.0600 = {
	type = character_event
	title = ep3_interactions_events.0600.t
	desc = ep3_interactions_events.0600.desc
	theme = administrative
	override_background = {
		trigger = {
			scope:supporter = {
				primary_title = {
					this = title:e_byzantium
				}
			}
		}
		reference = ep3_byzantium_throneroom
	}
	override_background = {
		trigger = {
			scope:supporter = {
				primary_title = {
					NOT = { this = title:e_byzantium }
				}
			}
		}
		reference = ep3_byzantine_feast
	}
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { OR = { religion = religion:eastern_orthodox_religion religion = religion:catholic_religion religion = religion:protestant_religion } }
			animation = acknowledging # anim uses crucifix scepter
		}
		animation = war_over_tie
	}
	right_portrait = {
		character = scope:supporter
		animation = happiness
	}

	immediate = {
		primary_title = {
			ordered_succession_appointment_investors = {
				candidate = root
				value >= 20
				limit = {
					NOT = {
						house ?= root.house
					}
					is_alive = yes
					is_imprisoned = no
					NOR = {
						has_relation_rival = root
						is_at_war_with = root
					}
				}
				save_scope_as = supporter
			}
		}
		if = {
			limit = {
				NOT = {
					exists = scope:new_landed_admin
				}
			}
			save_scope_as = new_landed_admin
		}
	}

	#Let's be allies!
	option = {
		name = ep3_interactions_events.0600.a
		trigger = {
			ep3_interactions_events_0600_nice_option_trigger = yes
		}
		scope:supporter = {
			save_scope_as = recipient
		}
		
		if = {
			limit = {
				scope:supporter = {
					is_ai = yes
				}
			}
			duel = {
				skills = { diplomacy intrigue }
				target = scope:supporter
				75 = { #Being allies sounds cool
					desc = ep3_interactions_events.0600.a.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -74
					}
					modifier = {
						scope:supporter = {
							opinion = {
								target = root
								value >= 40
							}
						}
						add = 50
					}
					modifier = {
						scope:supporter = {
							opinion = {
								target = root
								value >= 80
							}
						}
						add = 50
					}
					modifier = {
						scope:supporter = {
							highest_held_title_tier <= tier_duchy
						}
						highest_held_title_tier >= tier_kingdom
						add = 75
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = ep3_interactions_events.0600.a.success
						left_icon = scope:supporter
						
						show_as_tooltip = {
							ep3_interactions_events_0601_ally_success = yes
						}
						add_character_flag = {
							flag = supporter_response_ally_success
							days = 30
						}
					}
				}
				25 = { #Ah shit, he mad
					desc = ep3_interactions_events.0600.a.fail
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -24
					}
					modifier = {
						scope:supporter = {
							is_liege_or_above_of = root
						}
						add = 50
					}
					modifier = {
						scope:supporter ={
							opinion = {
								target = root
								value < 0
							}
						}
						add = 50
					}
					modifier = {
						scope:supporter ={
							opinion = {
								target = root
								value < -40
							}
						}
						add = 50
					}
					modifier = {
						scope:supporter ={
							opinion = {
								target = root
								value < -80
							}
						}
						add = 50
					}
					modifier = {
						scope:supporter = {
							highest_held_title_tier >= tier_kingdom
						}
						highest_held_title_tier <= tier_duchy
						add = 75
					}
					min = 5
					send_interface_toast = {
						type = event_toast_effect_bad
						title = ep3_interactions_events.0600.a.fail
						left_icon = scope:supporter
						
						show_as_tooltip = {
							ep3_interactions_events_0601_ally_fail = yes
						}
						add_character_flag = {
							flag = supporter_response_ally_fail
							days = 30
						}
					}
				}
			}
		}
		else = {
			custom_tooltip = player_supporter_agree_tt
			custom_tooltip = negotiate_alliance_effect_tooltip
			show_as_tooltip = {
				ep3_interactions_events_0601_ally_success = yes
			}
			add_character_flag = {
				flag = supporter_response_ally_player
				days = 30
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_loss
			ambitious = miniscule_stress_impact_loss
			paranoid = minor_stress_impact_gain
			fickle = medium_stress_impact_gain
			arrogant = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_sociability = 1
			}
			modifier = {
				add = 50
				has_trait = trusting
			}
			modifier = {
				add = -100
				OR = {
					AND = {
						diplomacy <= mediocre_skill_rating
						intrigue <= mediocre_skill_rating
					}
					diplomacy < low_skill_rating
					intrigue < low_skill_rating
				}
			}
			modifier = {
				add = 100
				OR = {
					AND = {
						diplomacy >= decent_skill_rating
						intrigue >= decent_skill_rating
					}
					diplomacy >= very_high_skill_rating
					intrigue >= very_high_skill_rating
				}
			}
			modifier = {
				add = -100
				opinion = {
					target = scope:supporter
					value <= 0
				}
			}
			modifier = {
				add = -100
				reverse_opinion = {
					target = scope:supporter
					value <= 0
				}
			}
			modifier = {
				add = 100
				opinion = {
					target = scope:supporter
					value >= 60
				}
			}
			modifier = {
				add = 100
				reverse_opinion = {
					target = scope:supporter
					value >= 60
				}
			}
			modifier = {
				add = -100
				OR = {
					AND = {
						scope:supporter = {
							highest_held_title_tier >= tier_kingdom
						}
						highest_held_title_tier <= tier_duchy
					}
					AND = {
						scope:supporter = {
							highest_held_title_tier <= tier_duchy
						}
						highest_held_title_tier >= tier_kingdom
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = arrogant
					has_trait = fickle
					has_trait = arbitrary
					AND = {
						diplomacy <= low_skill_rating
						intrigue <= low_skill_rating
					}
					opinion = {
						target = scope:supporter
						value <= -40
					}
					reverse_opinion = {
						target = scope:supporter
						value <= -40
					}
				}
			}
		}
	}

	#I really hate that bastard
	option = {
		trigger = {
			ep3_interactions_events_0600_hate_option_trigger = yes
		}
		name = ep3_interactions_events.0600.b
		flavor = ep3_interactions_events.0600.b.flavor
		
		show_as_tooltip = {
			ep3_interactions_events_0601_insult = yes
		}
		add_character_flag = {
			flag = supporter_response_insult
			days = 30
		}
		stress_impact = {
			arrogant = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			fickle = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
			trusting = medium_stress_impact_gain
			generous = medium_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -1
				ai_greed = 1
			}
			modifier = {
				add = 50
				OR = {
					has_trait = arrogant
					has_trait = wrathful
					has_trait = fickle
					has_trait = arbitrary
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value <= -50
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value <= -90
				}
			}
			modifier = {
				add = -100
				opinion = {
					target = scope:supporter
					value >= 30
				}
			}
			modifier = {
				add = -100
				scope:supporter = {
					highest_held_title_tier >= tier_kingdom
				}
				highest_held_title_tier <= tier_duchy
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = just
					has_trait = trusting
					has_trait = generous
					has_trait = compassionate
					opinion = {
						target = scope:supporter
						value >= 60
					}
				}
			}
		}
	}

	#Give him a hook
	option = {
		name = ep3_interactions_events.0600.c
		flavor = ep3_interactions_events.0600.c.flavor
		trigger = {
			ep3_interactions_events_0600_nice_option_trigger = no
			scope:supporter = {
				can_add_hook = {
					target = root
					type = loyalty_hook
				}
			}
		}
		show_as_tooltip = {
			ep3_interactions_events_0601_hook = yes
		}
		add_character_flag = {
			flag = supporter_response_hook
			days = 30
		}
		stress_impact = {
			trusting = minor_stress_impact_loss
			generous = minor_stress_impact_loss
			just = minor_stress_impact_loss
			paranoid = medium_stress_impact_gain
			fickle = medium_stress_impact_gain
			arbitrary = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			greedy = medium_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_greed = -1
			}
			modifier = {
				add = 50
				OR = {
					has_trait = trusting
					has_trait = generous
					has_trait = just
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value < 0
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value < -25
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value >= 90
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value >= 50
				}
			}
			modifier = {
				add = -100
				scope:supporter = {
					highest_held_title_tier <= tier_duchy
				}
				highest_held_title_tier >= tier_kingdom
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = arrogant
					has_trait = fickle
					has_trait = arbitrary
					has_trait = greedy
					has_trait = ambitious
					opinion = {
						target = scope:supporter
						value < -50
					}
				}
			}
		}
	}

	#Be his friend (aww)
	option = {
		trigger = {
			ep3_interactions_events_0600_hate_option_trigger = no
		}
		name = ep3_interactions_events.0600.d
		
		show_as_tooltip = {
			ep3_interactions_events_0601_friendship = yes
		}
		add_character_flag = {
			flag = supporter_response_friendship
			days = 30
		}
		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			gregarious = miniscule_stress_impact_loss
			shy = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
			modifier = {
				add = 50
				OR = {
					has_trait = trusting
					has_trait = generous
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value < 0
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value < -25
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value >= 90
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value >= 50
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = callous
					has_trait = fickle
					opinion = {
						target = scope:supporter
						value < -50
					}
					influence <= minor_influence_value
				}
			}
		}
	}

	#Send some gold
	option = {
		name = ep3_interactions_events.0600.e
		show_as_tooltip = {
			ep3_interactions_events_0601_gift = yes
		}
		add_character_flag = {
			flag = supporter_response_gift
			days = 30
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
				ai_rationality = 1
			}
			modifier = {
				add = 50
				OR = {
					has_trait = trusting
					has_trait = generous
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value < -25
				}
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					short_term_gold <= medium_gold_value
				}
			}
		}
	}

	#I don't owe this guy shit
	option = {
		name = ep3_interactions_events.0600.f
		show_as_tooltip = {
			ep3_interactions_events_0601_ignore = yes
		}
		add_character_flag = {
			flag = supporter_response_ignore
			days = 30
		}
		
		stress_impact = {
			arrogant = minor_stress_impact_loss
			fickle = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			just = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			generous = medium_stress_impact_gain
			humble = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -1
				ai_sociability = -0.5
			}
			modifier = {
				add = 50
				OR = {
					has_trait = arrogant
					has_trait = wrathful
					has_trait = fickle
					has_trait = arbitrary
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value <= -60
				}
			}
			modifier = {
				add = 50
				opinion = {
					target = scope:supporter
					value < 0
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value >= 30
				}
			}
			modifier = {
				add = -50
				opinion = {
					target = scope:supporter
					value >= 60
				}
			}
			modifier = {
				add = -100
				scope:supporter = {
					highest_held_title_tier >= tier_kingdom
				}
				highest_held_title_tier <= tier_duchy
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = just
					has_trait = trusting
					has_trait = generous
					has_trait = humble
					has_trait = gregarious
					opinion = {
						target = scope:supporter
						value >= 60
					}
				}
			}
		}
	}
	after = {
		scope:supporter = {
			trigger_event = ep3_interactions_events.0601
		}
	}
}

ep3_interactions_events.0601 = {
	type = letter_event
	opening = {
		desc = ep3_interactions_events.0601.opening
	}
	desc = {
		desc = ep3_interactions_events.0601.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						OR = {
							has_character_flag = supporter_response_insult
							has_character_flag = supporter_response_ignore
						}
					}
				}
				desc = ep3_interactions_events.0601.desc_scorn
			}
			desc = ep3_interactions_events.0601.desc_repay
		}
		
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						OR = {
							has_character_flag = supporter_response_ally_success
							has_character_flag = supporter_response_ally_fail
							has_character_flag = supporter_response_ally_player
						}
					}
				}
				desc = ep3_interactions_events.0601.desc_ally
			}
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						has_character_flag = supporter_response_insult
					}
				}
				desc = ep3_interactions_events.0601.desc_insult
			}
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						has_character_flag = supporter_response_hook
					}
				}
				desc = ep3_interactions_events.0601.desc_hook
			}
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						has_character_flag = supporter_response_friendship
					}
				}
				desc = ep3_interactions_events.0601.desc_friendship
			}
			triggered_desc = {
				trigger = {
					scope:new_landed_admin = {
						has_character_flag = supporter_response_gift
					}
				}
				desc = ep3_interactions_events.0601.desc_gift
			}
			desc = ep3_interactions_events.0601.desc_ignore
		}
	} 
	sender = scope:new_landed_admin
	
	immediate = {
		#How did the new ruler reply?
		scope:new_landed_admin = {
			if = {
				limit = {
					has_character_flag = supporter_response_ally_success
				}
				ep3_interactions_events_0601_ally_success = yes
			}
			else_if = {
				limit = {
					has_character_flag = supporter_response_ally_fail
				}
				ep3_interactions_events_0601_ally_fail = yes
			}
			else_if = {
				limit = {
					has_character_flag = supporter_response_insult
				}
				ep3_interactions_events_0601_insult = yes
			}
			else_if = {
				limit = {
					has_character_flag = supporter_response_hook
				}
				ep3_interactions_events_0601_hook = yes
				add_opinion = {
					target = scope:supporter
					modifier = trust_opinion
					opinion = 10
				}
			}
			else_if = {
				limit = {
					has_character_flag = supporter_response_friendship
				}
				ep3_interactions_events_0601_friendship = yes
				if = {
					limit = {
						can_set_relation_friend_trigger = { CHARACTER = scope:supporter}
					}
					add_opinion = {
						modifier = friendliness_opinion
						target = scope:supporter
						opinion = 10
					}
				}
				else = {
					add_opinion = {
						modifier = friendliness_opinion
						target = scope:supporter
						opinion = 30
					}
				}
			}

			else_if = {
				limit = {
					has_character_flag = supporter_response_gift
				}
				ep3_interactions_events_0601_gift = yes
			}
			else_if = {
				limit = {
					has_character_flag = supporter_response_ignore
				}
				ep3_interactions_events_0601_ignore = yes
				add_opinion = {
					target = scope:supporter
					modifier = disrespect_opinion
					opinion = -10
				}
			}
		}
	}

	#Yep
	option = {
		name = {
			trigger = {
				scope:new_landed_admin = {
					NOR = {
						has_character_flag = supporter_response_insult
						has_character_flag = supporter_response_ignore
					}
				}
			}
			text = ep3_interactions_events.0601.a_repaid
		}
		name = {
			trigger = {
				scope:new_landed_admin = {
					OR = {
						has_character_flag = supporter_response_insult
						has_character_flag = supporter_response_ignore
					}
				}
			}
			text = ep3_interactions_events.0601.a_scorned
		}
		if = {
			limit = {
				scope:new_landed_admin = {
					has_character_flag = supporter_response_ally_player
				}
			}
			scope:new_landed_admin = {
				send_interface_toast = {
					type = event_toast_effect_good
					title = ep3_interactions_events.0600.a.success
					left_icon = scope:supporter
	
					ep3_interactions_events_0601_ally_success = yes
				}
			}
			reverse_add_opinion = {
				modifier = trust_opinion
				target = scope:new_landed_admin
				opinion = 25
			}
			stress_impact = {
				paranoid = minor_stress_impact_gain
				arrogant = minor_stress_impact_gain
				fickle = minor_stress_impact_gain
			}
		}
	}

	#No thanks
	option = {
		trigger = {
			scope:new_landed_admin = {
				has_character_flag = supporter_response_ally_player
			}
		}
		name = ep3_interactions_events.0601.b
		scope:new_landed_admin = {
			send_interface_toast = {
				type = event_toast_effect_bad
				title = ep3_interactions_events.0600.a.fail
				left_icon = scope:supporter
				
				ep3_interactions_events_0601_ally_fail = yes
			}
		}
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:new_landed_admin
			opinion = -25
		}
		
		stress_impact = {
			trusting = minor_stress_impact_gain
			generous = minor_stress_impact_gain
			just = minor_stress_impact_gain
		}
	}
}

# You are an adventurer who just got granted a landless admin estate!
ep3_interactions_events.0610 = {
	type = character_event
	title = ep3_interactions_events.0610.t
	desc = {
		desc = ep3_interactions_events.0610.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:recipient = {
						this = scope:emperor
					}
				}
				desc = ep3_interactions_events.0610.desc_emperor
			}
			desc = ep3_interactions_events.0610.desc_governor
		}
		triggered_desc = {
			trigger = {
				root = {
					has_character_flag = procure_estate_conversion
				}
			}
			desc = ep3_interactions_events.0610.desc_conversion
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:recipient = {
						this = scope:emperor
					}
				}
				desc = ep3_interactions_events.0610.desc_emperor_outro
			}
			desc = ep3_interactions_events.0610.desc_non_governor_outro
		}
	}
	#Triggered desc based on what you paid
	#And if you converted
	#Triggered desc based on whether recipient is emperor
	theme = administrative
	left_portrait = {
		character = root
		animation = survey
	}
	lower_right_portrait = scope:recipient
	lower_center_portrait = {
		character = scope:emperor
		trigger = {
			this != scope:recipient
		}
	}
	override_background = {
		reference = estate
	}

	immediate = {
		play_sound_effect = "event:/DLC/EP3/SFX/Stingers/Byzantine_Flavor/ep3_mx_sting_byzantineflavor_become_governor"
		primary_title = {
			ordered_succession_appointment_investors = {
				candidate = root
				limit = {
					NOT = {
						house ?= root.house
					}
					is_alive = yes
					is_imprisoned = no
					NOR = {
						has_relation_rival = root
						is_at_war_with = root
					}
				}
				save_scope_as = supporter
			}
		}
		if = {
			limit = {
				NOT = {
					exists = scope:new_landed_admin
				}
			}
			save_scope_as = new_landed_admin
		}
		if = {
			limit = {
				scope:recipient = {
					top_liege != this

				}
			}
			scope:recipient.top_liege = {
				save_scope_as = emperor
			}
		}
		else = {
			scope:recipient = {
				save_scope_as = emperor
			}
		}
		show_as_tooltip = {
			get_title = primary_title
			domicile = {
				add_domicile_building = estate_main_01
			}
		}
	}

	#I'm a new kinda landless now
	option = {
		name = ep3_interactions_events.0610.a
	}
}

#You are turned down
ep3_interactions_events.0611 = {
	type = letter_event
	opening = {
		desc = ep3_interactions_events.0611.opening
	}
	desc = ep3_interactions_events.0611.desc
	sender = scope:recipient

	option = {
		name = ep3_interactions_events.0611.a
	}
}

ep3_interactions_events.0620 = { # Ask for Influence accepted letter
	type = letter_event
	opening = {
		desc = ep3_interactions_events.0620.opening
	}
	desc = {
		random_valid = {
			triggered_desc = {
				trigger = {
					faith.religion = {
						this = religion:christianity_religion
					}
				}
				desc = ep3_interactions_events.0620.desc_byz
			}
			desc = ep3_interactions_events.0620.desc
		}
	}
	sender = scope:recipient

	immediate = {
		show_as_tooltip = { ep3_hof_ask_for_influence_interaction_effect = yes }
	}

	option = {
		name = {
			trigger = {
				scope:actor = {
					ai_zeal >= low_positive_ai_value
					ai_greed < low_positive_ai_value
				}
			}
			text = ep3_interactions_events.0620.a
		}
		name = {
			trigger = {
				scope:actor = {
					ai_greed >= low_positive_ai_value
					ai_zeal < low_positive_ai_value
				}
			}
			text = ep3_interactions_events.0620.b
		}
		name = {
			trigger = {
				scope:actor = {
					ai_greed < low_positive_ai_value
					ai_zeal < low_positive_ai_value
				}
			}
			text = ep3_interactions_events.0620.c
		}
	}
}

ep3_interactions_events.0621 = { # Ask for Influence rejection letter event
	type = letter_event
	opening = {
		desc = ep3_interactions_events.0621.opening
	}
	desc = ep3_interactions_events.0621.desc
	sender = scope:recipient

	option = {
		name = ep3_interactions_events.0621.a
	}
}

# Governor is fired/retired - governor_removal_interaction
ep3_interactions_events.0630 = {
	type = letter_event
	opening = {
		desc = ep3_interactions_events.0630.opening
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:actor = {
						exists = scope:recipient.house
						house ?= {
							this = scope:recipient.house
						}
					}
				}
				desc = ep3_interactions_events.0630.desc_family
			}
			triggered_desc = {
				trigger = {
					scope:actor = {
						opinion = {
							target = scope:recipient
							value <= -50
						}
					}
				}
				desc = ep3_interactions_events.0630.desc_spite
			}
			triggered_desc = {
				trigger = {
					scope:actor = {
						opinion = {
							target = scope:recipient
							value >= 50
						}
					}
				}
				desc = ep3_interactions_events.0630.desc_guilt
			}
			desc = ep3_interactions_events.0630.desc
		}
	}
	sender = scope:actor

	immediate = {
	}

	option = {
		name = {
			trigger = {
				scope:actor = {
					OR = {
						ai_vengefulness >= low_positive_ai_value
						opinion = {
							target = scope:recipient
							value <= -60
						}
					}
				}
			}
			text = ep3_interactions_events.0630.a
		}
		name = {
			trigger = {
				scope:actor = {
					NOR = {
						ai_vengefulness >= low_positive_ai_value
						opinion = {
							target = scope:recipient
							value <= -60
						}
					}
					OR = {
						ai_honor >= low_positive_ai_value
						opinion = {
							target = scope:recipient
							value >= 60
						}
					}
				}
			}
			text = ep3_interactions_events.0630.b
		}
		name = {
			trigger = {
				scope:actor = {
					NOR = {
						ai_vengefulness >= low_positive_ai_value
						opinion = {
							target = scope:recipient
							value <= -60
						}
						ai_honor >= low_positive_ai_value
						opinion = {
							target = scope:recipient
							value >= 60
						}
					}
					
				}
			}
			text = ep3_interactions_events.0630.c
		}
		custom_tooltip = depose_governor_lose_titles_tt	
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_good
				title = demand_governor_resignation_accepted_toast
				left_icon = scope:recipient
				scope:recipient = {
					governor_resignation_title_transfer_effect = yes
					if = {
						limit = {
							scope:actor = {
								has_realm_law_flag = celestial_retirement_law
							}
							tgp_is_above_retirement_age_trigger = { REALM_OWNER = scope:actor }
						}
						show_as_tooltip = {
							scope:actor = {
								if = {
									limit = { has_treasury = yes }
									pay_treasury_to_gold = {
										target = scope:recipient
										value = scope:force_retirement_treasury_cost
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

# Faction War interactions
ep3_interactions_events.0800 = { # Join Faction War acceptance letter event
	type = letter_event
	opening = char_interaction.0001.opening
	desc = ep3_interactions_events.0800.desc
	sender = scope:recipient

	immediate = {
		ep3_join_faction_war_effect = yes
	}

	option = {
		name = ep3_interactions_events.0800.a
	}
}

ep3_interactions_events.0801 = { # Join Faction War rejection letter event
	type = letter_event
	opening = char_interaction.0001.opening
	desc = ep3_interactions_events.0801.desc
	sender = scope:recipient

	option = {
		name = ep3_interactions_events.0801.a
	}
}

ep3_interactions_events.0810 = { # Switch Faction War Sides acceptance letter event
	type = letter_event
	opening = char_interaction.0001.opening
	desc = ep3_interactions_events.0810.desc
	sender = scope:recipient

	immediate = {
		ep3_switch_faction_war_sides_effect = yes
	}

	option = {
		name = ep3_interactions_events.0810.a
	}
}

ep3_interactions_events.0811 = { # Switch Faction War Sides rejection letter event
	type = letter_event
	opening = char_interaction.0001.opening
	desc = ep3_interactions_events.0811.desc
	sender = scope:recipient

	option = {
		name = ep3_interactions_events.0811.a
	}
}
