﻿fp1_yearly_events = {
	trigger = { fp1_eligible_for_yearly_events_trigger = yes }
	weight_multiplier = {
		base = 1
		modifier = { # Reduces frequency for characters with non-matching cultures
			factor = 0.33
			religion = religion:folkgerman_religion

			NOT = {
				culture = { has_cultural_pillar = heritage_north_germanic }
			}
		}
		modifier = { # Reduces frequency for having both sets of FP events valid
			factor = 0.5
			OR = {
				fp2_eligible_for_yearly_events_trigger = yes
				fp3_eligible_for_yearly_events_trigger = yes
			}
		}
	}

	random_events = {
		chance_to_happen = 65
		200 = 0
		
		# Other Events
#		100 = varangian.0001
		200 = trait_specific.9001 # Become Poet
		
		#FP1 Events
		## Shieldmaidens
		100 = fp1_shieldmaiden.0001 # A wrong-gender courtier wishes to fight for you.
		400 = fp1_shieldmaiden.0032 # Your shieldmaiden improves their skills.
		## General Yearlies
		200 = fp1_yearly.0001 # Escaped Thrall - A thrall leaves your court in the night.
		200 = fp1_yearly.0011 # Calls for Courtier to be Declared Nithing - Locals call for one of your courtiers to be exiled.
		200 = fp1_yearly.0021 # A Matter of Life and Death - Two knights fight to the death over nothing.
		200 = fp1_yearly.0031 # Tall Tales at the Table - A deceitful warrior is telling tall-tales at court.
		100 = fp1_yearly.0041 # Explorers from the South - An Islamic explorer stops by for a visit.
		200 = fp1_yearly.0051 # The Unquiet Dead - You are informed of a reputed-draugr.
		200 = fp1_yearly.0071 # In the Deep Places of the World - locals in your Scandi capital report a troll.
		200 = fp1_yearly.0091 # A Vessel fit for a Ruler - commissioning a personal longship.
		200 = fp1_yearly.0101 # A Game of Riddles - a courtier challenges you to a game of riddles.
		200 = fp1_yearly.0111 # Accursed - one of your courtiers is the victim of a nithing pole.
		200 = fp1_yearly.2000 # A Child wants to run away to marry their beloved
		300 = fp1_yearly.2100 # Two lovers duel for your love
		200 = fp1_yearly.2200 # Berserker rampages though court
		200 = fp1_yearly.2300 # Convince a group of soldiers to join you
		200 = fp1_yearly.2400 # Invest in something that'll aid in your hunts
		200 = fp1_yearly.2600 # Become a Berserker
		## Flavour Yearlies
		200 = fp1_yearly.0501	# Out for a Sail - you spot a ship in distress.
		200 = fp1_yearly.0511	# The Stench of Success - a courtier won't let an old trophy go.
		200 = fp1_yearly.0521	# Blood on the Snow - your child wishes to snowball fight.
		200 = fp1_yearly.0531	# [Dynasty] on Ice - your child wants to learn how to ice skate.
		200 = fp1_yearly.0541	# The Beast of [Capital] - your child is playing pranks on courtiers.
		200 = fp1_yearly.0551	# Fishy Business - a courtier won't stop eating rotten fish.
		200 = fp1_yearly.0561	# My Arm Against Yours - a knight challenges you to arm-wrestling.
		200 = fp1_yearly.0571	# Petty Vandalism - your child has vandalised a runestone.
		200 = fp1_yearly.0581	# When I Grow Up - your child wishes to be a shieldperson.
		200 = fp1_yearly.0591	# Raised Voices at the Thing - two of your counties are fighting at a regional thing.
		200 = fp1_yearly.0601	# The Hardest Part of Ruling - you're incredibly bored in a protracted thing session.
		200 = fp1_yearly.0611	# Leading by Example - one of your children hurts another whilst imitating you.
		200 = fp1_yearly.0641	# Worthy of the Ocean - your longships are in disrepair.
		200 = fp1_yearly.0651	# Leviathan - you spot a whale whilst sailing.
		200 = fp1_yearly.0661	# A Novel Challenge - a knight challenges you to skiing.
		200 = fp1_yearly.0671	# A Slippery Slope - your child wants to go sledding.
		200 = fp1_yearly.0681	# Why Can't I Come? - your child wants to come raiding.
		200 = fp1_yearly.0691	# Attempted Atonement - a knight has converted after raiding a reformed faith.
		## Special Yearlies
		50 = fp1_yearly.1001 # You notice a stranger has been hanging around the court.
		50 = fp1_yearly.1071 # Sparklingly Clean
		50 = fp1_yearly.1081 # An explorer of the Atlantic wishes to share their tales with you.
		5 = fp1_yearly.2500 # What's that deviant up to this time!?
		1000 = fp1_major_decisions.1001 # Canute & the Tide
		## Jomsvikings
#		500 = fp1_jomsvikings.0001	# FP1 - Jomsvikings offer a Retainer
#		500 = fp1_jomsvikings.0021	# FP1 - Jomsvikings send Event Troops
#		1000 = fp1_jomsvikings.0041	# FP1 - Jomsvikings move to execute a stain on the faith.
	}
}

