#####################
# PILGRIMAGE VALUES #
#####################

# Reward values
short_pilgrimage_piety_gain = {
	value = medium_piety_gain
	if = {
		limit = {
			exists = dynasty
			dynasty = {
				has_dynasty_perk = erudition_legacy_4
			}
		}
		multiply = 1.3
	}
}

#Needs to be synced with the x_pilgrimage_piety_multiplier below to display the actual increase in %
medium_pilgrimage_piety_gain = {
	value = medium_piety_gain
	multiply = 1.5
	if = {
		limit = {
			exists = dynasty
			dynasty = {
				has_dynasty_perk = erudition_legacy_4
			}
		}
		multiply = 1.3
	}
}

medium_pilgrimage_piety_multiplier = { value = 50 }

long_pilgrimage_piety_gain = {
	value = medium_piety_gain
	multiply = 2.5
	if = {
		limit = {
			exists = dynasty
			dynasty = {
				has_dynasty_perk = erudition_legacy_4
			}
		}
		multiply = 1.3
	}
}

long_pilgrimage_piety_multiplier = { value = 150 }

very_long_pilgrimage_piety_gain = {
	value = medium_piety_gain
	multiply = 3.5
	if = {
		limit = {
			exists = dynasty
			dynasty = {
				has_dynasty_perk = erudition_legacy_4
			}
		}
		multiply = 1.3
	}
}

very_long_pilgrimage_piety_multiplier = { value = 250 }

#This needs to be synced with cost/length multipliers in the Solo Pilgrimage phase cost in the activity_types\pilgrimage.txt file
pilgrimage_length_cost_tier_1 = { 
	value = scope:host.medium_gold_value
	multiply = 0.2
}

#Praha -> Cologne
pilgrimage_length_cost_tier_2 = { 
	value = scope:host.medium_gold_value
	multiply = 0.4
}

pilgrimage_length_cost_tier_3 = { 
	value = scope:host.medium_gold_value
	multiply = 0.6
}

pilgrimage_length_cost_tier_4 = { 
	value = scope:host.medium_gold_value
	multiply = 0.8
}

pilgrimage_length_cost_tier_5 = { 
	value = scope:host.medium_gold_value
	multiply = 1
}

#Klingenberg -> Jerusalem
pilgrimage_length_cost_tier_6 = { 
	value = scope:host.medium_gold_value
	multiply = 1.2
}

#Klingenberg -> Kanchipuram
pilgrimage_length_cost_tier_7 = { 
	value = scope:host.medium_gold_value
	multiply = 1.5
}

pilgrimage_low_pious_multiplier = { value = 1.1 }
#Make sure the multiplier values sync up with the multiplier_tt values to display the Reward Tiers as percentages
pilgrimage_low_pious_multiplier_tt = { 
	value = pilgrimage_low_pious_multiplier 
	multiply = 100
	subtract = 100
}
pilgrimage_mid_pious_multiplier = { value = 1.25 }
#Make sure the multiplier values sync up with the multiplier_tt values to display the Reward Tiers as percentages
pilgrimage_mid_pious_multiplier_tt = { 
	value = pilgrimage_mid_pious_multiplier
	multiply = 100
	subtract = 100
}
pilgrimage_high_pious_multiplier = { value = 1.75 }
#Make sure the multiplier values sync up with the multiplier_tt values to display the Reward Tiers as percentages
pilgrimage_high_pious_multiplier_tt = { 
	value = pilgrimage_high_pious_multiplier
	multiply = 100
	subtract = 100
}
pilgrimage_perfect_pious_multiplier = { value = 2.5 }
#Make sure the multiplier values sync up with the multiplier_tt values to display the Reward Tiers as percentages
pilgrimage_perfect_pious_multiplier_tt = { 
	value = pilgrimage_perfect_pious_multiplier
	multiply = 100
	subtract = 100
}

pilgrimage_low_pious_trait_xp_value = { value = medium_trait_xp }
pilgrimage_mid_pious_trait_xp_value = { value = major_trait_xp }
pilgrimage_high_pious_trait_xp_value = { value = massive_trait_xp }
pilgrimage_perfect_pious_trait_xp_value = { 
	value = massive_trait_xp
	multiply = 2
}

