﻿#Interactions relating to the head of the dynasty

disinherit_interaction = {
	icon = icon_dynasty
	category = interaction_category_hostile
	interface_priority = 60

	desc = disinherit_interaction_desc
	use_diplomatic_range = no
	
	is_available = {
		trigger_if = {
			limit = { is_ai = yes }
			is_dynast = yes
			NOT = {
				has_trait = forgiving
			}
			is_at_war = no
		}
	}

	is_shown = {
		NOR = { 
			scope:recipient = scope:puppet_or_actor 

			AND = { # Explicit AND to ensure no funny business
				scope:recipient = { is_child_of = scope:puppet_or_actor }
				scope:puppet_or_actor.dynasty ?= {
					this = scope:recipient.dynasty
					has_dynasty_perk = fp2_coterie_legacy_5
				}
			}
		}

		scope:puppet_or_actor ?= {
			is_dynast = yes
			dynasty ?= scope:recipient.dynasty

		}
		scope:recipient = {
			NOT = {
				has_trait = disinherited
			}
		}
	}

	is_valid = {
		custom_description = {
			scope:puppet_or_actor.culture = {
				NOT = { has_cultural_parameter = cannot_disherit }
			} 
			text = "mystical_ancestors_disinherit"
		}
	}

	is_valid_showing_failures_only = {
		trigger_if = {
			limit = {
				NOT = { # in such cases, it will be free so no need to check for Renown
					scope:recipient = {
						OR = {
							has_trait = disputed_heritage
							any_secret = {
								type = secret_disputed_heritage
								is_known_by = scope:puppet_or_actor
							}
							has_trait = bastard
						}
					}
				}
			}
			scope:puppet_or_actor.dynasty = {
				dynasty_prestige >= medium_dynasty_prestige_value
			}
		}

		scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } }
		trigger_if = {
			limit = {
				scope:recipient = {
					NOR = {
						is_child_of = scope:puppet_or_actor
						is_grandchild_of = scope:puppet_or_actor
						is_great_grandchild_of = scope:puppet_or_actor
					}
				}
			}
			custom_description = {
				scope:recipient.top_liege = scope:puppet_or_actor.top_liege
				subject = scope:puppet_or_actor
				text = "same_realm_as"
			}
		}
		custom_tooltip = {
			text = cannot_take_overt_hostile_actions_against_diarch.tt
			NOT = { scope:recipient ?= scope:puppet_or_actor.diarch }
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0020
		}
	}
	
	on_accept = {
		scope:puppet_or_actor = {
			# Only get stressed/SP penalties if you don't have the parameter
			if = {
				limit = {
					NOT = { sp_hostile_schemes_except_murder_no_stress_or_fulfillment_trigger = yes }
				}
				stress_and_fulfillment_impact = {
					forgiving = minor_stress_impact_gain
					compassionate = minor_stress_impact_gain
				}
			}
			
			#Legitimacy loss
			if = {
				limit = { has_legitimacy = yes }
				if = {
					limit = { scope:recipient = { is_primary_heir_of = scope:puppet_or_actor } }
					add_legitimacy = {
						value = medium_legitimacy_loss
						multiply = scope:puppet_or_actor.primary_title.tier
					}
				}
				else_if = {
					limit = { scope:recipient = { is_child_of = scope:puppet_or_actor } }
					add_legitimacy = {
						value = minor_legitimacy_loss
						multiply = scope:puppet_or_actor.primary_title.tier
					}
				}
				else = {
					add_legitimacy = {
						value = miniscule_legitimacy_loss
						multiply = scope:puppet_or_actor.primary_title.tier
					}
				}
			}
			hidden_effect = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = disinherit_interaction_notification

					left_icon = scope:puppet_or_actor					
					right_icon = scope:recipient

					scope:recipient = {
						show_as_tooltip = {
							disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
						}
					}
				}
			}
		}
		hidden_effect = {
			if = {
				limit = {
					scope:is_puppet_action ?= yes
				}
				scope:actor = {
					send_interface_toast = {
						type = event_toast_effect_neutral
						title = disinherit_interaction_notification

						left_icon = scope:puppet_or_actor
						right_icon = scope:recipient

						scope:recipient = {
							show_as_tooltip = {
								disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
							}
						}
					}
				}
			}
		}

		scope:recipient = {
			disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = medium_unity_loss
			DESC = clan_unity_disinheritance.desc
			REVERSE_NON_HOUSE_TARGET = no
		}

		if = {
			limit = {
				scope:recipient = {
					any_secret = {
						type = secret_disputed_heritage
						is_known_by = scope:puppet_or_actor
						save_temporary_scope_as = secret_to_reveal
					}
				}
			}

			scope:secret_to_reveal = {
				expose_secret = scope:recipient.mother
			}

			scope:recipient = {
				add_trait = disputed_heritage
			}
		}
	}
	
	cost = {
		renown = {
			value = {
				add = scope:puppet_or_actor.dynasty.medium_dynasty_prestige_value
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = yes
						}
					}
					add = scope:puppet_or_actor.dynasty.major_dynasty_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = no
							any_heir_title = {
								exists = holder
							}
						}
					}
					add = scope:puppet_or_actor.dynasty.medium_dynasty_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							OR = {
								has_trait = disputed_heritage
								any_secret = {
									type = secret_disputed_heritage
									is_known_by = scope:puppet_or_actor
								}
								has_trait = bastard
							}
						}
					}
					multiply = 0
				}
			}
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
		prestige = {
			value = {
				add = medium_prestige_value
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = yes
						}
					}
					add = massive_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = no
							any_heir_title = {
								exists = holder
							}
						}
					}
					add = medium_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							OR = {
								has_trait = disputed_heritage
								any_secret = {
									type = secret_disputed_heritage
									is_known_by = scope:puppet_or_actor
								}
								has_trait = bastard
							}
						}
					}
					multiply = 0
				}
			}
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	
	auto_accept = yes

	ai_targets = {
		ai_recipients = dynasty
		max = 20
	}
	
	ai_frequency_by_tier = {
		barony = 0
		county = 96
		duchy = 48
		kingdom = 12
		empire = 12
		hegemony = 12
	}
	
	ai_will_do = {
		base = 0
		
		modifier = {
			add = -100
			scope:puppet_or_actor = {
				OR = {
					legitimacy_level = 0
					legitimacy_level = 1
				}
			}
			scope:recipient = { is_primary_heir_of = scope:puppet_or_actor }
		}
		
		modifier = {
			add = 100
			scope:recipient = {
				OR = {
					has_relation_rival = scope:puppet_or_actor
					has_relation_nemesis = scope:puppet_or_actor
				}
			}
		}
		
		modifier = {
			add = 100
			scope:recipient = {
				is_primary_heir_of = scope:puppet_or_actor
				OR = {
					has_trait = inbred
					has_trait = intellect_bad_3
					has_trait = incapable
				}
			}
		}
		
		modifier = {
			add = 5
			ai_vengefulness >= medium_positive_ai_value
			scope:recipient = {
				is_heir_of = scope:puppet_or_actor
			}
			OR = {
				AND = {
					scope:recipient = {
						has_trait = incestuous
					}
					NOT = { is_incestuous_trigger = yes }
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:incestuous RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = kinslayer
					}
					NOT = { has_trait = kinslayer }
				}
				AND = {
					scope:recipient = {
						has_trait = adulterer
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:adulterer RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = fornicator
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:fornicator RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = deviant
					}
					is_deviant_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:deviant RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = witch
					}
					is_witch_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:witch RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = sodomite
					}
					NOR = {
						has_trait = sodomite
						any_secret = {
							type = secret_homosexual
						}
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:sodomite RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = cannibal
					}
					is_cannibal_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:cannibal RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
			}
		}

		# Unity modifiers
		evaluate_action_decreasing_house_unity = {
			VALUE = 100
		}
		
		modifier = {
			factor = 0
			scope:recipient = {
				OR = {
					has_relation_friend = scope:puppet_or_actor
					has_relation_best_friend = scope:puppet_or_actor
				}
			}
		}
		
		modifier = {
			factor = 0
			scope:recipient = {
				is_ai = no
			}
		}
	}
}

