﻿hand_of_shadow_court_position = {
	sort_order = 298
	max_available_positions = 1
	minimum_rank = county
	skill = intrigue

	court_position_asset = {
		animation = assassin
		background = "gfx/interface/illustrations/event_scenes/fp2_corridor_night.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = intrigue
			multiply = 3
			max = 60
			desc = court_position_skill_intrigue
		}
		add = {
			value = diplomacy
			divide = 2
			desc = court_position_skill_diplomacy
		}
		if = {
			limit = { has_trait = deceitful }
			add = { value = 15 desc = court_position_deceitful_trait }
		}
		if = {
			limit = { has_trait = arbitrary }
			add = { value = 10 desc = court_position_arbitrary_trait }
		}
		if = {
			limit = { has_trait = sadistic }
			add = { value = 10 desc = court_position_sadistic_trait }
		}
		if = {
			limit = { has_trait = patient }
			add = { value = 5 desc = court_position_patient_trait }
		}
		if = {
			limit = { has_trait = honest }
			add = { value = -15 desc = court_position_honest_trait }
		}
		if = {
			limit = { has_trait = just }
			add = { value = -10 desc = court_position_just_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = hand_of_shadow_court_position_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_veiled_court_01
						has_building = dlm_veiled_court_02
						has_building = dlm_veiled_court_03
						has_building = dlm_veiled_court_04
						has_building = dlm_veiled_court_r_01
						has_building = dlm_veiled_court_r_02
						has_building = dlm_veiled_court_r_03
						has_building = dlm_veiled_court_r_04
						has_building = dlm_veiled_court_l_01
						has_building = dlm_veiled_court_l_02
						has_building = dlm_veiled_court_l_03
						has_building = dlm_veiled_court_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = {
			value = 0.3
		}
		round = no
	}

	received_salary = {
		gold = {
			value = 0.3
		}
		round = no
	}

	scaling_employer_modifiers = {
		terrible = {
			owned_scheme_secrecy_add = 1
		}
		poor = {
			owned_scheme_secrecy_add = 2
		}
		average = {
			owned_scheme_secrecy_add = 3
		}
		good = {
			owned_scheme_secrecy_add = 4
		}
		excellent = {
			owned_scheme_secrecy_add = 5
		}
	}

	modifier = {
		monthly_intrigue_lifestyle_xp_gain_mult = 0.1
	}

	on_court_position_received = {
		basic_gained_court_position_effect = yes
	}
	on_court_position_revoked = {
		basic_revoked_court_position_effect = yes
	}
	on_court_position_invalidated = {
		basic_invalidated_court_position_effect = yes
	}

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = {
					scope:highest_available_aptitude > scope:employee_aptitude
				}
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

dlm_criminal_network_spymaster_1 = {
	sort_order = 297
	max_available_positions = 1
	minimum_rank = county
	skill = intrigue

	court_position_asset = {
		animation = assassin
		background = "gfx/interface/illustrations/event_scenes/fp2_corridor_night.dds"
	}

	opinion = { value = regular_court_position_opinion }
	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = { value = intrigue multiply = 3 max = 60 desc = court_position_skill_intrigue }
		add = { value = diplomacy divide = 2 desc = court_position_skill_diplomacy }
		if = { limit = { has_trait = deceitful } add = { value = 15 desc = court_position_deceitful_trait } }
		if = { limit = { has_trait = arbitrary } add = { value = 10 desc = court_position_arbitrary_trait } }
		if = { limit = { has_trait = sadistic } add = { value = 10 desc = court_position_sadistic_trait } }
		if = { limit = { has_trait = patient } add = { value = 5 desc = court_position_patient_trait } }
		if = { limit = { has_trait = honest } add = { value = -15 desc = court_position_honest_trait } }
		if = { limit = { has_trait = just } add = { value = -10 desc = court_position_just_trait } }
		add = general_aptitude_bonus
	}

	is_shown = { always = no }

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = dlm_criminal_network_spymaster_1_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_dread_fort_01
						has_building = dlm_dread_fort_02
						has_building = dlm_dread_fort_03
						has_building = dlm_dread_fort_04
						has_building = dlm_dread_fort_r_01
						has_building = dlm_dread_fort_r_02
						has_building = dlm_dread_fort_r_03
						has_building = dlm_dread_fort_r_04
						has_building = dlm_dread_fort_l_01
						has_building = dlm_dread_fort_l_02
						has_building = dlm_dread_fort_l_03
						has_building = dlm_dread_fort_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = { court_position_employee_shown_trigger = yes }
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = { exists = this is_ai = yes }
				multiply = 0
			}
		}
	}

	salary = { gold = { value = 0.25 } round = no }
	received_salary = { gold = { value = 0.25 } round = no }

	scaling_employer_modifiers = {
		terrible = { owned_scheme_secrecy_add = 1 }
		poor = { owned_scheme_secrecy_add = 2 }
		average = { owned_scheme_secrecy_add = 3 }
		good = { owned_scheme_secrecy_add = 4 }
		excellent = { owned_scheme_secrecy_add = 5 }
	}

	modifier = { monthly_intrigue_lifestyle_xp_gain_mult = 0.05 }
	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 35
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = { value = scope:employee_aptitude multiply = 4 }
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

