﻿# 2.5 Reichsstadt
HRT_grant_imperial_city_status_interaction = { #modified appoint_podesta_interaction
	icon = grant_titles_interaction
	interface_priority = 30
	common_interaction = yes
	category = interaction_category_vassal
	ai_min_reply_days = 0
	ai_max_reply_days = 0
	popup_on_receive = yes
	pause_on_receive = yes
	desc = HRT_grant_imperial_city_status_desc

	greeting = positive
	notification_text = REQUEST_REPUBLIC_TEXT

	is_shown = {
		NOT = { scope:actor = scope:recipient }
		scope:actor = {
			culture = {
				has_innovation = innovation_HRT_imperial_charter
			}
			has_primary_title = title:e_hre
			NOT = { is_at_war_with = scope:recipient }
		}
		scope:recipient = {
			is_ai = yes
			is_landed = yes
			target_is_liege_or_above = scope:actor
			any_held_title = {
				count = 1
				tier = tier_county
				title:c_aachen = {
					NOT = {
						is_target_in_variable_list = {
							name = HRT_reichsstaedte
							target = prev
						}
					}
				}
			}
			can_be_granted_titles_by = { RULER = scope:actor }
		}
	}

	is_valid_showing_failures_only = {
		custom_description = {
			text = HRT_demand_fealty_interaction_authority_req
			scope:actor = {
				scope:actor.var:HRT_authority >= HRT_demand_fealty_interaction_authority_value
			}
		}

		custom_description = {
			text = HRT_requires_crown_authority
			scope:actor = {
				trigger_if = {
					limit = { government_has_flag = government_is_feudal }
					has_realm_law = crown_authority_2
				}
			}
		}

		custom_description = {
			text = HRT_requires_imperial_administration
			scope:actor = {
				trigger_if = {
					limit = { government_has_flag = government_is_administrative }
					has_realm_law = imperial_bureaucracy_2
				}
			}
		}

		custom_description = {
			text = HRT_too_many_republics
			title:c_aachen = {
				trigger_if = {
					limit = { has_variable_list = HRT_reichsstaedte }
					any_in_list = {
						variable = HRT_reichsstaedte
						count < 7
					}
				}
			}
		}
		
		scope:recipient = {
			target_is_liege_or_above = scope:actor
			is_claimant = no

			custom_description = {
				text = must_be_one_county_count
				any_held_title = {
					tier = tier_county
					count = 1
				}
			}

			custom_description = {
				text = must_not_have_landed_relatives
				NOT = {
					any_close_or_extended_family_member = {
						is_landed_or_landless_administrative = yes
					}
				}
			}
			
			custom_description = {
				text = must_not_be_heir_to_any_title
				scope:recipient = {
					any_heir_title = {
						count < 1
						tier >= tier_county
					}
				}
			}

			custom_description = { #The county must be developed or have at least one city
				text = county_must_have_city
				any_held_title = {
					count = 1
					tier = tier_county
					OR = {
						any_county_province = {
							has_holding_type = city_holding
						}
						development_level > 20
					}
				}
			}

			custom_description = {
				text = HRT_is_elector_prince
				OR = {
					NOT = {
						title:e_hre = {
							any_elector = {
								this = scope:recipient
							}
						}
					}
					AND = {
						title:e_hre = {
							any_elector = {
								this = scope:recipient
							}
						}
						government_has_flag = government_is_theocracy
					}
				}
			}
		}

		scope:recipient = { is_busy_in_events_localised = yes }
		trigger_if = {
			limit = {
				scope:recipient = {
					is_ruler = no
				}
			}
			scope:recipient = {
				is_imprisoned = no
			}
		}
	}

	cost = { prestige = minor_prestige_value }
	cooldown = { months = 1 } #{ years = 5 }
	cooldown_against_recipient = { years = 10 }

	on_accept = {
		scope:actor = {
			hidden_effect = {
				send_interface_toast = {
					type = event_toast_effect_neutral
					title = HRT_grant_imperial_city_status_interaction_notification

					left_icon = scope:actor					
					right_icon = scope:recipient

					scope:recipient = {
						show_as_tooltip = {
							create_title_and_vassal_change = {
								type = returned
								save_scope_as = change
								add_claim_on_loss = no
							}
							if = {
								limit = {
									NOT = { government_has_flag = government_is_theocracy }
								}
								every_vassal = {
									limit = {
										government_has_flag = government_is_republic
									}
									every_held_title = { 
										change_title_holder = {
											holder = scope:recipient
											change = scope:change
											take_baronies = yes
										}
									}
								}
							}
							if = {
								limit = {
									liege = {
										NOT = { this = scope:actor }
									}
								}
								liege = {
									add_opinion = {
										target = scope:actor
										modifier = retracted_vassal
									}
								}
							}
							change_liege = {
								liege = scope:actor
								change = scope:change
							}
							resolve_title_and_vassal_change = scope:change
							if = {
								limit = {
									NOR = {
										has_government = free_imperial_city_government
										government_has_flag = government_is_theocracy
									}
								}
								change_government = free_imperial_city_government
							}
						}
					}
				}
				change_variable = {
					name = HRT_authority
					subtract = 80
				}
			}
		}
		scope:recipient = {
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change
				add_claim_on_loss = no
			}
			if = {
				limit = {
					NOT = { government_has_flag = government_is_theocracy }
				}
				every_vassal = {
					limit = {
						government_has_flag = government_is_republic
					}
					every_held_title = { 
						change_title_holder = {
							holder = scope:recipient
							change = scope:change
							take_baronies = yes
						}
					}
				}
			}
			if = {
				limit = {
					liege = {
						NOT = { this = scope:actor }
					}
				}
				liege = {
					add_opinion = {
						target = scope:actor
						modifier = retracted_vassal
					}
				}
			}
			change_liege = {
				liege = scope:actor
				change = scope:change
			}
			resolve_title_and_vassal_change = scope:change
			if = {
				limit = {
					NOR = {
						has_government = free_imperial_city_government
						government_has_flag = government_is_theocracy
					}
				}
				change_government = free_imperial_city_government
			}
			if = { # Set the appropriate Succession Law
				limit = {
					NOT = { government_has_flag = government_is_theocracy }
				}
				add_realm_law_skip_effects = city_succession_law
			}
			create_story = HRT_imperial_city_story
			capital_province.county = { # Why not capital_county?
				add_county_modifier = HRT_reichsstadt_1
				set_variable = {
					name = HRT_reichsstadt_years
					value = 0
				}
				set_variable = {
					name = HRT_reichsstadt_development
					value = development_level
				}
				title:c_aachen = {
					add_to_variable_list = {
						name = HRT_reichsstaedte
						target = prev
					}
				}
			}
		}
	}

	auto_accept = yes

	# AI
	ai_potential = {
		culture = {
			has_innovation = innovation_HRT_imperial_charter
		}
		has_primary_title = title:e_hre
	}
	
	ai_target_quick_trigger = {
		adult = yes
	}
	ai_targets = {
		ai_recipients = vassals
	}

	ai_frequency = 240

	ai_will_do = {
		base = 100

		modifier = {
			scope:recipient = {
				OR = {
					has_primary_title = title:c_worms
					has_primary_title = title:c_speyer
					has_primary_title = title:c_frankfurt
					has_primary_title = title:c_augsburg
					has_primary_title = title:c_aachen
					has_primary_title = title:c_regensburg
					has_primary_title = title:c_ulm
				}
			}
			add = 5000
		}
	}
}

