﻿# Returns whether or not the given county is a valid target for
# task_dispatch_missionaries.
#
# scope:councillor = councillor_high_priestess
# scope:councillor_liege = liege of the councillor_high_priestess
# scope:province = the capital province of the targeted county
# scope:county = the target county
is_valid_dispatch_missionaries_county = {
	scope:county = {
		exists = holder
		NOT = { faith = scope:councillor_liege.faith }

		custom_description = {
			text = task_dispatch_missionaries_no_nearby_missionaries_trigger
			OR = {
				holder.faith = scope:councillor_liege.faith
				any_title_to_title_neighboring_and_across_water_county = {
					OR = {
						faith = scope:councillor_liege.faith
						holder ?= {
							target_is_same_character_or_above = scope:councillor_liege
						}
					}
				}
			}
		}

		holder = {
			in_diplomatic_range = scope:councillor_liege
			custom_description = {
				text = task_dispatch_missionaries_own_court_unavailable_trigger
				NOT = {
					target_is_same_character_or_above = scope:councillor_liege
				}
			}
		}
	}
}