disinherit_children_interaction = {
	icon = icon_dynasty
	category = interaction_category_hostile
	interface_priority = 60

	desc = disinherit_children_interaction_desc
	use_diplomatic_range = no

	is_available = {
		trigger_if = {
			limit = { is_ai = yes }
			is_dynast = yes
			NOT = {
				has_trait = forgiving
			}
			is_at_war = no
		}
	}

	is_shown = {
		# DLC checking
		has_fp2_dlc_trigger = yes
		# Standard check
		scope:recipient != scope:puppet_or_actor

		scope:puppet_or_actor.dynasty ?= {
			this = scope:recipient.dynasty
			has_dynasty_perk = fp2_coterie_legacy_5
		}
		scope:recipient = {
			NOT = {
				has_trait = disinherited
			}
		}
	}

	is_valid = {
		scope:puppet_or_actor = { is_parent_of = scope:recipient }


		custom_description = {
			scope:puppet_or_actor.culture = {
				NOT = { has_cultural_parameter = cannot_disherit }
			}
			text = "mystical_ancestors_disinherit"
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor = {
			prestige >= major_prestige_value
		}
		scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } }
		trigger_if = {
			limit = {
				scope:recipient = {
					NOR = {
						is_child_of = scope:puppet_or_actor
						is_grandchild_of = scope:puppet_or_actor
						is_great_grandchild_of = scope:puppet_or_actor
					}
				}
			}
			custom_description = {
				scope:recipient.top_liege = scope:puppet_or_actor.top_liege
				subject = scope:puppet_or_actor
				text = "same_realm_as"
			}
		}
		custom_tooltip = {
			text = cannot_take_overt_hostile_actions_against_diarch.tt
			NOT = { scope:recipient ?= scope:puppet_or_actor.diarch }
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0020
		}
	}

	on_accept = {
		scope:puppet_or_actor = {
			# Only get stressed/SP penalties if you don't have the parameter
			if = {
				limit = {
					NOT = { sp_hostile_schemes_except_murder_no_stress_or_fulfillment_trigger = yes }
				}
				stress_and_fulfillment_impact = {
					forgiving = minor_stress_impact_gain
					compassionate = minor_stress_impact_gain
				}
			}
			add_tyranny = massive_tyranny_value
			hidden_effect = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = disinherit_interaction_notification

					left_icon = scope:puppet_or_actor
					right_icon = scope:recipient

					scope:recipient = {
						show_as_tooltip = {
							disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
						}
					}
				}
			}
		}
		hidden_effect = {
			if = {
				limit = {
					scope:is_puppet_action ?= yes
				}
				scope:actor = {
					send_interface_toast = {
						type = event_toast_effect_neutral
						title = disinherit_interaction_notification

						left_icon = scope:puppet_or_actor
						right_icon = scope:recipient

						scope:recipient = {
							show_as_tooltip = {
								disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
							}
						}
					}
				}
			}
		}

		scope:recipient = {
			disinherit_effect = { DISINHERITOR = scope:puppet_or_actor }
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = minor_unity_loss
			DESC = clan_unity_disinheritance.desc
			REVERSE_NON_HOUSE_TARGET = no
		}		
	}

	cost = {
		prestige = {
			value = {
				add = medium_prestige_value
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = yes
						}
					}
					add = massive_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = no
							any_heir_title = {
								exists = holder
							}
						}
					}
					add = medium_prestige_value
				}
			}
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}

	auto_accept = yes

	ai_targets = {
		ai_recipients = dynasty
		max = 20
	}

	ai_frequency_by_tier = {
		barony = 0
		county = 96
		duchy = 48
		kingdom = 12
		empire = 12
		hegemony = 12
	}

	ai_will_do = {
		base = 0

		modifier = {
			add = 100
			scope:recipient = {
				OR = {
					has_relation_rival = scope:puppet_or_actor
					has_relation_nemesis = scope:puppet_or_actor
				}
			}
		}

		modifier = {
			add = 100
			scope:recipient = {
				is_primary_heir_of = scope:puppet_or_actor
				OR = {
					has_trait = inbred
					has_trait = intellect_bad_3
					has_trait = incapable
				}
			}
		}

		modifier = {
			add = 5
			ai_vengefulness >= medium_positive_ai_value
			scope:recipient = {
				is_heir_of = scope:puppet_or_actor
			}
			OR = {
				AND = {
					scope:recipient = {
						has_trait = incestuous
					}
					NOT = { is_incestuous_trigger = yes }
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:incestuous RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = kinslayer
					}
					NOT = { has_trait = kinslayer }
				}
				AND = {
					scope:recipient = {
						has_trait = adulterer
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:adulterer RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = fornicator
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:fornicator RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = deviant
					}
					is_deviant_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:deviant RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = witch
					}
					is_witch_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:witch RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = sodomite
					}
					NOR = {
						has_trait = sodomite
						any_secret = {
							type = secret_homosexual
						}
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:sodomite RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = cannibal
					}
					is_cannibal_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:cannibal RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
			}
		}

		# Unity modifiers
		evaluate_action_decreasing_house_unity = {
			VALUE = 100
		}

		modifier = {
			factor = 0
			scope:recipient = {
				OR = {
					has_relation_friend = scope:puppet_or_actor
					has_relation_best_friend = scope:puppet_or_actor
				}
			}
		}

		modifier = {
			factor = 0
			scope:recipient = {
				is_ai = no
			}
		}
	}
}

