﻿pool_repopulate_prowess = {
	age = { 18 45 }
	random_traits = yes
	gender_female_chance = root_soldier_female_chance
	culture = root.culture
	faith = root.faith
	prowess = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_martial_1 = { weight = { base = 35 } }
		education_martial_2 = { weight = { base = 35 } }
		education_martial_3 = { weight = { base = 20 } }
		education_martial_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		#LIFESTYLES LEVELED
		lifestyle_blademaster = {}
		lifestyle_hunter = {}
		lifestyle_reveler = {}
		lifestyle_traveler = {}
		#LIFESTYLES
		gallant = {}
		overseer = {}
		strategist = {}
		torturer = {}
		whole_of_body = {}
		#PERSONALITY
		brave = {}
		vengeful = {}
		sadistic = {}
		ambitious = {}
		gluttonous = {}
		wrathful = {}
		zealous = {}
		impatient = {}		
		#PHYSICAL
		strong = {}
		athletic = {}
		# EVENT AND SPECIALS
		adventurer = {}		
		berserker = {}
	}
	dynasty = none
	after_creation = {
### 1% chance for to be a Poet
		random = {
			chance = 1
			add_trait = 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
				}
			}
		}
### 2% chance for to be a Gardner
		random = {
			chance = 2
			add_trait = lifestyle_gardener
		}
		
### 20% for Cultural Traditions Commander Traits
		if = {
			limit = {
				culture = {
					has_cultural_parameter = winter_soldier_trait_more_common
				}
				NOT = {
					has_trait = winter_soldier
				}
			}
			random = {
				chance = 20
				add_trait = winter_soldier
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = forest_fighter_trait_more_common
				}
				NOT = {
					has_trait = forest_fighter
				}
			}
			random = {
				chance = 20
				add_trait = forest_fighter
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = rough_terrain_expert_trait_more_common
				}
				NOT = {
					has_trait = rough_terrain_expert
				}
			}
			random = {
				chance = 20
				add_trait = rough_terrain_expert
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = desert_warrior_trait_more_common
				}
				NOT = {
					has_trait = desert_warrior
				}
			}
			random = {
				chance = 20
				add_trait = desert_warrior
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = jungle_stalker_trait_more_common
				}
				NOT = {
					has_trait = jungle_stalker
				}
			}
			random = {
				chance = 20
				add_trait = jungle_stalker
			}
		}

		add_random_tiered_trait_xp_effect = {
			TRAIT = lifestyle_blademaster
			LEVEL_1 = yes
			LEVEL_3 = yes
		}
		add_random_tiered_trait_track_xp_effect = {
			TRAIT = lifestyle_hunter
			TRACK = hunter
			LEVEL_1 = yes
			LEVEL_3 = no
		}

### 33% Tourney Participation Chance
		if = {
			limit = { has_dlc_feature = tours_and_tournaments }
			random = {
				chance = 33
				add_trait = tourney_participant
				add_random_tourney_participant_level_effect = yes
			}
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}

pool_repopulate_diplomacy = {
	age = { 18 45 }
	gender_female_chance = root_faith_dominant_gender_adjusted_female_chance #because chancellor gender is doctrine dependent
	random_traits = yes
	culture = root.culture
	faith = root.faith
	diplomacy = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_diplomacy_1 = { weight = { base = 35 } }
		education_diplomacy_2 = { weight = { base = 35 } }
		education_diplomacy_3 = { weight = { base = 20 } }
		education_diplomacy_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		diplomat = {}
		family_first = {}
		august = {}
		lifestyle_reveler = {}
		generous = {}
		arrogant = {}
		honest = {}
		gregarious = {}
		trusting = {}
		compassionate = {}
		fickle = {}
		forgiving = {}
		poet = {}
		tourney_participant = {}
		lifestyle_traveler = {}
	}
	dynasty = none
	after_creation = {
		random = {
			chance = 1
			
			add_trait = poet
			
			modifier = {
				add = 15
				culture = { has_cultural_parameter = poet_trait_more_common }
			}
			modifier = {
				add = 10
				OR = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					religion = religion:germanic_religion
				}
			}
		}
		if = {
			limit = { has_trait = lifestyle_reveler }
			add_trait_xp = {
				trait = lifestyle_reveler
				value = {
					integer_range = {
						min = small_lifestyle_random_xp_low
						max = small_lifestyle_random_xp_high
					}
				}
			}
		}
		add_random_tiered_trait_track_xp_effect = {
			TRAIT = tourney_participant
			TRACK = wit
			LEVEL_1 = yes
			LEVEL_3 = no
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}

