﻿stray_bastard_knight = {
	age = 18
	culture = scope:relative.culture
	faith = scope:relative.faith
	random_traits_list = {
		count = 1
		education_martial_2 = {}
		education_martial_3 = {}
		education_martial_4 = {}
	}
	random_traits_list = {
		count = 1
		brave = {}
		just = {}
		gallant = {}
		honest = {}
		gregarious = {}
		generous = {}
		diligent = {}
	}
	random_traits_list = {
		count = 1
		lustful = {}
		chaste = {}
		ambitious = {}
		beauty_good_1 = {}
		physique_good_1 = {}
		physique_good_2 = {}
	}
	random_traits = yes
	martial = {
		min_template_high_skill
		max_template_high_skill
	}
	prowess = { 10 15 }
}

stray_bastard_physician = {
	age = 18
	culture = scope:relative.culture
	faith = scope:relative.faith

	random_traits_list = {
		count = 1
		education_learning_3 = {}
		education_learning_4 = {}
	}
	trait = lifestyle_physician
	random_traits = yes
	
	learning = {
		min_template_high_skill
		max_template_high_skill
	}

	after_creation = {
		random = {
			chance = 66
			if = {
				limit = {
					NOT = { has_trait = lifestyle_herbalist }
				}
				add_trait = lifestyle_herbalist
			}
		}
	}
}

stray_bastard_monk = {
	age = 18
	culture = scope:relative.culture
	faith = scope:relative.faith
	
	random_traits_list = {
		count = 1
		education_learning_2 = {}
		education_learning_3 = {}
		education_learning_4 = {}
	}
	trait = devoted
	random_traits = no
	random_traits_list = {
		count = 3
		lustful = {
			trigger = {
				root.faith = { trait_is_virtue = lustful }
			}
		}
		chaste = {
			trigger = {
				root.faith = { trait_is_virtue = chaste }
			}
		}
		gluttonous = {
			trigger = {
				root.faith = { trait_is_virtue = gluttonous }
			}
		}
		temperate = {
			trigger = {
				root.faith = { trait_is_virtue = temperate }
			}
		}
		greedy = {
			trigger = {
				root.faith = { trait_is_virtue = greedy }
			}
		}
		generous = {
			trigger = {
				root.faith = { trait_is_virtue = generous }
			}
		}
		wrathful = {
			trigger = {
				root.faith = { trait_is_virtue = wrathful }
			}
		}
		calm = {
			trigger = {
				root.faith = { trait_is_virtue = calm }
			}
		}
		patient = {
			trigger = {
				root.faith = { trait_is_virtue = patient }
			}
		}
		impatient = {
			trigger = {
				root.faith = { trait_is_virtue = impatient }
			}
		}
		arrogant = {
			trigger = {
				root.faith = { trait_is_virtue = arrogant }
			}
		}
		humble = {
			trigger = {
				root.faith = { trait_is_virtue = humble }
			}
		}
		deceitful = {
			trigger = {
				root.faith = { trait_is_virtue = deceitful }
			}
		}
		honest = {
			trigger = {
				root.faith = { trait_is_virtue = honest }
			}
		}
		craven = {
			trigger = {
				root.faith = { trait_is_virtue = craven }
			}
		}
		brave = {
			trigger = {
				root.faith = { trait_is_virtue = brave }
			}
		}
		ambitious = {
			trigger = {
				root.faith = { trait_is_virtue = ambitious }
			}
		}
		content = {
			trigger = {
				root.faith = { trait_is_virtue = content }
			}
		}
		arbitrary = {
			trigger = {
				root.faith = { trait_is_virtue = arbitrary }
			}
		}
		just = {
			trigger = {
				root.faith = { trait_is_virtue = just }
			}
		}
		paranoid = {
			trigger = {
				root.faith = { trait_is_virtue = paranoid }
			}
		}
		trusting = {
			trigger = {
				root.faith = { trait_is_virtue = trusting }
			}
		}
		compassionate = {
			trigger = {
				root.faith = { trait_is_virtue = compassionate }
			}
		}
		callous = {
			trigger = {
				root.faith = { trait_is_virtue = callous }
			}
		}
		sadistic = {
			trigger = {
				root.faith = { trait_is_virtue = sadistic }
			}
		}
		stubborn = {
			trigger = {
				root.faith = { trait_is_virtue = stubborn }
			}
		}
		fickle = {
			trigger = {
				root.faith = { trait_is_virtue = fickle }
			}
		}
		vengeful = {
			trigger = {
				root.faith = { trait_is_virtue = vengeful }
			}
		}
		forgiving = {
			trigger = {
				root.faith = { trait_is_virtue = forgiving }
			}
		}
	}

	learning = {
		min_template_decent_skill
		max_template_high_skill
	}
}

