﻿guest_management = {
	# Can this character visit a specific court? Each ruler with free guest slots checks this once a month for each local pool character.
	# root, scope:guest = the potential guest
	# scope:host = the potential host
	guest_can_arrive = {
		any_traveling_family_member = { # the whole family must be allowed to arrive
			count = all
			guest_allowed_to_arrive_trigger = { HOST = scope:host }
		}
		#If claimant, make sure that they don't have a claim on the new host.
		trigger_if = {
			limit = { is_claimant = yes }
			any_claim = {
				courtier_or_guest_claim_trigger = { RULER = scope:host }
			}
		}
	}

	# If guest_can_arrive is true, the host decides which guests arrive using this weight. Will randomly select a few of the best candidates.
	# root, scope:guest = the potential guest
	# scope:host = the potential host
	guest_score = {
		base = 100
		
		###GENERAL WEIGHTS###
		
		modifier = {
			NOT = {
				culture = scope:host.culture
			}
			add = -20
		}
		modifier = {
			NOT = { faith = scope:host.faith }
			add = -30
		}
		modifier = { #ADDED
			is_lowborn = no
			add = 150
		}
		modifier = { #ADDED
			culture = scope:host.culture
			add = 40
		}
		modifier = { #ADDED
			faith = scope:host.faith
			add = 60
		}
		modifier = {
			is_adult = no
			add = 150 #CHANGED
		}
		modifier = {
			age >= 65
			add = -50
		}
		modifier = {
			scope:host = { has_imprisonment_reason = scope:guest }
			NOT = {
				reverse_opinion = {
					target = scope:host
					value >= medium_positive_opinion
				}
				OR = {
					has_relation_friend = scope:host
					has_relation_lover = scope:host
					is_close_or_extended_family_of = scope:host
					AND = {
						exists = dynasty
						dynasty = scope:host.dynasty
					}
				}
			}
			add = -1000
		}


		###CLAIMANTS###
		#Max: 2000 (6000 with perk)
		modifier = { #Best useful claim is county
			any_claim = {
				useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
			}
			add = {
				if = {
					limit = {
						any_claim = {
							useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
							tier >= tier_kingdom
						}
					}
					add = 2000
				}
				else_if = {
					limit = {
						any_claim = {
							useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
							tier >= tier_duchy
						}
					}
					add = 1500
				}
				else = {
					add = 1000
				}
				if = { #Invitation decision bonus
					limit = { scope:host = { has_character_flag = invite_claimants_decision_active } }
					multiply = 2
				}
				if = {
					limit = {
						exists = scope:host.dynasty
						scope:host.dynasty = {
							has_dynasty_perk = erudition_legacy_1
						}
					}
					multiply = 3
				}
			}
		}


		###MARRIAGE CANDIDATES###
		#Max: 2000 (+300 extra opinion bonus max from general weights section)
		modifier = {
			guest_marriage_candidate_trigger = yes
			add = {
				add = 0
				#Genetic traits
				if = {
					limit = {  num_of_good_genetic_traits >= 1  }
					if = {
						limit = { num_of_good_genetic_traits = 1 }
						add = 250
					}
					else_if = {
						limit = { num_of_good_genetic_traits = 2 }
						add = 250
					}
					else = {
						add = 300
					}
				}

				#Dynasty
				if = {
					limit = { exists = dynasty }
					add = {
						value = dynasty.dynasty_prestige_level #0-10
						max = {
							value = scope:host.dynasty.dynasty_prestige_level
							add = 3
						}
						multiply = 150 #Max 750
					}
				}

				#Fertility
				if = {
					limit = { fertility >= high_fertility }
					add = 200
				}

				#Claims
				if = {
					limit = { has_useful_potential_spouse_claim_trigger = { RULER = scope:host } } #Claims, no matter their level, as long as they're strong
					add = 1000
				}
			}
		}

		###COMMANDER CANDIDATES###
		#Max: 500
		compare_modifier = {
			trigger = { guest_commander_candidate_trigger = { HOST = scope:host } }
			value = martial
			multiplier = 17.5
			max = 350
		}
		modifier = {
			guest_commander_candidate_trigger = { HOST = scope:host }
			number_of_commander_traits >= 1
			add = {
				if = {
					limit = { number_of_commander_traits = 1 }
					add = 100
				}
				else_if = {
					limit = { number_of_commander_traits = 2 }
					add = 125
				}
				else = {
					add = 150
				}
			}
		}


		###VASSAL CANDIDATES###
		#Max: 500 (+150 extra opinion bonus max from general weights section)
		modifier = {
			guest_vassal_candidate_trigger = yes
			add = {
				if = {
					limit = { guest_vassal_candidate_good_traits_trigger = yes } #Gives +opinion of liege
					add = 100
				}
				if = {
					limit = { domain_size > domain_limit }
					add = 100
				}
				add = {
					value = stewardship
					multiply = 7.5
					max = 150
				}
				add = {
					value = martial
					multiply = 7.5
					max = 150
				}
			}
		}



		###KNIGHT CANDIDATES###
		#Max: 300 (600 with perk)
		modifier = {
			trigger = {
				guest_knight_candidate_trigger = { HOST = root }
			}
			add = {
				value = prowess
				multiply = 15
				max = 300
				if = { #Invitation decision bonus
					limit = { scope:host = { has_character_flag = invite_knights_decision_active } }
					multiply = 1.5
				}
				if = {
					limit = {
						exists = scope:host.dynasty
						scope:host.dynasty = {
							has_dynasty_perk = erudition_legacy_1
						}
					}
					multiply = 2
				}
				if = {
					limit = {
						prowess >= high_skill_rating
						NOT = { culture = scope:host.culture }
						scope:host.culture = { has_cultural_parameter = powerful_foreign_knights_find_you_attractive }
					}
					# Oh yeah, you're gonna get you a Cid.
					multiply = 4
				}
			}
		}

		###COURT PHYSICIAN CANDIDATES###
		#Max: 200
		compare_modifier = {
			trigger = { guest_physician_candidate_trigger = yes }
			value = learning
			multiplier = 5
			max = 100
		}
		modifier = {
			guest_physician_candidate_trigger = yes
			OR = {
				has_trait = lifestyle_mystic
				has_trait = lifestyle_physician
				has_trait = lifestyle_herbalist
			}
			add = 100
		}


		###RELATIONS###
		#Max: 3500 (if you have an obscenely strong connection to them)
		modifier = {
			exists = dynasty
			dynasty = scope:host.dynasty
			NOT = { is_close_or_extended_family_of = scope:host }
			add = 1000
		}
		modifier = {
			is_extended_family_of = scope:host
			add = 2000
		}
		modifier = {
			is_close_family_of = scope:host
			add = 2500
		}
		modifier = {
			is_child_of = scope:host
			add = 5000
		}
		modifier = {
			has_relation_friend = scope:host
			add = 1000
		}
		modifier = {
			has_relation_best_friend = scope:host
			add = 2000
		}
		modifier = {
			has_relation_lover = scope:host
			add = 2000
		}
		modifier = {
			has_relation_soulmate = scope:host
			add = 4000
		}
		modifier = {
			has_relation_ward = scope:host
			add = 2000
		}
		modifier = {
			has_relation_guardian = scope:host
			add = 2000
		}
		modifier = { #The enemy of my enemy...
			any_relation = {
				type = rival
				any_relation = {
					type = rival
					this = scope:host
				}
			}
			add = 600
		}


		###INTERESTING CHARACTERS### (player only)
		#Between 50 and 200 per interesting aspect
		modifier = {
			scope:host = { is_ai = no }
			add = {
				value = 0
				#SECRETS
				if = {
					limit = {
						any_secret = {
							NOT = { is_known_by = scope:host }
						}
					}
					add = 200
				}
				#LIFESTYLE TRAITS
				if = {
					limit = { has_trait = lifestyle_reveler }
					add = 50
				}
				if = {
					limit = { has_trait = seducer }
					add = 50
				}
				if = {
					limit = { has_trait = lifestyle_blademaster }
					add = 50
				}
				if = {
					limit = { has_trait = lifestyle_hunter }
					add = 50
				}
				if = {
					limit = {
						guest_physician_candidate_trigger = no #No double herbalist bonus
						has_trait = lifestyle_herbalist
					}
					add = 50
				}
				if = {
					limit = { has_trait = torturer }
					add = 50
				}
				if = {
					limit = { has_trait = gallant }
					add = 50
				}
				#CRIME/SHUNNED TRAITS
				if = {
					limit = {
						has_trait = deviant
						NOT = { trait_is_criminal_in_faith_trigger = { TRAIT = deviant FAITH = scope:host.faith GENDER_CHARACTER = scope:guest } }
					}
					add = 50
				}
				if = {
					limit = {
						has_trait = cannibal
						NOT = { trait_is_criminal_in_faith_trigger = { TRAIT = cannibal FAITH = scope:host.faith GENDER_CHARACTER = scope:guest } }
					}
					add = 50
				}
				if = {
					limit = {
						has_trait = witch
						NOT = { trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = scope:host.faith GENDER_CHARACTER = scope:guest } }
					}
					add = 50
				}
				if = {
					limit = {
						is_witch_trigger = yes
						scope:host = { is_witch_trigger = yes }
					}
					add = 200
				}
				#MISC TRAITS
				if = {
					limit = {
						OR = {
							has_trait = lunatic
							has_trait = possessed
						}
					}
					add = 200
				}
				if = {
					limit = { has_a_stress_coping_trait_trigger = yes }
					add = 50
				}
				if = {
					limit = { has_interesting_portrait_altering_trait_trigger = yes }
					add = 50
				}
			}
		}


		###SKILLS###
		#All skills 10: 150
		#Max: 300
		compare_modifier = {
			trigger = { diplomacy >= mediocre_skill_rating }
			value = diplomacy
			multiplier = 3
			max = 60
		}
		compare_modifier = {
			trigger = {
				martial >= mediocre_skill_rating
				NOR = { #no double martial bonus
					NOT = { guest_commander_candidate_trigger = { HOST = scope:host } }
					guest_vassal_candidate_trigger = no
				}
			}
			value = martial
			multiplier = 3
			max = 60
		}
		compare_modifier = {
			trigger = {
				stewardship >= mediocre_skill_rating
				guest_vassal_candidate_trigger = no #no double stewardship bonus
			}
			value = stewardship
			multiplier = 3
			max = 60
		}
		compare_modifier = {
			trigger = { intrigue >= mediocre_skill_rating }
			value = intrigue
			multiplier = 3
			max = 60
		}
		compare_modifier = {
			trigger = {
				learning >= mediocre_skill_rating
				guest_physician_candidate_trigger = no #no double learning bonus
			}
			value = learning
			multiplier = 3
			max = 60
		}


		###MALE/FEMALE BALANCE###
		#Max = 200
		modifier = {
			guest_male_female_balance_trigger = yes
			scope:host.faith = { has_dominant_ruling_gender = scope:guest }
			add = 75
		}
		modifier = {
			guest_male_female_balance_trigger = yes
			NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:host } }  #Can't be commander/knight
			add = 125
		}

		min = 0
		#Max value is increased with tiers, to make it less likely for low tier rulers to get great characters
		max = {
			value = { #Yes double value is the way (for script math)
				value = 0 #Roughly the highest value for all general categories + the most expensive role category maxed
				if = {
					limit = { scope:host = { highest_held_title_tier = tier_empire } }
					add = 3000
				}
				else_if = {
					limit = { scope:host = { highest_held_title_tier = tier_kingdom } }
					add = 2500
				}
				else_if = {
					limit = { scope:host = { highest_held_title_tier = tier_duchy } }
					add = 1500
				}
				else_if = {
					limit = { scope:host = { highest_held_title_tier = tier_county } }
					add = 500
				}
			}
		}
	}

	# Can a guest leave the court? Checked once a year for each ruler.
	# root, scope:guest = the guest
	# scope:host = their host
	can_leave = {
		any_traveling_family_member = {
			count = all
			guest_allowed_to_leave_trigger = yes
		}
	}

	# Chance that the guest decides to leave in ‰ (= 10 x the likelihood in %). While can_leave is true this is evaluated every month.
	#We strive to keep this value around 50 (min 20 max 100). Guests should have an average chance of leaving each month of 5%. This equals a ~50% chance of leaving after 1 year (once they have passed their minimum visit time and as long as they're allowed to leave)
	# root, scope:guest = the guest
	# scope:host = their host
	monthly_leave_chance_x10 = {
		base = 50

		#Claimants wants to stay and have claims pressed
		modifier = {
			any_claim = {
				useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
			}
			add = -50
		}

		#Energetic characters are more likely to move, lazy characters less likely
		ai_energy_target_modifier = { VALUE = -20 }
		

		#More likely to stay if they like host, less likely if they dislike host
		opinion_modifier = {
			opinion_target = scope:host
			multiplier = -0.2
			min = -15
			max = 15
		}
		modifier = {
			has_relation_friend = scope:host
			add = -25
		}
		modifier = {
			has_relation_lover = scope:host
			add = -25
		}
		modifier = {
			is_close_family_of = scope:host
			add = -25
		}
		modifier = {
			is_child_of = scope:host
			add = -100
		}
		modifier = {
			has_relation_rival = scope:host
			add = 30
		}

		#Pregnant women don't want to travel
		modifier = {
			has_trait = pregnant
			add = -50
		}

		#Unhealthy characters don't want to travel
		modifier = {
			health <= poor_health
			add = -20
		}

		#Married people are less likely to move (because spouse also does calculations)
		modifier = {
			exists = primary_spouse
			primary_spouse = { is_pool_guest_of = scope:host }
			add = -25
		}

		#Lodging amenities encourage guests to stay longer
		modifier = {
			add = {		
				if = {
					limit = {
						scope:host = { has_royal_court = yes has_dlc_feature = royal_court }
					}
					if = {
						limit = {
							scope:host = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = medium_amenity_level }
								}
							}
						}
						add = -5
					}
					else_if = {
						limit = {
							scope:host = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = high_amenity_level }
								}
							}
						}
						add = -10
					}
					else_if = {
						limit = {
							scope:host = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = very_high_amenity_level }
								}
							}
						}
						add = -15
					}
					else_if = {
						limit = {
							scope:host = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = max_amenity_level }
								}
							}
						}
						add = -20
					}
				}
			}
		}

		# Capping min and max to avoid extreme values
		min = {
			value = {
			#Lodging affects the min value
				add = 20
				scope:host = {
					if = {
						limit = {
							has_royal_court = yes
							has_dlc_feature = royal_court
						}
						if = {
							limit = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = medium_amenity_level }
								}
							}
							add = -4
						}
						else_if = {
							limit = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = high_amenity_level }
								}
							}
							add = -6
						}
						else_if = {
							limit = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = very_high_amenity_level }
								}
							}
							add = -8
						}
						else_if = {
							limit = {
								court_owner = {
									amenity_level = { type = court_lodging_standards value = max_amenity_level }
								}
							}
							add = -10
						}
					}
				}
			}
		}
		max = {
			value = {
				add = 100
				if = {
					limit = { is_adult = no }
					multiply = 0 #Children shouldn't try to leave on their own
				}
				#Lodging affects the max value
				add = {
					scope:host = {
						if = {
							limit = {
								has_royal_court = yes
								has_dlc_feature = royal_court
							}
							if = {
								limit = {
									court_owner = {
										amenity_level = { type = court_lodging_standards value = medium_amenity_level }
									}
								}
								subtract = 4
							}
							else_if = {
								limit = {
									court_owner = {
										amenity_level = { type = court_lodging_standards value = high_amenity_level }
									}
								}
								subtract = 6
							}
							else_if = {
								limit = {
									court_owner = {
										amenity_level = { type = court_lodging_standards value = very_high_amenity_level }
									}
								}
								subtract = 8
							}
							else_if = {
								limit = {
									court_owner = {
										amenity_level = { type = court_lodging_standards value = max_amenity_level }
									}
								}
								subtract = 10
							}
						}
					}
				}
			}
		}
	}

	# Description shown to the player's pool guests to indicate what they could be useful for.
	# The first entry with a valid limit and the highest weight will be shown. If no entry is valid, nothing will be shown.
	# Syntax:
	# guest_description = {
	#	 description = {
	#		 limit = {}	# trigger, default: always = yes	root/scope:guest = the guest, scope:host = the host
	#		 weight = {}	# MTTH, default: base = 1			root/scope:guest = the guest, scope:host = the host
	#		 desc = {}		# dynamic description				root/scope:guest = the guest, scope:host = the host
	#	 }
	#	 description = { ... }
	# }
	guest_description = {

		###Claims###
		description = {
			limit = { any_claim = { useful_courtier_or_guest_claim_trigger = { RULER = scope:host } } }
			weight = {
				base = 1000
			}
			desc = {
				desc = guest_description.claim_start.desc
				first_valid = {
					triggered_desc = {
						trigger = {
							any_claim = {
								useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
								tier = tier_kingdom
							}
						}
						desc = guest_description.kingdom_claim.desc
					}
					triggered_desc = {
						trigger = {
							any_claim = {
								useful_courtier_or_guest_claim_trigger = { RULER = scope:host }
								tier = tier_duchy
							}
						}
						desc = guest_description.duchy_claim.desc
					}
					desc = guest_description.claim_claim.desc
				}
			}
		}

		###Genetic trait###
		description = {
			limit = {
				num_of_good_genetic_traits > this.num_of_bad_genetic_traits
				fertility > low_fertility
				can_marry_trigger = yes
				#To account for a person marrying their concubines
				trigger_if = {
					limit = {
						is_concubine = yes
					}
					is_concubine_of = scope:host
				}
			}
			weight = {
				base = 200
				modifier = {
					factor = { add = genetic_character_value }
				}
			}
			desc = {
				desc = guest_description.gentic_start.desc
				first_valid = {
					triggered_desc = {
						trigger = { has_trait = intellect_good_3 }
						desc = guest_description.intellect_good_3.desc
					}
					triggered_desc = {
						trigger = { has_trait = physique_good_3 }
						desc = guest_description.physique_good_3.desc
					}
					triggered_desc = {
						trigger = { has_trait = beauty_good_3 }
						desc = guest_description.beauty_good_3.desc
					}
					triggered_desc = {
						trigger = { has_trait = intellect_good_2 }
						desc = guest_description.intellect_good_2.desc
					}
					triggered_desc = {
						trigger = { has_trait = physique_good_2 }
						desc = guest_description.physique_good_2.desc
					}
					triggered_desc = {
						trigger = { has_trait = beauty_good_2 }
						desc = guest_description.beauty_good_2.desc
					}
					triggered_desc = {
						trigger = { has_trait = intellect_good_1 }
						desc = guest_description.intellect_good_1.desc
					}
					triggered_desc = {
						trigger = { has_trait = physique_good_1 }
						desc = guest_description.physique_good_1.desc
					}
					triggered_desc = {
						trigger = { has_trait = beauty_good_1 }
						desc = guest_description.beauty_good_1.desc
					}
					triggered_desc = {
						trigger = { has_trait = fecund }
						desc = guest_description.fecund.desc
					}
				}
				desc = guest_description.gentic_end.desc
			}
		}


		###SKILLS###

		#Prowess
		description = {
			limit = {
				prowess >= decent_skill_rating
				can_be_knight_trigger = { ARMY_OWNER = scope:host }
			}
			weight = {
				base = 150
				modifier = {
					add = {
						value = prowess
						subtract = decent_skill_rating
						multiply = 10
					}
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = { prowess >= extremely_high_skill_rating }
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = { prowess >= high_skill_rating }
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.prowess.desc
			}
		}

		#Martial
		description = {
			limit = {
				martial >= decent_skill_rating
				OR = {
					can_be_marshal_trigger = { COURT_OWNER = scope:host }
					can_be_commander_basic_trigger = { ARMY_OWNER = scope:host }
				}
			}
			weight = {
				base = 120
				modifier = {
					add = {
						value = martial
						subtract = decent_skill_rating
						multiply = 10
					}
				}
				modifier = {
					add = {
						value = number_of_commander_traits
						multiply = 15
					}
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = {
							OR = {
								martial >= extremely_high_skill_rating
								AND = {
									martial >= high_skill_rating
									number_of_commander_traits >= 2
								}
							}
						}
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = {
							OR = {
								martial >= high_skill_rating
								number_of_commander_traits >= 2
							}
						}
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.martial_start.desc
				first_valid = {
					triggered_desc = {
						trigger = { number_of_commander_traits = 3 }
						desc = guest_description.martial_3_commander_traits.desc
					}
					triggered_desc = {
						trigger = { number_of_commander_traits = 2 }
						desc = guest_description.martial_2_commander_traits.desc
					}
					triggered_desc = {
						trigger = { number_of_commander_traits = 1 }
						desc = guest_description.martial_1_commander_traits.desc
					}
					desc = guest_description.martial_0_commander_traits.desc
				}
			}
		}

		#Diplomacy
		description = {
			limit = {
				diplomacy >= decent_skill_rating
				can_be_chancellor_trigger = { COURT_OWNER = scope:host }
			}
			weight = {
				base = 100
				modifier = {
					add = {
						value = diplomacy
						subtract = decent_skill_rating
						multiply = 10
					}
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = { diplomacy >= extremely_high_skill_rating }
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = { diplomacy >= high_skill_rating }
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.diplomacy.desc
			}
		}

		#Stewardship
		description = {
			limit = {
				stewardship >= decent_skill_rating
				can_be_steward_trigger = { COURT_OWNER = scope:host }
			}
			weight = {
				base = 100
				modifier = {
					add = {
						value = stewardship
						subtract = decent_skill_rating
						multiply = 10
					}
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = { stewardship >= extremely_high_skill_rating }
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = { stewardship >= high_skill_rating }
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.stewardship.desc
			}
		}

		#Intrigue
		description = {
			limit = {
				intrigue >= decent_skill_rating
				can_be_spymaster_trigger = { COURT_OWNER = scope:host }
			}
			weight = {
				base = 70
				modifier = {
					add = {
						value = intrigue
						subtract = decent_skill_rating
						multiply = 10
					}
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = { intrigue >= extremely_high_skill_rating }
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = { intrigue >= high_skill_rating }
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.intrigue.desc
			}
		}

		#Learning
		description = {
			limit = { learning >= decent_skill_rating } # 2019/05/08: No current restrictions on court physician
			weight = {
				base = 70
				modifier = {
					add = {
						value = learning
						subtract = decent_skill_rating
						multiply = 10
					}
				}
				modifier = {
					OR = {
						has_trait = lifestyle_herbalist
						has_trait = lifestyle_physician
						has_trait = lifestyle_mystic
					}
					add = 50
				}
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = {
							OR = {
								learning >= extremely_high_skill_rating
								AND = {
									learning >= high_skill_rating
									OR = {
										has_trait = lifestyle_herbalist
										has_trait = lifestyle_physician
										has_trait = lifestyle_mystic
									}
								}
							}
						}
						desc = guest_description.outstanding_skill.desc
					}
					triggered_desc = {
						trigger = {
							OR = {
								learning >= high_skill_rating
								OR = {
									has_trait = lifestyle_herbalist
									has_trait = lifestyle_physician
									has_trait = lifestyle_mystic
								}
							}
						}
						trigger = { learning >= high_skill_rating }
						desc = guest_description.experienced_skill.desc
					}
					desc = guest_description.competent_skill.desc
				}
				desc = guest_description.learning_start.desc
				first_valid = {
					triggered_desc = {
						trigger = { has_trait = lifestyle_physician }
						desc = guest_description.learning_physician_trait_1.desc
					}
					triggered_desc = {
						trigger = { has_trait = lifestyle_mystic }
						desc = guest_description.learning_mystic_trait_1.desc
					}
					triggered_desc = {
						trigger = { has_trait = lifestyle_herbalist }
						desc = guest_description.learning_herbalist_trait.desc
					}
					desc = guest_description.learning_no_trait.desc
				}
			}
		}

		###Vassal###
		description = {
			limit = {
				guest_vassal_candidate_trigger = yes
				opinion = {
					target = scope:host
					value > 0
				}
				OR = {
					guest_vassal_candidate_good_traits_trigger = yes
					stewardship >= decent_skill_rating
					martial >= decent_skill_rating
				}
			}
			weight = {
				base = 70
				opinion_modifier = {
					opinion_target = scope:host
					who = scope:guest
					multiplier = 0.5
				}
			}
			desc = {
				desc = guest_description.vassal_start.desc
				first_valid = {
					triggered_desc = {
						trigger = { has_trait = content }
						desc = guest_description.vassal_content.desc
					}
					triggered_desc = {
						trigger = { has_trait = humble }
						desc = guest_description.vassal_humble.desc
					}
					triggered_desc = {
						trigger = { has_trait = trusting }
						desc = guest_description.vassal_trusting.desc
					}
					triggered_desc = {
						trigger = { stewardship >= this.martial }
						desc = guest_description.vassal_stewardship.desc
					}
					desc = guest_description.vassal_martial.desc
				}
			}
		}
	}
}