restore_inheritance_interaction = {
	icon = icon_dynasty
	category = interaction_category_friendly
	desc = restore_inheritance_interaction_desc

	interface_priority = 60

	is_available = {
		trigger_if = {
			limit = { is_ai = yes }
			is_dynast = yes
			is_at_war = no
		}
	}

	is_shown = {
		scope:puppet_or_actor ?= {
			is_dynast = yes
			dynasty ?= scope:recipient.dynasty

		}
		scope:recipient = {
			has_trait = disinherited
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor.dynasty ={
			dynasty_prestige >= miniscule_dynasty_prestige_value
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0030
		}
	}
	
	on_accept = {
		scope:puppet_or_actor = {
			stress_and_fulfillment_impact = {
				vengeful = minor_stress_impact_gain
				stubborn = minor_stress_impact_gain
			}
			hidden_effect = {
				send_interface_message = {
					type = event_dynasty_neutral
					title = restore_inheritance_interaction_notification
					right_icon = scope:recipient
					show_as_tooltip = {
						scope:recipient = {
							restore_inheritance_effect = yes
						}
					}
				}
			}
		}

		scope:recipient = {
			restore_inheritance_effect = yes
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = minor_unity_gain
			DESC = clan_unity_re_inheritance.desc
			REVERSE_NON_HOUSE_TARGET = no
		}		
	}

	cost = {
		renown = {
			value = scope:puppet_or_actor.dynasty.medium_dynasty_prestige_value
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	
	auto_accept = yes

	ai_targets = {
		ai_recipients = dynasty
		max = 20
	}
	
	ai_frequency_by_tier = {
		barony = 0
		county = 96
		duchy = 48
		kingdom = 12
		empire = 12
		hegemony = 12
	}
	
	ai_will_do = {
		base = 0
		
		modifier = {
			add = 100
			scope:recipient = {
				OR = {
					has_relation_friend = scope:puppet_or_actor
					has_relation_best_friend = scope:puppet_or_actor
				}
			}
		}
		
		modifier = {
			add = 5
			ai_vengefulness <= medium_negative_ai_value
		}
		
		modifier = {
			add = 100
			scope:recipient = scope:puppet_or_actor
		}

		# Unity modifiers
		evaluate_action_increasing_house_unity = {
			VALUE = 100
		}
		
		modifier = {
			factor = 0
			scope:recipient = {
				OR = {
					has_relation_rival = scope:puppet_or_actor
					has_relation_nemesis = scope:puppet_or_actor
				}
			}
		}
	}
}

denounce_interaction = {
	icon = icon_dynasty
	category = interaction_category_hostile
	interface_priority = 59 #after disinherit

	desc = denounce_interaction_desc
	
	is_available = {
		trigger_if = {
			limit = { is_ai = yes }
			is_adult = yes
			is_dynast = yes
			NOT = {
				has_trait = forgiving
			}
		}
	}

	is_shown = {
		scope:recipient != scope:puppet_or_actor

		scope:puppet_or_actor ?= {
			is_dynast = yes
			dynasty ?= scope:recipient.dynasty
		}
		scope:recipient = {
			NOT = {
				has_trait = denounced
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor.dynasty = {
			dynasty_prestige >= minor_dynasty_prestige_value
		}
		scope:recipient = { NOT = { has_strong_hook = scope:puppet_or_actor } }
		custom_tooltip = {
			text = cannot_take_overt_hostile_actions_against_diarch.tt
			NOT = { scope:recipient ?= scope:puppet_or_actor.diarch }
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0040
		}
	}
	
	on_accept = {
		scope:puppet_or_actor = {
			# Only get stressed/SP penalties if you don't have the parameter
			if = {
				limit = {
					NOT = { sp_hostile_schemes_except_murder_no_stress_or_fulfillment_trigger = yes }
				}
				stress_and_fulfillment_impact = {
					forgiving = minor_stress_impact_gain
					compassionate = minor_stress_impact_gain
				}
			}

			hidden_effect = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = denounce_interaction_notification

					left_icon = scope:puppet_or_actor					
					right_icon = scope:recipient

					scope:recipient = {
						show_as_tooltip = {
							denounce_effect = { ACTOR = scope:puppet_or_actor RECIPIENT = scope:recipient }
						}
					}
				}
			}
		}
		hidden_effect = {
			if = {
				limit = {
					scope:is_puppet_action ?= yes
				}
				scope:actor = {
					send_interface_toast = {
						type = event_toast_effect_neutral
						title = denounce_interaction_notification

						left_icon = scope:puppet_or_actor
						right_icon = scope:recipient

						scope:recipient = {
							show_as_tooltip = {
								denounce_effect = { ACTOR = scope:puppet_or_actor RECIPIENT = scope:recipient }
							}
						}
					}
				}
			}
		}

		scope:recipient = {
			denounce_effect = { ACTOR = scope:puppet_or_actor RECIPIENT = scope:recipient }
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = minor_unity_loss
			DESC = clan_unity_denouncement.desc
			REVERSE_NON_HOUSE_TARGET = no
		}		
	}

	cost = {
		renown = {
			value = {
				add = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = yes
						}
					}
					add = scope:puppet_or_actor.dynasty.medium_dynasty_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = no
							any_heir_title = {
								exists = holder
							}
						}
					}
					add = scope:puppet_or_actor.dynasty.minor_dynasty_prestige_value
				}
			}
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
		prestige = {
			value = {
				add = medium_prestige_value
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = yes
						}
					}
					add = major_prestige_value
				}
				if = {
					limit = {
						scope:recipient = {
							is_landed_or_landless_administrative_or_theocratic = no
							any_heir_title = {
								exists = holder
							}
						}
					}
					add = medium_prestige_value
				}
			}
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	
	auto_accept = yes

	ai_targets = {
		ai_recipients = dynasty
		max = 20
	}
	
	ai_frequency_by_tier = {
		barony = 0
		county = 96
		duchy = 48
		kingdom = 12
		empire = 12
		hegemony = 12
	}
	
	ai_will_do = {
		base = 0
		
		modifier = {
			add = 100
			scope:recipient = {
				OR = {
					has_relation_rival = scope:puppet_or_actor
					has_relation_nemesis = scope:puppet_or_actor
				}
			}
		}
		
		modifier = {
			add = 5
			ai_vengefulness >= medium_positive_ai_value
			OR = {
				AND = {
					scope:recipient = {
						has_trait = incestuous
					}
					NOT = { is_incestuous_trigger = yes }
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:incestuous RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = kinslayer
					}
					NOT = { has_trait = kinslayer }
				}
				AND = {
					scope:recipient = {
						has_trait = adulterer
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:adulterer RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = fornicator
					}
					NOR = {
						has_trait = adulterer
						has_trait = fornicator
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:fornicator RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = deviant
					}
					is_deviant_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:deviant RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = witch
					}
					is_witch_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:witch RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = sodomite
					}
					NOR = {
						has_trait = sodomite
						any_secret = {
							type = secret_homosexual
						}
					}
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:sodomite RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
				AND = {
					scope:recipient = {
						has_trait = cannibal
					}
					is_cannibal_trigger = no
					trait_is_criminal_in_rite_trigger = { TRAIT = trait:cannibal RITE = scope:puppet_or_actor.rite GENDER_CHARACTER = scope:recipient }
				}
			}
		}

		# Unity modifiers
		evaluate_action_decreasing_house_unity = {
			VALUE = 100
		}
		
		modifier = {
			factor = 0
			scope:recipient = {
				OR = {
					has_relation_friend = scope:puppet_or_actor
					has_relation_best_friend = scope:puppet_or_actor
				}
			}
		}
	}
}

