hunt_success_chance_value = {
	activity_host = {
		### HOST
		# SKILLS
		add = {
			value = learning
			divide = 4
			ceiling = yes
			max = 10
			desc = learning_modifier
		}
		add = {
			value = martial
			divide = 8
			ceiling = yes
			max = 10
			desc = martial_modifier
		}
		add = {
			value = prowess
			divide = 4
			ceiling = yes
			max = 10
			desc = prowess_modifier
		}
		# TRAIT
		add = {
			value = 0
			if = {
				limit = { has_trait = lifestyle_hunter }
				add = 3
			}
			if = {
				limit = {
					has_trait = lifestyle_hunter
					involved_activity = {
						has_activity_option = { category = special_type option = hunt_type_falconry }
					}
					has_trait_xp = { trait = lifestyle_hunter track = falconer value >= 25 }
				}
				add = {
					value = 3
					if = {
						limit = {
							has_trait_xp = { trait = lifestyle_hunter track = falconer value >= 50 }
						}
						add = 3
					}
					if = {
						limit = {
							has_trait_xp = { trait = lifestyle_hunter track = falconer value >= 75 }
						}
						add = 3
					}
				}
			}
			else_if = {
				limit = {
					has_trait = lifestyle_hunter
					involved_activity = {
						NOT = {
							has_activity_option = { category = special_type option = hunt_type_falconry }
						}
					}
					has_trait_xp = { trait = lifestyle_hunter track = hunter value >= 25 }
				}
				add = {
					value = 3
					if = {
						limit = {
							has_trait_xp = { trait = lifestyle_hunter track = hunter value >= 50 }
						}
						add = 3
					}
					if = {
						limit = {
							has_trait_xp = { trait = lifestyle_hunter track = hunter value >= 75 }
						}
						add = 3
					}
				}
			}
			desc = hunt_success_chance.trait
		}
		# MODIFIERS
		if = { # Shrek
			limit = {
				has_character_modifier = hunt_guide_local_madman_modifier
				var:hunt_guide_local_madman_place ?= involved_activity.activity_location.county
			}
			add = {
				value = 5
				desc = hunt_success_chance.hunt_guide_local_madman_modifier
			}
		}
		if = { # Tame Deer
			limit = {
				has_character_modifier = hunt_tame_deer_modifier
				exists = involved_activity.var:animal_type
				var:tame_animal_type ?= involved_activity.var:animal_type
			}
			add = {
				value = 5
				desc = hunt_success_chance.hunt_tame_deer_modifier
			}
		}
		if = { # Beastmaster
			limit = { has_character_modifier = ep2_beastmaster_modifier }
			add = {
				value = 5
				desc = hunt_success_chance.ep2_beastmaster_modifier
			}
		}
		if = { # Scenthound
			limit = {
				has_character_modifier = dog_story_scenthound_modifier
				involved_activity = {
					NOR = {
						has_activity_option = { category = special_type option = hunt_type_falconry }
						hunt_animal_type_dangerous_trigger = { VAR = var:animal_type }
					}
				}
			}
			add = {
				value = 5
				desc = hunt_success_chance.dog_story_scenthound_modifier
			}
		}
		if = { # Beasthound
			limit = {
				has_character_modifier = dog_story_beasthound_modifier
				involved_activity = {
					hunt_animal_type_dangerous_trigger = { VAR = var:animal_type }
					NOT = {
						has_activity_option = { category = special_type option = hunt_type_falconry }
					}
				}
			}
			add = {
				value = 5
				desc = hunt_success_chance.dog_story_beasthound_modifier
			}
		}
		# MASTER OF THE HUNT
		if = {
			limit = { exists = court_position:master_of_hunt_court_position }
			add = {
				value = 0
				court_position:master_of_hunt_court_position = {
					if = {
						limit = {
							aptitude = { court_position = master_of_hunt_court_position value <= 1 }
						}
						add = 3
					}
					else_if = {
						limit = {
							aptitude = { court_position = master_of_hunt_court_position value = 2 }
						}
						add = 6
					}
					else_if = {
						limit = {
							aptitude = { court_position = master_of_hunt_court_position value = 3 }
						}
						add = 9
					}
					else_if = {
						limit = {
							aptitude = { court_position = master_of_hunt_court_position value = 4 }
						}
						add = 12
					}
					else = { add = 15 }
				}
				desc = hunt_success_chance.master_of_hunt
			}
		}
		if = {
			limit = {
				has_court_position = master_of_hunt_court_position
			}
			add = {
				value = 10
				desc = hunt_success_chance.master_of_hunt_holder
			}
		}
		# HUNTSMAN
		if = {
			limit = { exists = court_position:huntperson_camp_officer }
			add = {
				value = 0
				court_position:huntperson_camp_officer = {
					if = {
						limit = {
							aptitude = { court_position = huntperson_camp_officer value <= 1 }
						}
						add = 3
					}
					else_if = {
						limit = {
							aptitude = { court_position = huntperson_camp_officer value = 2 }
						}
						add = 6
					}
					else_if = {
						limit = {
							aptitude = { court_position = huntperson_camp_officer value = 3 }
						}
						add = 9
					}
					else_if = {
						limit = {
							aptitude = { court_position = huntperson_camp_officer value = 4 }
						}
						add = 12
					}
					else = { add = 15 }
				}
				desc = hunt_success_chance.master_of_hunt
			}
		}
		# ESTATE
		if = {
			limit = {
				domicile ?= { has_domicile_parameter = kennels_more_successful_hunts_1 }
			}
			add = {
				value = kennels_more_successful_hunts_1_value
				desc = estate_has_kennels
			}
		}
		else_if = {
			limit = {
				domicile ?= { has_domicile_parameter = kennels_more_successful_hunts_2 }
			}
			add = {
				value = kennels_more_successful_hunts_2_value
				desc = estate_has_kennels
			}
		}
		if = { #Greek Architecture
			limit = {
				religion = religion:hellenism_religion
				OR = {
					has_title = title:b_ephesos
					any_liege_or_above = { has_title = title:b_ephesos }
				}
				title:b_ephesos = {
					religion = religion:hellenism_religion
					holder.religion = religion:hellenism_religion
					title_province = { has_building_or_higher = temple_of_artemis_01 }
				}
			}
			add = {
				value = 15
				desc = hunt_success_chance.temple_of_artemis
			}
		}
	}
	# GUESTS
	if = { # Hunters
		limit = {
			any_attending_character = {
				NOR = {
					this = prev.activity_host
					prev.activity_host.court_position:master_of_hunt_court_position ?= this
				}
				OR = {
					has_trait = lifestyle_hunter
					has_character_modifier = ep2_beastmaster_modifier
				}
			}
		}
		add = {
			value = 0
			every_attending_character = {
				limit = {
					NOR = {
						this = prev.activity_host
						prev.activity_host.court_position:master_of_hunt_court_position ?= this
					}
					has_trait = lifestyle_hunter
				}
				add = 3
			}
			every_attending_character = {
				limit = {
					NOR = {
						this = prev.activity_host
						prev.activity_host.court_position:master_of_hunt_court_position ?= this
					}
					has_character_modifier = ep2_beastmaster_modifier
				}
				add = 3
			}
			desc = hunt_success_chance.attending_hunters
		}
	}
	#OPTION
	if = {
		limit = {
			has_activity_option = { category = hunt_option_attendants option = hunt_attendants_normal }
		}
		add = {
			value = 1.25
			multiply = hunt_success_chance_roco_amenity_level_value
			desc = hunt_success_chance.hunt_option_attendants
		}
	}
	else_if = {
		limit = {
			has_activity_option = { category = hunt_option_attendants option = hunt_attendants_many }
		}
		add = {
			value = 2.5
			multiply = hunt_success_chance_roco_amenity_level_value
			desc = hunt_success_chance.hunt_option_attendants
		}
	}
	# FORCED ANIMAL
	if = {
		limit = { exists = var:hunt_forced_type }
		add = {
			value = 0
			if = {
				limit = { var:hunt_forced_type = flag:deer }
				add = -10
			}
			else_if = {
				limit = { var:hunt_forced_type = flag:fox }
				add = -5
			}
			else_if = {
				limit = { var:hunt_forced_type = flag:hare }
				add = -10
			}
			else_if = {
				limit = { var:hunt_forced_type = flag:wolf }
				add = -10
			}
			desc = hunt_success_chance.forced_type
		}
	}
	# METHOD	
	if = { # Captive
		limit = { exists = var:captive_release }
		add = {
			value = 15
			desc = hunt_success_chance.captive_release
		}
	}
	# LOCATION
	activity_location = { add = hunt_province_reference_value }
	# CULTURE
	save_temporary_scope_as = activity_temp
	add = {
		value = 0
		activity_host.culture ?= {
			if = { # Forests
				limit = {
					has_cultural_parameter = forest_hunt_success_chance
					scope:activity_temp.activity_location = {
						OR = {
							terrain = forest
							terrain = taiga
						}
					}
				}
				add = 5
			}
			if = { # Hills
				limit = {
					has_cultural_parameter = hills_hunt_success_chance
					scope:activity_temp.activity_location = { terrain = hills }
				}
				add = 5
			}
			if = { # Deserts
				limit = {
					has_cultural_parameter = desert_hunt_success_chance
					scope:activity_temp.activity_location = {
						OR = {
							terrain = desert
							terrain = oasis
						}
					}
				}
				add = 5
			}
			if = { # Steppes
				limit = {
					has_cultural_parameter = steppe_hunt_success_chance
					scope:activity_temp.activity_location = { terrain = steppe }
				}
				add = 5
			}
			if = { # Mountains
				limit = {
					has_cultural_parameter = mountains_hunt_success_chance
					scope:activity_temp.activity_location = {
						OR = {
							terrain = mountains
							terrain = desert_mountains
						}
					}
				}
				add = 5
			}
			if = { # Drylands
				limit = {
					has_cultural_parameter = drylands_hunt_success_chance
					scope:activity_temp.activity_location = {
						OR = {
							terrain = drylands
							terrain = desert
						}
					}
				}
				add = 5
			}
			if = { # Jungle
				limit = {
					has_cultural_parameter = jungle_hunt_success_chance
					scope:activity_temp.activity_location = { terrain = jungle }
				}
				add = 5
			}
			if = { # Wetlands
				limit = {
					has_cultural_parameter = wetlands_hunt_success_chance
					scope:activity_temp.activity_location = {
						OR = {
							terrain = wetlands
							terrain = floodplains
						}
					}
				}
				add = 5
			}
		}
		desc = hunt_success_chance.culture
	}
	# SIGHTINGS
	if = {
		limit = {
			OR = {
				# Standard
				AND = {
					OR = {
						activity_location.county = { has_county_modifier = hunt_sighting_standard_modifier }
						activity_location.county = { has_county_modifier = hunt_sighting_dangerous_modifier }
					}
					has_activity_option = { category = special_type option = hunt_type_standard }
				}
				# Falconry
				AND = {
					activity_location.county = { has_county_modifier = hunt_sighting_falconry_modifier }
					has_activity_option = { category = special_type option = hunt_type_falconry }
				}
			}
			# Sighting animal is same as activity animal
			exists = var:animal_type
			exists = activity_location.county.var:animal_type
			var:animal_type = activity_location.county.var:animal_type
		}
		add = {
			value = 20
			desc = hunt_success_chance.sighting
		}
	}
	# MODIFIERS
	if = { # Mismanaged Game
		limit = {
			activity_location.county = { has_county_modifier = hunt_mismanaged_game_modifier }
			exists = var:animal_type
			activity_host.var:mismanaged_animal_type ?= var:animal_type
		}
		add = {
			value = -5
			desc = hunt_success_chance.hunt_mismanaged_game_modifier
		}
	}
	if = { # Abundant Game
		limit = {
			activity_location.county = { has_county_modifier = ep3_abundant_game_modifier }
		}
		add = {
			value = 10
			desc = hunt_success_chance.hunt_abundant_game_modifier
		}
	}
	if = { # Wild Predators
		limit = {
			activity_location.county = { has_county_modifier = ep3_wild_predators_modifier }
		}
		add = {
			value = -5
			desc = hunt_success_chance.hunt_wild_predators_modifier
		}
	}
	# EVENTS
	if = {
		limit = { exists = var:hunt_success_chance_event }
		add = {
			value = var:hunt_success_chance_event
			desc = hunt_success_chance.events
		}
	}
	# TYPE
	if = { # Falconry is somewhat more difficult
		limit = {
			has_activity_option = { category = special_type option = hunt_type_falconry }
		}
		multiply = 0.75
	}
	else_if = { # Legendary is a lot more difficult
		limit = {
			has_activity_option = { category = special_type option = hunt_type_legendary }
		}
		multiply = 0.5
	}
	if = {
		limit = { var:hunt_success ?= flag:no }
		multiply = 0
	}
	min = 10
	max = 80
}