dlm_criminal_network_spymaster_2 = {
	sort_order = 296
	max_available_positions = 1
	minimum_rank = county
	skill = intrigue

	court_position_asset = {
		animation = assassin
		background = "gfx/interface/illustrations/event_scenes/fp2_corridor_night.dds"
	}

	opinion = { value = regular_court_position_opinion }
	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = { value = intrigue multiply = 3 max = 60 desc = court_position_skill_intrigue }
		add = { value = diplomacy divide = 2 desc = court_position_skill_diplomacy }
		if = { limit = { has_trait = deceitful } add = { value = 15 desc = court_position_deceitful_trait } }
		if = { limit = { has_trait = arbitrary } add = { value = 10 desc = court_position_arbitrary_trait } }
		if = { limit = { has_trait = sadistic } add = { value = 10 desc = court_position_sadistic_trait } }
		if = { limit = { has_trait = patient } add = { value = 5 desc = court_position_patient_trait } }
		if = { limit = { has_trait = honest } add = { value = -15 desc = court_position_honest_trait } }
		if = { limit = { has_trait = just } add = { value = -10 desc = court_position_just_trait } }
		add = general_aptitude_bonus
	}

	is_shown = { always = no }

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = dlm_criminal_network_spymaster_2_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_dread_fort_r_01
						has_building = dlm_dread_fort_r_02
						has_building = dlm_dread_fort_r_03
						has_building = dlm_dread_fort_r_04
						has_building = dlm_dread_fort_l_01
						has_building = dlm_dread_fort_l_02
						has_building = dlm_dread_fort_l_03
						has_building = dlm_dread_fort_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = { court_position_employee_shown_trigger = yes }
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = { exists = this is_ai = yes }
				multiply = 0
			}
		}
	}

	salary = { gold = { value = 0.25 } round = no }
	received_salary = { gold = { value = 0.25 } round = no }

	scaling_employer_modifiers = {
		terrible = { owned_hostile_scheme_success_chance_add = 2 }
		poor = { owned_hostile_scheme_success_chance_add = 4 }
		average = { owned_hostile_scheme_success_chance_add = 6 }
		good = { owned_hostile_scheme_success_chance_add = 8 }
		excellent = { owned_hostile_scheme_success_chance_add = 10 }
	}

	modifier = { monthly_intrigue_lifestyle_xp_gain_mult = 0.05 }
	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 35
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = { value = scope:employee_aptitude multiply = 4 }
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

