﻿### EK NOTE: Added our new terrain types

adventurers_scout_for_talent_option = {
	is_shown = {
   		is_landless_adventurer = yes
		NOT = { has_perk = toe_the_line_perk }
	}

	is_valid = {
		NOT = { has_perk = toe_the_line_perk }
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_speed = -5
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_scout_for_talent_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

#EK ADDITION: Plunder travel option, unlocked from the raiding perk tree instead of regular raiding for laamps
adventurers_plunder_travel_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = taking_it_all_perk
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_speed = -30
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_plunder_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}
#EK ADDITION END

adventurers_make_local_deals_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = fearful_troops_perk
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_safety = -20
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_make_local_deals_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

adventurers_search_for_secrets_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = digging_for_dirt_perk
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_safety = -10
		travel_speed = 10
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_search_for_secrets_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

adventurers_encourage_relationships_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = chains_of_loyalty_perk
		any_courtier = {
			is_adult = yes
			count >= 3
		}
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_speed = 5
		travel_safety = -5
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_encourage_relationships_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

adventurers_gather_inspiration_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = popular_figurehead_perk
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_speed = 5
		travel_safety = -5
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_gather_inspiration_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

adventurers_proselytize_zealously_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		has_perk = zealous_proselytizer_perk
		is_landless_adventurer = yes
	}
	
	travel_modifier = {
		travel_speed = 5
		travel_safety = -5
	}
	
	on_applied_effect = {
		custom_tooltip = adventurers_proselytize_zealously_option.tt
	}
	
	ai_will_do = {
		value = 100
	}
}

adventurers_forward_scouts_option = {
	is_shown = {
   		is_landless_adventurer = yes
	}

	is_valid = {
		custom_tooltip = {
			text = adventurers_forward_scouts_option.tt.has_right_parameter
			domicile ?= { has_domicile_parameter = camp_unlocks_forward_scouts }
		}
	}
	
	travel_modifier = {
		travel_safety = 20
		travel_speed = -5
	}
	
	on_applied_effect = {
	}
	
	ai_will_do = {
		value = 100
	}
}

purchase_rough_terrain_gear_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = yes
	}

	is_valid = {
		is_landless_adventurer = yes
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				desc = purchase_mountaineer_gear_option
			}
		}
	}

	owner_modifier = {
		mountains_travel_danger = mountains_low_danger_reduction
		hills_travel_danger = hills_low_danger_reduction
		wetlands_travel_danger = wetlands_low_danger_reduction
		floodplains_travel_danger = floodplains_low_danger_reduction
		volcanic_travel_danger = volcanic_low_danger_reduction #EK EDIT: Added Volcanic terrain type
		black_marsh_travel_danger = black_marsh_low_danger_reduction #EK EDIT: Added Black Marsh terrain type
		tundra_travel_danger = tundra_low_danger_reduction #EK EDIT: Added Tundra terrain type
	}
	
	on_applied_effect = {
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = mountains
						terrain = desert_mountains
						terrain = hills
						terrain = wetlands
						terrain = floodplains
						#EK EDITS: added ek terraint ypes
						terrain = volcanic
						terrain = black_marsh
						terrain = tundra
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

purchase_desert_gear_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = yes
	}

	is_valid = {
		is_landless_adventurer = yes
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				desc = purchase_desert_gear_option
			}
		}
	}

	owner_modifier = {
		desert_travel_danger = desert_low_danger_reduction
		steppe_travel_danger = steppe_low_danger_reduction
		drylands_travel_danger = drylands_low_danger_reduction
		desert_mountains_travel_danger = desert_mountains_low_danger_reduction
		ashlands_travel_danger = ashlands_low_danger_reduction #EK EDIT: Added Ashlands terrain type
	}
	
	on_applied_effect = {
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = desert
						terrain = steppe
						terrain = drylands
						terrain = desert_mountains
						#EK EDIT: Added Ashlands terrain type
						terrain = ashlands
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

purchase_forest_gear_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = yes
	}

	is_valid = {
		is_landless_adventurer = yes
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				desc = purchase_rough_terrain_gear_option
			}
		}
	}

	owner_modifier = {
		forest_travel_danger = forest_low_danger_reduction
		taiga_travel_danger = taiga_low_danger_reduction
		jungle_travel_danger = jungle_low_danger_reduction
	}
	
	on_applied_effect = {
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = forest
						terrain = taiga
						terrain = jungle
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

experienced_captains_option = {
	is_shown = {
   		is_ruler = yes
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = medium_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = experienced_captains_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = medium_travel_option_cost
					desc = experienced_captains_option
				}
			}
		}
	}

	owner_modifier = {
		coastal_sea_travel_danger = medium_sea_danger_reduction
		sea_travel_danger = medium_sea_danger_reduction #Still a bit more dangerous since sea travel is more dangerous than coastal sea
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to character bloat for every AI
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				# Try to find a pool character with the Forder trait
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							#EK EDIT: ek age equivalency
							ek_human_age_equivalent >= 30
							ek_human_age_equivalent <= 55
							is_married = no
							has_trait = forder
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							#EK EDIT: ek age equivalency
							ek_human_age_equivalent >= 30
							ek_human_age_equivalent <= 55
							is_married = no
							has_trait = forder
						}
						save_scope_as = new_guide
					}
				}
				# If we don't have one, we pull a random pool character and add the trait
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							#EK EDIT: ek age equivalency
							ek_human_age_equivalent >= 30
							ek_human_age_equivalent <= 55
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							#EK EDIT: ek age equivalency
							ek_human_age_equivalent >= 30
							ek_human_age_equivalent <= 55
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = forder
								}
							}
							add_trait = forder
						}
						save_scope_as = new_guide
					}
				}
				# Fallback scenario, we just create a character
				else = {
					create_character = {
						location = root.location
						template = sea_captain
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.medium_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = captain_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = captain_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					is_sea_province = yes
				}
			}
			add = {
				value = 100
			}
		}
	}
}