#by Rylock
demand_imperial_subjugation_interaction = {
	category = interaction_category_vassal

	#common_interaction = yes
	interface_priority = 100
	ai_maybe = yes
	ai_min_reply_days = 5
	ai_max_reply_days = 10
	can_send_despite_rejection = yes
	popup_on_receive = yes
	pause_on_receive = yes

	desc = demand_imperial_subjugation_interaction_desc
	
	greeting = positive
	notification_text = DEMAND_IMPERIAL_SUBJUGATION_NOTIFICATION
	pre_answer_maybe_key = ANSWER_MIGHT_SUCCEED
	pre_answer_no_key = ANSWER_CANT_SUCCEED
	pre_answer_yes_key = ANSWER_WILL_SUCCEED
	pre_answer_maybe_breakdown_key = ANSWER_SUM_CHANCE
	
	ai_potential = {
		is_adult = yes
		is_independent_ruler = yes
		highest_held_title_tier > tier_duchy
	}

	is_shown = {
		scope:actor = {
			HRT_is_emperor_trigger = yes
			highest_held_title_tier = tier_kingdom
		}
		scope:recipient = {
			is_landed = yes
			is_independent_ruler = yes
			highest_held_title_tier <= scope:actor.highest_held_title_tier
			
			## Historicity by Rylock
			# their primary title lies within Carolingian borders
			OR = {
				capital_county.title_province = { geographical_region = HRT_core_territory }
				primary_title = {
					OR = {
						this = title:k_lotharingia
						this = title:k_burgundy
						this = title:k_east_francia
						this = title:k_bavaria
						this = title:k_italy
					}
				}
			}
			# their realm is smaller
			sub_realm_size < scope:actor.sub_realm_size
			# they are catholic and feudal
			faith = faith:catholic
			OR = {
				government_has_flag = government_is_feudal
				government_has_flag = government_is_administrative
			}
			NOR = {
				this = scope:actor
				government_has_flag = can_not_be_vassal_or_liege
				this = scope:actor.faith.religious_head
				# they don't hold more than one kingdom title
				any_held_title = {
					tier = tier_kingdom
					count > 1
				}
				has_opinion_modifier = {
					modifier = demanded_my_title_hre_opinion
					target = scope:actor
				}
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:actor = {
			custom_tooltip = {
				text = HRT_demand_fealty_interaction_authority_req
				scope:actor.var:HRT_authority >= HRT_demand_fealty_interaction_authority_value
			}
			is_at_war = no
			is_adult = yes
			is_busy_in_events_localised = yes
			is_available = yes
			NOT = { has_truce = scope:recipient }
		}
		scope:recipient = {
			is_busy_in_events_localised = yes
			OR = {
				is_imprisoned = no
				is_imprisoned_by = scope:actor
			}
			NOR = {
				has_strong_hook = scope:actor
				is_at_war = yes
			}
			custom_description = {
				text = was_recently_granted_independence
				NOT = {
					has_opinion_modifier = {
						modifier = granted_independence_opinion
						target = scope:actor
					}
				}
			}
		}
	}

	can_send = {
		scope:actor = {
			custom_description = {
				text = "character_interactions_hostile_actions_disabled_delay"
				NOT = { has_character_flag = flag_hostile_actions_disabled_delay }
			}
		}
	}
	
	is_highlighted = {
		scope:actor.var:HRT_authority >= HRT_demand_fealty_interaction_authority_value
	}

	on_send = {
		scope:actor = {
			add_character_flag = {
				flag = flag_hostile_actions_disabled_delay
				days = 10
			}
		}
	}

	# Low starting obligations
	send_option = {
		flag = low_obligations
		localization = low_obligations
	}

	# Medium starting obligations
	send_option = {
		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 = {
		flag = high_obligations								# If selected then scope:flag_name will be set to yes
		localization = high_obligations					# Loc_key for option label
	}

	send_options_exclusive = yes

	auto_accept = no
	
	on_decline = {
		scope:actor = {
			if = {
				limit = {
					NOT = { has_claim_on = scope:recipient.primary_title }
				}
				add_unpressed_claim = scope:recipient.primary_title
			}
			if = {
				limit = { is_allied_to = scope:recipient }
				break_alliance = scope:recipient
			}
			progress_towards_rival_effect = {
				CHARACTER = scope:recipient
				REASON = rival_demanded_title
				OPINION = -50
			}
			reverse_add_opinion = {
				target = scope:recipient
				modifier = demanded_my_title_hre_opinion
			}
		}
	}
	
	on_accept = {
		custom_tooltip = imperial_subjugation_accept_tt
		takes_same_tier_titles_then_vassalizes = { SUBJUGATOR = scope:actor TARGET = scope:recipient }
		# Reduce Imperial Authority
		change_variable = {
			name = HRT_authority
			subtract = HRT_unification_authority_value
		}
	}
	
	ai_accept = {
		base = 0
		
		modifier = {
			desc = HRT_demand_fealty_authority_tt
			add = scope:actor.var:HRT_authority
		}
		
		# 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
		}

		modifier = { # Cultural Acceptance
			add = offer_vassalage_acceptance_value
			desc = cultural_acceptance_interaction_reason
			trigger = {
				scope:actor = {
					NOT = { has_same_culture_as = scope:recipient }
					culture = {
						cultural_acceptance = { target = scope:recipient.culture value <= 90 }
					}
				}
			}
		}

		# MAIN
		modifier = { #We just fought against each other.
			desc = offer_vassalization_interaction_aibehavior_recent_war_tt
			trigger = {
				scope:recipient = {
					any_truce_holder = {
						this = 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 = { # 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 = { #I am a King!
			desc = offer_vassalization_interaction_aibehavior_amkingtier_tt
			trigger = {
				scope:recipient = { highest_held_title_tier = tier_kingdom }
			}
			add = {
				value = -50
				if = {
					limit = {
						scope:recipient = {
							any_held_title = {
								OR = {
									this = title:k_papal_state
									this = title:k_france
									this = title:k_denmark
									this = title:k_venice
								}
							}
						}
					}
					add = -200
				}
			}
		}
		modifier = { # Allied
			desc = offer_vassalization_interaction_aibehavior_allied_tt
			trigger = {
				scope:recipient = {
					is_allied_to = scope:actor
				}
			}
			add = 25
		}
		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 = 25
		}
		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
						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 = { #Military Power
			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 = { #Military Power
			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
			}
		}
		modifier = { #Realm Size
			desc = offer_vassalization_interaction_aibehavior_realmsize_tt
			trigger = {
				scope:actor.sub_realm_size < scope:recipient.sub_realm_size_plus_10
			}
			add = -100
		}
		modifier = { #Realm Size
			desc = offer_vassalization_interaction_aibehavior_realmsize_tt
			trigger = {
				scope:actor.sub_realm_size > scope:recipient.sub_realm_size_plus_20
			}
			add = {
				value = scope:actor.sub_realm_size
				subtract = scope:recipient.sub_realm_size_plus_20
				max = 20
			}
		}

		# 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 = 20
		}
		modifier = { #Best Friend modifier.
			desc = offer_vassalization_interaction_aibehavior_best_friend_tt
			trigger = {
				scope:recipient = {
					has_relation_best_friend = scope:actor
				}
			}
			add = 50
		}
		modifier = { #Lover modifier.
			desc = interaction_lover
			trigger = {
				scope:recipient = {
					has_relation_lover = scope:actor
					NOT = { has_relation_soulmate = scope:actor }
				}
			}
			add = 20
		}
		modifier = { #Soulmate modifier.
			desc = interaction_soulmate
			trigger = {
				scope:recipient = {
					has_relation_soulmate = scope:actor
				}
			}
			add = 50
		}
		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 = 25
		}

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

		modifier = { # Is a child
			desc = offer_vassalization_interaction_aibehavior_recipient_child_tt
			trigger = {
				scope:recipient = {
					is_adult = no
				}
			}
			add = 5
		}
		modifier = { #Illegitimacy modifier.
			desc = offer_vassalization_interaction_aibehavior_illegitimate_tt
			trigger = {
				OR = {
					AND = {
						scope:actor = {
							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
			add = {
				value = {
					value = scope:actor.piety_level
					subtract = low_piety_level
				}
				multiply = 5
			}
		}

		# 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
		}

		# DIPLOMATIC COURT GRANDEUR BONUS
		modifier = {
			trigger = {
				scope:actor = {
					has_royal_court = yes
					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 = 30
			scope:low_obligations = yes
			desc = CONTRACT_LOW_TAXES_REASON
		}
		modifier = {
			add = -40
			scope:high_obligations = yes
			desc = CONTRACT_HIGH_TAXES_REASON
		}
	}

	# AI
	ai_targets = {
		ai_recipients = neighboring_rulers
	}
	ai_frequency = 12

	ai_will_do = {
		base = 100

		# AI prefers to receive higher obligations from their vassals when possible.
		modifier = {
			add = 2
			scope:low_obligations = yes
		}

		modifier = {
			add = 3
			scope:normal_obligations = yes
		}

		modifier = {
			add = 4
			scope:high_obligations = yes
		}

		modifier = {
			factor = 0
			scope:actor.sub_realm_size < scope:recipient.sub_realm_size_plus_10
		}
		
		modifier = {
			factor = 0
			scope:actor.sub_realm_size >= 140
			NOT = {
				scope:recipient = { primary_title = title:k_italy }
			}
		}
		
		modifier = {
			factor = 0
			scope:recipient = { save_temporary_scope_as = target }
			scope:actor.strength_with_relevant_allies_vs_target_value <= scope:recipient.one_and_a_half_times_current_strength_with_relevant_allies_vs_root
		}
		
		modifier = {
			factor = 0
			scope:actor = {
				has_claim_on = scope:recipient.primary_title
				NOR = {
					is_allied_to = scope:recipient
					has_relation_friend = scope:actor
					has_relation_lover = scope:actor
				}
			}
		}


		modifier = { # If the recipient is a player, do not bother sending
			factor = 0
			scope:recipient = {
				is_ai = no
			}
		}
	}
}