﻿# Interaction used to convert people when you reform or create a faith
orthodox_poland_rerechristianisation = {
	category = interaction_category_religion
	special_interaction = request_conversion_interaction
	popup_on_receive = yes
	icon = religious_claim
	desc = orthodox_poland_rerechristianisation_desc
	is_highlighted = { always = yes }
	is_shown = {
		scope:recipient = {
			OR = { 
				culture = { has_cultural_pillar = heritage_west_slavic }
				culture = { has_cultural_pillar = heritage_south_slavic }
				culture = { has_cultural_pillar = heritage_east_slavic }
			}
			OR = { 
				has_faith = faith:catholic
				has_faith = faith:bosnian_church
			}
			is_independent_ruler = yes
			is_landed = yes
		}
		scope:actor = { 
			has_faith = faith:orthodox 
			OR = { 
				has_title = title:k_poland 
				has_title = title:e_wendish_empire
				has_title = title:e_sclavinia
			}
		}
		has_global_variable = orthodox_poland_sclavinia
	}
	is_valid = {
		scope:actor = {
			piety >= 250
			prestige >= 250
		}
		OR = {
			AND = { 
				scope:actor = { prestige_level >= 3 }
				scope:recipient = { opinion = { target = scope:actor value >= 75 } }
			}
			AND = { 
				scope:actor = { prestige_level >= 4 }
				scope:recipient = { opinion = { target = scope:actor value >= 50 } }
			}
			AND = {
				scope:actor = { piety_level >= 3 }
				scope:actor.faith.religious_head = {
					opinion = {
						target = scope:actor
						value >= 75
					}
				}
				scope:recipient = { opinion = { target = scope:actor value >= 50 } }
			}
		}
	}
	ai_accept = {
		base = 0
		religion_demand_conversion_default_modifier = yes
		modifier = {
			add = 25
			desc = orthodox_baptism_interaction_sclavinia_bonus
		}
	}
	
	ai_min_reply_days = 5
	ai_max_reply_days = 10
	can_send_despite_rejection = no
	
	on_accept = {
		scope:actor = { 
			add_piety = -250
			add_prestige = -250
			add_legitimacy = 5
		}
		scope:recipient = {
			add_piety = 100
			add_prestige = 100
			custom_tooltip = conversion_full_sclavinia
			show_as_tooltip = { set_character_faith = faith:orthodox }
			hidden_effect = {
				every_vassal_or_below = {
					limit = { NOT = { has_trait = zealous }  }
					set_character_faith = faith:orthodox
					capital_county = { 
						set_county_faith = faith:orthodox
					}
					every_close_family_member = { 
						set_character_faith = faith:orthodox
					}
					every_courtier = { 
						set_character_faith = faith:orthodox
					}
				}
				set_character_faith = faith:orthodox
				capital_county = { 
					set_county_faith = faith:orthodox
				}
				every_close_family_member = { 
					set_character_faith = faith:orthodox
				}
				every_courtier = { 
					set_character_faith = faith:orthodox
				}
				trigger_event = faith_conversion.1001
			}
		}
		scope:actor = {
			trigger_event = religious_interaction.2002
			custom_tooltip = negotiate_alliance_effect_tooltip
			create_alliance = scope:recipient
		}
	}
	on_send = {
	}
	send_options_exclusive = yes
	ai_will_do = {
		base = 100
	}
	
	ai_frequency = 1
	ai_targets = { 
		ai_recipients = neighboring_rulers
	}

}
orthodox_baptism_interaction_sclavinia = {
	category = interaction_category_religion
	special_interaction = request_conversion_interaction
	popup_on_receive = yes
	icon = religious
	desc = orthodox_baptism_interaction_sclavinia_desc
	is_highlighted = { always = yes }
	is_shown = {
		scope:recipient = {
			OR = { 
				culture = { has_cultural_pillar = heritage_baltic }
				culture = { has_cultural_pillar = heritage_west_slavic }
				culture = { has_cultural_pillar = heritage_south_slavic }
				culture = { has_cultural_pillar = heritage_east_slavic }
			}
			faith = { has_doctrine_parameter = unreformed } 
			is_independent_ruler = yes           
			is_landed = yes
		}
		scope:actor = { 
			has_faith = faith:orthodox 
			OR = { 
				has_title = title:k_poland 
				has_title = title:e_wendish_empire
				has_title = title:e_sclavinia
			}
		}
		OR = { 
			has_global_variable = empire_unlock_sclavinia
			has_global_variable = orthodox_unlock_sclavinia
		}
	}
	is_valid = { 
		scope:actor = {
			piety >= 250
		}
		OR = { 
			scope:actor = { piety_level >= 3 }
			AND = { 
				scope:actor = { piety_level >= 2 }
				scope:actor = { 
					num_virtuous_traits >= 1
				}
			}
			AND = { 
				scope:actor = { piety_level >= 2 }
				scope:recipient = { 
					custom_tooltip = { 
						text = orthodox_baptism_interaction_sclavinia_trigger_tooltip_catholics
						any_neighboring_and_across_water_top_liege_realm_owner = {
							has_faith = faith:catholic
						}
					}
				}
			}
		}
		scope:recipient = { 
			opinion = { target = scope:actor value >= 25 }
			custom_tooltip = { 
				text = orthodox_baptism_interaction_sclavinia_trigger_tooltip
				any_neighboring_and_across_water_top_liege_realm_owner = {
					has_faith = faith:orthodox
				}
			}
		}
	}
	ai_accept = {
		base = 0
		modifier = {
			add = 25
			desc = orthodox_baptism_interaction_sclavinia_bonus
		}
		religion_demand_conversion_default_modifier = yes
		modifier = { 
			scope:recipient.culture = {
				has_cultural_tradition = tradition_zealous_people
			}
			add = 50
			desc = orthodox_baptism_interaction_sclavinia_strong_believers
		}
	}
	
	ai_min_reply_days = 5
	ai_max_reply_days = 10
	can_send_despite_rejection = no
	
	on_accept = {
		scope:actor = { 
			add_piety = -250
		}
		scope:recipient = {
			add_piety = 100
			add_prestige = 100
			custom_tooltip = conversion_full_sclavinia
			show_as_tooltip = { set_character_faith = faith:orthodox }
			hidden_effect = {
				every_vassal_or_below = {
					limit = { NOT = { has_trait = zealous }  }
					set_character_faith = faith:orthodox
					capital_county = { 
						set_county_faith = faith:orthodox
					}
					every_close_family_member = { 
						set_character_faith = faith:orthodox
					}
					every_courtier = { 
						set_character_faith = faith:orthodox
					}
				}
				set_character_faith = faith:orthodox
				capital_county = { 
					set_county_faith = faith:orthodox
				}
				every_close_family_member = { 
					set_character_faith = faith:orthodox
				}
				every_courtier = { 
					set_character_faith = faith:orthodox
				}
				trigger_event = faith_conversion.1001
			}
		}
		scope:actor = {
			trigger_event = religious_interaction.2002
		}
		if = { 
			limit = { 
				scope:recipient = { has_culture = culture:prussian }
				NOT = { has_global_variable = prussians_baptised }
			}
			scope:actor = { 
				trigger_event = {
					id = sclavinia.0009
					days = 1
				}
			}
		}
		#if = { 
		#	limit = { 
		#		scope:recipient = { completely_controls = title:c_kiev }
		#	}
		#	scope:actor = { 
		#		trigger_event = {
		#			id = sclavinia.9999
		#			days = 1
		#		}
		#	}
		#}
	}
	on_send = {
	}
	send_options_exclusive = yes
	ai_will_do = {
		base = 100
	}
	
	ai_frequency = 1
	ai_targets = { 
		ai_recipients = neighboring_rulers
	}

}
orthodox_vassalizing_eastern_slavs = {
	category = interaction_category_vassal
	interface_priority = 999
	special_interaction = request_conversion_interaction
	popup_on_receive = yes
	icon = religious_claim
	desc = orthodox_vassalizing_eastern_slavs_desc
	is_highlighted = { always = yes }
	is_shown = {
		scope:recipient = {
			OR = {
				culture = { has_cultural_pillar = heritage_west_slavic }
				culture = { has_cultural_pillar = heritage_east_slavic }
				culture = { has_cultural_pillar = heritage_south_slavic }
			}
			has_faith = faith:orthodox
			is_independent_ruler = yes
			is_landed = yes
			NOT = { scope:actor = this }
		}
		scope:actor = { 
			has_faith = faith:orthodox 
			OR = { 
				has_title = title:k_poland 
				has_title = title:e_wendish_empire
				has_title = title:e_sclavinia
			}
		}
		has_global_variable = orthodox_unlock_sclavinia
	}
	is_valid = {
		scope:recipient = { is_at_war = no }
		scope:recipient = {
			opinion = { target = scope:actor value >= 100 } 
		}
		OR = { 
			AND = { 
				custom_tooltip = { 
					text = tier_differnce_sclavinia_emperor
					scope:actor = { 
						tier_difference = {
							target = scope:recipient
							value >= 0
						}
					}
				}
				scope:actor = { prestige >= 500 }
			}
			AND = {
				custom_tooltip = { 
					text = tier_differnce_sclavinia_king
					scope:actor = { 
						tier_difference = {
							target = scope:recipient
							value < 0
						}
					}
				}
				scope:actor = { prestige >= 1000 }
			}
		}
		OR = { 
			scope:actor = { prestige_level >= 4 }
			AND = { 
				scope:actor = { 
					piety_level >= 3
					prestige_level >= 3 
				}
				scope:actor = { 
					num_virtuous_traits >= 1
				}
			}
		}
		OR = { 
			AND = {
				scope:actor = { piety_level >= 4 }
				scope:actor.faith.religious_head = {
					opinion = {
						target = scope:actor
						value >= 50
					}
				}
			}
			AND = {
				scope:actor = { piety_level >= 3 }
				scope:actor.faith.religious_head = {
					opinion = {
						target = scope:actor
						value >= 75
					}
				}
			}
		}
	}
	
	ai_accept = {
		base = 0
		# MAIN
		# Heretic/Infidel modifier.
		# Tier difference modifier.
		# Dejure modifier.
		# Distant/Remote Realm modifier.
		# Military power difference modifier.

		# MINOR
		# Rivalry modifier.
		# Same Dynasty modifier.
		# Cultural/Cultural Group modifiers.
		# Ageism modifier vs kids.
		# Ruler Legitimacy modifier.
		# Claimant modifier.
		# FP3 Piety Level modifier.

		# OPINION SCALES
		# Dread
		# Compare Opinion modifier.
		
		# PERKS
		modifier = { # Perk boost
			desc = offer_vassalization_true_ruler_perk_tt
			trigger = {
				scope:actor = { has_perk = true_ruler_perk }
			}
			add = true_ruler_value
		}
		modifier = { # Education 5 boost
			desc = offer_vassalization_education_diplomacy_5_tt
			trigger = {
				scope:actor = { has_trait_with_flag = offer_vassalisation_25 }
			}
			add = 25
		}

		# EVENTS - temporary bonuses gained by events
		modifier = {
			desc = event_bonus_to_vassal_accept_tt
			trigger = {
				scope:actor = { has_character_modifier = event_bonus_to_vassal_accept }
			}
			add = 20
		}


		# STRUGGLES - bonus gained by successful Sway scheme during the Persian Struggle
		modifier = {
			desc = fp3_persian_struggle_previously_swayed_tt
			trigger = {
				scope:recipient = {
					has_opinion_modifier = {
						modifier = scheme_sway_and_compelled_to_submit_opinion
						target = scope:actor
					}
				}
			}
			add = 20
		}

		modifier = {
			desc = fp3_rekindler_of_iran_modifier_reason
			trigger = {
				AND = { 
					scope:actor = { dynasty ?={ has_dynasty_modifier = fp3_rekindler_of_iran_modifier } }
					scope:recipient = { culture = { has_cultural_pillar = heritage_iranian } }
				}
			}
			add = 20
		}
		
		# OBEDIENCE
		modifier = {
			desc = obedient_interaction_reason
			trigger = {
				is_obedient_to = scope:actor
			}
			add = 20
		}

		modifier = { # Cultural Acceptance
			add = offer_vassalage_acceptance_value
			desc = cultural_acceptance_interaction_reason
			trigger = {
				scope:actor = {
					NOR = {
						has_same_culture_as = scope:recipient
						government_has_flag = government_is_nomadic # Nomads do not care about Culture
						has_trait = nomadic_philosophy
					}
					culture = {
						cultural_acceptance = { target = scope:recipient.culture value <= 90 }
					}
				}
			}
		}

		# MAIN
		modifier = { #Different faith, no pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic.
						faith = scope:actor.faith
						faith = { has_doctrine = doctrine_pluralism_pluralistic }
					}
				}
			}
			add = {
				value = -40
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -40
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -40
				}
			}
		}

		modifier = { #Different faith, pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOT = {
						faith = scope:actor.faith
					}
					NOT = {
						scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic }
					}
					faith = { has_doctrine = doctrine_pluralism_pluralistic }
				}
			}
			add = {
				value = -20
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -20
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -20
				}
			}
		}

		modifier = { #Different faith, both have pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOT = {
						faith = scope:actor.faith
					}
					scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic }
					faith = { has_doctrine = doctrine_pluralism_pluralistic }
				}
			}
			add = {
				value = -10
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -10
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -10
				}
			}
		}
		modifier = { #We just fought against each other.
			desc = offer_vassalization_interaction_aibehavior_recent_war_tt
			trigger = {
				scope:recipient = {
					any_truce_holder = {
						this = scope:actor
					}
				}
				# Ensure the truce wasn't purchased and is indeed from a war
				scope:actor = {
					NOT = {
						has_purchased_truce_with_char = { TARGET = scope:recipient }
					}
				}
				scope:recipient = {
					NOT = {
						has_purchased_truce_with_char = { TARGET = scope:actor }
					}
				}
			}
			add = -50
		}
		modifier = { #I fought an independence war against you.
			desc = offer_vassalization_interaction_aibehavior_independence_war_tt
			trigger = {
				scope:recipient = {
					exists = var:independence_war_former_liege
					var:independence_war_former_liege = scope:actor
				}
			}
			add = -200
		}
		modifier = { # I am Tribal and you are not
			desc = interaction_tribal_vs_nontribal
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_tribal
				}
				scope:actor = {
					NOT = { government_has_flag = government_is_tribal }
				}
			}
			add = -20
		}
		modifier = { # You are Tribal and I am not
			desc = interaction_nontribal_vs_tribal
			trigger = {
				scope:actor = {
					government_has_flag = government_is_tribal
				}
				scope:recipient = {
					NOT = { government_has_flag = government_is_tribal }
				}
			}
			add = -20
		}
		modifier = { # I am Nomadic and you are Nomadic
			desc = interaction_is_nomadic
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_nomadic
				}
				scope:actor = {
					government_has_flag = government_is_nomadic
				}
			}
			add = -50
		}
		modifier = { # I am Nomadic and you are not
			desc = interaction_nomadic_vs_nonnomadic
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_nomadic
				}
				scope:actor = {
					NOT = { government_has_flag = government_is_nomadic }
				}
			}
			add = -75
		}
		modifier = { # You are Nomadic and I am not
			desc = interaction_nonnomadic_vs_nomadic
			trigger = {
				scope:actor = {
					government_has_flag = government_is_nomadic
				}
				scope:recipient = {
					NOT = { government_has_flag = government_is_nomadic }
				}
			}
			add = -75
		}
		modifier = { # Isolationist tradition
			desc = isolationist_reason
			trigger = {
				NOT = {
					scope:actor.culture = scope:recipient.culture
				}
				scope:recipient.culture = {
					has_cultural_tradition = tradition_isolationist
				}
			}
			add = -20
		}
		modifier = { #Bankrupt
			desc = bankrupt_reason
			trigger = {
				scope:actor.gold <= -1
			}
			add = -100
		}
		modifier = { #Wide difference in rank
			desc = offer_vassalization_interaction_aibehavior_widetitletier_tt
			trigger = {
				scope:actor = {
					tier_difference = {
						target = scope:recipient
						value > 1
					}
				}
			}
			add = 10
		}
		modifier = { # Allied
			desc = offer_vassalization_interaction_aibehavior_allied_tt
			trigger = {
				scope:recipient = {
					is_allied_to = scope:actor
				}
			}
			add = 20
		}
		modifier = { # Is the Rightful Liege of recipient
			desc = offer_vassalization_interaction_aibehavior_rightfulliegetitleholder_tt
			trigger = {
				scope:actor = { is_rightful_liege_of = scope:recipient }
			}
			add = 20
		}
		modifier = { #Is not the Rightful Liege of recipient
			desc = offer_vassalization_interaction_aibehavior_not_rightfulliegetitleholder_tt
			trigger = {
				NOT = {
					scope:actor = { is_rightful_liege_of = scope:recipient }
				}
			}
			add = -20
		}
		modifier = { # Encircled
			desc = offer_vassalization_interaction_aibehavior_encircled_tt
			trigger = {
				scope:recipient = {
					NOT = {
						any_neighboring_top_liege_realm_owner = {
							NOT = {
								this = scope:actor
							}
						}
					}
					NOT = {
						any_realm_county = {
							is_coastal_county = yes
						}
					}
				}
			}
			add = 20
		}
		modifier = { #Distant Realm — Overseas Connection
			desc = offer_vassalization_interaction_aibehavior_distantrealm_tt
			trigger = {
				scope:actor = {
					character_is_realm_neighbor = scope:recipient
					NOT = { #Ibiza should want to be a vassal of Mallorca, etc.
						character_is_land_realm_neighbor = scope:recipient
						scope:actor = { is_rightful_liege_of = scope:recipient }
					}
				}
			}
			add = -100
		}
		modifier = { #Distant Realm — No Connection
			desc = offer_vassalization_interaction_aibehavior_distantrealm_tt
			trigger = {
				scope:actor = {
					NOT = {
						character_is_realm_neighbor = scope:recipient
					}
				}
				scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value < 200000 } }
			}
			add = -250
		}
		modifier = { #Remote Realm.
			desc = offer_vassalization_interaction_aibehavior_remoterealm_tt
			trigger = {
				scope:actor = {
					NOT = {
						character_is_realm_neighbor = scope:recipient
					}
				}
				scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value >= 200000 } }
			}
			add = -500
		}
		modifier = {
			desc = offer_vassalization_interaction_aibehavior_power_tt
	  	  	add = {
				value = 1
				subtract = {
					value = scope:recipient.max_military_strength # Intended for recipient to use max, to avoid having vassalizations become too easy for weakened realms
					divide = { value = scope:actor.current_military_strength min = 1 }
				}
				multiply = 20
				ceiling = yes
	  		}
		}
		modifier = {
			desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt
			trigger = {
				scope:actor = {
				number_of_powerful_vassals >= 1
				}
			}

	  	  	add = {
				value = 0
				scope:actor = {
					every_powerful_vassal = {
						if = {
							limit = {
								save_temporary_opinion_value_as = {
									name = vassal_opinion
									target = scope:actor
								}
							}
							add = scope:vassal_opinion
						}
					}

					if = {
						limit = {
							number_of_powerful_vassals > 0
						}
						divide = number_of_powerful_vassals
					}
					else = {
						divide = 5
					}
				}

				divide = 5
	  		}
		}

		# MINOR
		modifier = { #Friend modifier.
			desc = offer_vassalization_interaction_aibehavior_friend_tt
			trigger = {
				scope:recipient = {
					has_relation_friend = scope:actor
					NOT = { has_relation_best_friend = scope:actor }
				}
			}
			add = 10
		}
		modifier = { #Best Friend modifier.
			desc = offer_vassalization_interaction_aibehavior_best_friend_tt
			trigger = {
				scope:recipient = {
					has_relation_best_friend = scope:actor
				}
			}
			add = 20
		}
		modifier = { #Lover modifier.
			desc = interaction_lover
			trigger = {
				scope:recipient = {
					has_relation_lover = scope:actor
					NOT = { has_relation_soulmate = scope:actor }
				}
			}
			add = 10
		}
		modifier = { #Soulmate modifier.
			desc = interaction_soulmate
			trigger = {
				scope:recipient = {
					has_relation_soulmate = scope:actor
				}
			}
			add = 20
		}
		modifier = { #Rivalry modifier.
			desc = offer_vassalization_interaction_aibehavior_rival_tt
			trigger = {
				scope:recipient = {
					has_relation_rival = scope:actor
					NOT = { has_relation_nemesis = scope:actor }
				}
			}
			add = -100
		}
		modifier = { #Nemesis modifier.
			desc = offer_vassalization_interaction_aibehavior_nemesis_tt
			trigger = {
				scope:recipient = {
					has_relation_nemesis = scope:actor
				}
			}
			add = -1000
		}
		modifier = { #Same Dynasty modifier.
			desc = offer_vassalization_interaction_aibehavior_dynasty_tt
			trigger = {
				scope:recipient = {
					dynasty = scope:actor.dynasty
				}
			}
			add = 5
		}

		modifier = { # Same language
			add = 5
			desc = speaks_same_language_interaction_reason
			trigger = {
				scope:actor = {
					knows_language_of_culture = scope:recipient.culture
				}
			}
		}

		modifier = { # Iberian Struggle, less likely for outsiders to vassalize inside
			add = -35
			desc = iberian_struggle_reason_reason
			trigger = {
				scope:actor = {
					NOT = {
						any_character_struggle = { is_struggle_type = iberian_struggle }
					}
				}
				scope:recipient = {
					any_character_struggle = { is_struggle_type = iberian_struggle }
				}
			}
		}

		modifier = { #Ageism modifier vs kids.
			desc = offer_vassalization_interaction_aibehavior_child_tt
			trigger = {
				scope:actor = {
					age < 12
				}
				scope:recipient = {
					age > 16
				}
			}
			add = -5
		}
		modifier = { #Illegitimacy modifier.
			desc = offer_vassalization_interaction_aibehavior_illegitimate_tt
			trigger = {
				scope:actor = {
					OR = {
						AND = {
							has_trait = bastard
							scope:recipient = {
								faith = { NOT = { has_doctrine = doctrine_bastardry_none } }
							}
						}
						has_trait = denounced
						has_trait = disinherited
					}
				}
			}
			add = -10
		}

		modifier = { #Claimant modifier.
			desc = offer_vassalization_interaction_aibehavior_claimant_tt
			trigger = {
				scope:actor.primary_title = {
					scope:recipient = {
						has_claim_on = prev
					}
				}
			}
			add = -20
		}

		modifier = { # Ambitious
			desc = TAKE_THE_VOWS_AMBITIOUS
			trigger = {
				scope:recipient = {
					has_trait = ambitious
				}
			}
			add = -20
		}

		modifier = { # Paranoid
			desc = INTERACTION_PARANOID
			trigger = {
				scope:recipient = {
					has_trait = paranoid
				}
			}
			add = -20
		}

		modifier = { # Arrogant
			desc = INTERACTION_ARROGANT
			trigger = {
				scope:recipient = {
					has_trait = arrogant
				}
			}
			add = -20
		}

		modifier = { # Fickle
			desc = INTERACTION_FICKLE
			trigger = {
				scope:recipient = {
					has_trait = fickle
				}
			}
			add = -10
		}

		modifier = { # Stubborn
			desc = INTERACTION_STUBBORN
			trigger = {
				scope:recipient = {
					has_trait = stubborn
				}
			}
			add = -10
		}

		modifier = { # Trusting
			desc = TAKE_THE_VOWS_TRUSTING
			trigger = {
				scope:recipient = {
					has_trait = trusting
				}
			}
			add = 5
		}

		modifier = { # Content
			desc = INTERACTION_CONTENT
			trigger = {
				scope:recipient = {
					has_trait = content
				}
			}
			add = 5
		}

		modifier = { # FP3 modifier.
			desc = GENERIC_YOUR_PIETY_LEVEL_MODIFIER
			trigger = { scope:actor = { any_character_struggle = { has_struggle_phase_parameter = piety_level_affects_vassalage_acceptance } } }
			add = {
				value = {
					value = scope:actor.piety_level
					subtract = low_piety_level
				}
				multiply = 10
			}
		}

		# OPINION INFLUENCE
		modifier = {
			add = intimidated_external_reason_value
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 1
				}
			}
			desc = INTIMIDATED_REASON
		}
		modifier = {
			add = cowed_external_reason_value
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 2
				}
			}
			desc = COWED_REASON
		}
		opinion_modifier = { #Compare Opinion modifier - Clans care more about opinion
			trigger = {
				scope:actor = {
					government_has_flag = government_is_clan
				}
				scope:recipient = {
					government_has_flag = government_is_clan
				}
			}
			who = scope:recipient
			opinion_target = scope:actor
			multiplier = 0.7
		}
		opinion_modifier = { #Compare Opinion modifier.
			trigger = {
				OR = {
					scope:actor = {
						NOT = { government_has_flag = government_is_clan }
					}
					scope:recipient = {
						NOT = { government_has_flag = government_is_clan }
					}
				}
			}
			who = scope:recipient
			opinion_target = scope:actor
			multiplier = 0.35
		}

		# DIPLOMATIC COURT GRANDEUR BONUS
		modifier = {
			trigger = {
				scope:actor = {
					has_royal_court = yes
					has_dlc_feature = royal_court
					has_court_type = court_diplomatic
					court_grandeur_current_level >= 1
				}
			}
			add = {
				value = scope:actor.court_grandeur_current
				if = {
					limit = { # Reduce the bonus if you are below your expected level
						scope:actor = {
							court_grandeur_current_level < court_grandeur_minimum_expected_level
						}
					}
					multiply = 0.15
				}
				else = {
					multiply = 0.3
				}
			}
			desc = DIPLOMATIC_COURT_ACCEPTANCE_INCREASE_REASON
		}

		# CONTRACT OPTIONS
		modifier = {
			add = 60
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:religious_exemption = yes
			desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON
		}
		modifier = {
			add = 30
			scope:recipient = {	government_has_flag = government_is_clan }
			scope:religious_exemption_clan = yes
			desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON
		}
		modifier = {
			add = 30
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:low_obligations = yes
			desc = CONTRACT_LOW_TAXES_REASON
		}
		modifier = {
			add = -40
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:high_obligations = yes
			desc = CONTRACT_HIGH_TAXES_REASON
		}

		# INSPECTION BONUSES
		modifier = {
			desc = "INSPECTION_REASON"
			add = 5
			scope:recipient = {
				has_variable_list = lesser_inspection_bonus
				is_target_in_variable_list = {
					name = lesser_inspection_bonus
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON"
			add = 10
			scope:recipient = {
				has_variable_list = inspection_bonus
				is_target_in_variable_list = {
					name = inspection_bonus
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON_REWARD"
			add = 10
			scope:recipient = {
				has_variable_list = inspection_reward
				is_target_in_variable_list = {
					name = inspection_reward
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON_REWARD_FOCUSED"
			add = 10
			scope:actor = { has_character_modifier = inspection_reward_focused_vassal_acceptance }
		}

		# LOW LEGITIMACY
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -25
			scope:actor = {
				has_legitimacy_flag = reduced_vassalization_acceptance
			}
		}
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -50
			scope:actor = {
				has_legitimacy_flag = very_reduced_vassalization_acceptance
			}
		}
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -75
			scope:actor = {
				has_legitimacy_flag = massively_reduced_vassalization_acceptance
			}
		}

		# HIGH LEGITIMACY
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 25
			scope:actor = {
				has_legitimacy_flag = increased_vassalization_acceptance
			}
		}
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 50
			scope:actor = {
				has_legitimacy_flag = very_increased_vassalization_acceptance
			}
		}
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 75
			scope:actor = {
				has_legitimacy_flag = extra_increased_vassalization_acceptance
			}
		}

		# INFLUENCE
		modifier = {
			add = 25
			scope:influence_send_option = yes
			desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION
		}

		#HISTORICALLY ADMIN PEOPLES WANT TO BE ADMIN
		modifier = {
			add = 30
			scope:actor = {
				government_has_flag = government_is_administrative
			}
			scope:recipient = {
				culture = {
					OR = {
						this = culture:greek
						any_parent_culture_or_above = {
							this = culture:greek
						}
						this = culture:han
						any_parent_culture_or_above = {
							this = culture:han
						}
					}
				}
			}
			
			desc = "HISTORICAL_ADMIN_REASON"
		}

		modifier = { # AI-only weights, keep the pope from vassalizing too fast
			trigger = {
				exists = faith:catholic.religious_head
				faith:catholic.religious_head = scope:actor
				scope:actor = { is_ai = yes }
			}
			add = -50
		}

		modifier = {
			trigger = {
				scope:actor = {
					has_variable = severed_head_vassalization
					var:severed_head_vassalization = {
						this = scope:recipient
					}
				}
			}
			add = 200
			desc = COWED_BY_SEVERED_HEAD_MODIFIER
		}

		#ALL these modifiers are also used in impress_intent_vassalization_acceptance_value, keep them synced
	}
	
	ai_min_reply_days = 5
	ai_max_reply_days = 10
	can_send_despite_rejection = no
	
	on_accept = { 
		if = {
			limit = {
				scope:actor = { 
					tier_difference = {
						target = scope:recipient
						value >= 0
					}
				}
			}	
			scope:actor = { add_prestige = -500	}
		}
		else = { 
			scope:actor = { add_prestige = -1000 }
		}
		hidden_effect = {
			if = { 
				limit = { 
					scope:recipient = { highest_held_title_tier >= tier_kingdom }
					scope:actor = { highest_held_title_tier = tier_empire }
				}
				scope:recipient = {
					create_title_and_vassal_change = {
						type = granted
						save_scope_as = change
					}
					every_vassal = {
						limit = { highest_held_title_tier = tier_kingdom }
						change_liege = { 
							liege = scope:actor
							change = scope:change
						}
					}
					resolve_title_and_vassal_change = scope:change
				}
			}
			else = { 
				scope:recipient = {
					create_title_and_vassal_change = {
						type = granted
						save_scope_as = change
					}
					every_vassal = {
						change_liege = { 
							liege = scope:actor
							change = scope:change
						}
					}
					resolve_title_and_vassal_change = scope:change
				}
			}
		}
		hidden_effect = { 
			scope:recipient = {
				every_held_title = { 
					limit = { tier >= scope:actor.highest_held_title_tier }
					scope:recipient = { destroy_title = prev }
				}
			}
		}
		scope:recipient = {
			custom_tooltip = orthodox_vassalizing_eastern_slavs_orthodox_destroy_kingdom
		}
		scope:recipient = {
			create_title_and_vassal_change = {
				type = swear_fealty
				save_scope_as = change
			}
			change_liege = { 
				liege = scope:actor 
				change = scope:change
			}
			add_opinion = {
				modifier = became_vassal
				target = scope:actor
				opinion = 10
			}
			resolve_title_and_vassal_change = scope:change
		}
		scope:actor = {
			trigger_event = char_interaction.0001
		}
	}
	on_send = {
	}
	send_options_exclusive = yes
	ai_will_do = {
		base = 100
	}
	
	ai_frequency = 1
	ai_targets = { 
		ai_recipients = neighboring_rulers
	}

}
orthodox_vassalizing_eastern_slavs_empire = {
	category = interaction_category_vassal
	interface_priority = 999
	special_interaction = request_conversion_interaction
	popup_on_receive = yes
	icon = negotiate_settlement_interaction
	desc = orthodox_vassalizing_eastern_slavs_empire_desc
	is_highlighted = { always = yes }
	is_shown = {
		scope:recipient = {
			OR = {
				culture = { has_cultural_pillar = heritage_baltic }
				culture = { has_cultural_pillar = heritage_west_slavic }
				culture = { has_cultural_pillar = heritage_east_slavic }
			}
			has_faith = faith:orthodox
			is_independent_ruler = yes              
			is_landed = yes
			NOT = { scope:actor = this }
		}
		scope:actor = { 
			has_faith = faith:orthodox 
			OR = { 
				has_title = title:k_poland 
				has_title = title:e_wendish_empire
				has_title = title:e_sclavinia
			}
		}
		has_global_variable = empire_unlock_sclavinia
	}
	is_valid = {
		scope:recipient = { is_at_war = no }
		scope:recipient = {
			custom_tooltip = { 
				text = orthodox_vassalizing_eastern_slavs_tooltip
				highest_held_title_tier < scope:actor.highest_held_title_tier
			}
			opinion = { target = scope:actor value >= 100 } 
		}
		scope:actor = { 
			prestige >= 500
		}
		OR = { 
			scope:actor = { prestige_level >= 4 }
			AND = { 
				scope:actor = { 
					piety_level >= 3
					prestige_level >= 3
				}
				scope:actor = { 
					num_virtuous_traits >= 1
				}
			}
		}
		OR = { 
			AND = {
				scope:actor = { piety_level >= 4 }
				scope:actor.faith.religious_head = {
					opinion = {
						target = scope:actor
						value >= 50
					}
				}
			}
			AND = {
				scope:actor = { piety_level >= 3 }
				scope:actor.faith.religious_head = {
					opinion = {
						target = scope:actor
						value >= 75
					}
				}
			}
			AND = {			
				custom_tooltip = { 
					text = unite_the_western_slavs_decision_orthodox_vassalizing_eastern_slavs_empire
					has_global_variable = unite_the_western_slavs_decision
				}
				scope:actor = { piety_level >= 3 }	
				scope:actor.cp:councillor_court_chaplain = {
					opinion = {
						target = scope:actor
						value >= 50
					}
				} 
			}
		}
	}
	ai_accept = {
		base = 0
		# MAIN
		# Heretic/Infidel modifier.
		# Tier difference modifier.
		# Dejure modifier.
		# Distant/Remote Realm modifier.
		# Military power difference modifier.

		# MINOR
		# Rivalry modifier.
		# Same Dynasty modifier.
		# Cultural/Cultural Group modifiers.
		# Ageism modifier vs kids.
		# Ruler Legitimacy modifier.
		# Claimant modifier.
		# FP3 Piety Level modifier.

		# OPINION SCALES
		# Dread
		# Compare Opinion modifier.
		
		# PERKS
		modifier = { # Perk boost
			desc = offer_vassalization_true_ruler_perk_tt
			trigger = {
				scope:actor = { has_perk = true_ruler_perk }
			}
			add = true_ruler_value
		}
		modifier = { # Education 5 boost
			desc = offer_vassalization_education_diplomacy_5_tt
			trigger = {
				scope:actor = { has_trait_with_flag = offer_vassalisation_25 }
			}
			add = 25
		}

		# EVENTS - temporary bonuses gained by events
		modifier = {
			desc = event_bonus_to_vassal_accept_tt
			trigger = {
				scope:actor = { has_character_modifier = event_bonus_to_vassal_accept }
			}
			add = 20
		}


		# STRUGGLES - bonus gained by successful Sway scheme during the Persian Struggle
		modifier = {
			desc = fp3_persian_struggle_previously_swayed_tt
			trigger = {
				scope:recipient = {
					has_opinion_modifier = {
						modifier = scheme_sway_and_compelled_to_submit_opinion
						target = scope:actor
					}
				}
			}
			add = 20
		}

		modifier = {
			desc = fp3_rekindler_of_iran_modifier_reason
			trigger = {
				AND = { 
					scope:actor = { dynasty ?={ has_dynasty_modifier = fp3_rekindler_of_iran_modifier } }
					scope:recipient = { culture = { has_cultural_pillar = heritage_iranian } }
				}
			}
			add = 20
		}
		
		# OBEDIENCE
		modifier = {
			desc = obedient_interaction_reason
			trigger = {
				is_obedient_to = scope:actor
			}
			add = 20
		}

		modifier = { # Cultural Acceptance
			add = offer_vassalage_acceptance_value
			desc = cultural_acceptance_interaction_reason
			trigger = {
				scope:actor = {
					NOR = {
						has_same_culture_as = scope:recipient
						government_has_flag = government_is_nomadic # Nomads do not care about Culture
						has_trait = nomadic_philosophy
					}
					culture = {
						cultural_acceptance = { target = scope:recipient.culture value <= 90 }
					}
				}
			}
		}

		# MAIN
		modifier = { #Different faith, no pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic.
						faith = scope:actor.faith
						faith = { has_doctrine = doctrine_pluralism_pluralistic }
					}
				}
			}
			add = {
				value = -40
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -40
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -40
				}
			}
		}

		modifier = { #Different faith, pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOT = {
						faith = scope:actor.faith
					}
					NOT = {
						scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic }
					}
					faith = { has_doctrine = doctrine_pluralism_pluralistic }
				}
			}
			add = {
				value = -20
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -20
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -20
				}
			}
		}

		modifier = { #Different faith, both have pluralism.
			desc = offer_vassalization_interaction_aibehavior_differentfaith_tt
			trigger = {
				scope:actor = {
					NOR = { # Nomads do not care about Faith
						government_has_flag = government_is_nomadic
						has_trait = nomadic_philosophy
					}
				}
				scope:recipient = {
					NOT = {
						faith = scope:actor.faith
					}
					scope:actor.faith = { has_doctrine = doctrine_pluralism_pluralistic }
					faith = { has_doctrine = doctrine_pluralism_pluralistic }
				}
			}
			add = {
				value = -10
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_hostile_level
							}
						}
					}
					add = -10
				}
				if = {
					limit = {
						scope:recipient.faith = {
							faith_hostility_level = {
								target = scope:actor.faith
								value >= faith_evil_level
							}
						}
					}
					add = -10
				}
			}
		}
		modifier = { #We just fought against each other.
			desc = offer_vassalization_interaction_aibehavior_recent_war_tt
			trigger = {
				scope:recipient = {
					any_truce_holder = {
						this = scope:actor
					}
				}
				# Ensure the truce wasn't purchased and is indeed from a war
				scope:actor = {
					NOT = {
						has_purchased_truce_with_char = { TARGET = scope:recipient }
					}
				}
				scope:recipient = {
					NOT = {
						has_purchased_truce_with_char = { TARGET = scope:actor }
					}
				}
			}
			add = -50
		}
		modifier = { #I fought an independence war against you.
			desc = offer_vassalization_interaction_aibehavior_independence_war_tt
			trigger = {
				scope:recipient = {
					exists = var:independence_war_former_liege
					var:independence_war_former_liege = scope:actor
				}
			}
			add = -200
		}
		modifier = { # I am Tribal and you are not
			desc = interaction_tribal_vs_nontribal
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_tribal
				}
				scope:actor = {
					NOT = { government_has_flag = government_is_tribal }
				}
			}
			add = -20
		}
		modifier = { # You are Tribal and I am not
			desc = interaction_nontribal_vs_tribal
			trigger = {
				scope:actor = {
					government_has_flag = government_is_tribal
				}
				scope:recipient = {
					NOT = { government_has_flag = government_is_tribal }
				}
			}
			add = -20
		}
		modifier = { # I am Nomadic and you are Nomadic
			desc = interaction_is_nomadic
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_nomadic
				}
				scope:actor = {
					government_has_flag = government_is_nomadic
				}
			}
			add = -50
		}
		modifier = { # I am Nomadic and you are not
			desc = interaction_nomadic_vs_nonnomadic
			trigger = {
				scope:recipient = {
					government_has_flag = government_is_nomadic
				}
				scope:actor = {
					NOT = { government_has_flag = government_is_nomadic }
				}
			}
			add = -75
		}
		modifier = { # You are Nomadic and I am not
			desc = interaction_nonnomadic_vs_nomadic
			trigger = {
				scope:actor = {
					government_has_flag = government_is_nomadic
				}
				scope:recipient = {
					NOT = { government_has_flag = government_is_nomadic }
				}
			}
			add = -75
		}
		modifier = { # Isolationist tradition
			desc = isolationist_reason
			trigger = {
				NOT = {
					scope:actor.culture = scope:recipient.culture
				}
				scope:recipient.culture = {
					has_cultural_tradition = tradition_isolationist
				}
			}
			add = -20
		}
		modifier = { #Bankrupt
			desc = bankrupt_reason
			trigger = {
				scope:actor.gold <= -1
			}
			add = -100
		}
		modifier = { #Wide difference in rank
			desc = offer_vassalization_interaction_aibehavior_widetitletier_tt
			trigger = {
				scope:actor = {
					tier_difference = {
						target = scope:recipient
						value > 1
					}
				}
			}
			add = 10
		}
		modifier = { # Allied
			desc = offer_vassalization_interaction_aibehavior_allied_tt
			trigger = {
				scope:recipient = {
					is_allied_to = scope:actor
				}
			}
			add = 20
		}
		modifier = { # Is the Rightful Liege of recipient
			desc = offer_vassalization_interaction_aibehavior_rightfulliegetitleholder_tt
			trigger = {
				scope:actor = { is_rightful_liege_of = scope:recipient }
			}
			add = 20
		}
		modifier = { #Is not the Rightful Liege of recipient
			desc = offer_vassalization_interaction_aibehavior_not_rightfulliegetitleholder_tt
			trigger = {
				NOT = {
					scope:actor = { is_rightful_liege_of = scope:recipient }
				}
			}
			add = -20
		}
		modifier = { # Encircled
			desc = offer_vassalization_interaction_aibehavior_encircled_tt
			trigger = {
				scope:recipient = {
					NOT = {
						any_neighboring_top_liege_realm_owner = {
							NOT = {
								this = scope:actor
							}
						}
					}
					NOT = {
						any_realm_county = {
							is_coastal_county = yes
						}
					}
				}
			}
			add = 20
		}
		modifier = { #Distant Realm — Overseas Connection
			desc = offer_vassalization_interaction_aibehavior_distantrealm_tt
			trigger = {
				scope:actor = {
					character_is_realm_neighbor = scope:recipient
					NOT = { #Ibiza should want to be a vassal of Mallorca, etc.
						character_is_land_realm_neighbor = scope:recipient
						scope:actor = { is_rightful_liege_of = scope:recipient }
					}
				}
			}
			add = -100
		}
		modifier = { #Distant Realm — No Connection
			desc = offer_vassalization_interaction_aibehavior_distantrealm_tt
			trigger = {
				scope:actor = {
					NOT = {
						character_is_realm_neighbor = scope:recipient
					}
				}
				scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value < 200000 } }
			}
			add = -250
		}
		modifier = { #Remote Realm.
			desc = offer_vassalization_interaction_aibehavior_remoterealm_tt
			trigger = {
				scope:actor = {
					NOT = {
						character_is_realm_neighbor = scope:recipient
					}
				}
				scope:recipient.capital_province = { squared_distance = { target = scope:actor.capital_province value >= 200000 } }
			}
			add = -500
		}
		modifier = {
			desc = offer_vassalization_interaction_aibehavior_power_tt
	  	  	add = {
				value = 1
				subtract = {
					value = scope:recipient.max_military_strength # Intended for recipient to use max, to avoid having vassalizations become too easy for weakened realms
					divide = { value = scope:actor.current_military_strength min = 1 }
				}
				multiply = 20
				ceiling = yes
	  		}
		}
		modifier = {
			desc = offer_vassalization_interaction_aibehavior_vassal_opinion_tt
			trigger = {
				scope:actor = {
				number_of_powerful_vassals >= 1
				}
			}

	  	  	add = {
				value = 0
				scope:actor = {
					every_powerful_vassal = {
						if = {
							limit = {
								save_temporary_opinion_value_as = {
									name = vassal_opinion
									target = scope:actor
								}
							}
							add = scope:vassal_opinion
						}
					}

					if = {
						limit = {
							number_of_powerful_vassals > 0
						}
						divide = number_of_powerful_vassals
					}
					else = {
						divide = 5
					}
				}

				divide = 5
	  		}
		}

		# MINOR
		modifier = { #Friend modifier.
			desc = offer_vassalization_interaction_aibehavior_friend_tt
			trigger = {
				scope:recipient = {
					has_relation_friend = scope:actor
					NOT = { has_relation_best_friend = scope:actor }
				}
			}
			add = 10
		}
		modifier = { #Best Friend modifier.
			desc = offer_vassalization_interaction_aibehavior_best_friend_tt
			trigger = {
				scope:recipient = {
					has_relation_best_friend = scope:actor
				}
			}
			add = 20
		}
		modifier = { #Lover modifier.
			desc = interaction_lover
			trigger = {
				scope:recipient = {
					has_relation_lover = scope:actor
					NOT = { has_relation_soulmate = scope:actor }
				}
			}
			add = 10
		}
		modifier = { #Soulmate modifier.
			desc = interaction_soulmate
			trigger = {
				scope:recipient = {
					has_relation_soulmate = scope:actor
				}
			}
			add = 20
		}
		modifier = { #Rivalry modifier.
			desc = offer_vassalization_interaction_aibehavior_rival_tt
			trigger = {
				scope:recipient = {
					has_relation_rival = scope:actor
					NOT = { has_relation_nemesis = scope:actor }
				}
			}
			add = -100
		}
		modifier = { #Nemesis modifier.
			desc = offer_vassalization_interaction_aibehavior_nemesis_tt
			trigger = {
				scope:recipient = {
					has_relation_nemesis = scope:actor
				}
			}
			add = -1000
		}
		modifier = { #Same Dynasty modifier.
			desc = offer_vassalization_interaction_aibehavior_dynasty_tt
			trigger = {
				scope:recipient = {
					dynasty = scope:actor.dynasty
				}
			}
			add = 5
		}

		modifier = { # Same language
			add = 5
			desc = speaks_same_language_interaction_reason
			trigger = {
				scope:actor = {
					knows_language_of_culture = scope:recipient.culture
				}
			}
		}

		modifier = { # Iberian Struggle, less likely for outsiders to vassalize inside
			add = -35
			desc = iberian_struggle_reason_reason
			trigger = {
				scope:actor = {
					NOT = {
						any_character_struggle = { is_struggle_type = iberian_struggle }
					}
				}
				scope:recipient = {
					any_character_struggle = { is_struggle_type = iberian_struggle }
				}
			}
		}

		modifier = { #Ageism modifier vs kids.
			desc = offer_vassalization_interaction_aibehavior_child_tt
			trigger = {
				scope:actor = {
					age < 12
				}
				scope:recipient = {
					age > 16
				}
			}
			add = -5
		}
		modifier = { #Illegitimacy modifier.
			desc = offer_vassalization_interaction_aibehavior_illegitimate_tt
			trigger = {
				scope:actor = {
					OR = {
						AND = {
							has_trait = bastard
							scope:recipient = {
								faith = { NOT = { has_doctrine = doctrine_bastardry_none } }
							}
						}
						has_trait = denounced
						has_trait = disinherited
					}
				}
			}
			add = -10
		}

		modifier = { #Claimant modifier.
			desc = offer_vassalization_interaction_aibehavior_claimant_tt
			trigger = {
				scope:actor.primary_title = {
					scope:recipient = {
						has_claim_on = prev
					}
				}
			}
			add = -20
		}

		modifier = { # Ambitious
			desc = TAKE_THE_VOWS_AMBITIOUS
			trigger = {
				scope:recipient = {
					has_trait = ambitious
				}
			}
			add = -20
		}

		modifier = { # Paranoid
			desc = INTERACTION_PARANOID
			trigger = {
				scope:recipient = {
					has_trait = paranoid
				}
			}
			add = -20
		}

		modifier = { # Arrogant
			desc = INTERACTION_ARROGANT
			trigger = {
				scope:recipient = {
					has_trait = arrogant
				}
			}
			add = -20
		}

		modifier = { # Fickle
			desc = INTERACTION_FICKLE
			trigger = {
				scope:recipient = {
					has_trait = fickle
				}
			}
			add = -10
		}

		modifier = { # Stubborn
			desc = INTERACTION_STUBBORN
			trigger = {
				scope:recipient = {
					has_trait = stubborn
				}
			}
			add = -10
		}

		modifier = { # Trusting
			desc = TAKE_THE_VOWS_TRUSTING
			trigger = {
				scope:recipient = {
					has_trait = trusting
				}
			}
			add = 5
		}

		modifier = { # Content
			desc = INTERACTION_CONTENT
			trigger = {
				scope:recipient = {
					has_trait = content
				}
			}
			add = 5
		}

		modifier = { # FP3 modifier.
			desc = GENERIC_YOUR_PIETY_LEVEL_MODIFIER
			trigger = { scope:actor = { any_character_struggle = { has_struggle_phase_parameter = piety_level_affects_vassalage_acceptance } } }
			add = {
				value = {
					value = scope:actor.piety_level
					subtract = low_piety_level
				}
				multiply = 10
			}
		}

		# OPINION INFLUENCE
		modifier = {
			add = intimidated_external_reason_value
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 1
				}
			}
			desc = INTIMIDATED_REASON
		}
		modifier = {
			add = cowed_external_reason_value
			scope:recipient = {
				has_dread_level_towards = {
					target = scope:actor
					level = 2
				}
			}
			desc = COWED_REASON
		}
		opinion_modifier = { #Compare Opinion modifier - Clans care more about opinion
			trigger = {
				scope:actor = {
					government_has_flag = government_is_clan
				}
				scope:recipient = {
					government_has_flag = government_is_clan
				}
			}
			who = scope:recipient
			opinion_target = scope:actor
			multiplier = 0.7
		}
		opinion_modifier = { #Compare Opinion modifier.
			trigger = {
				OR = {
					scope:actor = {
						NOT = { government_has_flag = government_is_clan }
					}
					scope:recipient = {
						NOT = { government_has_flag = government_is_clan }
					}
				}
			}
			who = scope:recipient
			opinion_target = scope:actor
			multiplier = 0.35
		}

		# DIPLOMATIC COURT GRANDEUR BONUS
		modifier = {
			trigger = {
				scope:actor = {
					has_royal_court = yes
					has_dlc_feature = royal_court
					has_court_type = court_diplomatic
					court_grandeur_current_level >= 1
				}
			}
			add = {
				value = scope:actor.court_grandeur_current
				if = {
					limit = { # Reduce the bonus if you are below your expected level
						scope:actor = {
							court_grandeur_current_level < court_grandeur_minimum_expected_level
						}
					}
					multiply = 0.15
				}
				else = {
					multiply = 0.3
				}
			}
			desc = DIPLOMATIC_COURT_ACCEPTANCE_INCREASE_REASON
		}

		# CONTRACT OPTIONS
		modifier = {
			add = 60
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:religious_exemption = yes
			desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON
		}
		modifier = {
			add = 30
			scope:recipient = {	government_has_flag = government_is_clan }
			scope:religious_exemption_clan = yes
			desc = CONTRACT_RELIGIOUS_EXEMPTION_REASON
		}
		modifier = {
			add = 30
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:low_obligations = yes
			desc = CONTRACT_LOW_TAXES_REASON
		}
		modifier = {
			add = -40
			scope:recipient = {	government_has_flag = government_is_feudal }
			scope:high_obligations = yes
			desc = CONTRACT_HIGH_TAXES_REASON
		}

		# INSPECTION BONUSES
		modifier = {
			desc = "INSPECTION_REASON"
			add = 5
			scope:recipient = {
				has_variable_list = lesser_inspection_bonus
				is_target_in_variable_list = {
					name = lesser_inspection_bonus
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON"
			add = 10
			scope:recipient = {
				has_variable_list = inspection_bonus
				is_target_in_variable_list = {
					name = inspection_bonus
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON_REWARD"
			add = 10
			scope:recipient = {
				has_variable_list = inspection_reward
				is_target_in_variable_list = {
					name = inspection_reward
					target = scope:actor
				}
			}
		}
		modifier = {
			desc = "INSPECTION_REASON_REWARD_FOCUSED"
			add = 10
			scope:actor = { has_character_modifier = inspection_reward_focused_vassal_acceptance }
		}

		# LOW LEGITIMACY
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -25
			scope:actor = {
				has_legitimacy_flag = reduced_vassalization_acceptance
			}
		}
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -50
			scope:actor = {
				has_legitimacy_flag = very_reduced_vassalization_acceptance
			}
		}
		modifier = {
			desc = "LOW_LEGITIMACY_REASON"
			add = -75
			scope:actor = {
				has_legitimacy_flag = massively_reduced_vassalization_acceptance
			}
		}

		# HIGH LEGITIMACY
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 25
			scope:actor = {
				has_legitimacy_flag = increased_vassalization_acceptance
			}
		}
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 50
			scope:actor = {
				has_legitimacy_flag = very_increased_vassalization_acceptance
			}
		}
		modifier = {
			desc = "HIGH_LEGITIMACY_REASON"
			add = 75
			scope:actor = {
				has_legitimacy_flag = extra_increased_vassalization_acceptance
			}
		}

		# INFLUENCE
		modifier = {
			add = 25
			scope:influence_send_option = yes
			desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION
		}

		#HISTORICALLY ADMIN PEOPLES WANT TO BE ADMIN
		modifier = {
			add = 30
			scope:actor = {
				government_has_flag = government_is_administrative
			}
			scope:recipient = {
				culture = {
					OR = {
						this = culture:greek
						any_parent_culture_or_above = {
							this = culture:greek
						}
						this = culture:han
						any_parent_culture_or_above = {
							this = culture:han
						}
					}
				}
			}
			
			desc = "HISTORICAL_ADMIN_REASON"
		}

		modifier = { # AI-only weights, keep the pope from vassalizing too fast
			trigger = {
				exists = faith:catholic.religious_head
				faith:catholic.religious_head = scope:actor
				scope:actor = { is_ai = yes }
			}
			add = -50
		}

		modifier = {
			trigger = {
				scope:actor = {
					has_variable = severed_head_vassalization
					var:severed_head_vassalization = {
						this = scope:recipient
					}
				}
			}
			add = 200
			desc = COWED_BY_SEVERED_HEAD_MODIFIER
		}

		#ALL these modifiers are also used in impress_intent_vassalization_acceptance_value, keep them synced
	}
	
	ai_min_reply_days = 5
	ai_max_reply_days = 10
	can_send_despite_rejection = no
	

	# Low starting obligations
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_feudal
			}
		}
		flag = low_obligations
		localization = low_obligations
	}

	# Medium starting obligations
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_feudal
			}
		}
		flag = normal_obligations								# If selected then scope:flag_name will be set to yes
		localization = normal_obligations				# Loc_key for option label
		starts_enabled = { always = yes	}				# Trigger for whether this should be on when the window opens. If not defined, defaults to off

	}

	# High starting obligations
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_feudal
			}
		}
		flag = high_obligations								# If selected then scope:flag_name will be set to yes
		localization = high_obligations					# Loc_key for option label
	}

	# Low starting obligations + religious exemption
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_feudal
			}
		}
		is_valid = {
			NOT = { scope:recipient.faith = scope:actor.faith }
		}
		flag = religious_exemption
		localization = religious_exemption
	}

	# Religious exemption, for clans
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_clan
			}
		}
		is_valid = {
			NOT = { scope:recipient.faith = scope:actor.faith }
		}
		flag = religious_exemption_clan
		localization = religious_exemption
	}

	# Nothing, for clans
	send_option = {
		is_shown = {
			scope:recipient = {
				government_has_flag = government_is_clan
			}
		}
		is_valid = {
			always = yes
		}
		flag = no_exemption_clan
		localization = no_exemption
	}

	send_option = { # EP3 Influence
		is_shown = {
			scope:actor = {
				government_has_flag = government_has_influence
			}
		}
		is_valid = {
			scope:actor = { influence >= medium_influence_value }
		}
		flag = influence_send_option
		localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE
	}

	on_accept = {
		scope:actor = { 
			add_prestige = -500
			trigger_event = char_interaction.0001
		}
		offer_vassalization_interaction_effect = yes
	}
	on_send = {
	}
	send_options_exclusive = yes
	ai_will_do = {
		base = 100
	}
	
	ai_frequency = 1
	ai_targets = { 
		ai_recipients = neighboring_rulers
	}

}
retract_province_sclavinia = {
	category = interaction_category_vassal
	common_interaction = yes
	popup_on_receive = yes
	icon = icon_governor_removal
	desc = retract_province_sclavinia_desc
	
	is_shown = {
		scope:recipient = {
			OR = { 
				has_title = title:k_wielkopolska
				has_title = title:k_malopolska
				has_title = title:k_litewska
			}
			NOT = { scope:actor = this }
			is_vassal_of = scope:actor
		}
	}
	ai_accept = {
		base = 1
	}
	ai_min_reply_days = 0
	ai_max_reply_days = 0
	
	on_accept = {
		if = { 
			limit = { 
				scope:recipient = {
					has_title = title:k_wielkopolska
				}
			}
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:k_wielkopolska = {
				change_title_holder = {
					holder = scope:actor
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
		}
		if = { 
			limit = { 
				scope:recipient = {
					has_title = title:k_malopolska
				}
			}
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:k_malopolska = {
				change_title_holder = {
					holder = scope:actor
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
		}
		if = { 
			limit = { 
				scope:recipient = {
					has_title = title:k_litewska
				}
			}
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change_title
				add_claim_on_loss = no
			}
			title:k_litewska = {
				change_title_holder = {
					holder = scope:actor
					change = scope:change_title
				}
			}
			resolve_title_and_vassal_change = scope:change_title
		}
		scope:recipient = { 
			add_opinion = {
				modifier = revoked_court_position_opinion
				target = scope:actor
				opinion = -30
			}
		}
	}
	on_send = {
	}
	send_options_exclusive = yes
	ai_will_do = {
		base = 100
	}
	
}