hire_experienced_mercenaries_option = {
	is_shown = {
   		is_ruler = yes
	}

	is_valid = {
		custom_tooltip = {
			text = available_mercenary.tt
			any_mercenary_company = {
				is_mercenary_in_hire_range = root
				mercenary_company_leader = {
					is_travelling = no
					is_at_war = no
					is_in_army = no
					NOT = {
						any_courtier = {
							is_in_army = yes
						}
					}
				}
			}
		}
	}
	
	cost = {
		gold = {
			add = {
				value = high_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = hire_experienced_mercenaries_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = high_travel_option_cost
					desc = hire_experienced_mercenaries_option
				}
			}
		}
	}
	
	travel_modifier = {
		travel_speed = 10
		travel_safety = 20
	}
	
	on_applied_effect = {
		hidden_effect = {
			random_mercenary_company = {
				limit = {
					is_mercenary_in_hire_range = root
					mercenary_company_leader = {
						is_travelling = no
						is_at_war = no
						is_in_army = no
						NOT = {
							any_courtier = {
								is_in_army = yes
							}
						}
					}
				}
				mercenary_company_leader = {
					save_scope_as = mercenary_leader
				}
			}
			
			scope:mercenary_leader = {
				add_gold = root.high_travel_option_cost
			}
			
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				send_interface_toast = {
					type = event_toast_effect_good
					title = mercenary_leader.t
					left_icon = scope:mercenary_leader
					root.current_travel_plan ?= {
						add_companion = scope:mercenary_leader
					}
				}
			}
		}
		custom_tooltip = mercenary_leader_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 50
				}
			}
			add = {
				value = 100
			}
		}
		if = {
			limit = {
				travel_plan_owner.gold <= travel_plan_owner.minor_gold_value
			}
			add = {
				value = -500
			}
		}
	}
}

#EK ADDITIONS: new options