pool_repopulate_martial = {
	age = { 30 45 }
	gender_female_chance = root_faith_dominant_gender_adjusted_female_chance #because marshal gender is doctrine dependent
	random_traits = yes
	culture = root.culture
	faith = root.faith
	martial = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_martial_1 = { weight = { base = 35 } }
		education_martial_2 = { weight = { base = 35 } }
		education_martial_3 = { weight = { base = 20 } }
		education_martial_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		#LIFESTYLES LEVELED
		lifestyle_blademaster = {}
		lifestyle_hunter = {}
		lifestyle_reveler = {}
		lifestyle_traveler = {}
		#LIFESTYLES
		gallant = {}
		overseer = {}
		strategist = {}
		torturer = {}
		whole_of_body = {}
		#PERSONALITY
		brave = {}
		vengeful = {}
		sadistic = {}
		ambitious = {}
		gluttonous = {}
		wrathful = {}
		zealous = {}
		impatient = {}		
		#PHYSICAL
		strong = {}
		athletic = {}
		# EVENT AND SPECIALS
		adventurer = {}		
		berserker = {}
	}
	dynasty = none
	after_creation = {
		if = {
			limit = {
				OR = {
					culture = { has_cultural_pillar = heritage_north_germanic }
					religion = religion:germanic_religion
				}
			}
			random_list = {
				65 = {}
				15 = {
					add_trait = varangian
				}
				15 = {
					add_trait = berserker
				}
				5 = {
					add_trait = poet
				}
			}
		}
		
		# Cultural Traditions
		if = {
			limit = {
				culture = {
					has_cultural_parameter = poet_trait_more_common
				}
				NOT = {
					has_trait = poet
				}
			}
			random = {
				chance = 10
				add_trait = poet
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = winter_soldier_trait_more_common
				}
				NOT = {
					has_trait = winter_soldier
				}
			}
			random = {
				chance = 10
				add_trait = winter_soldier
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = forest_fighter_trait_more_common
				}
				NOT = {
					has_trait = forest_fighter
				}
			}
			random = {
				chance = 10
				add_trait = forest_fighter
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = rough_terrain_expert_trait_more_common
				}
				NOT = {
					has_trait = rough_terrain_expert
				}
			}
			random = {
				chance = 10
				add_trait = rough_terrain_expert
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = desert_warrior_trait_more_common
				}
				NOT = {
					has_trait = desert_warrior
				}
			}
			random = {
				chance = 10
				add_trait = desert_warrior
			}
		}
		if = {
			limit = {
				culture = {
					has_cultural_parameter = jungle_stalker_trait_more_common
				}
				NOT = {
					has_trait = jungle_stalker
				}
			}
			random = {
				chance = 10
				add_trait = jungle_stalker
			}
		}
		add_random_tiered_trait_track_xp_effect = {
			TRAIT = lifestyle_hunter
			TRACK = hunter
			LEVEL_1 = yes
			LEVEL_3 = no
		}
		add_random_tiered_trait_track_xp_effect = {
			TRAIT = tourney_participant
			TRACK = wit
			LEVEL_1 = yes
			LEVEL_3 = no
		}

### 20% Tourney Participation Chance
		if = {
			limit = { has_dlc_feature = tours_and_tournaments }
			random = {
				chance = 20
				add_trait = tourney_participant
				add_random_tourney_participant_level_effect = yes
			}
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}