fp2_yearly_events = {
	trigger = {
#		has_fp2_dlc_trigger = yes
		always = no
		# Most events are geographical in nature
#		capital_province ?= { geographical_region = world_europe_west_iberia }
	}
	weight_multiplier = {
		base = 1
		modifier = { # Reduces frequency for characters with non-matching cultures
			factor = 0.33

			NOT = {
				culture = { has_cultural_pillar = heritage_iberian }
			}
		}
		modifier = { # Reduces chance after recently having had an event from this pulse
			factor = 0.2
			has_character_flag = recently_got_fp2_event
		}
		modifier = { # Reduces frequency for having both sets of FP events valid
			factor = 0.5
			OR = {
				fp1_eligible_for_yearly_events_trigger = yes
				fp3_eligible_for_yearly_events_trigger = yes
			}
		}
	}

	random_events = {
		200 = 0
		
		# FP2 - Fate of Iberia Events
#		160 = fp2_yearly.1001   # Chess Two 
#		10 = fp2_yearly.1002	# A Compromising Position 
#		160 = fp2_yearly.1003   # Tilting at...Giants?  
#		160 = fp2_yearly.1004   # The Hawk of Quraysh 
#		160 = fp2_yearly.1005   # Lost Viking  
#		80 = fp2_yearly.1006	# Viking Cheese?
#		180 = fp2_yearly.2020	# Horchata colonialism event
#		160 = fp2_yearly.4004	# The Wandering Master
#		160 = fp2_yearly.4005 	# Establishing Enclaves
#		160 = fp2_yearly.4006   # God's Architect 
#		160 = fp2_yearly.8000	# Burning the Vineyards
#		180 = fp2_yearly.8001	# Assembling the Cortes
#		160 = fp2_yearly.8002 	# A Dietary Dilemma
#		160 = fp2_yearly.8003	# Flight of Fancy
#		160 = fp2_yearly.8004	# The Toledo School of Translation
#		160 = fp2_yearly.8005	# Under the Stone Pine
#		160 = fp2_yearly.8006	# Saqaliba Settlers 
#		180 = fp2_struggle.1002	# Xenophilic Advancment
#		160 = fp2_struggle.1050	# Dreams of Destruction
#		150 = fp2_struggle.2000	# Disorderly Market
#		140 = fp2_struggle.2008	# Misdeeds of the Councillor
#		350 = fp2_struggle.2013	# The Secret to Freedom
#		130 = fp2_struggle.2015	# Letter on the Back
#		180 = fp2_yearly.2025	# Suffering from Success
#		150 = fp2_yearly.4001	# You fancy a little siesta
#		150 = fp2_yearly.4002	# A county is increasingly religiously intertwined
#		150 = fp2_yearly.4003	# The road to Santiago is under threat from bandits
#		150 = fp2_yearly.4007 	# Finding a shell on the road to Santiago
#		150 = fp2_yearly.4008 	# Folk stories around the fireside
#		300 = fp2_yearly.4009 	# Visiting the Malato Tree
#		150 = fp2_yearly.4010 	# Finding a Verraco
#		300 = fp2_yearly.3000 	# Neighboring Muslims are growing rice, adopt the practice yourself?
#		100 = bell_special_yearly.1000 # The bell of Huesca yearly 
#		150 = fp2_yearly.9000 	# Thriving Jewish Community
#		150 = fp2_yearly.9001 	# Suspect Conversos of secretly praciticing Judaism
#		150 = fp2_yearly.9002 	# Jewish people come fleeing persecution from a nearby realm
#		150 = fp2_yearly.9005 	# Toledan Nights
#		50 = fp2_yearly.9006 	# Local bishop mad his church faces the wrong way
	}
	
	effect = {
		root = {
			add_character_flag = {
				flag = recently_got_fp2_event
				days = 1095 # 3 years
			}
		}
	}
}