# This can be further fleshed out in the future, to include more actions regarding the court mage
hire_alteration_mage_option = {
	is_shown = {
   		is_ruler = yes
		OR = {	# Perfomnce trigger. We don't want every count to scan for a mage every time they travel
			is_ai = no
			highest_held_title_tier >= tier_kingdom
		}
	}

	is_valid = { 
		custom_tooltip = { 
			text = not_already_has_feather.tt
			NOT = { has_character_modifier = modifier_ritual_feather }
		}
	}
	
	cost = {
		gold = {
			add = {
				value = high_travel_option_cost
				desc = hire_alteration_mage_option
			}
		}
	}
	
	travel_modifier = {
		travel_speed = 20
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = {
				limit = {
					exists = root.capital_province
					any_pool_character = {
						province = root.capital_province
						is_available_ai_adult = yes
						can_magic_trigger = yes
						has_perk = alteration_journeyman_perk
					}
				}
				random_pool_character = {
					province = root.capital_province
					limit = {
						is_available_ai_adult = yes
						can_magic_trigger = yes
						has_perk = alteration_journeyman_perk
					}
					save_scope_as = alteration_mage
				}
			}
			if = { 
				limit = { NOT = { exists = scope:alteration_mage } }
				create_character = {
					location = root.capital_province
					template = court_mage_template
					dynasty = none
					save_scope_as = alteration_mage
					after_creation = {
						if = { limit = { NOT = { has_perk = alteration_novice_perk } }
							add_perk = alteration_novice_perk
						}
						if = { limit = { NOT = { has_perk = alteration_apprentice_perk } }
							add_perk = alteration_apprentice_perk
						}
						if = { limit = { NOT = { has_perk = alteration_journeyman_perk } }
							add_perk = alteration_journeyman_perk 
						}
					}
				}			
			}			
			scope:alteration_mage = {
				add_gold = root.high_travel_option_cost
			}
			
			send_interface_toast = {
				title = alteration_mage.t
				left_icon = scope:alteration_mage
				root.current_travel_plan ?= {
					add_companion = scope:alteration_mage
				}
			}
		}
		custom_tooltip = alteration_mage_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 50
				}
			}
			add = {
				value = 100
			}
		}
		if = {
			limit = {
				travel_plan_owner.gold <= travel_plan_owner.minor_gold_value
			}
			add = {
				value = -500
			}
		}
	}
}

#EK TODO GFX: add icon
hire_argonian_guide_option = {
	is_shown = {
		is_ruler = yes
		#Twe can't scope to the travel owner's destination or route here, so this option is generic
		NOT = { culture = { has_cultural_tradition = tradition_histskin } }
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = medium_travel_option_cost
				desc = hire_argonian_guide_option
			}
		}
	}

	owner_modifier = {
		black_marsh_travel_danger = black_marsh_argonian_travel_option_danger_reduction
		wetlands_travel_danger = wetlands_medium_danger_reduction
		floodplains_travel_danger = floodplains_medium_danger_reduction
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forder #EK NOTE: this is copied from forder, we still prefer argonians who know their way around rivers n' stuff
							has_character_flag = race_argonian
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forder
							has_character_flag = race_argonian
						}
						save_scope_as = new_guide
					}
				}
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_character_flag = race_argonian
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_character_flag = race_argonian
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						age = { 30 55 }
						dynasty = none
						faith = faith:hist
						culture = culture:agaceph #these guys are the friendliest to outsiders
						random_traits_list = {
							count = 1
							education_martial_1 = {}
							education_martial_2 = {}
							education_martial_3 = {}
							education_martial_4 = {}
						}
						random_traits = yes
						gender_female_chance = root_soldier_female_chance
						after_creation = {
							random_list = {
								55 = {
								
								}
								45 = {
									add_trait = adventurer
								}
							}
							random_list = {
								55 = {
								
								}
								45 = {
									add_trait = forder
								}
							}
							random_list = {
								55 = {
								
								}
								45 = {
									add_trait = lifestyle_traveler
								}
							}
							### EK EDIT
							ek_character_setup_effect = yes
							unmourned_blood_traits_effect = yes
						}
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						title = argonian_guide.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = argonian_guide_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 2
					OR = {
						terrain = black_marsh
					}
				}
			}
			add = {
				value = 150
			}
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = wetlands
						terrain = floodplains
					}
				}
			}
			add = {
				value = 25
			}
		}
	}
}
#EK ADDITION END

hire_jungle_expert_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				desc = hire_jungle_expert_option
			}
		}
	}

	owner_modifier = {
		jungle_travel_danger = jungle_medium_danger_reduction
		#EK EDIT: Added Jungle Hills and Valenwood terrain types
		jungle_hills_travel_danger = jungle_hills_medium_danger_reduction
		valenwood_travel_danger = valenwood_medium_danger_reduction
		valenwood_hills_travel_danger = valenwood_hills_medium_danger_reduction
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				# Try to find a pool character the Jungle Stalker trait
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = jungle_stalker
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = jungle_stalker
						}
						save_scope_as = new_guide
					}
				}
				# Otherwise, just give the trait to a pool character
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = jungle_stalker
								}
							}
							add_trait = jungle_stalker
						}
						save_scope_as = new_guide
					}
				}
				# else create a character
				else = {
					create_character = {
						location = root.location
						template = jungle_guide
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = jungle_stalker_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = jungle_stalker_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					terrain = jungle
					#EK EDIT: Added Jungle Hills and Valenwood terrain types
					terrain = jungle_hills
					terrain = valenwood
					terrain = valenwood_hills
				}
			}
			add = {
				value = 100
			}
		}
	}
}

