﻿# Overriding adventurer creation chances
ep3_laamp_chance_score_value = {
	value = 0
	add = { value = sum_of_all_skills_and_prowess_value divide = 4 }
	add = { value = piety_level multiply = 2 } # Devotion
	add = { value = prestige_level multiply = 2 } # Fame
	
	# Age
	if = {
		limit = { age < 25 }
		add = 3
	}
	if = {
		limit = { age >= 40 }
		add = -1
	}
	if = {
		limit = {
			age >= 50
			NOR = {
				has_trait = physique_good
				has_trait = strong
			}
		}
		add = -2
	}
	
	# Personality
	if = {
		limit = { has_trait = ambitious }
		add = 4
	}
	if = {
		limit = { has_trait = brave }
		add = 3
	}
	if = {
		limit = { has_trait = arrogant }
		add = 2
	}
	if = {
		limit = { has_trait = stubborn }
		add = 2
	}
	if = {
		limit = { has_trait = impatient }
		add = 2
	}
	
	# Genetics
	if = {
		limit = { has_trait = beauty_good_1 }
		add = 1
	}
	if = {
		limit = { has_trait = beauty_good_2 }
		add = 2
	}
	if = {
		limit = { has_trait = beauty_good_3 }
		add = 3
	}
	if = {
		limit = { has_trait = intellect_good_1 }
		add = 2
	}
	if = {
		limit = { has_trait = intellect_good_2 }
		add = 3
	}
	if = {
		limit = { has_trait = intellect_good_3 }
		add = 4
	}
	if = {
		limit = { has_trait = intellect_bad_1 }
		add = -2
	}
	if = {
		limit = { has_trait = intellect_bad_2 }
		add = -3
	}
	if = {
		limit = { has_trait = intellect_bad_3 }
		add = -4
	}
	if = {
		limit = { has_trait = physique_good_1 }
		add = 2
	}
	if = {
		limit = { has_trait = physique_good_2 }
		add = 3
	}
	if = {
		limit = { has_trait = physique_good_3 }
		add = 4
	}
	if = {
		limit = { has_trait = physique_bad_1 }
		add = -2
	}
	if = {
		limit = { has_trait = physique_bad_2 }
		add = -3
	}
	if = {
		limit = { has_trait = physique_bad_3 }
		add = -4
	}
	if = {
		limit = { has_trait = weak }
		add = -3
	}
	if = {
		limit = { has_trait = dull }
		add = -3
	}
	if = {
		limit = { has_trait = inbred }
		add = -5
	}
	if = {
		limit = { has_trait = shrewd }
		add = 3
	}
	
	# Lifestyle
	if = {
		limit = { has_trait = diplomat }
		add = 3
	}
	if = {
		limit = { has_trait = lifestyle_reveler }
		add = 1
	}
	if = {
		limit = { has_trait = lifestyle_blademaster }
		add = 3
	}
	if = {
		limit = { has_trait = lifestyle_hunter }
		add = 2
	}
	if = {
		limit = { has_trait = strategist }
		add = 3
	}
	if = {
		limit = { has_trait = gallant }
		add = 3
	}
	if = {
		limit = { has_trait = schemer }
		add = 3
	}
	if = {
		limit = { has_trait = seducer }
		add = 2
	}
	if = {
		limit = { has_trait = torturer }
		add = 2
	}
	
	# Edit from vanilla code, just commander traits
	every_character_trait = {
		limit = { has_trait_category = commander }
		add = 3
	}
	
	# Fame
	if = {
		limit = { has_trait = saoshyant_descendant }
		add = 3
	}
	if = {
		limit = { has_trait = savior }
		add = 3
	}
	if = {
		limit = { has_trait = order_member }
		add = 3
	}
	if = {
		limit = { has_trait = viking }
		add = 5
	}
	if = {
		limit = { has_trait = berserker }
		add = 5
	}
	if = {
		limit = { has_trait = shieldmaiden }
		add = 5
	}
	if = {
		limit = { has_trait = varangian }
		add = 5
	}
	if = {
		limit = { has_trait = lifestyle_poet }
		add = 3
	}
	if = {
		limit = { has_trait = disinherited }
		add = 5
	}
	if = {
		limit = { has_trait = denounced }
		add = 3
	}
	if = {
		limit = { has_trait = decadent }
		add = 3
	}
	if = {
		limit = { has_trait = rakish }
		add = 2
	}
	if = {
		limit = { has_trait = athletic }
		add = 2
	}
	
	# Education
	if = {
		limit = { has_trait = education_martial_1 }
		add = 1
	}
	if = {
		limit = { has_trait = education_martial_2 }
		add = 3
	}
	if = {
		limit = { has_trait = education_martial_3 }
		add = 5
	}
	if = {
		limit = { has_trait = education_martial_4 }
		add = 8
	}
	if = {
		limit = { has_trait = education_martial_5 }
		add = 10
	}
	if = {
		limit = { has_trait = education_martial_prowess_1 }
		add = 2
	}
	if = {
		limit = { has_trait = education_martial_prowess_2 }
		add = 4
	}
	if = {
		limit = { has_trait = education_martial_prowess_3 }
		add = 6
	}
	if = {
		limit = { has_trait = education_martial_prowess_4 }
		add = 8
	}
	
	# Bastardry
	if = {
		limit = { has_trait = bastard }
		add = 5
	}
	if = {
		limit = { has_trait = legitimized_bastard }
		add = 2
	}
	if = {
		limit = { has_trait = wild_oat }
		add = 2
	}
	if = {
		limit = { has_trait = child_of_concubine }
		add = 2
	}
	
	# Cosmetics
	if = {
		limit = { has_trait = scarred }
		add = 2
	}
	if = {
		limit = { has_trait = one_eyed }
		add = 2
	}
	if = {
		limit = { has_trait = disfigured }
		add = 2
	}
	
	# Culture/Faith
	if = {
		limit = {
			faith = { has_doctrine_parameter = unlock_voluntary_laampdom_faith }
		}
		add = 5
	}
	if = {
		limit = {
			culture = { has_cultural_parameter = unlock_voluntary_laampdom }
		}
		add = 5
	}
	if = {
		limit = {
			has_trait = nomadic_philosophy
		}
		add = 5
	}
	if = {
		limit = {
			culture = { has_cultural_parameter = much_more_likely_to_be_laamps }
		}
		add = 50
	}
	if = {
		limit = {
			culture = { has_cultural_parameter = more_likely_to_be_laamps }
		}
		add = 25
	}
	
	# Too much to lose
	every_heir_title = {
		add = {
			value = 0
			subtract = tier
		}
	}
	every_held_title = {
		add = {
			value = tier
			multiply = -2
		}
	}
	# Stop streaks
	every_held_title = {
		limit = {
			previous_holder ?= {
				is_alive = yes
				government_has_flag = government_is_landless_adventurer
			}
		}
		add = -75
	}
	# Encourage potential legitimists and such to go wandering.
	if = {
		limit = { realm_size <= 0 }
		every_claim = {
			limit = { tier >= tier_kingdom }
			add = 30
		}
	}
	
	min = 0
}

