﻿oathbound_sway_vassals_interaction = {
	icon = icon_scheme_sway
	category = interaction_category_friendly
	common_interaction = yes

	send_name = START_SCHEME

	interface_priority = 75

	scheme = oathbound_sway_vassals
	ignores_pending_interaction_block = yes

	ai_targets = {
		ai_recipients = var:val_oathholder.vassals
	}
	ai_frequency = 12

	is_shown = {
		scope:actor.var:val_oathholder = {
			is_alive = yes
		}
		NOT = { scope:actor = scope:recipient }
		NOT = { scope:recipient = scope:actor.var:val_oathholder }
		scope:recipient = {
			liege = scope:actor.var:val_oathholder
		}
	}

	is_valid_showing_failures_only = {
		scope:actor = {
			can_start_scheme = {
				type = oathbound_sway_vassals
				target_character = scope:recipient
			}
		}
		#limit range for landless adventurers
		trigger_if = {
			limit = {
				scope:actor = {
					is_landless_adventurer = yes
				}
			}
			#Has to be used instead of diplo range checks in laamp to landed interactions
			ep3_laamp_diplo_range_trigger = {
				TARGET = scope:recipient
				LAAMP = scope:actor
			}
		}
	}

	desc = oathbound_sway_vassals_interaction_tt_sway_approved

	on_accept = {
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = sway_interaction_notification

				left_icon = scope:actor					
				right_icon = scope:recipient

				begin_scheme_basic_effect = {
					SCHEME_TYPE = oathbound_sway_vassals
					TARGET_TYPE = target_character
					TARGET_SCOPE = scope:recipient
				}
			}
		}
	}
	
	ai_potential = {
		primary_title.tier >= tier_county
		NOR = {
			scheme_generic_ai_blocker_trigger = yes
			primary_title = {
				is_mercenary_company = yes
			}
		}
	}
	
	auto_accept = yes
	
	ai_will_do = {
		base = -1000
		
		modifier = {
			add = 1200
			scope:recipient = {
				is_vassal_of = scope:actor.var:val_oathholder
			}
		}
	}
}