hire_mountaineer_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = hire_mountaineer_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = hire_mountaineer_option
				}
			}
		}
	}

	owner_modifier = {
		mountains_travel_danger = mountains_medium_danger_reduction
		desert_mountains_travel_danger = desert_mountains_medium_danger_reduction
		hills_travel_danger = hills_medium_danger_reduction
		volcanic_travel_danger = volcanic_medium_danger_reduction #EK EDIT: Added Volcanic terrain type
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = rough_terrain_expert
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = rough_terrain_expert
						}
						save_scope_as = new_guide
					}
				}
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = rough_terrain_expert
								}
							}
							add_trait = rough_terrain_expert
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						template = mountaineer_guide
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = mountaineer_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = mountaineer_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = mountains
						terrain = desert_mountains
						terrain = hills
						terrain = volcanic #EK EDIT: Added Volcanic terrain type
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

hire_forder_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
		is_playable_character = yes
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = hire_forder_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = hire_forder_option
				}
			}
		}
	}

	owner_modifier = {
		wetlands_travel_danger = wetlands_medium_danger_reduction
		floodplains_travel_danger = floodplains_medium_danger_reduction
		#EK EDIT: Added Mangrove Forest and Black Marsh terrain types
		mangrove_forest_travel_danger = mangrove_forest_medium_danger_reduction
		black_marsh_travel_danger = black_marsh_low_danger_reduction
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forder
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forder
						}
						save_scope_as = new_guide
					}
				}
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = forder
								}
							}
							add_trait = forder
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						template = forder_guide
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = forder_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = forder_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = wetlands
						terrain = floodplains
						#EK EDIT: Added Mangrove Forest and Black Marsh terrain types
						terrain = mangrove_forest
						terrain = black_marsh
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

hire_desert_warrior_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = hire_desert_warrior_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = hire_desert_warrior_option
				}
			}
		}
	}

	owner_modifier = {
		desert_travel_danger = desert_medium_danger_reduction
		steppe_travel_danger = steppe_medium_danger_reduction
		drylands_travel_danger = drylands_medium_danger_reduction
		#EK EDIT: Added Desert Hills, Ashlands and Wasteland terrain types
		desert_hills_travel_danger = desert_hills_medium_danger_reduction
		ashlands_travel_danger = ashlands_medium_danger_reduction
		wasteland_travel_danger = wasteland_medium_danger_reduction
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = desert_warrior
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = desert_warrior
						}
						save_scope_as = new_guide
					}
				}
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = desert_warrior
								}
							}
							add_trait = desert_warrior
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						template = desert_warrior_guide
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = desert_warrior_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = desert_warrior_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = desert
						terrain = steppe
						terrain = drylands
						#EK EDIT: Added Desert Hills, Ashlands and Wasteland terrain types
						terrain = desert_hills
						terrain = ashlands
						terrain = wasteland
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

hire_rough_terrain_expert_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = hire_rough_terrain_expert_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = hire_rough_terrain_expert_option
				}
			}
		}
	}

	owner_modifier = {
		forest_travel_danger = forest_medium_danger_reduction
		taiga_travel_danger = taiga_medium_danger_reduction
		#EK EDIT: Added Taiga Hills and Tundra terrain types
		taiga_hills_travel_danger = taiga_hills_medium_danger_reduction
		tundra_travel_danger = tundra_medium_danger_reduction
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forest_fighter
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							has_trait = forest_fighter
						}
						save_scope_as = new_guide
					}
				}
				else_if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
						}
						if = {
							limit = {
								NOT = {
									has_trait = forest_fighter
								}
							}
							add_trait = forest_fighter
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						template = rough_terrain_guide
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.low_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = rough_terrain_expert_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = rough_terrain_expert_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					OR = {
						terrain = forest
						terrain = taiga
						 #EK EDIT: Added Taiga Hills and Tundra terrain types
						terrain = taiga_hills
						terrain = tundra
					}
				}
			}
			add = {
				value = 100
			}
		}
	}
}