dlm_criminal_network_spymaster_3 = {
	sort_order = 295
	max_available_positions = 1
	minimum_rank = county
	skill = intrigue

	court_position_asset = {
		animation = assassin
		background = "gfx/interface/illustrations/event_scenes/fp2_corridor_night.dds"
	}

	opinion = { value = regular_court_position_opinion }
	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = { value = intrigue multiply = 3 max = 60 desc = court_position_skill_intrigue }
		add = { value = diplomacy divide = 2 desc = court_position_skill_diplomacy }
		if = { limit = { has_trait = deceitful } add = { value = 15 desc = court_position_deceitful_trait } }
		if = { limit = { has_trait = arbitrary } add = { value = 10 desc = court_position_arbitrary_trait } }
		if = { limit = { has_trait = sadistic } add = { value = 10 desc = court_position_sadistic_trait } }
		if = { limit = { has_trait = patient } add = { value = 5 desc = court_position_patient_trait } }
		if = { limit = { has_trait = honest } add = { value = -15 desc = court_position_honest_trait } }
		if = { limit = { has_trait = just } add = { value = -10 desc = court_position_just_trait } }
		add = general_aptitude_bonus
	}

	is_shown = { always = no }

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = dlm_criminal_network_spymaster_3_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_dread_fort_l_01
						has_building = dlm_dread_fort_l_02
						has_building = dlm_dread_fort_l_03
						has_building = dlm_dread_fort_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = { court_position_employee_shown_trigger = yes }
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = { exists = this is_ai = yes }
				multiply = 0
			}
		}
	}

	salary = { gold = { value = 0.25 } round = no }
	received_salary = { gold = { value = 0.25 } round = no }

	scaling_employer_modifiers = {
		terrible = { enemy_hostile_scheme_success_chance_add = -0.02 }
		poor = { enemy_hostile_scheme_success_chance_add = -0.03 }
		average = { enemy_hostile_scheme_success_chance_add = -0.04 }
		good = { enemy_hostile_scheme_success_chance_add = -0.05 }
		excellent = { enemy_hostile_scheme_success_chance_add = -0.06 }
	}

	modifier = { monthly_intrigue_lifestyle_xp_gain_mult = 0.05 }
	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 35
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = { value = scope:employee_aptitude multiply = 4 }
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

