﻿###################
# Replace Councillor
###################
replace_councillor_interaction = {
	category = interaction_category_hostile
	
	ai_potential = {
		always = no
	}
	# ai_targets = { #AI uses event council_plot.198
		# ai_recipients = courtiers
		# ai_recipients = peer_vassals
	# }
	
	auto_accept = yes
	use_diplomatic_range = no

	scheme = replace_councillor

	desc = replace_councillor_interaction_desc
	
	is_shown = {
		exists = scope:actor.liege_or_court_owner
		scope:recipient = {
			is_councillor = yes
			liege_or_court_owner = scope:actor.liege_or_court_owner
		}	
		scope:actor = { 
			is_adult = yes
			is_imprisoned = no
			is_councillor = no
		}
		NOT = { scope:recipient = scope:actor }		
	}

	is_valid_showing_failures_only = {
	}

	is_valid = {
		scope:actor = {		
			can_start_scheme = {
				type = replace_councillor
				target = scope:recipient
			}
			OR = {
				is_powerful_vassal = yes
				trigger_if = {
					limit = { scope:recipient = { has_council_position = councillor_chancellor } }
					diplomacy >= 12
				}
				trigger_else_if = {
					limit = { scope:recipient = { has_council_position = councillor_steward } }
					stewardship >= 12
				}
				trigger_else_if = {
					limit = { scope:recipient = { has_council_position = councillor_marshal } }
					martial >= 12
				}
				trigger_else_if = {
					limit = { scope:recipient = { has_council_position = councillor_spymaster } }
					intrigue >= 12
				}
				trigger_else_if = {
					limit = { scope:recipient = { has_council_position = councillor_court_chaplain } }
					learning >= 12
				}
				trigger_else = {
					stewardship >= 12
				}
			}	
		}			
	}

	on_accept = {
		scope:actor = {
			stress_impact = {
				content = medium_stress_impact_gain
			}
			hidden_effect = {
				start_scheme = {
					target = scope:recipient
					type = replace_councillor
				}
			}
		}
	}
}


