﻿court_physician_court_position = {
	sort_order = 399
	max_available_positions = 1
	skill = learning
	minimum_rank = barony

	court_position_asset = {
		animation = physician
		background = "gfx/interface/illustrations/event_scenes/study_physician.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	# How high the aptitude has to be to reach the 5 different modifier levels
	aptitude_level_breakpoints = { 20 40 60 80 }

	# How good is this character in this position? root scope is the holder of the court position
	aptitude = {
		value = 1
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = soon_forgiven_perk
				}
			}
			add = {
				value = 10
				desc = court_position_soon_forgiven_perk
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = friend }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_friend
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = lover }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_lover
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				is_married = yes
			}
			add = {
				value = 10
				desc = court_position_positions_of_power_perk_marriage
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_best_friend = prev
				}
			}
			add = {
				value = 30
				desc = court_position_best_friend
			}
		}
		else_if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_friend = prev
				}
			}
			add = {
				value = 15
				desc = court_position_friend
			}
		}
		add = court_position_aptitude_boon_voyager_trait
		# Skill
		add = {
			value = learning
			multiply = 1.75
			max = 50
			desc = court_position_skill_learning
		}
		# Physician
		if = {
			limit = { has_trait = lifestyle_physician }
			add = {
				value = 15
				if = {
					limit = {
						has_trait_xp = { trait = lifestyle_physician value >= 50 }
					}
					add = 15
				}
				if = {
					limit = {
						has_trait_xp = { trait = lifestyle_physician value >= 100 }
					}
					add = 15
				}
				desc = court_position_physician_1_trait
			}
		}
		# Mystic
		if = {
			limit = { has_trait = lifestyle_mystic }
			add = {
				value = 5
				if = {
					limit = {
						has_trait_xp = { trait = lifestyle_mystic value >= 50 }
					}
					add = 5
				}
				if = {
					limit = {
						has_trait_xp = { trait = lifestyle_mystic value >= 100 }
					}
					add = 5
				}
				desc = court_position_mystic_1_trait
			}
		}
		# Herbalist
		if = {
			limit = { has_trait = lifestyle_herbalist }
			add = {
				value = 15
				desc = court_position_herbalist_trait
			}
		}
		# Nomad Yurt
		if = {
			limit = {
				employer.domicile ?= {
					has_domicile_building_or_higher = physician_yurt_01
				}
			}
			add = {
				value = 0
				if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_physician_aptitude_lvl_4
						}
					}
					add = 32
				}
				else_if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_physician_aptitude_lvl_3
						}
					}
					add = 16
				}
				else_if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_physician_aptitude_lvl_2
						}
					}
					add = 8
				}
				else_if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_physician_aptitude_lvl_1
						}
					}
					add = 4
				}
				desc = physician_yurt_01_domicile_building
			}
		}
		# Education
		if = {
			limit = { has_trait = education_learning }
			add = {
				value = 4
				if = {
					limit = { has_trait = education_learning_2 }
					add = 4
				}
				else_if = {
					limit = { has_trait = education_learning_3 }
					add = 8
				}
				else_if = {
					limit = { has_trait = education_learning_4 }
					add = 12
				}
				else_if = {
					limit = { has_trait = education_learning_5 }
					add = 22
				}
				desc = education_learning
			}
		}
		if = {
			limit = {
				has_trait = blind
			}
			add = {
				value = -50
				desc = court_position_blind_trait
			}
		}
		if = {
			limit = {
				any_character_artifact = {
					has_artifact_modifier = artifact_physician_aptitude_1_modifier
				}
			}
			add = 20
		}
		add = court_position_aptitude_traveling_friends_value
		add = court_position_aptitude_family_business_value
		add = court_position_aptitude_low_penalty_value
		# Camp
		if = {
			limit = {
				employer.domicile ?= { has_domicile_parameter = camp_improved_court_physician_aptitude }
			}
			add = {
				value = camp_improved_court_physician_aptitude_value
				desc = camp_improved_court_physician_aptitude_desc
			}
		}
		# Estate
		if = {
			limit = {
				liege ?= {
					domicile ?= { has_domicile_parameter = estate_increase_physician_aptitude }
				}
			}
			add = {
				value = estate_increase_physician_aptitude_value
				desc = estate_increase_physician_aptitude_desc
			}
		}
		add = court_position_aptitude_eunuch_tradition_value
		# Bonus from court.8311
		if = {
			limit = { var:bonus_aptitude_role ?= flag:court_physician }
			add = {
				value = cp_bonus_aptitude_value
				desc = cp_bonus_aptitude
			}
		}
		# Seneschal
		if = {
			limit = {
				liege.court_position:seneschal_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:seneschal_court_position.seneschal_improve_court_value
				desc = seneschal_improve_court_aptitude_desc
			}
		}
		# Yeke Jarquchi
		if = {
			limit = {
				liege.court_position:yeke_jarquchi_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:yeke_jarquchi_court_position.yeke_jarquchi_improve_court_value
				desc = yeke_jarquchi_improve_court_aptitude_desc
			}
		}
	}

	is_shown = { }

	# Is this an available position for this court? (root is court owner)
	valid_position = { }

	is_shown_character = {
		scope:employee = {
			is_imprisoned = no
		}
	}


	valid_character = {
		valid_camp_officer_trigger = {
			OFFICER = court_physician
		}
	}

	revoke_cost = { # root is the liege, no other scopes are passed here!
		prestige =  {
			value = major_court_position_prestige_revoke_cost
			# Set to 0 via obligation hook
			if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = court_physician
						LIEGE = root
					}
				}
				multiply = 0
			}
			# Avoid AI prestige issues
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
			# Special case for events
			if = {
				limit = {
					exists = this
					has_character_flag = free_revoke_cost
				}
				multiply = 0
			}
			#Lowering for LAAMPS, to match Camp Officer revoke cost
			if = {
				limit = { 
					exists = this
					government_has_flag = government_is_landless_adventurer
				}
				value = minor_court_position_prestige_revoke_cost
			}
		}
	}

	salary = {
		gold = {
			value = court_position_physician_salary # Update X_salary_tooltip if script_value is changed
			# Set to 0 with Dynasty Perk Inner Circle
			if = {
				limit = { court_position_inner_circle_salary_trigger = { POS = court_physician } }
				multiply = {
					value = 0
					desc = inner_circle_salary_mod
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = court_physician
						LIEGE = scope:liege
					}
				}
				multiply = {
					value = 0.5
					desc = obligation_hook_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved salary
			if = {
				limit = {
					court_position_halved_salary_trigger = { POS = court_physician }
				}
				multiply = {
					value = 0.5
					desc = court_position_halved_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Increased salary
			if = {
				limit = {
					court_position_increased_salary_trigger = { POS = court_physician }
				}
				multiply = {
					value = 1.5
					desc = court_position_increased_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#You're working with LAAMPS now
			if = {
				limit = { 
					scope:liege ?= { government_has_flag = government_is_landless_adventurer }
				}
				multiply = {
					value = 0
					desc = court_position_laamps_free
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
		}
		round = no
	}

travel_leader_court_position = {
	sort_order = 375
	max_available_positions = 1
	is_travel_related = yes
	skill = stewardship

	court_position_asset = {
		animation = holding_staff
		background = "gfx/interface/illustrations/event_scenes/ep2_travel_mountains.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	# How high the aptitude has to be to reach the 5 different modifier levels
	aptitude_level_breakpoints = { 20 40 60 80 }

	minimum_rank = barony

	# How good is this character in this position? root scope is the holder of the court position
	aptitude = {
		value = 1
		add = court_position_aptitude_boon_voyager_trait
		add = {
			value = learning
			multiply = 1
			max = 50
			desc = court_position_skill_learning
		}
		add = {
			value = stewardship
			multiply = 1.3
			max = 50
			desc = court_position_skill_stewardship
		}
		if = {
			limit = {
				num_of_known_languages >= 2
			}
			add = {
				value = num_of_known_languages
				subtract = 1
				multiply = 5
				max = 50
				desc = court_position_languages
			}
		}

		# SPEED
		add = {
			value = travel_leader_speed
			multiply = 1.8
			subtract = 10
			min = 0
			desc = court_position_speed
		}

		# SAFETY
		add = {
			value = travel_leader_safety
			multiply = 1.8
			subtract = 10
			min = 0
			desc = court_position_safety
		}

		# POSITIVES
		if = {
			limit = {
				has_trait = adventurer
			}
			add = {
				value = 10
				desc = court_position_adventurer_trait
			}
		}
		if = {
			limit = {
				has_trait = brave
			}
			add = {
				value = 5
				desc = court_position_brave_trait
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_herbalist
			}
			add = {
				value = 5
				desc = court_position_herbalist_trait
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_hunter
			}
			add = {
				value = 5
				desc = court_position_hunter_1_trait
			}
		}
		if = {
			limit = {
				has_trait = diligent
			}
			add = {
				value = 5
				desc = court_position_diligent_trait
			}
		}
		if = {
			limit = {
				has_trait = flexible_leader
			}
			add = {
				value = 10
				desc = court_position_flexible_leader_trait
			}
		}
		if = {
			limit = {
				has_trait = forest_fighter
			}
			add = {
				value = 10
				desc = court_position_forest_fighter_trait
			}
		}
		if = {
			limit = {
				has_trait = open_terrain_expert
			}
			add = {
				value = 10
				desc = court_position_open_terrain_expert_trait
			}
		}
		if = {
			limit = {
				has_trait = rough_terrain_expert
			}
			add = {
				value = 10
				desc = court_position_rough_terrain_expert_trait
			}
		}
		if = {
			limit = {
				has_trait = desert_warrior
			}
			add = {
				value = 10
				desc = court_position_desert_warrior_trait
			}
		}
		if = {
			limit = {
				has_trait = jungle_stalker
			}
			add = {
				value = 10
				desc = court_position_jungle_stalker_trait
			}
		}
		if = {
			limit = {
				has_trait = winter_soldier
			}
			add = {
				value = 10
				desc = court_position_winter_soldier_trait
			}
		}
		if = {
			limit = {
				has_trait = administrator
			}
			add = {
				value = 5
				desc = court_position_administrator_trait
			}
		}
		if = {
			limit = {
				has_trait = scholar
			}
			add = {
				value = 5
				desc = court_position_scholar_trait
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_physician
			}
			add = {
				value = 5
				desc = court_position_physician_1_trait
			}
		}
		if = {
			limit = {
				has_trait_xp = {
					trait = lifestyle_traveler
					track = travel
					value >= 75
				}
			}
			add = {
				value = 40
				desc = court_position_traveler_trait_experienced
			}
		}
		else_if = {
			limit = {
				has_trait_xp = {
					trait = lifestyle_traveler
					track = danger
					value >= 75
				}
			}
			add = {
				value = 40
				desc = court_position_traveler_trait_experienced_danger
			}
		}
		else_if = {
			limit = {
				has_trait_xp = {
					trait = lifestyle_traveler
					track = travel
					value >= 50
				}
			}
			add = {
				value = 30
				desc = court_position_traveler_trait_experienced
			}
		}
		else_if = {
			limit = {
				has_trait_xp = {
					trait = lifestyle_traveler
					track = danger
					value >= 50
				}
			}
			add = {
				value = 30
				desc = court_position_traveler_trait_experienced_danger
			}
		}
		else_if = {
			limit = {
				has_trait = lifestyle_traveler
			}
			add = {
				value = 20
				desc = court_position_traveler_trait
			}
		}
		if = {
			limit = {
				has_character_modifier = ep2_beastmaster_modifier
			}
			add = {
				value = 30
				desc = court_position_beastmaster_modifier
			}
		}

		if = {
			limit = {
				has_perk = travel_companion_perk
			}
			add = {
				value = 15
				desc = court_position_travel_companion_modifier
			}
		}
		if = {
			limit = {
				liege ?= { has_perk = travel_companion_perk }
			}
			add = {
				value = 15
				desc = court_position_travel_companion_liege_modifier
			}
		}

		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = friend }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_friend
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = lover }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_lover
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				is_married = yes
			}
			add = {
				value = 10
				desc = court_position_positions_of_power_perk_marriage
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_best_friend = prev
				}
			}
			add = {
				value = 30
				desc = court_position_best_friend
			}
		}
		else_if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_friend = prev
				}
			}
			add = {
				value = 15
				desc = court_position_friend
			}
		}

		add = court_position_aptitude_traveling_friends_value


		# NEGATIVES
		if = {
			limit = {
				has_trait = craven
			}
			add = {
				value = -20
				desc = court_position_craven_trait
			}
		}
		if = {
			limit = {
				has_trait = lazy
			}
			add = {
				value = -10
				desc = court_position_lazy_trait
			}
		}
		if = {
			limit = {
				has_trait = clubfooted
			}
			add = {
				value = -30
				desc = court_position_clubfooted_trait
			}
		}
		if = {
			limit = {
				has_trait = blind
			}
			add = {
				value = -50
				desc = court_position_blind_trait
			}
		}
		if = {
			limit = {
				has_trait = incapable
			}
			multiply = {
				value = 0
				desc = court_position_incapable_trait
			}
		}
		if = {
			limit = {
				has_trait = infirm
			}
			add = {
				value = -50
				desc = court_position_infirm_trait
			}
		}
		if = {
			limit = {
				has_trait = maimed
			}
			add = {
				value = -30
				desc = court_position_maimed_trait
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_reveler
			}
			add = {
				value = -5
				desc = court_position_reveler_1_trait
			}
		}
		add = court_position_aptitude_traveling_friends_value
		add = court_position_aptitude_eunuch_tradition_value
		add = court_position_aptitude_family_business_value
		# Bonus from court.8311
		if = {
			limit = { var:bonus_aptitude_role ?= flag:travel_leader }
			add = {
				value = cp_bonus_aptitude_value
				desc = cp_bonus_aptitude
			}
		}
		# Seneschal
		if = {
			limit = {
				liege.court_position:seneschal_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:seneschal_court_position.seneschal_improve_court_value
				desc = seneschal_improve_court_aptitude_desc
			}
		}
		# Yeke Jarquchi
		if = {
			limit = {
				liege.court_position:yeke_jarquchi_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:yeke_jarquchi_court_position.yeke_jarquchi_improve_court_value
				desc = yeke_jarquchi_improve_court_aptitude_desc
			}
		}
		min = 0
	}

	is_shown = {
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier < tier_county
				NOT = { any_courtier = { is_ai = no } }
			}
			always = no
		}
	}

	# Is this an available position for this court? (root is court owner)
	valid_position = { }

	is_shown_character = {
		scope:employee = {
			is_imprisoned = no
			is_clergy = no
			bannable_serving_diarch_trigger = no
			NOT = { has_variable = gone_adventuring }
		}
	}

	valid_character = {
		valid_camp_officer_trigger = {
			OFFICER = travel_leader
		}
	}

	salary = {
		round = no
		gold = {
			value = court_position_travel_leader_salary # Update X_salary_tooltip if script_value is changed
			# Set to 0 with Dynasty Perk Inner Circle
			if = {
				limit = { court_position_inner_circle_salary_trigger = { POS = travel_leader } }
				multiply = {
					value = 0
					desc = inner_circle_salary_mod
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved with obligation hook
			else_if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = travel_leader
						LIEGE = scope:liege
					}
				}
				multiply = {
					value = 0.5
					desc = obligation_hook_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved salary
			if = {
				limit = {
					court_position_halved_salary_trigger = { POS = travel_leader }
				}
				multiply = {
					value = 0.5
					desc = court_position_halved_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Increased salary
			if = {
				limit = {
					court_position_increased_salary_trigger = { POS = travel_leader }
				}
				multiply = {
					value = 1.5
					desc = court_position_increased_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#You're working with LAAMPS now
			if = {
				limit = { 
					scope:liege ?= { government_has_flag = government_is_landless_adventurer }
				}
				multiply = {
					value = 0
					desc = court_position_laamps_free
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
		}
	}

	revoke_cost = { # root is the liege, no other scopes are passed here!
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			# Set to 0 via obligation hook
			if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = travel_leader
						LIEGE = root
					}
				}
				multiply = 0
			}
			# Avoid AI prestige issues
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
			# Special case for events
			if = {
				limit = {
					exists = this
					has_character_flag = free_revoke_cost
				}
				multiply = 0
			}
		}
	}

	# These modifiers are employed based on what level the aptitude reaches (levels are defined as breakpoints)
	scaling_employer_modifiers = {
		terrible = {
			monthly_wanderer_lifestyle_xp_gain_mult = 0.025
		}
		poor = {
			monthly_wanderer_lifestyle_xp_gain_mult = 0.05
		}
		average = {
			monthly_wanderer_lifestyle_xp_gain_mult = 0.075
		}
		good = {
			monthly_wanderer_lifestyle_xp_gain_mult = 0.15
		}
		excellent = {
			monthly_wanderer_lifestyle_xp_gain_mult = 0.25
		}
	}

	custom_employer_modifier_description = travel_leader_court_position_custom_desc

	modifier = {
		diplomacy = 1
		health = 0.1
	}

	on_court_position_received = {
		court_travel_leader_title_accepted_effect = yes
	}
	on_court_position_revoked = {
		court_travel_leader_title_revoked_effect = yes
	}
	on_court_position_invalidated = {
		court_travel_leader_title_invalidated_effect = yes
	}
	on_court_position_vacated = {
		court_position_vacated_event_effect = {
			COURT_POSITION_TYPE = travel_leader_court_position
		}
	}

	search_for_courtier = {
		send_interface_toast = {
			type = event_toast_effect_neutral
			title = hire_travel_leader_decision
			custom_tooltip = hire_travel_leader_decision_tooltip
		}

		trigger_event = {
			id = travel_events.1010
			days = 14
		}
	}

	# Scripted value to determine whether an AI will hire/fire a position or not. Hires over 0, fires under -50. Look in _court_positions.info for more extensive documentation!
	candidate_score = {
        value = 150
    	# Always have this position if you can, regardless of monetary situation
    	add = court_position_candidate_score_base_value
    	add = court_position_candidate_aptitude_value

		# No debt considerations for Travel Leaders, they are too important

        if = {
            limit = {
                exists = scope:firing_court_position
            }
            add = 200
            scope:employee = {
                # Does the liege have a better candidate that they should be hiring instead?
                if = {
                    limit = {
                        scope:highest_available_aptitude > scope:employee_aptitude
                    }
                    add = -150
                }
            }
        }

        if = { # To stop petitioned positions immediately being fired by the AI
			limit = {
				court_position_petition_ai_weight_trigger = { ROLE = travel_leader }
			}
			add = 1000
		}
    }
}

antiquarian_court_position = {
	sort_order = 350
	max_available_positions = 1
	skill = learning
	minimum_rank = barony

	court_position_asset = {
		animation = throne_room_one_handed_passive_3
		background = "gfx/interface/illustrations/event_scenes/armory.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	# How high the aptitude has to be to reach the 5 different modifier levels
	aptitude_level_breakpoints = { 20 40 60 80 }

	# How good is this character in this position? root scope is the holder of the court position
	aptitude = {
		value = 1
		add = court_position_aptitude_boon_voyager_trait
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = soon_forgiven_perk
				}
			}
			add = {
				value = 10
				desc = court_position_soon_forgiven_perk
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = friend }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_friend
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = lover }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_lover
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				is_married = yes
			}
			add = {
				value = 10
				desc = court_position_positions_of_power_perk_marriage
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_best_friend = prev
				}
			}
			add = {
				value = 30
				desc = court_position_best_friend
			}
		}
		else_if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = likable_perk
					has_relation_friend = prev
				}
			}
			add = {
				value = 15
				desc = court_position_friend
			}
		}
		add = {
			value = learning
			multiply = 2.5
			max = 60
			desc = court_position_skill_learning
		}
		if = { # Characters with a completed inspiration are very good Antiquarians
			limit = {
				has_completed_inspiration = yes
			}
			add = {
				value = 30
				desc = court_position_completed_inspiration
			}
		}
		if = { # Shy characters are likely to spend more time with the artifacts than other people
			limit = {
				has_trait = shy
			}
			add = {
				value = 15
				desc = court_position_shy_trait
			}
		}
		if = {
			limit = {
				has_trait = diligent
			}
			add = {
				value = 15
				desc = court_position_diligent_trait
			}
		}
		if = {
			limit = {
				has_trait = administrator
			}
			add = {
				value = 15
				desc = court_position_administrator_trait
			}
		}
		if = {
			limit = { has_trait = overseer }
			add = {
				value = 15
				desc = court_position_overseer_trait
			}
		}
		if = {
			limit = {
				has_variable = fund_inspiration_6508_architect_improvement
			}
			add = {
				value = 5
				desc = court_position_architect_study_experience
			}
		}
		if = {
			limit = {
				liege ?= {
					domicile ?= { has_domicile_parameter = estate_increase_antiquarian_aptitude }
				}
			}
			add = {
				value = estate_increase_antiquarian_aptitude_value
				desc = estate_increase_antiquarian_aptitude_desc
			}
		}
		add = court_position_aptitude_traveling_friends_value
		add = court_position_aptitude_eunuch_tradition_value
		add = court_position_aptitude_family_business_value
		add = court_position_aptitude_low_penalty_value
		# Bonus from court.8311
		if = {
			limit = { var:bonus_aptitude_role ?= flag:antiquarian }
			add = {
				value = cp_bonus_aptitude_value
				desc = cp_bonus_aptitude
			}
		}
		# Seneschal
		if = {
			limit = {
				liege.court_position:seneschal_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:seneschal_court_position.seneschal_improve_court_value
				desc = seneschal_improve_court_aptitude_desc
			}
		}
		# Yeke Jarquchi
		if = {
			limit = {
				liege.court_position:yeke_jarquchi_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:yeke_jarquchi_court_position.yeke_jarquchi_improve_court_value
				desc = yeke_jarquchi_improve_court_aptitude_desc
			}
		}
	}

	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
				NOT = { any_courtier = { is_ai = no } }
			}
			always = no
		}
	}

	# Is this an available position for this court? (root is court owner)
	valid_position = {
		OR = {
			is_landed_or_landless_administrative = yes
			government_has_flag = government_is_nomadic
		}
		trigger_if = {
			limit = {
				is_ai = yes
			}
			has_any_artifact = yes
		}
	}

	is_shown_character = {
		scope:employee = {
			is_imprisoned = no
		}
	}

	valid_character = {
		scope:employee = {
			antiquarian_validity_trigger = { EMPLOYER = scope:liege }
		}
	}

	revoke_cost = { # root is the liege, no other scopes are passed here!
		prestige =  {
			value = major_court_position_prestige_revoke_cost
			# Set to 0 via obligation hook
			if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = antiquarian
						LIEGE = root
					}
				}
				multiply = 0
			}
			# Avoid AI prestige issues
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
			# Special case for events
			if = {
				limit = {
					exists = this
					has_character_flag = free_revoke_cost
				}
				multiply = 0
			}
			#Lowering for LAAMPS, to match Camp Officer revoke cost
			if = {
				limit = {
					exists = this
					government_has_flag = government_is_landless_adventurer
				}
				value = minor_court_position_prestige_revoke_cost
			}
		}
	}

	salary = {
		round = no
		gold = {
			value = court_position_antiquarian_salary # Update X_salary_tooltip if script_value is changed
			# Set to 0 with Dynasty Perk Inner Circle
			if = {
				limit = { court_position_inner_circle_salary_trigger = { POS = antiquarian } }
				multiply = {
					value = 0
					desc = inner_circle_salary_mod
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved with obligation hook
			else_if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = antiquarian
						LIEGE = scope:liege
					}
				}
				multiply = {
					value = 0.5
					desc = obligation_hook_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved salary
			if = {
				limit = {
					court_position_halved_salary_trigger = { POS = antiquarian }
				}
				multiply = {
					value = 0.5
					desc = court_position_halved_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Increased salary
			if = {
				limit = {
					court_position_increased_salary_trigger = { POS = antiquarian }
				}
				multiply = {
					value = 1.5
					desc = court_position_increased_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#You're working with LAAMPS now
			if = {
				limit = { 
					scope:liege ?= { government_has_flag = government_is_landless_adventurer }
				}
				multiply = {
					value = 0
					desc = court_position_laamps_free
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
		}
	}

	# These modifiers are employed based on what level the aptitude reaches (levels are defined as breakpoints)
	scaling_employer_modifiers = {
		terrible = {
			artifact_decay_reduction_mult = -0.07
		}
		poor = {
			artifact_decay_reduction_mult = -0.11
		}
		average = {
			artifact_decay_reduction_mult = -0.17
		}
		good = {
			artifact_decay_reduction_mult = -0.25
		}
		excellent = {
			artifact_decay_reduction_mult = -0.35
		}
	}

	custom_employer_modifier_description = antiquarian_employer_custom_effect_description

	modifier = {
		stewardship = 2
		artifact_decay_reduction_mult = -0.2
	}

	on_court_position_received = {
		antiquarian_title_accepted_effect = yes
	}
	on_court_position_revoked = {
		antiquarian_title_revoked_effect = yes
	}
	on_court_position_invalidated = {
		antiquarian_title_invalidated_effect = yes
	}
	on_court_position_vacated = {
		court_position_vacated_event_effect = {
			COURT_POSITION_TYPE = antiquarian_court_position
		}
	}

	# Scripted value to determine whether an AI will hire/fire a position or not. Hires over 0, fires under -50. Look in _court_positions.info for more extensive documentation!
	candidate_score = {
		value = 50
		add = scope:base_value
		add = court_position_candidate_score_base_value
		add = court_position_candidate_aptitude_value
		if = {
			limit = {
				scope:liege = {
					government_allows = administrative
				}
			}
			add = 150
		}
		if = {
			limit = {
				scope:liege = {
					highest_held_title_tier >= tier_duchy
				}
			}
			add = 50
		}
		if = {
			limit = {
				scope:liege = {
					highest_held_title_tier >= tier_kingdom
				}
			}
			add = 50
		}
        if = {
            limit = {
                exists = scope:firing_court_position
            }
            add = 100
            scope:employee = {
                # Does the liege have a better candidate that they should be hiring instead?
                if = {
                    limit = {
                        scope:highest_available_aptitude > scope:employee_aptitude
                    }
                    add = -75
                }
            }
        }
        if = { # To stop petitioned positions immediately being fired by the AI
			limit = {
				court_position_petition_ai_weight_trigger = { ROLE = antiquarian }
			}
			add = 1000
		}
		add = court_position_debt_considerations_value
	}
}

bodyguard_court_position = { # EP1
	sort_order = {
		value = 131
		if = { # Lower for landless
			limit = {
				is_landed_or_landless_administrative = no
			}
			subtract = 101
		}
	}
	max_available_positions = 2

	skill = prowess
	minimum_rank = barony

	court_position_asset = {
		trigger = {
			culture = { has_cultural_pillar = heritage_mongolic }
		}
		animation = menacing
		background = "gfx/interface/illustrations/event_scenes/corridor.dds"
		localization_key = bodyguard_court_position_nomadic
	}

	court_position_asset = {
		animation = menacing
		background = "gfx/interface/illustrations/event_scenes/corridor.dds"
	}

	opinion = {
		value = regular_court_position_opinion
	}

	# How high the aptitude has to be to reach the 5 different modifier levels
	aptitude_level_breakpoints = { 20 40 60 80 }

	# How good is this character in this position? root scope is the holder of the court position
	aptitude = {
		value = 1
		add = court_position_aptitude_boon_voyager_trait
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = soon_forgiven_perk
				}
			}
			add = {
				value = 10
				desc = court_position_soon_forgiven_perk
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = friend }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_friend
			}
		}
		# Nomad Yurt
		if = {
			limit = {
				employer.domicile ?= {
					has_domicile_building_or_higher = bodyguard_yurt_01
				}
			}
			add = {
				value = 0
				if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_bodyguard_aptitude_lvl_3
						}
					}
					add = 30
				}
				else_if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_bodyguard_aptitude_lvl_2
						}
					}
					add = 20
				}
				else_if = {
					limit = {
						employer.domicile ?= {
							has_domicile_parameter = nomad_yurt_increased_bodyguard_aptitude_lvl_1
						}
					}
					add = 10
				}
				desc = bodyguard_yurt_01_domicile_building
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				any_relation = { type = lover }
			}
			add = {
				value = 5
				desc = court_position_positions_of_power_perk_lover
			}
		}
		if = {
			limit = {
				employer ?= {
					government_has_flag = government_is_landless_adventurer
					has_perk = positions_of_power_perk
				}
				is_married = yes
			}
			add = {
				value = 10
				desc = court_position_positions_of_power_perk_marriage
			}
		}
		add = {
			value = prowess
			multiply = 4
			max = 50
			desc = court_position_skill_prowess
		}
		if = {
			limit = {
				has_trait = shieldmaiden
			}
			add = {
				value = 20
				desc = court_position_shieldmaiden_trait
			}
		}
		if = {
			limit = {
				has_trait = lifestyle_blademaster
				has_trait_xp = {
					trait = lifestyle_blademaster
					value >= 100
				}
			}
			add = {
				value = 15
				desc = court_position_blademaster_3_trait
			}
		}
		else_if = {
			limit = {
				has_trait = lifestyle_blademaster
				has_trait_xp = {
					trait = lifestyle_blademaster
					value >= 50
				}
			}
			add = {
				value = 10
				desc = court_position_blademaster_2_trait
			}
		}
		else_if = {
			limit = {
				has_trait = lifestyle_blademaster
			}
			add = {
				value = 5
				desc = court_position_blademaster_1_trait
			}
		}
		if = {
			limit = {
				has_trait = gallant
			}
			add = {
				value = 5
				desc = court_position_gallant_trait
			}
		}
		if = {
			limit = {
				has_trait = brave
			}
			add = {
				value = 20
				desc = court_position_brave_trait
			}
		}
		if = {
			limit = {
				has_trait = paranoid
			}
			add = {
				value = 10
				desc = court_position_paranoid_trait
			}
		}
		if = {
			limit = {
				has_trait = craven
			}
			add = {
				value = -15
				desc = court_position_craven_trait
			}
		}
		add = court_position_aptitude_traveling_friends_value
		if = {
			limit = {
				has_trait = varangian
				employer ?= {
					has_title = title:e_byzantium
					employs_court_position = akolouthos_court_position
				}
			}
			add = {
				value = 5
				multiply = employer.court_position:akolouthos_court_position.aptitude:akolouthos_court_position
				desc = court_position_akolouthos_bonus
			}
		}
		if = {
			limit = {
				employer ?= {
					culture = {
						has_cultural_parameter = reduced_bodyguard_aptitude
					}
				}
			}
			add = {
				value = -10
				desc = court_position_palace_politics
			}
		}
		#Pick _one_
		if = {
			limit = {
				employer ?= { has_relation_soulmate = prev } #The considered character
			}
			add = {
				value = 40
				desc = court_position_soulmate
			}
		}
		else_if = {
			limit = {
				employer ?= { has_relation_best_friend = prev } #The considered character
			}
			add = {
				value = 30
				desc = court_position_best_friend
			}
		}
		else_if = {
			limit = {
				employer ?= { has_relation_friend = prev } #The considered character
			}
			add = {
				value = 15
				desc = court_position_friend
			}
		}
		if = {
			limit = {
				has_character_flag = best_knight_position
			}
			add = {
				value = 20
				desc = best_knight_position_desc
			}
		}
		if = {
			limit = {
				has_character_flag = competing_knight_position
				OR = {
					any_court_position_holder = {
						type = bodyguard_court_position
						has_character_flag = competing_knight_position
						NOT = { this = prev }
					}
					any_court_position_holder = {
						type = champion_court_position
						has_character_flag = competing_knight_position
					}
					any_court_position_holder = {
						type = akolouthos_court_position
						has_character_flag = competing_knight_position
					}
				}
			}
			add = 30
			desc = competing_knight_position_desc
		}
		# Estate bonus
		if = {
			limit = {
				liege ?= {
					domicile ?= { has_domicile_parameter = estate_increase_bodyguard_aptitude_1 }
				}
			}
			add = {
				value = estate_increase_bodyguard_aptitude_1_value
				desc = estate_increase_bodyguard_aptitude_desc
			}
		}
		if = {
			limit = {
				liege ?= {
					domicile ?= { has_domicile_parameter = estate_increase_bodyguard_aptitude_2 }
				}
			}
			add = {
				value = estate_increase_bodyguard_aptitude_2_value
				desc = estate_increase_bodyguard_aptitude_desc
			}
		}

		if = {
			limit = {
				has_perk = praetorian_guard_perk
			}
			add = {
				value = 15
				desc = court_position_bodyguard_modifier
			}
		}
		if = {
			limit = {
				liege ?= { has_perk = praetorian_guard_perk }
			}
			add = {
				value = 15
				desc = court_position_bodyguard_liege_modifier
			}
		}
		
		if = { # Cherbi / Chief Bodyguard bonus
			limit = {
				exists = liege.court_position:cherbi_court_position
			}
			switch = {
				trigger = "liege.court_position:cherbi_court_position.aptitude(cherbi_court_position)"
				1 = { 
					add = {
						value = 1 
						desc = court_position_bodyguard_cherbi_modifier
					}
				}
				2 = {
					add = {
						value = 4
						desc = court_position_bodyguard_cherbi_modifier
					}
				}
				3 = { 
					add = {
						value = 7
						desc = court_position_bodyguard_cherbi_modifier
					}
				}
				4 = {
					add = {
						value = 10
						desc = court_position_bodyguard_cherbi_modifier
					}
				}
				5 = {
					add = {
						value = 15
						desc = court_position_bodyguard_cherbi_modifier
					}
				}
			}
		}
		add = court_position_aptitude_eunuch_tradition_value
		add = court_position_aptitude_family_business_value
		add = court_position_aptitude_high_penalty_value
		# Bonus from court.8311
		if = {
			limit = { var:bonus_aptitude_role ?= flag:bodyguard }
			add = {
				value = cp_bonus_aptitude_value
				desc = cp_bonus_aptitude
			}
		}
		# Seneschal
		if = {
			limit = {
				liege.court_position:seneschal_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:seneschal_court_position.seneschal_improve_court_value
				desc = seneschal_improve_court_aptitude_desc
			}
		}
		# Yeke Jarquchi
		if = {
			limit = {
				liege.court_position:yeke_jarquchi_court_position ?= {
					has_variable = performing_improve_court
				}
			}
			add = {
				value = liege.court_position:yeke_jarquchi_court_position.yeke_jarquchi_improve_court_value
				desc = yeke_jarquchi_improve_court_aptitude_desc
			}
		}
	}

	is_shown = {
		has_ep1_court_positions_dlc_trigger = yes
		trigger_if = {
			limit = {
				is_ai = yes
				highest_held_title_tier <= tier_county
				NOT = { any_courtier = { is_ai = no } }
			}
			always = no
		}
	}

	valid_position = {
		trigger_if = {
			limit = {
				government_has_flag = government_is_nomadic
			}
			domicile ?= {
				has_domicile_building_or_higher = character_warfare_yurt_01
			}
		}
	}

	is_shown_character = {
		scope:employee = {
			is_imprisoned = no
		}
	}

	valid_character = {
		valid_camp_officer_trigger = {
			OFFICER = bodyguard
		}
	}

	revoke_cost = { # root is the liege, no other scopes are passed here!
		prestige =  {
			value = major_court_position_prestige_revoke_cost
			# Set to 0 via obligation hook
			if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = bodyguard
						LIEGE = root
					}
				}
				multiply = 0
			}
			# Avoid AI prestige issues
			if = {
				limit = {
					exists = this
					is_ai = yes
				}
				multiply = 0
			}
			# Special case for events
			if = {
				limit = {
					exists = this
					has_character_flag = free_revoke_cost
				}
				multiply = 0
			}
			#Lowering for LAAMPS, to match Camp Officer revoke cost
			if = {
				limit = { 
					exists = this
					government_has_flag = government_is_landless_adventurer
				}
				value = minor_court_position_prestige_revoke_cost
			}
		}
	}

	salary = {
		round = no
		gold = {
			value = minor_court_position_salary # Update X_salary_tooltip if script_value is changed
			# Set to 0 with Dynasty Perk Inner Circle
			if = {
				limit = { court_position_inner_circle_salary_trigger = { POS = bodyguard } }
				multiply = {
					value = 0
					desc = inner_circle_salary_mod
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved via obligation hook
			else_if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = bodyguard
						LIEGE = scope:liege
					}
				}
				multiply = {
					value = 0.5
					desc = obligation_hook_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#Set to 0 with our psycho bodyguard from travel_events.2040
			if = {
				limit = {
					scope:liege = {
						employs_court_position = bodyguard_court_position
						any_court_position_holder = {
					        type = bodyguard_court_position
					        has_variable = insane_bodyguard
						}
					}
				}
				multiply = {
					value = 0
					desc = insane_bodyguard_salary_mod
				}
			}
			# Halved salary
			if = {
				limit = {
					court_position_halved_salary_trigger = { POS = bodyguard }
				}
				multiply = {
					value = 0.5
					desc = court_position_halved_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Increased salary
			if = {
				limit = {
					court_position_increased_salary_trigger = { POS = bodyguard }
				}
				multiply = {
					value = 1.5
					desc = court_position_increased_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#You're working with LAAMPS now
			if = {
				limit = { 
					scope:liege ?= { government_has_flag = government_is_landless_adventurer }
				}
				multiply = {
					value = 0
					desc = court_position_laamps_free
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
		}
		prestige = {
			value = medium_court_position_prestige_salary # Update X_salary_tooltip if script_value is changed
			# Set to 0 with Dynasty Perk Inner Circle
			if = {
				limit = { court_position_inner_circle_salary_trigger = { POS = bodyguard } }
				multiply = {
					value = 0
					desc = inner_circle_salary_mod
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Halved via obligation hook
			else_if = {
				limit = {
					court_position_obligation_hook_salary_trigger = {
						POS = bodyguard
						LIEGE = scope:liege
					}
				}
				multiply = {
					value = 0.5
					desc = obligation_hook_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#Set to 0 with our psycho bodyguard from travel_events.2040
			if = {
				limit = {
					scope:liege = {
						employs_court_position = bodyguard_court_position
						any_court_position_holder = {
					        type = bodyguard_court_position
					        has_variable = insane_bodyguard
						}
					}
				}
				multiply = {
					value = 0
					desc = insane_bodyguard_salary_mod
				}
			}
			# Halved salary
			if = {
				limit = {
					court_position_halved_salary_trigger = { POS = bodyguard }
				}
				multiply = {
					value = 0.5
					desc = court_position_halved_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			# Increased salary
			if = {
				limit = {
					court_position_increased_salary_trigger = { POS = bodyguard }
				}
				multiply = {
					value = 1.5
					desc = court_position_increased_salary
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
			#You're working with LAAMPS now
			if = {
				limit = { 
					scope:liege ?= { government_has_flag = government_is_landless_adventurer }
				}
				multiply = {
					value = 0
					desc = court_position_laamps_free
					format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
				}
			}
		}
	}

	is_powerful_agent = yes

	# These modifiers are employed based on what level the aptitude reaches (levels are defined as breakpoints)
	scaling_employer_modifiers = {
		terrible = {
			enemy_hostile_scheme_success_chance_max_add = -1
		}
		poor = {
			enemy_hostile_scheme_success_chance_max_add = -2
		}
		average = {
			enemy_hostile_scheme_success_chance_max_add = -5
		}
		good = {
			enemy_hostile_scheme_success_chance_max_add = -7
		}
		excellent = {
			enemy_hostile_scheme_success_chance_max_add = -10
		}
	}

	custom_employer_modifier_description = bodyguard_employer_custom_effect_description

	modifier = {
		dread_baseline_add = 10
		intrigue = 1
		enemy_hostile_scheme_success_chance_max_add = -10
	}

	on_court_position_received = {
		bodyguard_title_accepted_effect = yes
	}
	on_court_position_revoked = {
		bodyguard_title_revoked_effect = yes
	}
	on_court_position_invalidated = {
		bodyguard_title_invalidated_effect = yes
	}
	on_court_position_vacated = {
		court_position_vacated_event_effect = {
			COURT_POSITION_TYPE = bodyguard_court_position
		}
	}
	# Scripted value to determine whether an AI will hire/fire a position or not. Hires over 0, fires under -50. Look in _court_positions.info for more extensive documentation!
	candidate_score = {
		value = 50
		add = scope:base_value
		add = court_position_candidate_score_base_value
		add = court_position_candidate_aptitude_value

		#counter the base_value for landless adventurers, as it assumes you would have a monthly income, don't worry court position don't have salary when hired by landless adventurers
    	if = {
    		limit = {
    			scope:liege = {
    				government_has_flag = government_is_landless_adventurer
    			}
    		}
    		add = {
    			value = scope:base_value
    			multiply = -1
    		}
    	}

		scope:liege = {
			# More likely if you're scared all the time
			if = {
				limit = {
					has_trait = paranoid
				}
				add = 50
			}

			# Less likely to hire an additional one if you're already employing one
			if = {
				limit = {
					employs_court_position = bodyguard_court_position
				}
				add = -50
			}
		}
		if = { # To stop petitioned positions immediately being fired by the AI
			limit = {
				court_position_petition_ai_weight_trigger = { ROLE = bodyguard }
			}
			add = 1000
		}
		add = court_position_debt_considerations_value
	}
}
}