guild_master_court_position = {
	sort_order = 294
	max_available_positions = 1
	minimum_rank = county
	skill = stewardship

	court_position_asset = {
		animation = reading
		background = "gfx/interface/illustrations/event_scenes/ep3_medi_estate.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = stewardship
			multiply = 3
			max = 60
			desc = court_position_skill_stewardship
		}
		add = {
			value = diplomacy
			divide = 2
			desc = court_position_skill_diplomacy
		}
		if = {
			limit = { has_trait = diligent }
			add = { value = 15 desc = court_position_diligent_trait }
		}
		if = {
			limit = { has_trait = patient }
			add = { value = 10 desc = court_position_patient_trait }
		}
		if = {
			limit = { has_trait = ambitious }
			add = { value = 10 desc = court_position_ambitious_trait }
		}
		if = {
			limit = { has_trait = greedy }
			add = { value = 10 desc = court_position_greedy_trait }
		}
		if = {
			limit = { has_trait = lazy }
			add = { value = -20 desc = court_position_lazy_trait }
		}
		if = {
			limit = { has_trait = arbitrary }
			add = { value = -10 desc = court_position_arbitrary_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = guild_master_court_position_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_agricultural_domain_01
						has_building = dlm_agricultural_domain_02
						has_building = dlm_agricultural_domain_03
						has_building = dlm_agricultural_domain_04
						has_building = dlm_agricultural_domain_r_01
						has_building = dlm_agricultural_domain_r_02
						has_building = dlm_agricultural_domain_r_03
						has_building = dlm_agricultural_domain_r_04
						has_building = dlm_agricultural_domain_l_01
						has_building = dlm_agricultural_domain_l_02
						has_building = dlm_agricultural_domain_l_03
						has_building = dlm_agricultural_domain_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = { value = 0.3 }
		round = no
	}

	received_salary = {
		gold = { value = 0.3 }
		round = no
	}

	base_employer_modifier = {
		domain_tax_mult = 0.05
	}

	modifier = {
		monthly_stewardship_lifestyle_xp_gain_mult = 0.1
	}

	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

mercenary_captain_court_position = {
	sort_order = 293
	max_available_positions = 1
	minimum_rank = county
	skill = martial

	court_position_asset = {
		animation = champion
		background = "gfx/interface/illustrations/event_scenes/tournament_melee_duel_training.jpg"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = martial
			multiply = 2
			max = 50
			desc = court_position_skill_martial
		}
		add = {
			value = prowess
			multiply = 2
			max = 50
			desc = court_position_skill_prowess
		}
		if = {
			limit = {
				has_trait = dlm_mercenary
				NOT = {
					has_trait_xp = {
						trait = dlm_mercenary
						value >= 100
					}
				}
			}
			add = { value = 10 desc = trait_dlm_mercenary }
		}
		if = {
			limit = {
				has_trait_xp = {
					trait = dlm_mercenary
					value >= 100
				}
			}
			add = { value = 20 desc = trait_dlm_mercenary_captain }
		}
		if = {
			limit = { has_trait = brave }
			add = { value = 10 desc = court_position_brave_trait }
		}
		if = {
			limit = { has_trait = wrathful }
			add = { value = 10 desc = court_position_wrathful_trait }
		}
		if = {
			limit = { has_trait = organizer }
			add = { value = 10 desc = court_position_organizer_trait }
		}
		if = {
			limit = { has_trait = craven }
			add = { value = -20 desc = court_position_craven_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		custom_tooltip = {
			text = mercenary_captain_court_position_requirement_tt
			any_sub_realm_barony = {
				county.holder = root
				title_province = {
					OR = {
						has_building = dlm_fortress_bastion_01
						has_building = dlm_fortress_bastion_02
						has_building = dlm_fortress_bastion_03
						has_building = dlm_fortress_bastion_04
						has_building = dlm_fortress_bastion_r_01
						has_building = dlm_fortress_bastion_r_02
						has_building = dlm_fortress_bastion_r_03
						has_building = dlm_fortress_bastion_r_04
						has_building = dlm_fortress_bastion_l_01
						has_building = dlm_fortress_bastion_l_02
						has_building = dlm_fortress_bastion_l_03
						has_building = dlm_fortress_bastion_l_04
					}
				}
			}
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_landed = no
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = { value = 0.4 }
		round = no
	}

	received_salary = {
		gold = { value = 0.4 }
		round = no
	}

	base_employer_modifier = {
		mercenary_hire_cost_mult = -0.05
		same_culture_mercenary_hire_cost_mult = -0.10
		army_maintenance_mult = -0.02
	}

	modifier = {
		monthly_martial_lifestyle_xp_gain_mult = 0.1
	}

	on_court_position_received = {
		basic_gained_court_position_effect = yes
		scope:employee = {
			if = {
				limit = { NOT = { has_trait = dlm_mercenary } }
				add_trait = dlm_mercenary
			}
			if = {
				limit = {
					NOT = { has_character_flag = dlm_mercenary_captain_training_started }
					NOT = {
						has_trait_xp = {
							trait = dlm_mercenary
							value >= 100
						}
					}
				}
				add_character_flag = { flag = dlm_mercenary_captain_training_started days = 1000 }
				add_character_flag = { flag = dlm_mercenary_captain_training_period days = 180 }
			}
			add_character_flag = { flag = dlm_mercenary_captain_recruit_cycle days = 30 }
		}
	}
	on_court_position_revoked = {
		basic_revoked_court_position_effect = yes
		scope:employee = {
			remove_character_flag = dlm_mercenary_captain_training_started
			remove_character_flag = dlm_mercenary_captain_training_period
			remove_character_flag = dlm_mercenary_captain_recruit_cycle
		}
	}
	on_court_position_invalidated = {
		basic_invalidated_court_position_effect = yes
		scope:employee = {
			remove_character_flag = dlm_mercenary_captain_training_started
			remove_character_flag = dlm_mercenary_captain_training_period
			remove_character_flag = dlm_mercenary_captain_recruit_cycle
		}
	}

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

grandmaster_golden_lance_court_position = {
	sort_order = 292
	max_available_positions = 1
	minimum_rank = county
	skill = martial

	court_position_asset = {
		animation = champion
		background = "gfx/interface/illustrations/event_scenes/tournament_melee_duel_training.jpg"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = martial
			multiply = 2
			max = 50
			desc = court_position_skill_martial
		}
		add = {
			value = prowess
			multiply = 2
			max = 50
			desc = court_position_skill_prowess
		}
		if = {
			limit = { has_trait = lifestyle_blademaster }
			if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 15 desc = court_position_blademaster_3_trait }
			}
			else_if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 10 desc = court_position_blademaster_2_trait }
			}
			else = {
				add = { value = 5 desc = court_position_blademaster_1_trait }
			}
		}
		if = {
			limit = { has_trait = brave }
			add = { value = 10 desc = court_position_brave_trait }
		}
		if = {
			limit = { has_trait = order_member }
			add = { value = 10 desc = court_position_order_member_trait }
		}
		if = {
			limit = { has_trait = craven }
			add = { value = -20 desc = court_position_craven_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		NOT = { has_court_position = grandmaster_crimson_oath_court_position }
		NOT = { has_court_position = grandmaster_iron_bastion_court_position }
		custom_tooltip = {
			text = grandmaster_golden_lance_court_position_requirement_tt
			dlm_unlock_maa_chapter_lances = yes
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = { value = 0.3 }
		round = no
	}

	received_salary = {
		gold = { value = 0.3 }
		round = no
	}

	scaling_employer_modifiers = {
		terrible = { knight_effectiveness_mult = 0.02 }
		poor = { knight_effectiveness_mult = 0.04 }
		average = { knight_effectiveness_mult = 0.06 }
		good = { knight_effectiveness_mult = 0.08 }
		excellent = { knight_effectiveness_mult = 0.10 }
	}

	modifier = {
		monthly_martial_lifestyle_xp_gain_mult = 0.1
		knight_effectiveness_mult = 0.1
	}

	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

grandmaster_crimson_oath_court_position = {
	sort_order = 291
	max_available_positions = 1
	minimum_rank = county
	skill = martial

	court_position_asset = {
		animation = champion
		background = "gfx/interface/illustrations/event_scenes/tournament_melee_duel_training.jpg"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = martial
			multiply = 2
			max = 50
			desc = court_position_skill_martial
		}
		add = {
			value = prowess
			multiply = 2
			max = 50
			desc = court_position_skill_prowess
		}
		if = {
			limit = { has_trait = lifestyle_blademaster }
			if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 15 desc = court_position_blademaster_3_trait }
			}
			else_if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 10 desc = court_position_blademaster_2_trait }
			}
			else = {
				add = { value = 5 desc = court_position_blademaster_1_trait }
			}
		}
		if = {
			limit = { has_trait = brave }
			add = { value = 10 desc = court_position_brave_trait }
		}
		if = {
			limit = { has_trait = order_member }
			add = { value = 10 desc = court_position_order_member_trait }
		}
		if = {
			limit = { has_trait = craven }
			add = { value = -20 desc = court_position_craven_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		NOT = { has_court_position = grandmaster_golden_lance_court_position }
		NOT = { has_court_position = grandmaster_iron_bastion_court_position }
		custom_tooltip = {
			text = grandmaster_crimson_oath_court_position_requirement_tt
			dlm_unlock_maa_chapter_retainers = yes
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = { value = 0.3 }
		round = no
	}

	received_salary = {
		gold = { value = 0.3 }
		round = no
	}

	scaling_employer_modifiers = {
		terrible = { knight_effectiveness_mult = 0.02 }
		poor = { knight_effectiveness_mult = 0.04 }
		average = { knight_effectiveness_mult = 0.06 }
		good = { knight_effectiveness_mult = 0.08 }
		excellent = { knight_effectiveness_mult = 0.10 }
	}

	modifier = {
		monthly_martial_lifestyle_xp_gain_mult = 0.1
		knight_effectiveness_mult = 0.1
	}

	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}

grandmaster_iron_bastion_court_position = {
	sort_order = 290
	max_available_positions = 1
	minimum_rank = county
	skill = martial

	court_position_asset = {
		animation = champion
		background = "gfx/interface/illustrations/event_scenes/tournament_melee_duel_training.jpg"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 5
		add = {
			value = martial
			multiply = 2
			max = 50
			desc = court_position_skill_martial
		}
		add = {
			value = prowess
			multiply = 2
			max = 50
			desc = court_position_skill_prowess
		}
		if = {
			limit = { has_trait = lifestyle_blademaster }
			if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 15 desc = court_position_blademaster_3_trait }
			}
			else_if = {
				limit = { has_trait_xp = { trait = lifestyle_blademaster value >= 100 } }
				add = { value = 10 desc = court_position_blademaster_2_trait }
			}
			else = {
				add = { value = 5 desc = court_position_blademaster_1_trait }
			}
		}
		if = {
			limit = { has_trait = brave }
			add = { value = 10 desc = court_position_brave_trait }
		}
		if = {
			limit = { has_trait = order_member }
			add = { value = 10 desc = court_position_order_member_trait }
		}
		if = {
			limit = { has_trait = craven }
			add = { value = -20 desc = court_position_craven_trait }
		}
		add = general_aptitude_bonus
	}

	is_shown = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
			}
			always = no
		}
	}

	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		NOT = { has_court_position = grandmaster_golden_lance_court_position }
		NOT = { has_court_position = grandmaster_crimson_oath_court_position }
		custom_tooltip = {
			text = grandmaster_iron_bastion_court_position_requirement_tt
			dlm_unlock_maa_chapter_wardens = yes
		}
	}

	is_shown_character = {
		scope:employee = {
			court_position_employee_shown_trigger = yes
		}
	}

	valid_character = {
		scope:employee = {
			is_adult = yes
			is_imprisoned = no
			court_position_employee_shown_trigger = yes
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
		}
	}

	salary = {
		gold = { value = 0.3 }
		round = no
	}

	received_salary = {
		gold = { value = 0.3 }
		round = no
	}

	scaling_employer_modifiers = {
		terrible = { knight_effectiveness_mult = 0.02 }
		poor = { knight_effectiveness_mult = 0.04 }
		average = { knight_effectiveness_mult = 0.06 }
		good = { knight_effectiveness_mult = 0.08 }
		excellent = { knight_effectiveness_mult = 0.10 }
	}

	modifier = {
		monthly_martial_lifestyle_xp_gain_mult = 0.1
		knight_effectiveness_mult = 0.1
	}

	on_court_position_received = { basic_gained_court_position_effect = yes }
	on_court_position_revoked = { basic_revoked_court_position_effect = yes }
	on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

	ai_position_score = {
		value = 40
		add = court_position_debt_considerations_value
	}
	ai_candidate_score = {
		value = 100
		scope:employee = {
			if = {
				limit = { scope:highest_available_aptitude > scope:employee_aptitude }
				add = -125
			}
			add = {
				value = scope:employee_aptitude
				multiply = 4
			}
		}
		add = scope:base_value
		add = court_position_candidate_score_base_value
	}
}