forgive_interaction = {
	icon = icon_dynasty
	category = interaction_category_friendly
	interface_priority = 60

	desc = forgive_interaction_desc
	
	is_available = {
		trigger_if = {
			limit = { is_ai = yes }
			is_dynast = yes
			is_at_war = no
		}
	}

	is_shown = {
		scope:puppet_or_actor ?= {
			is_dynast = yes
			dynasty ?= scope:recipient.dynasty
		}
		scope:recipient = {
			has_trait = denounced
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor.dynasty = {
			dynasty_prestige >= miniscule_dynasty_prestige_value
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0050
		}
	}

	on_accept = {
		scope:puppet_or_actor = {
			stress_and_fulfillment_impact = {
				vengeful = minor_stress_impact_gain
				stubborn = minor_stress_impact_gain
			}
			hidden_effect = {
				send_interface_message = {
					type = event_generic_neutral
					title = forgive_interaction_notification
					right_icon = scope:recipient
					show_as_tooltip = {
						scope:recipient = {
							forgive_effect = yes
						}
					}
				}
			}
		}

		scope:recipient = {
			forgive_effect = yes
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = minor_unity_gain
			DESC = clan_unity_forgiveness.desc
			REVERSE_NON_HOUSE_TARGET = no
		}		
	}

	cost = {
		renown = {
			value = scope:puppet_or_actor.dynasty.miniscule_dynasty_prestige_value
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	
	auto_accept = yes

	ai_targets = {
		ai_recipients = dynasty
		max = 20
	}
	
	ai_frequency_by_tier = {
		barony = 0
		county = 120
		duchy = 60
		kingdom = 24
		empire = 24
		hegemony = 24
	}
	
	ai_will_do = {
		base = 0
		
		modifier = {
			add = 100
			scope:recipient = {
				OR = {
					has_relation_friend = scope:puppet_or_actor
					has_relation_best_friend = scope:puppet_or_actor
				}
			}
		}
		
		modifier = {
			add = 5
			ai_vengefulness <= medium_negative_ai_value
		}
		
		modifier = {
			add = 100
			scope:recipient = scope:puppet_or_actor
		}

		# Unity modifiers
		evaluate_action_increasing_house_unity = {
			VALUE = 100
		}
		
		modifier = {
			factor = 0
			scope:recipient = {
				OR = {
					has_relation_rival = scope:puppet_or_actor
					has_relation_nemesis = scope:puppet_or_actor
				}
			}
		}
	}
}

call_dynasty_member_to_war_interaction = {
	icon = icon_dynasty
	category = interaction_category_diplomacy
	interface_priority = 60

	desc = call_dynasty_member_to_war_interaction_desc
	
	interface = call_ally
	special_interaction = call_ally_interaction
	popup_on_receive = yes
	pause_on_receive = yes
	
	greeting = positive
	notification_text = CALL_DYNASTY_MEMBER_NOTIFICATION
	
	is_shown = {
		scope:recipient != scope:puppet_or_actor

		scope:puppet_or_actor ?= {
			any_character_war = {
				is_war_leader = scope:puppet_or_actor
			}
			is_dynast = yes
			religion ?= scope:recipient.religion
			dynasty ?= scope:recipient.dynasty
			house != scope:recipient.house # Use the House Head version instead
		}
		scope:recipient = {
			is_ruler = yes
		}

		scope:recipient = {
			NOT = {
				target_is_liege_or_above = scope:puppet_or_actor
			}
		}
	}
	
	has_valid_target = {
		exists = scope:target
	}

	has_valid_target_showing_failures_only = {
		scope:target = {
			is_war_leader = scope:puppet_or_actor
		}
		joiner_not_already_in_another_war_with_any_target_war_participants_trigger = {
			WARRIOR = scope:puppet_or_actor
			JOINER = scope:recipient
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor.dynasty = { dynasty_prestige >= medium_dynasty_prestige_value }
		scope:recipient = {
			NOT = { government_has_flag = government_is_mercenary }
			NOT = { government_has_flag = government_is_holy_order }
		}
		custom_description = {
			text = "is_already_in_all_wars"
			scope:puppet_or_actor = {
				any_character_war = {
					NOR = {
						is_participant = scope:recipient
						was_called = scope:recipient
					}
					OR = {
						primary_attacker = scope:puppet_or_actor
						primary_defender = scope:puppet_or_actor
					}
				}
			}
		}
	}

	can_be_picked = {
		can_join_war_liege_vassal_check_trigger = { WARRIOR = scope:puppet_or_actor JOINER = scope:recipient }
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = call_ally.0001
		}
	}
		
	on_accept = {
		call_dynasty_member_to_war_interaction_effect = yes

		save_scope_value_as = {
			name = call_dynasty_member_to_war_interaction
			value = yes
		}

		if = {
			limit = {
				exists = scope:target
			}
			scope:puppet_or_actor = {
				trigger_event = call_ally.0100
			}
		}
	}
	
	on_decline = {
		#The war could theoretically end on the day the decline is sent
		if = {
			limit = {
				exists = scope:target
			}
			scope:target = {
				if = {
					limit = {
						is_attacker = scope:puppet_or_actor
					}
					scope:puppet_or_actor = {
						add_opinion = {
							modifier = rejected_call_to_offensive_war
							target = scope:recipient
						}
					}
				}
				else = {
					scope:puppet_or_actor = {
						add_opinion = {
							modifier = rejected_call_to_defensive_war
							target = scope:recipient
						}
					}
				}
				hidden_effect = {
					if = {
						limit = {
							NOT = { was_called = scope:recipient }
						}
						set_called_to = scope:recipient
					}
				}
			}
			scope:puppet_or_actor.dynasty = {
				add_dynasty_prestige = medium_dynasty_prestige_loss
			}
		}

		if = {
			limit = {
				exists = scope:target
			}
			scope:puppet_or_actor = {
				trigger_event = call_ally.0101
			}
		}
	}
	
	ai_accept = {
		base = 20

		modifier = {  # Refuse call to conflicts of little benefit
			add = -1000
			desc = WONT_FIGHT_MEANINGLESS_REASON
			trigger_if = {
				limit = { exists = scope:target }
				scope:target = { using_cb = fp2_border_raid }
				scope:recipient = { # Unless they like going on raids
					NOR = {
						has_trait = viking
						has_trait = reaver
					}
				}
			}
			trigger_else = { always = no }
		}

		modifier = {  # Refuse call against Heir
			add = -1000
			exists = scope:recipient.player_heir
			trigger_if = {
				limit = { scope:target.casus_belli.primary_defender = scope:puppet_or_actor }
				scope:target.casus_belli.primary_attacker = scope:recipient.player_heir
			}
			trigger_else = {
				scope:target.casus_belli.primary_defender = scope:recipient.player_heir
			}
			desc = WONT_FIGHT_HEIR_REASON
		}

		modifier = {  # Refuse call against Spouse
			add = -1000
			scope:recipient = {
				trigger_if = {
					limit = { scope:target.casus_belli.primary_defender = scope:puppet_or_actor }
					any_spouse = {
						this = scope:target.casus_belli.primary_attacker
					}
				}
				trigger_else = {
					any_spouse = {
						this = scope:target.casus_belli.primary_defender
					}
				}
				
			}
			desc = WONT_FIGHT_SPOUSE_REASON
		}
		
		modifier = {  # Reluctant when already at war
			add = -50
			scope:recipient = {
				is_at_war = yes
			}
			desc = ALREADY_AT_WAR
		}

		opinion_modifier = { # Opinion Factor
			who = scope:recipient
			opinion_target = scope:puppet_or_actor
			multiplier = 1.0
			desc = AI_OPINION_REASON
		}

		# Honor factor
		ai_value_modifier = {
			ai_honor = 1
			min = 0
		}

		modifier = {  # Tends to join defensive wars
			add = 50
			scope:target.casus_belli.primary_defender = scope:puppet_or_actor
			desc = DEFENSIVE_WAR_REASON
		}

		compare_modifier = { # Likes fighting infidels
			trigger = {
				scope:recipient.faith = scope:puppet_or_actor.faith
				OR = {
					AND = {
						scope:target.casus_belli.primary_attacker = {
							this = scope:puppet_or_actor
							faith = {
								faith_hostility_level = {
									target = scope:target.casus_belli.primary_defender.faith
									value >= religious_cb_enabled_hostility_level
								}
							}
						}
					}
					AND = {
						scope:target.casus_belli.primary_defender = {
							this = scope:puppet_or_actor
							faith = {
								faith_hostility_level = {
									target = scope:target.casus_belli.primary_attacker.faith
									value >= religious_cb_enabled_hostility_level
								}
							}
						}
					}
				}
			}
			target = scope:recipient
			value = ai_zeal
			desc = "ZEAL_AGAINST_INFIDELS"
			min = 0
			multiplier = 0.5
		}

		modifier = {  # Reluctant to attack another ally
			add = -50
			scope:target.casus_belli.primary_attacker = scope:puppet_or_actor
			scope:recipient = {
				is_allied_to = scope:target.casus_belli.primary_defender
			}
			desc = ATTACK_ON_ALLY_REASON
		}

		modifier = {  # Reluctant to defend against another ally
			add = -25
			scope:target.casus_belli.primary_defender = scope:puppet_or_actor
			scope:recipient = {
				is_allied_to = scope:target.casus_belli.primary_attacker
			}
			desc = WAR_WITH_ALLY_REASON
		}

		modifier = {  # Reluctant to join wars against religious brethren.
			add = -50
			scope:recipient.faith != scope:puppet_or_actor.faith
			scope:target.casus_belli.primary_attacker = scope:puppet_or_actor
			scope:target.casus_belli.primary_defender.faith = scope:recipient.faith
			scope:target.casus_belli.war = {
				OR = {
					using_cb = minor_religious_war
					using_cb = religious_war
					using_cb = major_religious_war
					using_cb = undirected_great_holy_war
					using_cb = directed_great_holy_war
				}
			}
			desc = WONT_ATTACK_RELIGIOUS_BRETHREN_REASON
		}

		fp3_struggle_resist_allied_wars_modifier = yes
	}

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

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

	send_options_exclusive = no
}

dynast_claim_title_interaction = {
	icon = icon_dynasty
	category = interaction_category_diplomacy
	interface_priority = 34 #right after HoF Request Claim
	desc = dynast_claim_title_interaction_desc
	target_type = title
	target_filter = recipient_domain_titles
	show_all_targets = no
	ignores_pending_interaction_block = yes
	cost = {
		renown = {
			value = dynast_claim_title_interaction_cost_value
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	is_shown = {
		scope:puppet_or_actor ?= {
			this != scope:recipient
			is_dynast = yes
			religion ?= scope:recipient.religion
			dynasty ?= scope:recipient.dynasty
		}

		scope:recipient = {
			is_playable_character = yes
			any_held_title = {
				is_landless_type_title = no
			}
		}
	}
	
	can_be_picked_title = {
		custom_tooltip = {
			NOT = { any_claimant = { this = scope:puppet_or_actor } }
			text = "ALREADY_HAVE_CLAIM_ON_THIS_TITLE"
		}
		is_landless_type_title = no
	}

	is_valid_showing_failures_only = {
		custom_description = {
			scope:recipient = {
				any_held_title = {
					title_tier >= county
					NOT = { any_claimant = { this = scope:puppet_or_actor } }
					is_landless_type_title = no
				} 
			}

			object = scope:recipient
			text = "already_have_claims_on_all_titles"
		}
		trigger_if = {
			limit = { scope:is_puppet_action ?= yes }
			scope:puppet_or_actor = {
				dynasty ?= {
					dynasty_prestige >= dynast_claim_title_interaction_cost_value
				}
			}
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0060
		}
	}
	
	on_accept = {
		if = {
			limit = { scope:is_puppet_action ?= yes }
			scope:puppet_or_actor = {
				if = {
					limit = { dynast_claim_title_interaction_cost_value > 0 }
					dynasty ?= { add_dynasty_prestige = { value = { add = dynast_claim_title_interaction_cost_value multiply = -1 } } }
				}
			}
		}
		dynast_claim_title_effect = yes
		scope:puppet_or_actor = {
			hidden_effect = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = dynast_claim_title_interaction_notification

					left_icon = scope:puppet_or_actor					
					right_icon = scope:recipient

					show_as_tooltip = {
						dynast_claim_title_effect = yes
					}
				}
			}
		}
		hidden_effect = {
			if = {
				limit = {
					scope:is_puppet_action ?= yes
				}
				scope:actor = {
					send_interface_toast = {
						type = event_toast_effect_neutral
						title = dynast_claim_title_interaction_notification

						left_icon = scope:puppet_or_actor
						right_icon = scope:recipient

						show_as_tooltip = {
							dynast_claim_title_effect = yes
						}
					}
				}
			}
		}

		# If we're a clan this interaction affects unity
		add_clan_unity_interaction_effect = {
			CHARACTER = scope:puppet_or_actor
			TARGET = scope:recipient
			VALUE = medium_unity_loss
			DESC = clan_unity_title_claim.desc
			REVERSE_NON_HOUSE_TARGET = no
		}
	}

	auto_accept = yes
}

dynast_end_dynasty_wars_interaction = {
	icon = icon_dynasty
	category = interaction_category_diplomacy
	desc = dynast_end_dynasty_wars_interaction_desc

	is_shown = {
		scope:puppet_or_actor != scope:recipient
		
		scope:puppet_or_actor ?= {
			is_dynast = yes
			religion ?= scope:recipient.religion
			dynasty ?= scope:recipient.dynasty
		}

		scope:recipient = {
			is_playable_character = yes
			any_character_war = {
				primary_defender != scope:puppet_or_actor
				primary_attacker ?= scope:recipient
				primary_defender.dynasty ?= scope:recipient.dynasty
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:puppet_or_actor.dynasty = {
			dynasty_prestige >= medium_dynasty_prestige_value
		}
		scope:puppet_or_actor = {
			NOT = {
				is_at_war_with = scope:recipient
			}
		}
	}

	on_auto_accept = {
		scope:recipient = {
			trigger_event = char_interaction.0070
		}
	}

	on_accept = {

		scope:puppet_or_actor = {
			hidden_effect = {
				send_interface_message = {
					type = event_dynasty_neutral
					title = dynast_end_dynasty_wars_interaction_notification
					right_icon = scope:recipient
					show_as_tooltip = {
						dynast_end_dynasty_wars_effect = yes
					}
				}
			}
		}
		dynast_end_dynasty_wars_effect = yes
	}

	auto_accept = yes
}

dynast_legitimize_bastard_interaction = {
	icon = icon_dynasty
	category = interaction_category_diplomacy
	desc = dynast_legitimize_bastard_interaction_desc

	is_shown = {
		scope:puppet_or_actor ?= {
			this = scope:recipient.dynasty.dynast
			religion ?= scope:recipient.religion
			house != scope:recipient.house
			rite ?= { rite_has_parameter = bastards_legitimize }
		}
		scope:recipient = {
			has_trait = bastard
			this != scope:puppet_or_actor
			rite ?= { rite_has_parameter = bastards_legitimize }
		}
	}

	is_valid = {
		scope:puppet_or_actor.dynasty = {
			dynasty_prestige >= medium_dynasty_prestige_value
		}
	}

	auto_accept = yes

	cost = {
		renown = {
			value = scope:puppet_or_actor.dynasty.medium_dynasty_prestige_value
			if = {
				limit = { scope:is_puppet_action ?= yes }
				multiply = 0
			}
		}
	}
	
	on_accept = {
		scope:puppet_or_actor = {
			stress_and_fulfillment_impact = {
				arrogant = minor_stress_impact_gain
			}
			send_interface_message = {
				type = event_dynasty_neutral
				title = dynast_legitimize_bastard_interaction_notification
				right_icon = scope:recipient
				show_as_tooltip = {
					scope:recipient = {
						add_trait_force_tooltip = legitimized_bastard
						add_opinion = {
							target = scope:puppet_or_actor
							modifier = legitimized_me_opinion
						}
					}
				}
			}
		}
		
		hidden_effect = {
			scope:recipient = {
				trigger_event = bastard_interaction.0009
				every_parent = {
					limit = {
						is_playable_character = yes
						this != scope:puppet_or_actor
					}
					hidden_effect = { #Nudge towards friendship
						if = {
							limit = {
								NOR = {
									has_relation_friend = scope:puppet_or_actor
									has_relation_potential_friend = scope:puppet_or_actor
								}
							}
							set_relation_potential_friend = scope:puppet_or_actor
						}
					}
					trigger_event = bastard_interaction.0010
				}
				every_sibling = {
					limit = {
						is_playable_character = yes
						this != scope:puppet_or_actor
					}
					trigger_event = bastard_interaction.0010
				}
			}

			scope:puppet_or_actor = {
				if = {
					limit = {
						has_character_modifier = oath_of_children
					}
					hidden_effect = {
						remove_character_modifier = oath_of_children
						add_character_modifier = oath_of_children
					}
				}
			}
		}
	}
}

#send_to_varangian_guard_interaction = {
#	category = interaction_category_friendly
#	interface_priority = 60
#	icon = send_to_varangian_guard_interaction
#
#	desc = send_to_varangian_guard_interaction_desc
#	use_diplomatic_range = no
#	common_interaction = yes
#	
#	is_available = {
#		trigger_if = {
#			limit = { is_ai = yes }
#			is_dynast = yes
#			dynasty ?= {
#				has_dynasty_perk = fp1_adventure_legacy_1
#			}
#
#			NOR = {
#				faith ?= {
#					has_doctrine_parameter = pacifist
#				}
#				this = title:e_byzantium.holder
#				is_at_war_with = title:e_byzantium.holder
#				has_truce = title:e_byzantium.holder
#			}
#
#			exists = title:e_byzantium.holder
#			is_at_war = no
#		}
#	}
#
#	is_shown = {
#		scope:recipient != scope:puppet_or_actor
#
#		scope:puppet_or_actor ?= {
#			is_dynast = yes
#			dynasty ?= scope:recipient.dynasty
#			
#			dynasty ?= {
#				has_dynasty_perk = fp1_adventure_legacy_1
#			}
#			
#			exists = title:e_byzantium.holder
#			NOR = {
#				faith ?= {
#					has_doctrine_parameter = pacifist
#				}
#				this = title:e_byzantium.holder
#				is_at_war_with = title:e_byzantium.holder
#				has_truce = title:e_byzantium.holder
#			}
#		}
#	}
#	
#	cooldown = { years = 2 }
#
#	is_valid_showing_failures_only = {
#		scope:puppet_or_actor = {
#			is_at_war = no
#			NOT = {
#				has_relation_rival = title:e_byzantium.holder
#			}
#		}
#		scope:recipient = {
#			is_ruler = no
#			is_adult = yes
#			is_married = no
#			NOR = {
#				has_trait = varangian
#				has_trait = order_member
#			}
#		}
#		trigger_if = {
#			limit = {
#				scope:recipient = {
#					is_adult = yes
#					NOT = {
#						can_be_knight_trigger = {
#							ARMY_OWNER = title:e_byzantium.holder
#						}
#					}
#				}
#			}
#			custom_description = {
#				scope:recipient = {
#					can_be_knight_trigger = {
#						ARMY_OWNER = title:e_byzantium.holder
#					}
#				}
#				text = "not_allowed_in_varangian_guard"
#			}
#		}
#		trigger_if = {
#			limit = {
#				scope:recipient = {
#					NOR = {
#						is_child_of = scope:puppet_or_actor
#						is_grandchild_of = scope:puppet_or_actor
#						is_great_grandchild_of = scope:puppet_or_actor
#					}
#				}
#			}
#			custom_description = {
#				scope:recipient.top_liege = scope:puppet_or_actor.top_liege
#				subject = scope:puppet_or_actor
#				text = "same_realm_as"
#			}
#		}
#	}
#	
#	on_accept = {
#		title:e_byzantium.holder = {
#			save_scope_as = emperor
#			if = {
#				limit = { capital_county = title:c_byzantion }
#				set_local_variable = {
#					name = to_miklagard
#					value = yes
#				}
#			}
#		}
#		
#		scope:puppet_or_actor = {
#			stress_and_fulfillment_impact = {
#				paranoid = minor_stress_impact_gain
#			}
#			hidden_effect = {
#				send_interface_toast = {
#					type = event_toast_effect_neutral
#					title = send_to_varangian_guard_interaction_toast
#
#					left_icon = scope:recipient					
#					right_icon = scope:emperor
#					
#					custom_tooltip = send_to_varangian_guard_interaction_toast_desc
#				}
#			}
#		}
#		hidden_effect = {
#			if = {
#				limit = {
#					scope:is_puppet_action ?= yes
#				}
#				scope:actor = {
#					send_interface_toast = {
#						type = event_toast_effect_neutral
#						title = send_to_varangian_guard_interaction_toast
#
#						left_icon = scope:recipient
#						right_icon = scope:emperor
#
#						custom_tooltip = send_to_varangian_guard_interaction_toast_desc
#					}
#				}
#			}
#		}
#
#		scope:recipient = {
#			save_scope_as = varangian_candidate
#			
#		}
#		
#		show_as_tooltip = {
#			scope:varangian_candidate = {
#				visit_court_of = scope:emperor
#				add_trait = varangian
#				custom_description_no_bullet = {
#					text = send_to_varangian_guard_interaction_effect
#				}
#			}
#		}
#		hidden_effect = {
#			scope:emperor = {
#				trigger_event = varangian.0003
#			}
#		}
#		
#		# If we're a clan this interaction affects unity
#		add_clan_unity_interaction_effect = {
#			CHARACTER = scope:puppet_or_actor
#			TARGET = scope:recipient
#			VALUE = miniscule_unity_loss
#			DESC = clan_unity_vaering.desc
#			REVERSE_NON_HOUSE_TARGET = no
#		}		
#	}
#	
#	cost = {
#		prestige = {
#			value = 350
#			if = {
#				limit = { scope:is_puppet_action ?= yes }
#				multiply = 0
#			}
#		}
#	}
#	
#	auto_accept = yes
#
#	ai_targets = {
#		ai_recipients = children
#		max = 10
#	}
#	
#	ai_frequency_by_tier = {
#		barony = 0
#		county = 120
#		duchy = 60
#		kingdom = 24
#		empire = 24
#		hegemony = 24
#	}
#	
#	ai_will_do = {
#		base = 100
#	}
#}