stray_bastard_rogue = {
	age = 18
	culture = scope:relative.culture
	faith = scope:relative.faith
	intrigue = {
		min_template_high_skill
		max_template_high_skill
	}
	diplomacy = {
		min_template_medium_skill
		max_template_decent_skill
	}
	random_traits_list = {
		count = 1
		education_intrigue_3 = {}
		education_intrigue_4 = {}
	}
	random_traits_list = {
		count = 1
		schemer = {}
		seducer = {}
		deceitful = {}
		lustful = {}
		calm = {}
		ambitious = {}
		paranoid = {}
		callous = {}
		sadistic = {}
		vengeful = {}
	}
	random_traits = yes
}

stray_bastard_beauty = {
	age = 18
	culture = scope:relative.culture
	faith = scope:relative.faith

	random_traits_list = {
		count = 1
		education_diplomacy_2 = {}
		education_diplomacy_3 = {}
		education_diplomacy_4 = {}
	}
	random_traits_list = {
		count = 1
		beauty_good_2 = {}
		beauty_good_3 = {}
	}
	random_traits_list = {
		count = 1
		seducer = {}
		lustful = {}
		ambitious = {}
		gregarious = {}
		generous = {}
	}
	random_traits = yes

	diplomacy = {
		min_template_decent_skill
		max_template_high_skill
	}
	after_creation = {
		random = {
			chance = 25
			add_trait = lifestyle_poet
			modifier = {
				add = 10
				culture = { has_cultural_parameter = poet_trait_more_common }
			}
			modifier = {
				add = 5
				OR = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					religion = religion:germanic_religion
				}
			}
		}
	}
}

lmf_language_tutor = {
	age = { 30 60 }
	culture = scope:tutor_culture
	faith = scope:liege.faith
	
	gender_female_chance = 50
	
	random_traits_list = {
		count = 1
		education_learning_1 = {}
		education_learning_2 = {}
		education_learning_3 = {}
	}
	random_traits_list = {
		count = 1
		patient = {}
		diligent = {}
		calm = {}
	}
	random_traits = yes
	dynasty = none

	learning = {
		min_template_medium_skill
		max_template_high_skill
	}
	martial = {
		min_template_low_skill
		max_template_medium_skill
	}
	prowess = {
		min_template_low_skill
		max_template_medium_skill
	}
	
	after_creation = {
		random_list = {
			10 = {
				add_trait = lifestyle_poet
				add_diplomacy_skill = 2
			}
			30 = {
				trigger = {
					scope:liege.faith = { has_doctrine_parameter = take_vows_active }
				}
				add_trait = devoted
			}
			20 = {
				add_trait = scholar
			}
			10 = {
				random_list = {
					20 = {
						add_trait = intellect_good_1
					}
					5 = {
						add_trait = intellect_good_2
					}
					10 = {
						add_trait = shrewd
					}
				}
			}
			10 = {
				trigger = {
					scope:liege.faith = {
						NOT = { has_doctrine_parameter = forbidden_from_pilgrimage }
					}
				}
				add_trait = pilgrim
				add_trait = lifestyle_traveler
			}
			10 = {}
		}
	}
}

lmf_prostitute = {
	age = { 18 30 }
	random_traits_list = {
		count = { 0 1 }
		beauty_good_1 = { weight = { base = 60 } }
		beauty_good_2 = { weight = { base = 30 } }
		beauty_good_3 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = 1
		seducer = { weight = { base = 20 } }
		lustful = { weight = { base = 50 } }
		greedy = { weight = { base = 10 } }
		deceitful = { weight = { base = 10 } }
		cynical = { weight = { base = 10 } }
	}
	dynasty = none
	random_traits = yes
	intrigue = {
		min_template_decent_skill
		max_template_decent_skill
	}
	after_creation = {
		add_trait = fornicator
		random = {
			chance = 25
			modifier = {
				add = 25
				age > 20
			}
			add_trait = lovers_pox
		}
	}
}

lmf_beautiful_local = {
	age = { 16 20 }
	random_traits_list = {
		count = 1
		beauty_good_1 = { weight = { base = 30 } }
		beauty_good_2 = { weight = { base = 50 } }
		beauty_good_3 = { weight = { base = 20 } }
	}
	dynasty = none
	random_traits = yes
	diplomacy = {
		min_template_decent_skill
		max_template_decent_skill
	}
	after_creation = {
		save_temporary_scope_as = beautiful_local
		every_character_trait = {
			limit = {
				OR = {
					this = trait:beauty_bad_1
					this = trait:beauty_bad_2
					this = trait:beauty_bad_3
					this = trait:intellect_bad_1
					this = trait:intellect_bad_2
					this = trait:intellect_bad_3
					this = trait:physique_bad_2
					this = trait:physique_bad_3
					this = trait:hunchbacked
					this = trait:dwarf
					this = trait:giant
					this = trait:inbred
					this = trait:spindly
					this = trait:scaly
					this = trait:albino
					this = trait:infertile
				}
			}
			scope:beautiful_local = { remove_trait = prev }
		}
	}
}