court_physician_option = {
	is_shown = {
		is_ruler = yes
	}

	is_valid = {
		custom_tooltip = {
			text = court_physician_option_tt
			exists = court_position:court_physician_court_position
			court_position:court_physician_court_position = {
				is_ai = yes
				is_available = yes
			}
		}
	}
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = court_physician_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = court_physician_option
				}
			}
		}
	}

	on_applied_effect = {
		# The Court Physician always gets auto-added
	}

	owner_modifier = {
		epidemic_travel_danger = epidemic_medium_danger_reduction
	}
	owner_modifier_description = court_physician_option_suffix

	ai_will_do = {
		value = 50
	}
}

cultural_ambassador_option = {
	is_shown = {
		is_ruler = yes
	}

	is_valid = {
	}
	
	cost = {
		gold = {
			add = {
				value = low_travel_option_cost
				if = {
					limit = {
						government_has_flag = government_is_nomadic
					}
					multiply = 0.5
				}
				desc = cultural_ambassador_option
			}
		}
		herd = {
			if = {
				limit = {
					government_has_flag = government_is_nomadic
				}
				add = {
					value = low_travel_option_cost
					desc = cultural_ambassador_option
				}
			}
		}
	}
	
	on_applied_effect = {
		hidden_effect = {
			if = { # No reason to steal too many Mercenaries away for travels; players and AI kings+ only
				limit = {
					OR = {
						is_ai = no
						highest_held_title_tier >= tier_kingdom
					}
				}
				if = {
					limit = {
						exists = root.capital_province
						any_pool_character = {
							province = root.capital_province
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							diplomacy > 8
						}
					}
					random_pool_character = {
						province = root.capital_province
						limit = {
							is_available_ai_adult = yes
							has_no_particular_noble_roots_trigger = yes
							ek_human_age_equivalent >= 30 #EK EDIT
							ek_human_age_equivalent <= 55 #EK EDIT
							is_married = no
							diplomacy > 10
						}
						save_scope_as = new_guide
					}
				}
				else = {
					create_character = {
						location = root.location
						template = cultural_ambassador
						save_scope_as = new_guide
					}
				}
				if = {
					limit = {
						exists = scope:new_guide
					}
					scope:new_guide = {
						add_gold = root.medium_travel_option_cost
						move_to_pool = yes
						add_character_flag = travel_option_added_character	#to send it back to pool when the travel is done
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = cultural_ambassador_recruited.t
						left_icon = scope:new_guide
						root.current_travel_plan ?= {
							add_companion = scope:new_guide
						}
					}
					root.current_travel_plan ?= {
						set_variable = {
							name = cultural_ambassador_scope
							value = scope:new_guide
						}
					}
				}
			}
		}
		custom_tooltip = cultural_ambassador_recruited.tt
	}
	
	ai_will_do = {
		value = 0
		if = {
			limit = {
				any_future_path_location = {
					count >= 3
					exists = county
					NOT = { culture = root.travel_plan_owner.culture }
				}
			}
			add = {
				value = 50
			}
		}
		if = {
			limit = {
				travel_plan_owner.gold <= travel_plan_owner.minor_gold_value
			}
			add = {
				value = -500
			}
		}
		if = {
			limit = {
				travel_plan_owner = {
					is_landless_adventurer = yes
				}
			}
			add = {
				value = -500
			}
		}
	}
}

hire_allied_mercenaries_option = {
	is_shown = {
		has_bp3_dlc_trigger = yes
	}

	is_valid = {
		has_perk = mercenary_contacts_perk
	}
	
	travel_modifier = {
		travel_speed = 5
		travel_safety = 5
	}
	
	ai_will_do = {
		value = 100
	}
}

appeasement_option = {
	is_shown = {
		has_bp3_dlc_trigger = yes
	}

	is_valid = {
		has_perk = local_hero_perk
	}

	owner_modifier = {
		monthly_tyranny = -0.8
		monthly_dread = -0.4
	}

	ai_will_do = {
		value = 50
	}
}

leisurely_option = {
	is_shown = {
		has_bp3_dlc_trigger = yes
	}

	is_valid = {
		has_perk = local_hero_perk
	}

	owner_modifier = {
		stress_gain_mult = -0.5
	}

	travel_modifier = {
		travel_speed = -20
	}

	on_travel_end_effect = {
		custom_tooltip = leisurely_option_tt
	}

	ai_will_do = {
		value = 50
	}
}