bp1_yearly_events = { # Disabled in yearly_on_actions
	trigger = {
		has_dlc_feature = friends_and_foes
		OR = {
			any_relation = { type = friend }
			any_relation = { type = rival }
		}
	}
	weight_multiplier = {
		base = 1
		modifier = { # Increase frequency the more you fit the conditions
			add = 0.25
			any_relation = { type = friend }
		}
		modifier = { # Increase frequency the more you fit the conditions
			add = 0.25
			any_relation = { type = rival }
		}
		modifier = { # Increase frequency the more you fit the conditions
			add = 0.25
			any_relation = { type = best_friend }
		}
		modifier = { # Increase frequency the more you fit the conditions
			add = 0.25
			any_relation = { type = nemesis }
		}
	}

	random_events = {
		200 = 0
		
		#BP1 Events
		100 = bp1_yearly.1000 # Best friend introduces you to a new hobby
		200 = bp1_yearly.1010 # A friend offers to mediate with your HoF who has excommunicated you
		500 = bp1_yearly.1020 # A friend visits you on your dying bed
		500 = bp1_yearly.1021 # You visit a friend on their dying bed
		500 = bp1_yearly.1030 # A rival visits you on your dying bed
		500 = bp1_yearly.1031 # You visit a rival on their dying bed
		100 = bp1_yearly.1040 # You make a new friend at the bathhouse
		50 = bp1_yearly.1050 # You make a new rival at the bathhouse
		100 = bp1_yearly.1060 # React to a superstitious friend
		150 = bp1_yearly.1061 # Make someone superstitious - hidden
		100 = bp1_yearly.1070 # Rival is superstitious - take advantage?
		100 = bp1_yearly.1080 # Married off relative writes home
		400 = bp1_yearly.1082 # Married off relative writes home to share a secret
		100 = bp1_yearly.2000 # Spoil your partner(s), learn a secret/hook followup
		400 = bp1_yearly.2010 # Two of your spouses/concubines are lovers!
		100 = bp1_yearly.2020 # A consort attempts to influence you into changing your heir
		100 = bp1_yearly.2030 # Mopey consort wants some guidance
		100 = bp1_yearly.2040 # Consort is upset with other consort
		100 = bp1_yearly.2050 # Friendly consorts wants to start a study circle
		200 = bp1_yearly.2060 # Friendly consorts want to tutor other consort's child
		100 = bp1_yearly.2070 # Childless older soulmate spouse ponders your relationship
		100 = bp1_yearly.3001 # Friend spots you some cash
		100 = bp1_yearly.3002 # You spot your friend some cash
		100 = bp1_yearly.3007 # Spouse's family member wants you to sponsor their inspiration
		100 = bp1_yearly.3100 # Your vassal/friend/family member offers you a skilled courtier
		20 = bp1_yearly.3101 # Friend offers to sell you a county you have a claim on
		100 = bp1_yearly.3201 # Fake feast invite from rival/nemesis
		100 = bp1_yearly.3300 # Remembering a pilgrimage 
		200 = bp1_yearly.3301 # Remembering a pilgrimage w/ a friend
		100 = bp1_yearly.4000 # Reflect over a family memory
		100 = bp1_yearly.4010 # Spouse demands their child gets a better guardian
		100 = bp1_yearly.4020 # Friend writes poetry about a war memory
		250 = bp1_yearly.4030 # Rival nestles their way into marrying one of your vassals, turns them disloyal
		10 = bp1_yearly.4040 # Kindly grandmother won't stop feeding you snacks; suffer the consequences of overeating, or break her heart?
		50 = bp1_yearly.5301 # Your friend is concerned about your physique
		150 = bp1_yearly.5100 # Chadsplaining to a plain courtier
		150 = bp1_yearly.5701 # Your Friend's Spouse Is Keeping Them Away From You
		100 = bp1_yearly.5702 # You ask a friend for help with skill
		200 = bp1_yearly.5703 # Your lover/rival threatens you in bed
		100 = bp1_yearly.5704 # Your rival seems strangely... attractive?
		200 = bp1_yearly.5705 # Your friend tries to talk you out of a bad relationship
		100 = bp1_yearly.5706 # You sleep with your rival's offspring
		400 = bp1_yearly.5707 # Your rival catches you sleeping with their offspring
		100 = bp1_yearly.5708 # You empathise with a friend's faith
		100 = bp1_yearly.5709 # Tempers flare between you and your rival
		70 = bp1_yearly.5713 # Your lover asks for money
		100 = bp1_yearly.5715 # You and a friend argue about pronunciation
		100 = bp1_yearly.5716 # Your zealous wife burns books
		100 = bp1_yearly.5717 # Your rival and your friend get into a drunken brawl
		100 = bp1_yearly.5719 # Your disloyal vassal is trying to embezzle
		100 = bp1_yearly.5720 # You and your rival armwrestle
		200 = bp1_yearly.5722 # Your nemesis launches your pet out of a catapult
		100 = bp1_yearly.5725 # You search for Khutulun
		50 = bp1_yearly.5728 # Rival steals and burns one of your artifacts
		10 = bp1_yearly.5740 # Scrambling for Answers
		80 = bp1_yearly.5800 # You make a perfume
		125 = bp1_yearly.6000 # Attacked by Rival's Child / Family Feud
		100 = bp1_yearly.7000 # Go on a picnic
		100 = bp1_yearly.7001 # Go fishing
		10 = bp1_yearly.7002 # Throw chamberpot at rival
		25 = bp1_yearly.7003 # Orgy Tapestry
		100 = bp1_yearly.7004 # Friend offers to talk about bad memory
		100 = bp1_yearly.7010 # Loyalty test
		100 = bp1_yearly.7050 # Memory of a war
		100 = bp1_yearly.7051 # Memory of Battle
		100 = bp1_yearly.7052 # Telling a story of a memory
		100 = bp1_yearly.7053 # A memory of revenge
		100 = bp1_yearly.7054 # Forgetting a memory
		100 = bp1_yearly.7055 # Recording a memory
		100 = bp1_yearly.7056 # Intimidating someone
		150 = bp1_yearly.7057 # Yearning
		100 = bp1_yearly.7058 # Friend eats all your food
		100 = bp1_yearly.8000 # Claimant moving towards rivalry
		200 = bp1_yearly.8010 # Best friend offers you a negotiated alliance
		100 = bp1_yearly.8020 # Rival of your rival offers friendship
		100 = bp1_yearly.8040 # Friend with conflicting personality falls out with you
		100 = bp1_yearly.9001 # Bully/guardian destroys your favourite toy
		100 = bp1_yearly.9005 # You get revenge for your destroyed toy
		100 = bp1_yearly.9006 # Becoming friends over a common sin
		10 = bp1_yearly.9007 # You find a peasant who looks exactly like you
		50 = bp1_yearly.9016 # Uppity second-in-line wants the throne
		50 = bp1_yearly.9017 # Uppity child is insecure about culture
		200 = bp1_yearly.9018 # Illegitimate child feels excluded
		100 = bp1_yearly.9019 # Spouse proposes a gay threesome
		200 = bp1_yearly.9020 # Spouse wants to do something kinky
		100 = bp1_yearly.9021 # Rival spouse is good in the bedroom
		100 = bp1_yearly.9022 # Friend holds an intervention
		200 = bp1_yearly.9023 # You realise you don't speak the same language
		100 = bp1_yearly.9024 # A friend visits you while you're sick
		150 = bp1_yearly.9025 # You realise you hate your friend
		100 = bp1_yearly.9026 # You're haunted by an old friend who convinces you to make amends before you die
		100 = bp1_yearly.9040 # The ghost of your dead lover wants to have sex again
		100 = bp1_yearly.9042 # Your chaplain finds a dessert that looks like HealthGodName
		100 = bp1_yearly.9043 # Your chaplain admits to being a deviant and a cannibal who eats babies
		100 = bp1_yearly.9047 # Lover wants you to wear their hair
		100 = bp1_yearly.9048 # Nemesis wants to end your rivalry by wrestling
		100 = bp1_yearly.9050 # You and a friend share war stories
		20 = bp1_yearly.7100 # Excreta incident, gain Nemesis

		# Family Feud
		5 = bp1_house_feud.0001 # Consider starting feud against own rival's house
		5 = bp1_house_feud.0002 # Consider starting feud against house family member rivals
		5 = bp1_house_feud.0003 # Consider starting feud against house who killed close family
		5 = bp1_house_feud.0006 # Consider starting feud against house with competing claims
		5 = bp1_house_feud.0007 # Consider starting feud against house who imprisoned you a while
		5 = bp1_house_feud.0008 # Consider starting feud against house who imprisoned family a while
		5 = bp1_house_feud.0012 # Consider starting feud against house who cuckolded you
	}
}