lmf_promising_warrior_template = {
	age = { 18 25 }
	faith = scope:county_template.faith
	culture = scope:county_template.culture
	dynasty = generate
	gender_female_chance = {
		if = {
			limit = {
				OR = {
					scope:county_template.culture = { has_cultural_parameter = martial_custom_female_only_combatant }
					scope:county_template.faith = { has_doctrine_parameter = combatant_must_be_female_if_no_roco }
				}
			}
			add = 100
		}
		else_if = {
			limit = {
				OR = {
					scope:county_template.culture = { has_cultural_parameter = martial_custom_equal_combatant }
					scope:county_template.faith = { has_doctrine_parameter = combatant_can_be_either_gender_if_no_roco }
				}
			}
			add = 50
		}
		else_if = {
			limit = {
				scope:county_template.culture = { has_cultural_parameter = has_access_to_shieldmaidens }
			}
			add = 10
		}
		else = {
			add = 0
		}
	}
	random_traits_list = {
		education_martial_2 = {
			weight = { base = 10 }
		}
		education_martial_3 = {
			weight = { base = 30 }
		}
		education_martial_4 = {
			weight = { base = 20 }
		}
	}
	random_traits_list = {
		wrathful = {}
		arrogant = {}
		brave = {}
		ambitious = {}
		diligent = {}
		gregarious = {}
		stubborn = {}
		vengeful = {}
	}
	
	random_traits = yes
	martial = { min_template_decent_skill max_template_high_skill }
	prowess = { min_template_decent_skill max_template_high_skill }
	
	after_creation = {
		set_interesting_traits_and_modifiers_effect = yes
		# Possible Commander trait
		if = {
			limit = { number_of_commander_traits < 1 }
			random_list = {
				10 = { add_trait = aggressive_attacker }
				10 = { add_trait = unyielding_defender }
				10 = { add_trait = flexible_leader }
				10 = { add_trait = logistician }
				10 = { add_trait = military_engineer }
				10 = { add_trait = reckless }
				40 = {}
			}
		}
		# Possible Extra Trait
		if = {
			limit = { number_of_lifestyle_traits < 1 }
			random_list = {
				10 = { add_trait = lifestyle_hunter }
				10 = { add_trait = lifestyle_blademaster }
				10 = { add_trait = athletic }
				10 = { add_trait = physique_good_1 }
				10 = { add_trait = physique_good_2 }
				50 = {}
			}
		}
		if = {
			limit = {
				is_female = yes
				scope:county_template.culture = { has_cultural_parameter = has_access_to_shieldmaidens }
				NOR = {
					has_trait = shieldmaiden
					scope:county_template.culture = { has_cultural_parameter = martial_custom_female_only_combatant }
					scope:county_template.faith = { has_doctrine_parameter = combatant_must_be_female_if_no_roco }
					scope:county_template.culture = { has_cultural_parameter = martial_custom_equal_combatant }
					scope:county_template.faith = { has_doctrine_parameter = combatant_can_be_either_gender_if_no_roco }
				}
			}
			add_trait = shieldmaiden
		}
	}
}

lmf_handsome_soldier_template = {
	age = { 18 25 }
	faith = scope:county_template.faith
	culture = scope:county_template.culture
	dynasty = none
	gender_female_chance = {
		if = {
			limit = {
				root = {
					is_attracted_to_women = yes
					is_attracted_to_men = no
				}
			}
			add = 100
		}
		else_if = {
			limit = {
				root = {
					is_attracted_to_women = no
					is_attracted_to_men = yes
				}
			}
			add = 0
		}
		else_if = {
			limit = {
				dummy_female = {
					can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:army.army_owner }
				}
			}
			add = 75
		}
		else = {
			add = 0
		}
	}
	random_traits_list = {
		education_martial_1 = {
			weight = { base = 10 }
		}		
		education_martial_2 = {
			weight = { base = 30 }
		}
		education_martial_3 = {
			weight = { base = 20 }
		}
	}
	trait = beauty_good_1
	random_traits = yes
	martial = { min_template_medium_skill max_template_decent_skill }
	prowess = { min_template_decent_skill max_template_high_skill }
	
	after_creation = {
		set_interesting_traits_and_modifiers_effect = yes
		# Possible Extra Trait
		random_list = {
			10 = {
				trigger = { is_male = yes }
				add_trait = strong
			}
			10 = { add_trait = athletic }
			10 = { add_trait = physique_good_1 }
			10 = {
				trigger = { is_male = yes }
				add_trait = physique_good_2
			}
			50 = {
				trigger = { is_female = yes }
				add_trait = beauty_good_2
			}
			50 = {
				modifier = {
					factor = 0.5
					is_male = yes
				}
			}
		}
	}
}

