﻿landed_el_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_spend_money.dds"
	}
	#decision_group_type = major
	sort_order = 1000


	is_shown = {
		is_landed = yes
		is_ai = no
		is_travelling = no
		is_imprisoned = no
		is_incapable = no
		is_at_war = no
		is_in_army = no
		is_adult = yes
		OR = {
			exists = cp:councillor_steward
			AND = {
			exists =	cp:councillor_kurultai_1
			has_government = nomad_government
			}
		}
		trigger_if = {
			limit = { exists = involved_activity }
			NOT = {
				OR = {
					has_activity_state = passive
					has_activity_state = active
				}
			}
		}
		NOT = { has_character_flag = el_is_employing_adventurer }
		NOT = { has_character_flag = el_is_employing_adventurer_interac }
		any_county = {
			any_county_province = {
			squared_distance = { target = root.capital_province value < el_squared_distance_camp }
				any_character_in_location = {
					has_government = landless_adventurer_government
					is_travelling = no
					is_at_war = no
					is_ai = yes
					is_in_army = no
					is_incapable = no
					NOT = { has_trait = infirm }
					is_adult = yes
					is_imprisoned = no
					NOT = { has_relation_rival = root }
					is_busy_in_events_unlocalised = no
					domicile.domicile_location = prev
					root = {
						NOT = {
							is_target_in_variable_list = {
								name = el_landed_refuted_list
								target = prev
							}
						}
					}					
				}
			}
		}
	}
	is_valid_showing_failures_only = {
		custom_tooltip = {
			text = landed_el_decision.tt
			el_landed_available_global = yes
		}
	}		
	ai_check_interval = 0

	cooldown = { days = 365 }

	effect = {
	save_scope_as = el_employer
		custom_tooltip = landed_el_decision.tt.a
		custom_tooltip = landed_el_decision.tt.c
		custom_tooltip = landed_el_decision.tt.d	
		custom_tooltip = landed_el_decision.tt.j
		
		if = {
			limit = { el_landed_available_train_knight = yes }
			custom_tooltip = el_landed_train_knight_valid_ok
		}
		if = {
			limit = {el_landed_available_tutor_child = yes }
			custom_tooltip = el_landed_tutor_child_valid_ok
		}
		if = {
			limit = {el_landed_available_des_nei = yes }
			custom_tooltip = el_landed_des_nei_valid_ok
		}
		if = {
			limit = {el_landed_available_regale_court = yes }
			custom_tooltip = el_landed_regale_court_valid_ok
		}
		if = {
			limit = {el_landed_available_imp_dom = yes }
			custom_tooltip = el_landed_imp_dom_valid_ok
		}
		if = {
			limit = {el_landed_available_con_nei = yes }
			custom_tooltip = el_landed_con_nei_valid_ok
		}
		if = {
			limit = {el_landed_available_sup_fac = yes }
			custom_tooltip = el_landed_sup_fac_valid_ok
		}
		
		add_character_flag = { 
			flag = el_is_employing_adventurer
			days = 365
		}
		if = {
			limit = { has_government = nomad_government }
			trigger_event = el_landed_trigger.0010
		}
		else = {
			trigger_event = el_landed_trigger.0001
		}
	}
}