fp3_yearly_events = {
	trigger = {
		has_fp3_dlc_trigger = yes
		
		# Most events are geographical in nature
		capital_province = { geographical_region = world_persian_empire }
	}
	weight_multiplier = {
		base = 1
		modifier = { # Reduces frequency for characters with non-matching cultures
			factor = 0.33

			NOR = {
				culture = { has_cultural_pillar = heritage_iranian }
				culture = { has_cultural_pillar = heritage_turkic }
				culture = { has_cultural_pillar = heritage_mongolic }
				culture = { has_cultural_pillar = heritage_arabic }
			}
		}
		modifier = { # Reduces chance after recently having had an event from this pulse
			factor = 0.2
			has_character_flag = recently_got_fp3_event
		}
		modifier = { # Reduces frequency for having other sets of FP events valid
			factor = 0.5
			OR = {
				fp1_eligible_for_yearly_events_trigger = yes
				fp2_eligible_for_yearly_events_trigger = yes
			}
		}
	}

	random_events = {
		200 = 0
		
		# Frontier Events
		250 = fp3_yearly.8000 # Ghazi Gone Bad
		250 = fp3_yearly.8001 # Frontier Fortress Benefactor
		250 = fp3_yearly.8002 # Faith at the Frontier
		350 = fp3_yearly.8003 # Exotic Espand
		350 = fp3_yearly.8004 # The Frontier Beckons
		350 = fp3_yearly.8009 # Caliphal Concerns
		250 = fp3_yearly.8010 # Abode of War
		250 = fp3_yearly.8014 # Secrets of the Teapot
		250 = fp3_yearly.8016 # Forgotten Stones & Hyrcanian Havoc
		500 = fp3_yearly.8018 # Heavenly Horses

		# The Nomads Story Cycle
		100 = fp3_yearly.8888 #Grazing Grievances 

		# Heritage Events
		250 = fp3_yearly.8019 # Refuge of Light
		250 = fp3_yearly.8020 # The Lady of the Land
		350 = fp3_yearly.8021 # An Acidic Accident
		500 = fp3_yearly.8024 # The Return to the Sky
		350 = fp3_yearly.8027 # Nine-Hundred Ninety Chapters of Gold
		250 = fp3_yearly.8033 # Frozen Delights
		550 = fp3_yearly.8034 # The Hephthalite Hoard
		250 = fp3_yearly.8035 # The Heart and the Creator
		250 = fp3_yearly.8036 # The City of the Mouthless
		500 = fp3_yearly.8037 # A Cure for Acedia (the Melancholia Chain)

		#FP3 - Extra Yearly Events
		150 = fp3_yearly.8045 #The Mysterious Bundle (the Buzina Chain)

		# Zoroastrian Events
		200 = fp3_yearly.8050 #The Fate of the Dead
		200 = fp3_yearly.8051 #The Purest Fire 

		# Guardianship Events
		200 = childhood.2400 # Ward approaches guardian with theological doubts

		# Clan Events
		250 = fp3_clan.8000 # Usury against Unity
		250 = fp3_clan.8001 # Clan Quarrel
		250 = fp3_clan.8002 # Bonds of Faith
		250 = fp3_clan.8003 # The Power of a Name
		250 = fp3_clan.8004 # Bonds of Fear
		250 = fp3_clan.8005 # A Proper Position
 		250 = fp3_clan.8006 # Small Spies
		125 = fp3_clan.3000 # Ravaged Tulips
 		
 		# Tax Collector / Clan Events
 		250 = fp3_clan.1000 # Worth more than Gold?	
 		250 = fp3_clan.1010 # GetHerHis Cup Runneth Over
 		250 = fp3_clan.1020 # Practical Learning
 		250 = fp3_clan.1030 # Tax Dispute
 		250 = fp3_clan.1040 # Mismanaged Land

 		250 = fp3_clan.8008 #Bleeding them Dry
		250 = fp3_clan.8009 #Popular with the People
		250 = fp3_clan.8010 #Competent Qadis / More Magistrates
		250 = fp3_clan.8011 #A Proper Paymaster
		250 = fp3_clan.8012 #Auspicious Avarice
		240 = fp3_clan.8013 #The Burden of Tax Farming
		250 = fp3_clan.8015 #Scandalous Scion
		250 = fp3_clan.8016 #Hammam Havoc 
		250 = fp3_clan.8017 #A Questionable Position

		# Eren events
		250 = fp3_yearly.2000 # Daylight Censors
		250 = fp3_yearly.2001 # Public Intoxication
		100 = fp3_yearly.2011 # Maunds of Wheat for non-royal court users
		250 = fp3_yearly.2020 # Set the Scale, Vassal Version
		500 = fp3_yearly.2040 # Commander of the Faithful
		500 = false_conversion.2000 # A Moment of Weakness
		250 = fp3_scholarship.1000 # A Second Aryabhata
	}

	effect = {
		root = {
			add_character_flag = {
				flag = recently_got_fp3_event
				days = 1095
			}
		}
	}
}