pool_repopulate_stewardship = {
	age = { 18 45 }
	gender_female_chance = root_faith_dominant_gender_adjusted_female_chance #because steward gender is doctrine dependent
	random_traits = yes
	culture = root.culture
	faith = root.faith
	stewardship = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_stewardship_1 = { weight = { base = 35 } }
		education_stewardship_2 = { weight = { base = 35 } }
		education_stewardship_3 = { weight = { base = 20 } }
		education_stewardship_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		architect = {}
		administrator = {}
		avaricious = {}
		temperate = {}
		greedy = {}
		just = {}
		stubborn = {}
		ambitious = {}
	}
	dynasty = none
	after_creation = {
		random = {
			chance = 1
			
			add_trait = 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
				}
			}
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		
	}
}

pool_repopulate_intrigue = {
	age = { 25 40 }
	random_traits = yes
	gender_female_chance = 50 #No gender blocks for spymaster
	culture = root.culture
	faith = root.faith
	intrigue = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_intrigue_1 = { weight = { base = 35 } }
		education_intrigue_2 = { weight = { base = 35 } }
		education_intrigue_3 = { weight = { base = 20 } }
		education_intrigue_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		schemer = {}
		seducer = {}
		torturer = {}
		deceitful = {}
		lustful = {}
		calm = {}
		arbitrary = {}
		paranoid = {}
		callous = {}
		sadistic = {}
		vengeful = {}
		craven = {}
	}
	dynasty = none
	after_creation = {
		random = {
			chance = 1
			
			add_trait = 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
				}
			}
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}

pool_repopulate_learning = {
	age = { 25 60 }
	gender_female_chance = 50 #No gender blocks for physicians
	random_traits = yes
	culture = root.culture
	faith = root.faith
	learning = {
		min_guest_template_skill max_guest_template_skill
	}
	random_traits_list = {
		education_learning_1 = { weight = { base = 35 } }
		education_learning_2 = { weight = { base = 35 } }
		education_learning_3 = { weight = { base = 20 } }
		education_learning_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		scholar = {}
		theologian = {}
		whole_of_body = {}
		lifestyle_physician = {}
		lifestyle_mystic = {}
		lifestyle_herbalist = {}
		chaste = {}
		diligent = {}
		patient = {}
		humble = {}
		shy = {}
		content = {}
		cynical = {}
		lazy = {}
	}
	dynasty = none
	after_creation = {
		if = {
			limit = {
				faith = {
					has_doctrine = tenet_monasticism
				}
			}
			random_list = {
				75 = {}
				25 = {
					add_trait = devoted
				}
			}
		}
		random = {
			chance = 1
			
			add_trait = 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
				}
			}
		}
		add_random_tiered_trait_xp_effect = {
			TRAIT = lifestyle_physician
			LEVEL_1 = yes
			LEVEL_3 = yes
		}
		add_random_tiered_trait_xp_effect = {
			TRAIT = lifestyle_mystic
			LEVEL_1 = yes
			LEVEL_3 = no
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}