pilgrimage_low_worldly_acceptance_value = { value = 1 }
pilgrimage_mid_worldly_acceptance_value = { value = 3 }
pilgrimage_high_worldly_acceptance_value = { value = 5 }
pilgrimage_perfect_worldly_acceptance_value = { value = 7 }


# Distances to target holy site
long_pilgrimage_max_length = 5000000 # 5M Over this distance, it will be an exceptionally long pilgrimage
medium_pilgrimage_max_length = 1000000 # 1M, slightly larger than 1 'holy roman empire' away
short_pilgrimage_max_length = 100000 # 100K, slightly larger than 1 'ireland' away.

hajj_cooldown_value = 1
pilgrimage_cooldown_value = 5

pilgrimage_entourage_pomp_appropriate_max_value = 5
pilgrimage_entourage_pomp_ceremonial_max_value = 10
pilgrimage_entourage_pomp_throng_max_value = 20
# This one doesn't sync with anything, just presenting it here for consistency/ease of tweaking.
pilgrimage_entourage_pomp_humble_max_value = 7

pilgrimage_entourage_base_set_weighting_value = {
	if = {
		limit = { bannable_serving_diarch_trigger = no }
		# We want to have bodyguards most of all.
		if = {
			limit = { has_court_position = bodyguard_court_position }
			add = 1000
		}
		if = {
			limit = { has_court_position = akolouthos_court_position }
			add = 1000
		}
		# But we'll settle for knights.
		else_if = {
			limit = {
				is_knight = yes
				prowess >= high_skill_rating
			}
			# We keep the weight low, since you'll probably have a good few such knights and we don't want them hogging all the spots.
			add = 5
		}
		# Also maybe someone to just chat to.
		## Positive relations.
		if = {
			limit = {
				has_any_good_relationship_with_character_trigger = { CHARACTER = scope:host }
			}
			# Same faith, standard weight.
			if = {
				limit = { faith = scope:host.faith }
				add = 100
			}
			# Other faith, _ehhhh_, they're for company but it's still a spiritual shindig.
			else = { add = 10 }
		}
		## Religious figures.
		if = {
			limit = {
				save_temporary_scope_as = current_char
				OR = {
					liege ?= { cp:councillor_court_chaplain ?= scope:current_char }
					AND = {
						faith = scope:host.faith
						has_trait = devoted
					}
				}
			}
			add = 300
		}
	}
	if = {
		limit = {
			bannable_serving_diarch_trigger = yes
		}
		add = -5000
	}
}

pilgrimage_entourage_extras_set_weighting_value = {
	# Same-faith only for all of these.
	if = {
		limit = {
			faith = scope:host.faith
			bannable_serving_diarch_trigger = no
		}
		# Assorted hangers-on.
		## Anyone with a court position.
		if = {
			limit = { has_any_court_position = yes }
			add = 50
		}
		## Zealous courtiers & those with high learning.
		if = {
			limit = {
				OR = {
					has_trait = zealous
					AND = {
						learning >= very_high_skill_rating
						NOT = { has_trait = cynical }
					}
				}
			}
			add = 25
		}
	}
	if = {
		limit = {
			bannable_serving_diarch_trigger = yes
		}
		add = -5000
	}
}

pilgrimage_entourage_sodding_everyone_set_weighting_value = {
	# Same-faith only for all of these.
	if = {
		limit = {
			faith = scope:host.faith
			is_designated_diarch = no
		}
		# Alright, now we're just grabbing everyone.
		## Plus landless councillors.
		if = {
			limit = { is_councillor = yes }
			add = 100
		}
		## Anyone with a learning education.
		if = {
			limit = { has_trait = education_learning }
			add = 25
		}
		## Finally, any adult courtier.
		if = {
			limit = { is_adult = yes }
			add = 1
		}
	}
	if = {
		limit = {
			bannable_serving_diarch_trigger = yes
		}
		add = -5000
	}
}