tutor_child_option = {
	is_shown = {
		has_bp3_dlc_trigger = yes
	}

	is_valid = {
		has_perk = know_your_land_know_your_people_perk
		trigger_if = {
			limit = {
				exists = player_heir
			}
			player_heir = {
				age < 15
				save_temporary_scope_as = heir_for_tooltip
				custom_tooltip = {
					text = heir_can_join_tt
					location = root.location
					is_available_allow_travelling = yes
				}
			}
		}
		trigger_else = {
			custom_tooltip = {
				text = no_heir_tt
				always = no
			}
		}
	}

	owner_modifier = {
		child_opinion = 5
	}

	travel_modifier = {
		travel_speed = -5
	}

	on_applied_effect = {
		hidden_effect = {
			if = {
				limit = {
					exists = player_heir
					player_heir = {
						age < 15
						location = root.location
					}
				}
				player_heir = { save_scope_as = tutored_heir }
				root.current_travel_plan ?= {
					add_companion = scope:tutored_heir
				}
			}
		}
		if = {
			limit = {
				exists = scope:tutored_heir
			}
			custom_tooltip = child_brought_along_specific.tt
		}
		else = {
			custom_tooltip = child_brought_along.tt
		}
	}
	
	ai_will_do = {
		value = 1
	}

	on_travel_end_effect = {
		custom_tooltip = tutor_child_option_tt
	}
}

fancy_mounts_option = {
	is_shown = {
		is_ruler = yes
		is_landless_adventurer = no
	}

	is_valid = {
		any_directly_owned_province = {
			OR = {
				has_building_or_higher = stables_04
				has_building_or_higher = camel_farms_04
			}
		}
	}

	travel_modifier = {
		travel_speed = 20
	}

	ai_will_do = {
		value = 100
	}
}

military_recruits_option = {
	is_shown = {
		primary_title.tier >= tier_duchy
		is_landless_adventurer = no
	}

	is_valid = {
		any_directly_owned_province = {
			has_building_or_higher = military_academy_01
		}
	}

	travel_modifier = {
		travel_safety = 10
	}

	on_applied_effect = {
		ordered_knight = {
			limit = {
				is_available_ai_adult = yes 
				age < 50
			}
			order_by = {
				value = 0
				subtract = prowess
			}
			max = 3
			check_range_bounds = no
			save_temporary_scope_as = knight_to_add
			root = {
				send_interface_message = {
					type = event_marshal_good
					title = military_recruits_option.t
					desc = military_recruits_option.desc
					left_icon = scope:knight_to_add
					current_travel_plan ?= {
						add_to_variable_list = {
							name = knights_to_train 
							target = scope:knight_to_add
						}
						add_companion = scope:knight_to_add
					}
				}
			}
		}
		# trigger hidden recursive event
		trigger_event = {
			id = travel_events.0060
			days = { 5 10 }
		}
	}

	ai_will_do = {
		value = 100
	}
}

superior_armaments_option = {
	is_shown = {
		primary_title.tier >= tier_duchy
		is_landless_adventurer = no
	}

	is_valid = {
		any_directly_owned_province = {
			has_building_or_higher = blacksmiths_01
		}
	}

	travel_modifier = {
		travel_safety = 10
	}

	owner_modifier = {
		artifact_decay_reduction_mult = -0.2
	}

	ai_will_do = {
		value = 90
	}
}

anxious_option = {
	is_shown = {
		is_ruler = yes
	}

	is_valid = {
		# Putting these here so the player knows why this option is available to them
		OR = {
			has_trait = impatient 
			has_trait = craven
			has_trait = reckless
		}
	}

	travel_modifier = {
		travel_speed = 20
		travel_safety = -10
	}

	ai_will_do = {
		value = 50
	}
}

circumspect_option = {
	is_shown = {
		is_ruler = yes
	}

	is_valid = {
		# Putting these here so the player knows why this option is available to them
		OR = {
			has_trait = fickle
			has_trait = arbitrary
			has_trait = paranoid
		}
	}

	travel_modifier = {
		travel_speed = -10
	}

	owner_modifier = {
		enemy_hostile_scheme_phase_duration_add = massive_scheme_phase_duration_malus_value
		enemy_hostile_scheme_success_chance_add = -50
	}

	ai_will_do = {
		value = 50
	}
}

estate_mounts_option = {
	is_shown = {
		domicile ?= {
			has_domicile_parameter = estate_unlock_mount_travel_option
		}
	}

	is_valid = {
	}

	travel_modifier = {
		travel_speed = 10
	}
	
	owner_modifier = {
		travel_companion_opinion = 10
		monthly_prestige = 1
	}

	ai_will_do = {
		value = 100
	}
}