pool_repopulate_spouse = {
	gender_female_chance = root.marriage_gender_adjusted_female_chance
	age = { 16 26 }
	random_traits = yes
	culture = root.culture
	faith = root.faith
	random_traits_list = {
		education_diplomacy_1 = { weight = { base = 35 } }
		education_diplomacy_2 = { weight = { base = 35 } }
		education_diplomacy_3 = { weight = { base = 20 } }
		education_diplomacy_4 = { weight = { base = 10 } }
		education_martial_1 = {
			weight = {
				base = 35
				modifier = { # Less common with martial education if character can't be combatant because of gender
					factor = 0.3
					trigger_if = {
						limit = { root = { is_female = yes } }
						dummy_male = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
					trigger_else = {
						dummy_female = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
				}
			}
		}
		education_martial_2 = {
			weight = {
				base = 35
				modifier = { # Less common with martial education if character can't be combatant because of gender
					factor = 0.3
					trigger_if = {
						limit = { root = { is_female = yes } }
						dummy_male = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
					trigger_else = {
						dummy_female = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
				}
			}
		}
		education_martial_3 = {
			weight = {
				base = 20
				modifier = { # Less common with martial education if character can't be combatant because of gender
					factor = 0.3
					trigger_if = {
						limit = { root = { is_female = yes } }
						dummy_male = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
					trigger_else = {
						dummy_female = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
				}
			}
		}
		education_martial_4 = {
			weight = {
				base = 10
				modifier = { # Less common with martial education if character can't be combatant because of gender
					factor = 0.3
					trigger_if = {
						limit = { root = { is_female = yes } }
						dummy_male = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
					trigger_else = {
						dummy_female = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
					}
				}
			}
		}
		education_stewardship_1 = { weight = { base = 35 } }
		education_stewardship_2 = { weight = { base = 35 } }
		education_stewardship_3 = { weight = { base = 20 } }
		education_stewardship_4 = { weight = { base = 10 } }
		education_intrigue_1 = { weight = { base = 35 } }
		education_intrigue_2 = { weight = { base = 35 } }
		education_intrigue_3 = { weight = { base = 20 } }
		education_intrigue_4 = { weight = { base = 10 } }
		education_learning_1 = { weight = { base = 35 } }
		education_learning_2 = { weight = { base = 35 } }
		education_learning_3 = { weight = { base = 20 } }
		education_learning_4 = { weight = { base = 10 } }
	}
	random_traits_list = {
		count = { 0 1 }
		diplomat = {}
		strategist = {}
		architect = {}
		schemer = {}
		scholar = {}
		august = {}
		overseer = {}
		administrator = {}
		seducer = {}
	}
	dynasty = none
	after_creation = {
#1% Poet
		random = {
			chance = 1
			add_trait = 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
				}
			}
		}
		random = { 	chance = 1
					add_trait = lifestyle_gardener	}
		
		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		
	}
}

pool_repopulate_local_flavor = {
	age = { 20 50 }
	gender_female_chance = root_faith_dominant_gender_adjusted_female_chance #because council gender is doctrine dependent
	random_traits = yes
	faith = root.faith
	
	random_culture = {
		culture:ashkenazi = {
			trigger = {
				NOT = {
					root.faith = { religion = { is_in_family = rf_pagan } }
				}
				root.capital_province = {
					OR = {
						geographical_region = world_europe
						geographical_region = world_asia_minor
					}
					NOT = {
						geographical_region = world_europe_west_iberia
					}
				}
			}
		}
		root.culture = {
			trigger = {
				root.faith = { religion = { is_in_family = rf_pagan } }
			}
		}
		culture:sephardi = {
			trigger = {
				root.capital_province = {
					geographical_region = world_europe_west_iberia
				}
			}
		}
		culture:radhanite = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_steppe
						geographical_region = world_india
					}
				}
			}
		}
		culture:kochinim = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india
				}
			}
		}
		culture:bavlim = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_middle_east
						geographical_region = world_middle_east_persia
						geographical_region = world_africa_north
					}
				}
			}
		}
		culture:kurdish = {
			trigger = {
				root.capital_province = {
					geographical_region = world_middle_east_persia
				}
			}
		}
		culture:rajput = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india
				}
			}
		}
		culture:hindustani = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india_rajastan
				}
			}
		}
		culture:gujarati = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india_rajastan
				}
			}
		}
		culture:marathi = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_india_rajastan
						geographical_region = world_india_deccan
					}
				}
			}
		}
		culture:tamil = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india_deccan
				}
			}
		}
		culture:telugu = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india_deccan
				}
			}
		}
		culture:kannada = {
			trigger = {
				root.capital_province = {
					geographical_region = world_india_deccan
				}
			}
		}
		culture:bengali = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_india_bengal
						geographical_region = world_burma
					}
				}
			}
		}
		culture:burmese = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_india_bengal
						geographical_region = world_burma
					}
				}
			}
		}
		culture:butr = {
			trigger = {
				root.capital_province = {
					geographical_region = world_africa
				}
			}
		}
		culture:zaghawa = {
			trigger = {
				root.capital_province = {
					geographical_region = world_africa
				}
			}
		}
		culture:bolghar = {
			trigger = {
				root.capital_province = {
					geographical_region = world_steppe_west
				}
			}
		}
		culture:assyrian = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_steppe_east
						geographical_region = world_steppe_tarim
					}
				}
			}
		}
		culture:khitan = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_steppe_east
						geographical_region = world_steppe_tarim
						geographical_region = world_tibet
					}
				}
			}
		}
		culture:han = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_steppe_east
						geographical_region = world_steppe_tarim
						geographical_region = world_tibet
						geographical_region = world_burma
					}
				}
			}
		}
		culture:cuman = {
			trigger = {
				root.capital_province = {
					geographical_region = world_steppe_west
				}
			}
		}
		culture:bodpa = {
			trigger = {
				root.capital_province = {
					geographical_region = world_tibet
				}
			}
		}
		culture:somali = {
			trigger = {
				root.capital_province = {
					OR = {
						geographical_region = world_middle_east
						geographical_region = world_middle_east_persia
						geographical_region = world_africa_north_east
						AND = {
							geographical_region = world_india
							county.holder.faith = {
								religion_tag = islam_religion
							}
						}
					}
				}
			}
		}
	}
	
	learning = {
		min_guest_template_skill max_guest_template_skill
	}
	
	stewardship = {
		min_guest_template_skill max_guest_template_skill
	}
	
	diplomacy = {
		min_guest_template_skill max_guest_template_skill
	}
	
	random_traits_list = {
		education_learning_3 = { weight = { base = 10 } }
		education_learning_4 = { weight = { base = 20 } }
		education_stewardship_3 = { weight = { base = 5 } }
		education_stewardship_4 = { weight = { base = 10 } }
		education_diplomacy_3 = { weight = { base = 10 } }
		education_diplomacy_4 = { weight = { base = 20 } }
	}
	random_traits_list = {
		scholar = {}
		theologian = {}
		lifestyle_physician = {}
		lifestyle_mystic = {}
		lifestyle_herbalist = {}
		administrator = {}
		architect = {}
		diplomat = {}
		lifestyle_hunter = {}
	}
	dynasty = none
	
	after_creation = {
		if = {
			limit = {
				culture = { has_cultural_pillar = heritage_israelite }
			}
			random_list = {
				10 = {
					set_character_faith = faith:rabbinism
				}
				2 = {
					trigger = {
						root.capital_province.faith = {
							religion_tag = christianity_religion
						}
						root.capital_province = {
							geographical_region = world_europe_west_iberia
						}
					}
					set_character_faith = faith:conversos
				}
				40 = {
					trigger = {
						has_trait = lifestyle_mystic
					}
					set_character_faith = faith:merkabah
				}
				20 = {
					trigger = {
						root.capital_province = {
							OR = {
								geographical_region = world_europe_south_east
								geographical_region = world_asia_minor
							}
						}
					}
					set_character_faith = faith:samaritan
				}
				20 = {
					trigger = {
						root.capital_province = {
							OR = {
								geographical_region = world_europe_south_east
								geographical_region = world_asia_minor
							}
						}
					}
					set_character_faith = faith:karaism
				}
				90 = {
					trigger = {
						root.capital_province = {
							geographical_region = world_india
						}
					}
					set_character_faith = faith:malabarism
				}
			}
			if = {
				limit = {
					NOT = {
						knows_language_of_culture = root.capital_province.culture
					}
				}
				learn_language_of_culture = root.capital_province.culture
			}
		}
		else_if = {
			limit = {
				culture = culture:greek
			}
			random_list = {
				10 = {
					set_character_faith = faith:iconoclast
				}
				10 = {
					set_character_faith = faith:paulician
				}
				10 = {
					set_character_faith = faith:bogomilist
				}
			}
		}
		else_if = {
			limit = {
				OR = {
					culture = culture:rajput
					culture = culture:marathi
					culture = culture:gujarati
					culture = culture:tamil
					culture = culture:telugu
					culture = culture:hindustani
					culture = culture:kannada
					culture = culture:bengali
					culture = culture:burmese
				}
			}
			random_list = {
				10 = {
					set_character_faith = faith:digambara
				}
				10 = {
					set_character_faith = faith:svetambara
				}
				20 = {
					set_character_faith = faith:yapaniya
				}
				35 = {
					trigger = {
						culture = culture:gujarati
					}
					set_character_faith = faith:zurvanism
				}
				100 = {
					trigger = {
						culture = culture:burmese
					}
					set_character_faith = faith:ari
				}
				5 = {
					set_character_faith = faith:nestorian
				}
				25 = {
					trigger = {
						OR = {
							culture = culture:kannada
							culture = culture:telugu
							culture = culture:tamil
						}
					}
					set_character_faith = faith:malabarism
				}
			}
		}
		else_if = {
			limit = {
				OR = {
					culture = culture:butr
					culture = culture:zaghawa
				}
			}
			random_list = {
				10 = {
					set_character_faith = faith:ibadi
				}
				10 = {
					set_character_faith = faith:sufri
				}
			}
		}
		else_if = {
			limit = {
				culture = culture:kurdish
			}
			set_character_faith = faith:yazidi
		}
		else_if = {
			limit = {
				OR = {
					culture = culture:bolghar
					culture = culture:somali
				}
			}
			set_character_faith = faith:ashari
			if = {
				limit = {
					root.capital_county.faith = {
						religion_tag = islam_religion
					}
				}
				set_character_faith = root.capital_county.faith
			}
		}
		else_if = {
			limit = {
				culture = culture:khazar
			}
			set_character_faith = faith:kabarism
		}
		else_if = {
			limit = {
				culture = culture:assyrian
			}
			set_character_faith = faith:nestorian
		}
		else_if = {
			limit = {
				culture = culture:khitan
			}
			random_list = {
				15 = {
					set_character_faith = faith:vajrayana
				}
				10 = {
					set_character_faith = faith:tengri_pagan
				}
				5 = {
					set_character_faith = faith:quanzhen
				}
			}
		}
		else_if = {
			limit = {
				culture = culture:han
			}
			random_list = {
				50 = {
					set_character_faith = faith:shangqing
					random_list = {
						50 = {}
						50 = {
							add_trait = devoted
						}
					}
				}
				15 = {
					set_character_faith = faith:mahayana
				}
				5 = {
					set_character_faith = faith:zhengyi
				}
			}
		}
		else_if = {
			limit = {
				culture = culture:bodpa
			}
			random_list = {
				10 = {
					set_character_faith = faith:bon
				}
				10 = {
					set_character_faith = faith:old_bon
				}
			}
		}
		else_if = {
			limit = {
				religion = { is_in_family = rf_pagan }
			}
			random_list = {
				10 = {
					add_trait = one_eyed
				}
				10 = {
					add_trait = albino
				}
				10 = {
					add_trait = scaly
				}
				10 = {
					add_trait = torturer
				}
				10 = {
					add_trait = whole_of_body
				}
				10 = {
					add_trait = flagellant
				}
				10 = {
					add_trait = scarred
				}
				10 = {
					add_trait = blind
				}
				10 = {
					add_trait = shrewd
				}
				10 = {
					add_trait = strong
				}
				10 = {
					add_trait = giant
				}
				10 = {
					add_trait = poet
				}
				450 = {
					trigger = {
						NOT = {
							trait_is_criminal_in_faith_trigger = { TRAIT = witch FAITH = this.faith GENDER_CHARACTER = this }
						}
					}
					add_trait = witch
				}
				150 = {
					trigger = {
						faith = {
							has_doctrine = tenet_warmonger
						}
						OR = {
							culture = { has_cultural_pillar = heritage_north_germanic }
							religion = religion:germanic_religion
						}
						NOR = {
							has_trait = craven
							has_trait = berserker
							has_trait = calm
						}
					}
					add_trait = berserker
				}
			}
		}
		
		# Learn flavorful & appropriate languages
		if = {
			limit = {
				OR = {
					culture = culture:butr
					culture = culture:kurdish
					culture = culture:somali
				}
			}
			
			if = {
				limit = {
					NOT = {
						knows_language = language_arabic
					}
				}
				random = {
					chance = 70
					learn_language = language_arabic
				}
			}
		}
		
		if = {
			limit = {
				culture = culture:assyrian
			}
			
			if = {
				limit = {
					NOT = {
						knows_language = language_greek
					}
				}
				random = {
					chance = 70
					learn_language = language_greek
				}
			}
		}
		
		if = { # Guaranteed warriors
			limit = {
				OR = {
					culture = culture:butr
					culture = culture:zaghawa
					culture = culture:khitan
					culture = culture:somali
				}
			}
			remove_trait = education_learning_3
			remove_trait = education_learning_4
			remove_trait = education_stewardship_3
			remove_trait = education_stewardship_4
			remove_trait = education_diplomacy_3
			remove_trait = education_diplomacy_4
			remove_trait = lifestyle_physician
			remove_trait = lifestyle_mystic
			remove_trait = theologian
			remove_trait = lifestyle_herbalist
			remove_trait = diplomat
			remove_trait = administrator
			remove_trait = architect
			remove_trait = scholar
			add_martial_skill = 4
			add_prowess_skill = 6
			random_list = {
				50 = {
					add_trait = education_martial_3
				}
				50 = {
					add_trait = education_martial_4
				}
			}
			random_list = {
				10 = {
					add_trait = strategist
				}
				30 = {
					add_trait = lifestyle_blademaster
					add_random_tiered_trait_xp_effect = {
						TRAIT = lifestyle_blademaster
						LEVEL_1 = yes
						LEVEL_3 = yes
					}
				}
				10 = {
					add_trait = tourney_participant
					add_random_tiered_trait_track_xp_effect = {
						TRAIT = tourney_participant
						TRACK = bow
						LEVEL_1 = yes
						LEVEL_3 = yes
					}
				}
				10 = {
					add_trait = overseer
				}
			}
			give_random_commander_trait_effect = yes
		}
		else_if = {
			limit = {
				OR = {
					religion = { is_in_family = rf_pagan }
					culture = culture:bolghar
					culture = culture:cuman
				}
			}
			random_list = {
				50 = {}
				50 = {
					remove_trait = education_learning_3
					remove_trait = education_learning_4
					remove_trait = education_stewardship_3
					remove_trait = education_stewardship_4
					remove_trait = education_diplomacy_3
					remove_trait = education_diplomacy_4
					remove_trait = lifestyle_physician
					remove_trait = lifestyle_mystic
					remove_trait = theologian
					remove_trait = lifestyle_herbalist
					remove_trait = diplomat
					remove_trait = administrator
					remove_trait = architect
					remove_trait = scholar
					add_martial_skill = 4
					add_prowess_skill = 6
					random_list = {
						50 = {
							add_trait = education_martial_3
						}
						50 = {
							add_trait = education_martial_4
						}
					}
					random_list = {
						10 = {
							add_trait = strategist
						}
						30 = {
							add_trait = lifestyle_blademaster
							add_random_tiered_trait_xp_effect = {
								TRAIT = lifestyle_blademaster
								LEVEL_1 = yes
								LEVEL_3 = yes
							}
						}
						10 = {
							add_trait = tourney_participant
							add_random_tiered_trait_track_xp_effect = {
								TRAIT = tourney_participant
								TRACK = bow
								LEVEL_1 = yes
								LEVEL_3 = yes
							}
						}
						10 = {
							add_trait = overseer
						}
					}
					give_random_commander_trait_effect = yes
				}
			}
		}
		add_random_tiered_trait_xp_effect = {
			TRAIT = lifestyle_physician
			LEVEL_1 = yes
			LEVEL_3 = yes
		}
		add_random_tiered_trait_xp_effect = {
			TRAIT = lifestyle_mystic
			LEVEL_1 = yes
			LEVEL_3 = no
		}
		add_random_tiered_trait_track_xp_effect = {
			TRAIT = lifestyle_hunter
			TRACK = hunter
			LEVEL_1 = yes
			LEVEL_3 = no
		}

		set_interesting_traits_and_modifiers_effect = yes
		set_good_congenitals_physics_effect = yes
		set_bad_congenitals_physics_effect = yes		

	}
}
