﻿#EK NOTE added our own events
# On actions for the Hunt activity

# 1. Start/Method
hunt_start_events = {
	trigger = {
		exists = scope:activity
		involved_activity.activity_host ?= this
	}
	events = {
		hunt.0500 # Standard
		hunt.0510 # Legendary
		hunt.0530 # Falconry
	}
}

# 2. Random Flavor
hunt_random_pulse = {
	trigger = {
		exists = scope:activity
		OR = {
			is_ai = no
			involved_activity.activity_host ?= this
		}
		scope:activity ?= { hunt_is_nerge_type = no }
	}
	random_events = {
		chance_of_no_event = {
			if = {
				limit = { this = scope:host }
				value = 0
			}
			else = { value = 50 }
		}
		# Generic
		100 = hunt.1011 #A rival, or someone that doesn't like you, is being an ass
		5 = hunt.1021 #You run into a beautiful peasant
		100 = hunt.1023 #Dog helps you find animal
		200 = hunt.4002 #A hunt guest shares a secret about someone with you
		100 = hunt.4003 #Poachers in the woods
		5 = hunt.4008 #Someone kills peasant
		100 = hunt.4015 #You walk in (out?) on lovers
		100 = hunt.5001 #You get the urge to pick herbs and flowers
		100 = hunt.5002 #Someone in your hunting party gets the urge to pick herbs and flowers
		# Legendary
		5 = hunt.4012 #See glimpse of mystical animal - starts story from sighting/randomly
		5 = hunt.7001 #Meet local madman (Shrek)
		5 = hunt.7020 #Boulder jumping
		# Relations
		200 = hunt.4011 #Your lover has come with, sneak away together
		150 = hunt.5003 #Your lover gives you flowers or a dead animal
		# Intents
		500 = hunt.7100 #Seduce convo
		500 = hunt.7300 # Befriend convo
		# Falconry
		25 = hunt.5060 # Find an eyas
		100 = hunt.8000 # Show off your falconry skills to your lover
		100 = hunt.8010 # Show off your falconry skills generally
		100 = hunt.8020 # Your falcon shows up with some coins!
		100 = hunt.8030 # Your falcon finds some tracking material!
		100 = hunt.8040 # Someone is showing off their falcon glove
		# Legendary Animal
		100 = hunt.8050 # You think you see a trace of the beast
		100 = hunt.8060 # Beware the beast!
		100 = hunt.8070 # You see the beast? Is it real?
		# Schemes
		5000 = hunt.7210 #Do you kill your murder target or not? - Chase
		5000 = hunt.7410 # Do you abduct or not?
		# MPO - Nomadic flavour events
		500 = mpo_hunt.0001 # Teach your child how to hunt something small
		500 = mpo_hunt.0010 # A bird of prey tries to attack someone you care about
		500 = mpo_hunt.0020 # You try to keep a wolf cub pet
		500 = mpo_hunt.0030 # You find a banished warrior
		250 = mpo_hunt.0040 # Your horses grow lean from the chase
		250 = mpo_hunt.0050 # Local hunters seek to aid you
		250 = mpo_hunt.0060 # You come across a colony of marmots to massacre
		##EK ADDITION: Added our own events
		100 = ek_hunt.1001 # You find a small secluded shrine dedicated to Hircine
		100 = ek_hunt.1003 # Spriggans gets pissed at your hunting
		100 = ek_hunt.1004 # The Forest Dark
		100 = ek_hunt.1006 # Racing the Cliffs
		100 = ek_hunt.1007 # The Source of the Bone
	}
	effect = { # Used to ensure a certain progress has been made before some events to fire
		involved_activity = { set_variable = hunt_outcome_random }
	}
}

# Outcome Start
hunt_outcome_start_events = {
	trigger = {
		exists = scope:activity
		involved_activity.activity_host ?= this
		scope:activity ?= { hunt_is_nerge_type = no }
	}
	random_events = {
		100 = hunt.1001 #Corner
		100 = hunt.1030 #Ambush
		100 = hunt.1040 #Stealth
		100 = hunt.1060 #Falconry
		5 = hunt.4012 #See glimpse of mystical animal - starts story from sighting/randomly
	}
}

# Outcome Complication
hunt_outcome_complication_events = {
	trigger = {
		exists = scope:activity
		OR = {
			is_ai = no
			involved_activity.activity_host ?= this
		}
		scope:activity ?= { hunt_is_nerge_type = no }
	}
	random_events = {
		# Shared
		50 = hunt.1002 # Chase goes well
		100 = hunt.4006 #Peasants foraging in the forest
		25 = hunt.4007 #Run into a rampaging animal
		100 = hunt.4910 #A guest is injured
		100 = hunt.4016 #You fake a catch
		100 = hunt.3020 #EP2: Tracks skill check
		100 = hunt.5010 #EP2: Fawning doe
		100 = hunt.7011 #EP2: Trapped guest
		50 = hunt.7800 #EP2: Arrow from nowhere
		# Schemes
		5000 = hunt.1012 #Do you shoot your murder target or not? - Ambush
		25 = hunt.1080 # Party murders you
		5000 = hunt.7210 #Do you kill your murder target or not? - Chase
		5000 = hunt.7410 # Do you abduct or not?
		# Schemes
		200 = hunt.4009 #Participant has murder/abduct scheme against you (or you heir dislikes you)
		200 = hunt.4010 #Participant has murder/abduct scheme against close family
		# Legendary
		25 = hunt_mystical_animal.1007 # Mad legendary trip
		50 = hunt.4018 #You get the mystical white animal!
		50 = hunt.8520 # Two sets of hoofprints, your huntmaster thinks you're following the wrong ones
		50 = hunt.8530 # Your leg gets stuck in a trap
		50 = hunt.8550 # You find droppings the same colour as the animal you're hunting
		# Falconry
		25 = hunt.5050 #EP2: Falcon snatched
		25 = hunt.8500 #EP2: Falcon is up in a tree and refuses to come down
		25 = hunt.8510 #EP2: Falcon attacked by a prowling animal (usually a big cat)
		# Animal specific
		25 = hunt.8560 # Big cat complication: you find a big cat cub abandoned in the wild
		10 = hunt.8570 # Herd animal complication: a hunt participant is caught in a stampede!
		25 = hunt.8580 # Predator complication: you find your prey but you're alone! Stare down the wolf
		25 = hunt.8590 # Predator complication: you find their cave
	}
}

# Outcome End
hunt_outcome_end_events = {
	trigger = {
		exists = scope:activity
		involved_activity.activity_host ?= this
		scope:activity ?= { hunt_is_nerge_type = no }
	}
	random_events = {
	 	# Corner
		1 = hunt.1003 # Success
		1 = hunt.1004 # Failure
		# Ambush
		1 = hunt.1032 # Success
		1 = hunt.1033 # Failure
		# Stealth
		1 = hunt.4001 # Success
		1 = hunt.1043 # Failure
		# Falconry
		1 = hunt.1062 #Falconry
		1 = hunt.1063 #Falconry
		# Legendary
		1 = hunt.4013 # Animal is not found
		1 = hunt.4017 # Animal found and killed 
		1 = hunt.4019 # Substitute animal found
		1 = hunt_mystical_animal.9001 # Animal found and killed
		1 = hunt_mystical_animal.1005 # Animal found but escaped
		1 = hunt.1090 # Animal escaped
		# Captive
		#1 = hunt.1052 #Dangerous
		#1 = hunt.1053 #Dangerous
	}
}

# End summary
hunt_end_events = {
	trigger = {
		involved_activity.activity_host ?= this
		scope:activity ?= { hunt_is_nerge_type = no }
	}
	random_events = {
		#hunt.8001 # Artifact end
		10 = hunt.9001 # Hunting end success
		3 = hunt.4004 #You bring down a particularly large animal - I
		#100 = hunt.4005 #You bring down a particularly large animal - II
		10 = hunt.9002 # Hunting end fail
	}
}

### SIGHTINGS

# For firing yearly Sighting events
hunt_sighting_on_action = {
	trigger = {
		hunt_sighting_event_trigger = yes
		NOR = {
			can_employ_court_position_type = master_of_hunt_court_position
			employs_court_position = master_of_hunt_court_position
			has_character_flag = recent_hunt_sighting
			has_character_flag = disabled_hunt_sightings_flag
		}
	}
	random_events = {
		chance_of_no_event = {
			value = 80
			if = {
				limit = { exists = court_position:master_of_hunt_court_position }
				add = -20
			}
			if = {
				limit = { exists = court_position:huntperson_camp_officer }
				add = -20
			}
			if = {
				limit = {
					has_character_flag = had_mystical_animal_story
					any_owned_story = { story_type = story_cycle_hunt_mystical_animal }
					NOT = {
						any_sub_realm_county = {
							has_county_modifier = hunt_sighting_legendary_modifier
							var:sighting_owner ?= root
						}
					}
				}
				add = -20
			}
		}
		100 = hunt.2500 # Standard
		5 = hunt.2510 # Legendary
		25 = hunt.2520 # Dangerous
		25 = hunt.2530 # Falconry
		25 = hunt.2540 # Sighting moves
	}
}


### Nerge flavor events
nerge_flavor_events_on_action = {
	random_events = {
		25 = mpo_nerge.1000 # Your eagle brings the pelt of an animal
		25 = mpo_nerge.1005 # A guest is not impressed with the hunt
		15 = mpo_nerge.1010 # Someone runs out of formation and scares the animals
		25 = mpo_nerge.1015 # Animals charge towards the group
		25 = mpo_nerge.1020 # The master of the hunt warns there aren't many animals left
		25 = mpo_nerge.1025 # Arguments break out over the spoils 
		5 = mpo_nerge.1030 # Another animal and their young are spotted
		15 = mpo_nerge.1035 # Hunters suggest a new tactic to catch the animals
		25 = mpo_hunt.0010 # A bird of prey tries to attack someone you care about
		25 = mpo_nerge.1040 # Hunter finds a bow among the bushes
		25 = mpo_nerge.1050 # Animal gets on the way, hunters try to get them
		25 = mpo_nerge.1060 # Delicious animals get on the way, get them
	}
}

nerge_flavor_events_ai_attending_on_action = {
	random_events = {
		chance_of_no_event = {
			value = 0
			if = {
				limit = {
					is_ai = yes
				}
				add = 50
			}
		}	
		25 = mpo_nerge.1000 # Your eagle brings the pelt of an animal
		25 = mpo_nerge.1005 # A guest is not impressed with the hunt
		1 = mpo_nerge.1010 # Someone runs out of formation and scares the animals
		1 = mpo_nerge.1015 # Animals charge towards the group
		25 = mpo_nerge.1020 # The master of the hunt warns there aren't many animals left
		25 = mpo_nerge.1025 # Arguments break out over the spoils 
		15 = mpo_nerge.1035 # Hunters suggest a new tactic to catch the animals
		1 = mpo_hunt.0010 # A bird of prey tries to attack someone you care about
		25 = mpo_nerge.1050 # Animal gets on the way, hunters try to get them
		25 = mpo_nerge.1060 # Delicious animals get on the way, get them
	}
}
