# Events listed here run for every living character at game start, that means they
# ALWAYS need to check if they should run.
on_startup = {
	events = {
		Plus.322 # CK2Plus Startup Event
		Plus.331 # Reset coa's on reloading save
		MNM.10025 #Save game conversion of secret_traits to secret religions
		Plus.2700 # Apply Game Rules
		CombatTraits.600 # Hand out combat traits
		Plus.2275 # Add greek/latin rite traits
		JD.10006#Save game fix for setting the name of the Chinese empire
		ZP.5 #Change Zorastrian pet traits into modifiers
		#Plus.372 # Wrong Checksum Event
		JD.60005 #Convert prosthetics event modifiers into artifacts
		JD.50401 # Set correct value of the Silk Road
		JD.30504 # Clean up living members of the chinese dynasty
	}
}

on_yearly_pulse = {
	events = {
		#Charlemagne
		CM.5000 # Ragnar Lodbrok
		CM.503 # Start of Viking Age
		CM.1011 # Lombard Queen
		Plus.1931 # Hurufi Epic Poem Bounce Event
		HL.1030 # Wolf Child growing older, rumors of real mother being a wolf
		63106 # (Safety flag clearance check event)
		ZE.1100 # Disobedient daughter is unhappy
		ZE.9000 # Ally not contributing in war
		ZE.10000 # Mercenary event tombula
		RIP.10012 # Check for plague notifications
		RIP.11700 # Prosperity system
		RIP.5050 # Scurvy event
		RIP.30316 # clean up immortal crisis 
		RIP.30317 # immortal crisis spreads
		# MNM.4430 # Passive nice trait gain for buddhist/jain monastic societies ### now only triggered upon succeeding in missions
		MNM.9815 # Seal of Solomon artifact makes you immune to possession
		MNM.70030 # Secret society visibility reduction
		HO.100 # Creation of Indian Holy Orders should important cities fall to another religion
		JD.20041 # Chinese commander teaching other commanders their leadership trait
		Plus.543 # Danish invasion of England
		Plus.925 # Character receives event to try to remove nickname
		Plus.1170 # Ruler has a stem duchy title but is not part of the HRE
		JD.4000 # Character raiding China result events
		bear.7 # Secret bear generation
		bear.1 # Secret bear discovery. Called here and in bear.7, as bear.1 can be temporarily precluded
		Plus.1171 # Ruler has a kingdom version of a stem duchy title but is part of the HRE
		Plus.2025 # Brother Angelo criticizes the Pope
		Plus.2030 # The Poor of Lyons appear
		Plus.2113 # Formalization of Bogomilism ends
		Plus.2200 # Rome Re-Established
		Plus.2202 # Constantinople Re-Established
		Plus.2205 # Alexandria Re-Established
		Plus.2208 # Antioch Re-Established
		Plus.2211 # Jerusalem Re-Established
		Plus.2214 # Latin Patriarchate of Constantinople Re-Established
		Plus.2216 # Latin Patriarchate of Alexandria Re-Established
		Plus.2218 # Latin Patriarchate of Antioch Re-Established
		Plus.2220 # Latin Patriarchate of Jerusalem Re-Established
		Plus.2201 # Rome De-Established
		Plus.2203 # Constantinople De-Established
		Plus.2206 # Alexandria De-Established
		Plus.2209 # Antioch De-Established
		Plus.2212 # Jerusalem De-Established
		Plus.2204 # Constantinople Reformed
		Plus.2207 # Alexandria Reformed
		Plus.2210 # Antioch Reformed
		Plus.2213 # Establishing Liege for the Pentarchs
		Plus.2215 # Latin Patriarchate of Constantinople De-Established
		Plus.2217 # Latin Patriarchate of Alexandria De-Established
		Plus.2219 # Latin Patriarchate of Antioch De-Established
		Plus.2221 # Latin Patriarchate of Jerusalem De-Established
		Plus.2272 # Remove Papal title for non-Chalcedonians
		Plus.327 # Convert Latin Empire to Byzantine Empire if the holder is no longer Catholic
		Plus.328 # Byzantium Auto-Destroy Mechanic. Destroys Byzantium if the title holder is not Orthodox or Hellenic
		Plus.338 # HRE Auto-Destroy Mechanic. Destroys the HRE if the ruler is no longer Catholic (or replacement heresy)
		Plus.2111 # Initialization event for Bogomilist laws
		43306 #Yearly check for tyranny from going against council
		ancrel.260 # add Druid trait to Celtic temple holders
		ancrel.2113 # Cleanup when a Flamines lost his title 
		ancrel.2121 # A vestalis must retire after 30 years
		ancrel.2122 # Cleanup when a Vestalis lost her title by some way other than retireing
		ancrel.2581 # Character is approached by the Mithraic Mysteries (formerly mtth 6 months)
		Plus.1759 # Small demesne modifier
		Plus.1760 # Overextended republic
		Plus.2500 # Add decadent dynasty trait
		Plus.2502 # Raise decadent dynasty trait
		PlusFaction.250 # Main Annual faction maintenance event
		PlusFaction.220 # Annual faction maintenance event
		Plus.307 # Contingent Territory Check
		Plus.371 # Main Maintenance Event
		Plus.2276 # Removing Latin/Greek Rites for non-priests
		Plus.503 # Special event for Neustria to be renamed to Normandy
		Plus.557 # Special event for Pamplona to be renamed to Navarra

		# Special Zoroastrian modifiers
		GoPagan.286 # Gains Zoroastrian Modifier
		GoPagan.287 # Loses Zoroastrian Modifier
		
		# TRIBUTARY EVENTS
		Plus.4010 # Tributes for AI
		Plus.4030 # Vassalize tributary for AI
		
		# AI vassal has a vassal too far away
		Plus.1757
		
		Plus.2275 # Add greek/latin rite traits
		
		# MTTH events that were consuming too much time
		PerformancePlus.900 # Councillor tries to befriend liege
		PerformancePlus.910 # Duelist tries to befriend liege
		Performance.941 # Reinforcements Arrive
		Performance320.500 # Prosperity Increase
		Performance320.502 # Peasant Obstructionism

		Plus.1771 #Education pulse tombola event
		
		Plus.2356 # Irminsul Reborn
	}
	random_events = {
	
		# Heretic Pride Events
		75 = Plus.2003 # Adult Cathar becomes celibate
		100 = Plus.2037 # Refugees arrive at a Waldensian ruler's capital
		100 = Plus.2038 # Waldensian ruler is greedy
		100 = Plus.2039 # Charitable Waldensian steward sees chance to help the poor
		100 = Plus.2138 # # Bogomilist missionaries move into a neighboring realm
		
		# Imperial Decadence Events
		50 = Plus.1855 # Emperor/Regent is Just
		50 = Plus.1856 # Emperor/Regent is Arbitrary
		50 = Plus.1857 # Emperor/Regent is Diligent
		50 = Plus.1858 # Emperor/Regent is Slothful
		50 = Plus.1859 # Emperor/Regent is Hedonist
		50 = Plus.1860 # Emperor/Regent is Cruel/Impaler
		100 = Plus.1861 # Emperor/Regent is Quick/Genius
		100 = Plus.1862 # Emperor/Regent is Inbred/Imbecile/Slow
		100 = Plus.1863 # Emperor is Incapable
		50 = Plus.1864 # Emperor/Regent is Drunkard
		100 = Plus.1865 # Emperor/Regent is Lunatic
		50 = Plus.1866 # Emperor/Regent is Possessed
		25 = Plus.1867 # Emperor/Regent is Depressed
		50 = Plus.1868 # Emperor is a prisoner
		50 = Plus.1869 # Emperor has a capable Steward
		50 = Plus.1870 # Emperor has a lousy Steward
		
		# Lifestyle Events
		50 = Plus.434 # Debate with a zealous courtier
		50 = Plus.435 # Hunter
		50 = Plus.436 # Falconer
		50 = Plus.437 # Scholar
		50 = Plus.438 # Mystic
		50 = Plus.439 # Impaler
		50 = Plus.440 # Gardener
		50 = Plus.441 # Poet
		50 = Plus.442 # Administrator
		50 = Plus.443 # Hedonist
		50 = Plus.444 # Duelist
		50 = Plus.445 # Faqih
		50 = Plus.446 # Architect
		50 = Plus.447 # Strategist
		50 = Plus.448 # Socializer
		50 = Plus.449 # Schemer
		50 = Plus.450 # Gamer
		75 = Plus.451 # A traveling merchant visits during a storm
		75 = Plus.452 # A function is happening in the capital
		75 = Plus.453 # See your knights sparring together
		75 = Plus.454 # Courtiers arguing about the war
		75 = Plus.455 # A day of peace for a ruler
		75 = Plus.456 # A disturbance in the market
		75 = Plus.457 # Wondering about rival
		75 = Plus.458 # Thinking about the plot
		75 = Plus.459 # Bookseller comes to court
		
		
		# CK2+ Events
		25 = Plus.730 # known murderer is excommunicated
		25 = Plus.731 # known murderer goes nuts
		25 = Plus.732 # paranoid murderer kills a courtier
		250 = Plus.1370 # Unknown bastard decides whether to approach their true father
		500 = GoPagan.150 # character has more than one sympathy trait
		
		#Holy Order Events
		200 = ancrel.2573
		
		# Feudal Life Events
		100 = 4000
		100 = 4005
		100 = 4010
		100 = 4015
		100 = 4020
		100 = 4036
		100 = 4045
		100 = 4050
		100 = 4055
		100 = 4060
		100 = 4085
		100 = 4110
		100 = 4115
		100 = 4120
		100 = 4125
		100 = 4130
		100 = 4135
		100 = 4145
		100 = 4150
		100 = 4155
		100 = 4175
		
		# Married Life Events
		100 = 30000
		100 = 30001
		100 = 30004
		100 = 30020
		100 = 30021
		100 = 30025
		100 = 30030
		100 = 30040
		100 = 30045
		100 = 30050
		100 = 30051
		100 = 30052
		100 = 30055
		100 = 30056
		100 = 30057
		100 = 30058
		100 = 30059
		100 = 30060
		100 = 30063
		100 = 30066
		100 = 30069
		100 = 30072
		100 = 30075
		100 = 30085
		100 = 30100
		100 = 30105
		100 = 30110
		
		# Old Lover Events (Disabled in "Way of Life")
		100 = 64000 # Confronts spouse about lover. Rivalries, lover lost.
		100 = 64005 # Lover is ill. Give comfort.
		100 = 64006 # Wounded lover. Wound removed.
		100 = 64010 # Teenage infatuation starts.
		100 = 64015 # Wife is old and ugly. Take a mistress?
		100 = 64025 # Fallen in love with spouse
		100 = 64030 # Vacation with lover
		100 = 64035 # Party/hunting/nothing with lover
		100 = 64040 # Ruler confronts spouse about lover
		
		#Job Flavour Events
		100 = 75010
		100 = 75020
		100 = 75030
		20 = 75040
		100 = 75050
		100 = 75060
		100 = 75065
		100 = 75070
		100 = 75075
		100 = 75080
		100 = 75085
		100 = 75090
		100 = 75095
		100 = 75105
		25 = 75110
		100 = 75120

		#Dynasty requests
		#250 = 66000
		250 = 66099
		
		#Hedge Knights Events
		50 = 71000
		50 = 71006
		50 = ancrel.1254
		50 = ancrel.154
		50 = ancrel.1260
		50 = ancrel.160
		
		#Rumours Events
		10 = 69000
		10 = 69003
		10 = 69010
		10 = 69014
		10 = 69020
		10 = 69023
		10 = 69030
		10 = 69037
		10 = 69040
		10 = 69043
		10 = 69050
		10 = 69052
		10 = 69054
		10 = 69056
		10 = 69058
		10 = 69060
		10 = 69063
		10 = 69070
		10 = 69073
		10 = 69100
		10 = 69095
		
		#Court Events
		100 = 73000
		100 = 73001
		100 = 73002
		100 = 73003
		100 = 73004
		100 = 73005
		100 = 73006
		100 = 73007
		100 = 73008
		100 = 73009
		100 = 73010
		
		#Bastard Events
		100 = 76000
		100 = 76005
		100 = 76010
		100 = 76025
		100 = 76030
		100 = 76035
		100 = 76040
		
		#Ward Events
		100 = 78000
		100 = 78005
		100 = 78010
		100 = 78015
		100 = 78018
		100 = 78025
		100 = 78030
		100 = HL.10610
		
		#Various Events
		100 = TOG.3403
		100 = TOG.3401
		100 = TOG.3402
		100 = 100019
		100 = 100024
		50 = 79007 # Shieldmaiden training event
		150 = 37250 #Wife of same education offers to help
		
		# Reincarnation: Memories of the previous life
		1000 = RoI.10020
		1000 = RoI.10021
		1000 = RoI.10022
		
		# Indian guru events
		100 = RoI.3100
		100 = RoI.3101
		100 = RoI.3102
		100 = RoI.3103
		100 = RoI.3104
		100 = RoI.3105
		100 = RoI.3106
		100 = RoI.3107
		100 = RoI.3108
		100 = RoI.3109
		100 = RoI.3110
		100 = RoI.3111
		100 = RoI.3112
		100 = RoI.3113
		100 = RoI.3114
		500 = RoI.3200
		500 = RoI.3300
		100 = RoI.3400
		
		# Indian ascetics and yogis
		20 = RoI.203
		20 = RoI.206
		20 = RoI.209
		20 = RoI.193
		
		# Indian story events
		20 = RoI.215
		20 = RoI.20147
		20 = RoI.20164
		
		# Indian minor events
		100 = RoI.157
		100 = RoI.158
		100 = RoI.163
		100 = RoI.180
		100 = RoI.190
		50 = RoI.401
		100 = RoI.403
		100 = RoI.410
		100 = RoI.411
		200 = RoI.412
		500 = RoI.500
		
		# Indian low religious authority events
		10 = RoI.3500
		100 = RoI.3506
		10 = RoI.3510
		100 = RoI.3516
		#10 = RoI.3520
		10 = RoI.3530
		100 = RoI.3536
		
		# Religious tolerance events
		100 = RoI.400
		
		# Way of Life events
		100 = WoL.12506 # Legendary Wisdom
		100 = WoL.12507 # Respected Ruler

		# Hero knight adventure events
		#200 = CM.2010 #event does not exist
		200 = CM.2020
		#200 = CM.2100 #event does not exist
		
		# Effects of being in hiding
		100 = CM.6100
		100 = CM.6102
		100 = CM.6104
		100 = CM.6106
		100 = CM.6108
		100 = CM.6110
		100 = CM.6112
		100 = CM.6114
		100 = CM.6116
		100 = CM.6118
		100 = CM.6120
		100 = CM.6122
		100 = CM.6124
		100 = CM.6126
		100 = CM.6128
		100 = CM.6130
		100 = CM.6132
		
		# Meddling mother events
		100 = CM.1150
		100 = CM.1160
		100 = CM.1170
		100 = CM.1180
		100 = CM.1190
		
		# Other Charlemagne/Carloman
		100 = CM.1130
		
		# Horse Lords Mercenary Events
		300 = HL.10100
		300 = HL.10200
		300 = HL.10210
		300 = HL.10220
		300 = HL.10230
		300 = HL.10240
		300 = HL.10250
		300 = HL.10260
		300 = HL.10270
		300 = HL.10400
		100 = HL.10410
		50 = HL.10500
		50 = HL.10510
		300 = HL.10530
		300 = HL.10600
		
		# Wolf's Blood events
		100 = HL.1010 # Wolf Child found in woods
		100 = HL.1020 # Child lost in woods and is rescued by wolves
		500 = HL.1200 # Call of the Wolves
		#500 = HL.1300 # The Lost Cub
		150 = HL.1400 # Werewolf first occurrence
		1500 = HL.1401 # Werewolf subsequent occurrences
		
		300 = HL.1500 # Become cannibal
		300 = HL.1510 # Howl at the moon
		300 = HL.1520 # Hunter instinct strikes unexpectedly (and awkwardly) at court
		300 = HL.1530 # Hunter instincts in martial training (upgrade martial education)
		300 = HL.1540 # Become strong
		300 = HL.1550 # Cunning as a wolf (quick)
		300 = HL.1560 # Animal instincts take over... (lustful)
		300 = HL.1570 # Pack instinct (gregarious)
		300 = HL.1580 # Wolf is brave (brave)
		300 = HL.1590 # Animal cruelty (cruel)
		300 = HL.1610 # Rabid wolf (wroth)
		300 = HL.1620 # Wolf-face (ugly)
		300 = HL.1630 # Animal mind (lower learning trait level) 
		300 = HL.1640 # Really howl at the moon! (lunatic)
		
		# Horse Lords Horse Events
		800 = HL.6010 # Ward can't ride yet
		100 = HL.6020 # Dangerous river crossing - save spouse or favorite horse?
		100 = HL.6030 # A loyal retinue warrior's family have lost their horses to sickness
		100 = HL.6510 # Your horse gets bitten by another horse
		100 = HL.6520 # Foreign portrait painter offers his services
		
		# Zeus Disobedient Daughter Events
		2000 = ZE.1300 # Disobedient daughter asks to marry lover
		
		# Zeus Councillor Random Events
		300 = ZE.4000 # Marshal suggests new commander
		300 = ZE.4010 # Marshal wants to do experiments with new weaponry
		200 = ZE.4100 # Marshal on mission turns against liege
		100 = ZE.4120 # Marshal - abuse of office, runs protection racket in province
		
		100 = ZE.5000 # Zealous Lord Spiritual asks to go and proselytize among heathens
		200 = ZE.5010 # Zealous Lord Spiritual insists in building more temple holdings, willing to donate own money
		300 = ZE.5020 # Lord Spiritual on mission turns disloyal
		100 = ZE.5030 # Lord Spiritual - abuse of office - charges money from populace for godly favor
		500 = ZE.5040 # Craven or Cynical Lord Spiritual complains about dangerous mission to convert heathens
		
		
		100 = ZE.3000 # Steward takes loan to cover up incompetence
		100 = ZE.3002 # Steward makes extra money because of high stewardship
		100 = ZE.3004 # Steward offers to make statue for liege
		100 = ZE.3011 # Steward offers to teach liege 
		
		100 = ZE.2060 # Councillor steals money from the realm coffers
		
		100 = ZE.2020 # Chancellor tries to teach ruler foreign languages
		100 = ZE.2030 # Chancellor sets up bureaucratic scheme to get hearings with the ruler
		
		100 = ZE.2070 # Spymaster uses realm spynetwork to blackmail people
		100 = ZE.2075 # Spymaster tries to improve spy defenses

		#Alliance events
		50 = ZE.8000
		50 = ZE.8010
		10 = ZE.9100

		#Favor events
		100 = ZE.8100 # Drank too much and fell
		100 = ZE.8110 # Vassal arguing with spouse
		100 = ZE.23000 # Councillor is Overburden with Work
		100 = ZE.23005 # Troublesome Peasants
		100 = ZE.22300 # Pardon a young noble
		200 = ZE.22400 # Voter saves another voters face at a Council Meeting
		200 = ZE.22500 # Godly voter shows you how to be more pious
		100 = ZE.22600 # Ask foreign voter for help
		200 = ZE.22700 # Give land to an unlanded friend for a favor
		200 = ZE.22800 # Offer to train your Liege's commanders
		
		#Dynamic mercenary events
		40 = ZE.23150 # Band Leader Speaks Highly of Employer
		
		#AI secretly convert event
		35 = MNM.3948 # Convert to spouse/friend/province

		#Female councillors
		25 = 77777 # Visit from talented woman
		100 = 77790 # Female relative wants to get on council
		150 = 77760 # Female vassal wants to get on council

		#End of days events
		50 = RIP.14000

		#Chess with death
		5 = RIP.30220
		
		#Immortal vassal crisis
		25 = RIP.30315
		50 = RIP.30318
		#Immortal rival
		25 = RIP.30300

		#Gamebook
		100 = GBC.1 # Making a friend in mourning
		
		#Physician Flavor events
		100 = RIP.4010 # Court Physician recommends that you "Take it Easy"
		100 = RIP.4011 # Court Physician gifts you a guide dog
		200 = RIP.4013 # Court Physician suggests fertility treatment
		100 = RIP.4020 # Court Physician Friend teaches you medicine
		100 = RIP.4022 # Court Physician suggests you implement provincial apothecaries (prosperity boost)
		100 = RIP.4030 # Court Physician asks for patronage
		200 = RIP.4040 # Court Physician training event
		200 = RIP.4100 # A Physician-Missionary arrives in a Tribal or Nomadic Court
		
		#Random Prosperity Increasing Events
		125 = RIP.4300 # Steward suggests building new roads
		125 = RIP.4301 # Lord Spiritual suggests building shrines
		125 = RIP.4302 # Marshal suggests building outposts
		125 = RIP.4303 # Spymaster suggests setting up local messenger stations
		125 = RIP.4304 # Chancellor suggests sponsoring local harvest festivals
		125 = RIP.4305 # You decide upon personally visiting a province
		
		#Maimed Flavor events
		100 = RIP.29100 # Disfigured events
		100 = RIP.29200 # One-eyed events
		100 = RIP.29300 # One-handed events
		100 = RIP.29400	# One-legged events
		100 = RIP.29511 # Close relation taking care of you
		
		#Hospital events
		100 = RIP.4501 # Pilgrim physician arrives
		100 = RIP.4504 # Perform charity
		100 = RIP.4512 # Religious heads demand money for hospital presence
		75 = RIP.4514 # Leper arrives at court
		100 = RIP.4520 # Soup kitchen is damaged
		100 = RIP.4530 # Court physician seek learning at hospital
		
		#Pet events
		100 = 77850 # Cat event tombula
		150 = 77860 # Cat makes you happy

		#Monks and Mystics events
		100 = MNM.9000 # Artifact rumor
		100 = MNM.3910 # Commission painting
		30 = MNM.7829 # AI-only disciple recruitment

		#Artifact events
		500 = MNM.9816 # Blessed Mantle allows you to make Water of the Blessed Mantle (-> logic)
		
		#Jade Dragon events 
		150 = JD.20000 # Visit by Chinese councilor
		150 = JD.30000 # Traders acting dishonest
		150 = JD.10009 # Courtier offers to visit the Western Protectorate
		200 = JD.30010 # Courtier from Chinese court compliments/berates
		25 = JD.60000 # Envoy from China offers trade for artifacts
		150 = JD.70000 # Escaped Chinese Noble
		200 = JD.10030 # Gifted refugee appears
		150 = JD.7000 # Chinese Teacher visits
		150 = JD.7010 # Radhanite Merchant asks for money
		150 = Plus.4600 # Hold a feast in the Emperor's Honor
		
		20 = JD.2100 # Chance of Religious Liberation CB

		150 = JD.4100
		
		# Former MTTH Events
		100 = TOG.3109 # Son wants to join the Varangians (Son) - Formerly 200 month MTTH
		100 = TOG.3111 # Son stays in Greece with wife (Son) - Formerly 200 month MTTH
		120 = TOG.3114 # Son returns scarred but seasoned (Son) - Formerly 160 month MTTH
		110 = TOG.3116 # Son returns with notions of Greek love (Son) - Formerly 180 month MTTH
		75 = TOG.3118 # Son returns castrated and blinded (Son) - Formerly 250 month MTTH
		120 = TOG.3120 # Son returns as excellent strategist (Son) - Formerly 160 month MTTH
		110 = TOG.3122 # Son returns with PTSD (Son) - Formerly 180 month MTTH
		110 = TOG.3124 # Son returns home with Greek wife (Son) - Formerly 180 month MTTH
		120 = TOG.3126 # Son returns home as a Christian zealot (Son) - Formerly 160 month MTTH
		140 = TOG.3128 # Son returns home as a seasoned warrior (Son) - Formerly 120 month MTTH
		100 = TOG.3130 # Son dies in battle (Son) - Formerly 200 month MTTH
		120 = TOG.3132 # Son returns with loot (Son) - Formerly 160 month MTTH
		50 = SoA.5219 # Donate to local monastery - Formerly 2000 month MTTH
		7 = ancrel.150  # Celtic Flavour - Meeting A Bard - Formerly 750 month MTTH
		5 = ancrel.151  # Celtic Flavour - Afanc - Formerly 1000 month MTTH
		5 = ancrel.1252  # Celtic Flavour - Banshee - Formerly 1000 month MTTH
		7 = ancrel.1253  # Celtic Flavour - Bran's Voyage - Formerly 750 month MTTH
		
		# Hellenic cult events
		1000 = ancrel.2575 # Approached by the Cult of Orpheus (formerly 6 months MTTH)
		1000 = ancrel.2576 # Approached by the Cult of Cybele (formerly 6 months MTTH)
		1000 = ancrel.2577 # Approached by the Cult of Serapis (formerly 6 months MTTH)
		1000 = ancrel.2578 # Approached by the Cult of Despoina (formerly 6 months MTTH)
		1000 = ancrel.2579 # Approached by the Cult of Trophonius (formerly 6 months MTTH)
		
		# Childhood Trait Reveal Events		
		40 = Plus.4055 # Child is smart or stupid
		40 = Plus.4057 # Child is tall or a dwarf
		40 = Plus.4059 # Child is strong or weak
		40 = Plus.4061 # Child is fair or ugly
		
		5000 = 0 # Chance of no yearly event
	}
}


#character
on_bi_yearly_pulse = {
	events = {
		TOG.3005 # Lose Berserker Trait when too old
		SoA.5300 # Christian becoming a wicked priest
		SoA.5301 # Muslim becoming a wicked caliph
		SoA.5302 # Norse becoming an unworthy priest
		SoA.5303 # Tengri becoming an unworthy priest
		SoA.5304 # Zoroastrian becoming an immoral priest
		SoA.5305 # Aztec becoming an unworthy priest
	}

	random_events = {
		#High prio maintenance
		100000 = Plus.329 # Norman conquest of England cleanup - Victory: France loses claims
		100000 = Plus.330 # Norman conquest of England cleanup - Loss: English provinces (back) to England
		100000 = Plus.2270 # Switch Catholic/Orthodox characters which appear before Schism
		100000 = Plus.2271 # Switch Chalcedonian characters which appear after Schism
		
		#Mid prio maintenance
		10000 = Plus.305 # Remove Crowned by Pope if not the Kaiser
		10000 = Plus.317 # AI Non-holy orders surrender baronies in different realms
		10000 = Plus.319 # Add Bloodlust trait
		10000 = Plus.335 # Adds the Yehudi trait to Jews and children of Jews
		10000 = Plus.345 # Removes In Hiding trait from characters who no longer have someone to remove it
		10000 = Plus.346 # Removes austerity modifier from non-AI characters
		10000 = Plus.1603 # Remove support for heir opinion if he is neither heir nor liege
		
		#Low prio maintenance
		1000 = Plus.300 # AI plot check
		1000 = Plus.301 # Cancel AI plot if too few helpers and has taken too long
		1000 = Plus.108 # Character buys estates
		1000 = Plus.109 # Ruler sells off estates
		1000 = Plus.310 # Copies empire's Crown Laws to de jure kingdoms
		1000 = Plus.316 # Independent baron opinion modifiers
		1000 = Plus.339 # Change Scarred trait on females
		
		#Low chance maintenance
		100 = Plus.312 # AI spouse finder
		
		#Rare maintenance
		20 = Plus.302 # Allow AI plotting
		
		#Very rare maintenance
		10 = Plus.115 # Generate random claim on a neighbour
		
		100 = 0 # No maintenance event

		#Various Traits Events
		50 = 65000
		50 = 65001
		50 = 65003
		50 = 65005
		50 = 65007
		50 = 65009
		50 = 65166
		50 = 65011
		50 = 65020
		50 = 65021
		50 = 65022
		50 = 65023
		50 = 65030
		50 = 65031
		50 = 65032
		50 = 65033
		50 = 65034
		50 = 65035
		50 = 65036
		50 = 65037
		50 = 65040
		50 = 65041
		50 = 65042
		50 = 65043
		50 = 65165
		50 = 65044
		50 = 65045
		50 = 65048
		50 = 65049
		50 = 65050
		50 = 65051
		50 = 65052
		50 = 65053
		50 = 65055
		50 = 65057
		50 = 65060
		50 = 65061
		50 = 65065
		50 = 65070
		50 = 65071
		50 = 65072
		50 = 65074
		50 = 65080
		50 = 65081
		50 = 65085
		50 = 65090
		50 = 65095
		50 = 65100
		50 = 65101
		50 = 65102
		50 = 65105
		50 = 65106
		50 = 65107
		50 = 65110
		50 = 65115
		50 = 65120
		50 = 65125
		50 = 65126
		50 = 65130
		50 = 65135
		50 = 65140
		50 = 65145
		50 = 65150
		50 = 65155
		50 = 65160

		#Seven Virtues
		50 = 3020
		50 = 3021
		50 = 3022
		50 = 3025
		50 = 3026
		50 = 3030
		50 = 3035
		50 = 3012
		50 = 3013
		50 = 3095
		50 = 3080
		50 = 3081
		50 = 3082
		50 = 3083
		50 = 3084
		50 = 3085
		50 = 3120
		50 = 3121
		50 = 3123
		50 = 3124
		50 = 3125
		50 = 3126
		50 = 3200
		50 = 3202
		50 = 3203
		50 = 3205
		50 = 3240
		50 = 3242
		50 = 3243
		50 = 3245
		50 = 3246
		50 = 3247
		50 = 3248
		50 = 3258
		50 = 3160
		50 = 3170
		50 = 3175

		#Seven Deadly Sins
		50 = 3000
		50 = 3001
		50 = 3005
		50 = 3010
		50 = 3011
		50 = 3040
		50 = 3045
		50 = 3050
		50 = 3055
		50 = 3060
		50 = 3065
		50 = 3070
		50 = 3075
		50 = 3100
		50 = 3105
		50 = 3110
		50 = 3115
		50 = 3180
		50 = 3185
		50 = 3190
		50 = 3195
		50 = 3140
		50 = 3141
		50 = 3142
		50 = 3143
		50 = 3144
		50 = 3145
		50 = 3220
		50 = 3225
		50 = 3230
		50 = 3235
		
		
		#Misc Traits, Paranoid, Honest,Gregagrious, Craven
		50 = 3480
		50 = 3485
		50 = 3490
		50 = 3495
		50 = 3280
		50 = 3282
		50 = 3710
		50 = 3715
		50 = 3720
		50 = 3725
		50 = 3300
		50 = 3305
		50 = 3310
		50 = 3315

		
		#Deceitful
		50 = 3260
		50 = 3261
		50 = 3262
		50 = 3263
	

		#Lifestyle events
		100 = 3520
		100 = 3525
		100 = 3530
		100 = 3535
		100 = 3540
		100 = 3543
		100 = 3546
		100 = 3550
		100 = 3555
		100 = 3560
		100 = 3563
		100 = 3568
		100 = 3570
		100 = 3575
		100 = 3585
		100 = 3590
		100 = 3593
		100 = 3600
		100 = 3605
		100 = 3610
		100 = 3615
		100 = 3620
		100 = 3625
		100 = 3630
		100 = 3635
		100 = 3640
		100 = 3645
		100 = 3650
		100 = 3655
		100 = 3660
		100 = 3665
		100 = 3675
		100 = 3680
		100 = 3685
		100 = 3690
		100 = 3700
		
		20 = TOG.3009
		
		# Previously society events
		100 = MNM.3920 # Secret Religious societies: Worried member
		100 = MNM.3930 # Secret Religious societies: Fellow society member goes for a round
	}
}

#character
on_five_year_pulse = {
	events = {
		GR.1
		Plus.537 # Sigfrid Arrives to convert norse pagans
		MNM.10030 # Have AI characters join societies
		JD.1000 # Muslim Adventurers targeting India
	}
	random_events = {
		#----  misc traits needing revision below...
		
		#Heretic Pride events
		50 = Plus.2114 # Bogomilist Formalization: Support Common Liturgy
		50 = Plus.2115 # Bogomilist Formalization: Canonicalize Bible
		50 = Plus.2116 # Bogomilist Formalization: Church Councils
		50 = Plus.2118 # Bogomilist Formalization: Seminary Schools
		50 = Plus.2120 # Bogomilist Formalization: Endorsed by Priest
		50 = Plus.2121 # Bogomilist Formalization: Public Speech
		50 = Plus.2122 # Bogomilist Formalization: Ruler Writes Text
		50 = Plus.2123 # Bogomilist Formalization: Troublemaker Sect
		50 = Plus.2124 # Bogomilist Formalization: Traditionalist Revival
		50 = Plus.2125 # Bogomilist Formalization: Demand For Reversal
		50 = Plus.2126 # Bogomilist Formalization: Blamed by Priest
		50 = Plus.2127 # Bogomilist Formalization: Learned Priest Objects

		#CK2Plus Events
		5 = Plus.2027 # Catholic faithful consider the Fraticelli heresy
		
		#Brave
		10 = 3320
		10 = 3325
		10 = 3330
		10 = 3335
		10 = 3740
		
		#Shy
		10 = 3340
		10 = 3345
		10 = 3350
		10 = 3355
		
		#Ambitious
		10 = 3360
		10 = 3365
		10 = 3370
		10 = 3375
		10 = 3371
		
		#Content
		10 = 3380
		10 = 3385
		10 = 3390
		10 = 3395
		10 = 3745
		
		#Arbitrary
		10 = 3400
		10 = 3405
		10 = 3410
		10 = 3415
		10 = 3411
		
		#Just
		10 = 3420
		10 = 3425
		10 = 3430
		10 = 3435
		
		#Cynical
		10 = 3440
		10 = 3445
		10 = 3450
		10 = 3455	
		10 = 3456		
		
		#Zealous
		10 = 3460
		10 = 3465
		10 = 3470
		10 = 3475
		10 = 3476
		10 = 3750
		10 = 3755

		#Trusting
		10 = 3500
		10 = 3505
		10 = 3510
		10 = 3515
		
		#Personality Traits
		10 = 1000
		10 = 1001
		10 = 1003
		10 = 1004
		10 = 1005
		10 = 1006
		10 = 1007
		10 = 1008
		10 = 1009
		10 = 1010
		10 = 1011
		10 = 1012
		10 = 1013
		10 = 1014
		10 = 1015
		10 = 1016
		10 = 1017
		10 = 1018
		10 = 1019
		10 = 1028
		10 = 1029
		10 = 1030
		10 = 1031
		10 = 1032
		10 = 1033
		10 = 1034
		10 = 1035
		10 = 1036
		10 = 1037
		10 = 1038
		10 = 1039
		10 = 1040
		10 = 1041
		10 = 1042
		10 = 1043
		10 = 1044
		10 = 1045
		10 = 1046
		10 = 1047
		10 = 1048
		10 = 1051
		10 = 1052
		10 = 1053
		10 = 1054
		10 = 1057
		10 = 1058
		10 = 1060
		10 = 1070
		#10 = 3264 this was moved into 3260
		10 = 3730
		10 = 3735
		
		#Zoroastrian pets
		1 = ZP.1
		
		80 = 0
	}
}

#character
on_decade_pulse = {
	events = {
		RIP.10031 # clear global flags from bubonic plague
	}
	
	random_events = {
		100 = 63050 #former MTTH event
		40 = SoA.4020 #former MTTH event
		100 = PlusFaction.120 #former MTTH event
		1 = 6010 # Leper - former MTTH event
		200 = 0
	}
}

# For characters 2 to 16 years old
on_yearly_childhood_pulse = {
	events = {
		ancrel.2120 # The Vestalis Maxima should be the guardian of all underage Vestalis
		
		# Childhood traits revealed if they haven't yet
		Plus.4057 # Child is tall or a dwarf
	}
	random_events = {
		# Childhood Personality Events
		
		#Age 6-16, aiming to get at least 4 traits before adult.
		100 = 1500
		100 = 1510
		100 = 1520
		100 = 1530
		100 = 1540
		100 = 1550
		100 = 1560
		100 = 1570
		100 = 1580
		100 = 1590
		100 = 1600
		100 = 1610
		100 = 1620
		100 = 1630
		100 = 1640
		100 = 1650
		100 = 1660
		100 = 1670
		100 = 1680
		100 = 1690
		100 = 1700
		100 = 1710
		100 = 1720
		100 = 1730
		100 = 1965
		100 = 1632
		100 = 1732
		5000 = RoI.10010 # Acknowledged reincarnated child acquires trait from previous personality
		500 = Plus.2000 # Cathar child gains chaste
		500 = Plus.2040 # Waldensian child gains charitable
		
		#Toddler flavour events (age 2-5), not very common, but some will get them.
		10 = 1900 
		10 = 1901
		10 = 1902
		10 = 1903
		10 = 1904
		
		#Young children flavour events, (age 6-10), not very common, but some will get then..
		20 = 1905
		20 = 1906
		20 = 1907
		20 = 1908
		20 = 1909
		20 = 1910
		20 = 1911
		20 = 1912
		
		#Youngsters flavour events (age 11-15), not very common, but some will get then..
		50 = 1913
		50 = 1914
		50 = 1915
		50 = 1916
		50 = 1917
		50 = 1918
		50 = 1919
		50 = 1920
		50 = 1921
		50 = 1922
		50 = 1923
		50 = 1924
		50 = 1925
		50 = 1926
		50 = 1927
		50 = 1928
		50 = 1929
		50 = 1930
		50 = 1931
		50 = 1932
		50 = 1933
		50 = Plus.4050 #replacing redundant vanilla event 1934
		50 = 1935
		
		#Friends rival flavour events moved from MTTH to childhood pulse.
		1000 = 100005
		1000 = 100015

		#changeling child events, moved from MTTH to childhood pulse
		35 = ancrel.216
		35 = ancrel.218
		35 = ancrel.220
		25 = ancrel.222
		25 = ancrel.225
		25 = ancrel.228
		15 = ancrel.231
		
		1500 = 0
	}
}

# Yearly pulse (six months from on_yearly_pulse) intended for Focus events (only fires for characters with a Focus)
on_focus_pulse = {
	
	random_events = {
		1000 = 0
		
		# Family Focus
		300 = WoL.3010 # Relations with spouse improve
		200 = WoL.3020 # Relations with sibling improve
		400 = WoL.3030 # Relations with parent improve
		400 = WoL.3040 # Relations with child improve
		200 = WoL.3048 # Relations between two close relatives improve
		200 = WoL.3059 # Relations between two non-adult children improve
		
		# Theology Focus
		500 = WoL.7000 # Study religious myths?
		200 = WoL.7010 # Befriend priest through your religious interest
		200 = WoL.7020 # Visit holy site and speak with priests there (not Muslims, Christians, Jews or Indians)
		200 = WoL.7030 # Reflect on own life and how it relates to the gods.
		200 = WoL.7040 # Theologian's view of other religions - can gain Sympathy for other faiths
		200 = WoL.7050 # Question own faith - can gain Cynical or Zealous
		50 = WoL.7060 # Embrace heresy? Zealous characters only. Can lose the trait or become heretic.
		400 = WoL.7070 # Embrace theologian lifestyle?
		200 = WoL.7080 # Mystical experience - lose Depressed and Stressed
		200 = WoL.7090 # Meditation/Prayer in Seclusion - Go into hiding for a week. Lose Drunkard, Gluttonous and Lustful and possible gain Temperate and Chaste (depending on religion). Tiny Chance of restored eyesight or cured illness.
	
		# Hunting focus
		200 = WoL.5000 # Epic Hunt chain start
		200 = WoL.5200 # Receive hunting dog
		200 = WoL.5210 # Dog makes you happy
		200 = WoL.5211 # Dog makes you popular
		200 = WoL.5220 # Train your dog?
		200 = WoL.5230 # Bad dog kills other dog
		200 = WoL.5231 # Bad dog kills or wounds courtier
		
		# War Focus
		120 = WoL.11300 # Improved martial education
		120 = WoL.11301 # Leader Trait gained: Troop type specialist
		120 = WoL.11302 # Leader Trait gained: Terrain/climate specialist
		120 = WoL.11303 # Leader Trait gained: Battle tactics
		120 = WoL.11304 # Leader Trait gained: Inspiration, logistics and sieges
		120 = WoL.11305 # Leader Trait gained: Offense vs Defense
		120 = WoL.11310 # Teach a commander one of my leader traits
		
		# Rulership Focus
		50 = WoL.12000 # The Architect
		50 = WoL.12010 # Depressed
		25 = WoL.12011 # Stressed
		50 = WoL.12027 # Farm Fire
		50 = WoL.12015 # The Murders
		50 = WoL.12028 # Witch!
		50 = WoL.12029 # Drunkard
		50 = WoL.12025 # Noble Feud
		25 = WoL.12030 # City brigands
	}
}

#on combat pulse
on_combat_pulse = {
	random_events = {
		2750 = 0
		35 = DuelEngine.500 # Battlefield Duel
		20 = CombatTraits.0 # Earn CTA (combat trait advancement) experience
		1 = 242 # Killed
		2 = 243 # Wounded
		1 = 244 # Maimed
		1 = 245 # Serious head injury
		50 = 246 # Improves martial education
		20 = 247 # Flat improvement to martial skill

		20 = 248 # Knowledge boost in capital from battle.
		10 = 255 # Marshal: Unnecessary violence
		25 = 270 # Gain Brave
		25 = 271 # Gain Craven
		25 = HL.10200 # Lose Craven
		25 = HL.10300 # Gain Brave
		20 = 272 # Gain Wroth
		20 = 273 # Gain Patient
		
		30 = 96500 # Gain Combat Trait 1
		15 = 96501 # Gain Combat Trait 2
		15 = 96502 # Gain Combat Trait 3
		15 = 96503 # Gain Combat Trait 4
		
		50 = TOG.3000 # Becomes Berserker
		15 = TOG.3001 # Berserker Maimed
		20 = TOG.3002 # Berserker Wounded
		15 = TOG.3003 # Berserker Killed
		25 = TOG.3004 # Berserker Kills Many
		15 = 79009 # Shieldmaiden can save liege on battlefield
		15 = 79001 # Shieldmaiden saves liege, but she is injured (small chain)
		
		50 = MNM.1202 # Scrying vision inspires greatness
		50 = MNM.1203 # Scrying vision injury
	}
}

#on siege pulse
on_siege_pulse = {
	events = {
		Plus.1000 # Ruler gets option to hide or remain at the castle
	}
	random_events = {
		200000 = 0
		75 = 62000
		75 = 62001
		75 = 62003
		75 = 62004
		75 = 62005
		75 = 62006
		75 = 62007
		75 = 62008
		75 = 62009
		75 = 62010
		25 = 62014
		75 = 62015
		15 = 62011	
		15 = 62012
		15 = 62013
		100 = Plus.958 # Building sacked during siege
		7500 = Plus.1005 # Escape from a siege where you have not hidden
	}
}

# any leader in battle on winning side is ROOT - opponent army leader is FROM
on_battle_won = {
	random_events = {
		800 = 0
		50 = 260 # Heroism shown
		50 = 261 # Soldier Distinguish himself.
		100 = 8310 # Crusader becomes zealous
		50 = CM.1054 # Death of Roland
	}
}

# any leader in battle on winning side is ROOT - opponent army leader is FROM
on_major_battle_won = {
	events = {
		CM.10029 # Chronicle
		Plus.3384 # Imperial Guard distinguishes himself in victory
	}
}

# Winning army leader is ROOT - opponent army leader is FROM
on_battle_won_leader = {
}

# Winning army leader is ROOT - opponent army leader is FROM
on_major_battle_won_leader = {
	events = {
		CM.10031
	}
	random_events = {
		900 = 0
		100 = GoPagan.236 # Army of the Light
		100 = Plus.2128 # Bogomilist Formalization: Major Battle Won
	}
}

# Winning army owner is ROOT - opponent army owner is FROM
on_battle_won_owner = {
	events = {
		RIP.15115 #EoD prophet loses
	}
}

# Any leader in battle on losing side is ROOT - opponent army leader is FROM
on_battle_lost = {
	random_events = {
		700 = 0
		50 = 250 # Imprisoned by the enemy
		50 = 8320 # Crusader becomes cynical
		200 = CM.1056 # Death of Roland
	}
}

# Any leader in battle on losing side is ROOT - opponent army leader is FROM
on_major_battle_lost = {
	events = {
		CM.10030 # Chronicle
	}
}

# Losing army leader ROOT - opponent army leader is FROM
on_battle_lost_leader = {

}

# Losing army leader ROOT - opponent army leader is FROM
on_major_battle_lost_leader = {
	events = {
		CM.10032
	}
	random_events = {
		900 = 0
		100 = GoPagan.237 #Army of the Light
		100 = Plus.2129 # Bogomilist Formalization: Major Battle Lost
	}
}

# Losing army owner is ROOT - opponent army owner is FROM
on_battle_lost_owner = {
	events = {
		Plus.362 # Rebel/Adventurer imprisoned after loss
		HL.180 # Check raiding adventurer defeat
	}
}

# The taken Holding title is in FROM.
on_siege_won_leader = {
	events = {
		8330 # Conquers the crusade target
		60100 # Mongols sack Kiev
		60101 # Mongols sack Novgorod
		60102 # Mongols sack Krakow
		60103 # Mongols sack Aachen
		60104 # Mongols sack Paris
		60105 # Mongols sack London
		60106 # Mongols sack Rome
		60107 # Mongols sack Venice
		60108 # Mongols sack Constantinople
		60109 # Mongols sack Lisbon
		60110 # Mongols sack Smolensk
		60111 # Mongols sack Prague
		60112 # Mongols sack Vienna
		60113 # Mongols sack Esztergom
		60114 # Mongols sack Athens
		60115 # Mongols sack Belgrade
		60116 # Mongols sack Baghdad
		60117 # Mongols sack Damascus
		60118 # Mongols sack Jerusalem
		60119 # Mongols sack Alexandria
		60120 # Mongols sack Cairo
		60121 # Mongols sack Mecca
		88005 # Mongols sack city near the Hashshashin
		CM.10033 # Chronicle for certain major locations
		CM.10034 # Chronicle for certain major locations
		Plus.1020 # Waylit siege imprison event (not unreformed pagans)
		Plus.1025 # If liberating a friendly settlement
		Plus.1030 # Waylit siege imprison event (unreformed pagans)
	}
	random_events = {
		300 = 0
		100 = 8340 # Finds the Spear of Destiny / Holy Lance
		100 = 8342 # Finds the Holy Grail
		500 = 8345 # Sack of Jerusalem
	}
}

on_siege_lost_leader = {
	events = {
		8350 # Loses the crusade target's capital
	}
}

# Fires for the owner of the winning unit (ROOT). The taken Holding title is in FROM.
on_siege_over_winner = {
	events = {
		TOG.1005 # Peasants take county capital
		TOG.1025 # Heretics take county capital
		TOG.1045 # Nationalists take county capital
		TOG.1065 # Religious rebels take county capital
		TOG.1085 # Decadence rebels take county capital
		CM.1101 # Destruction of Irminsul
		CM.10035 # Chronicle for certain major locations
		Plus.2035 # Christian holy site is sacked by Waldensians
		HL.2005 # Minor Nomad Clan rebels take county capital
		RIP.11702 # Prosperity lost when sieged
		RIP.11713 # Monument to Glory teardown
		HL.4813 # Nomads may pillage holdings on siege
		MNM.6222 # Assassins occupy holding
		MNM.7111 # Devil Worshipers desecrate holding
		MNM.9900 # Chance to steal artifact from capital holdings
	}
	random_events = {
		400 = 0 # Nothing happens
		100 = SoA.5400 # Massacre at Beziers-type event
		50 = Plus.2016 # Lollard/Paulician/Iconoclast wins siege over a Christian temple
		50 = Plus.2034 # Waldensian wins siege over a Christian temple
	}
}

# Fires for all characters presumed to be in the Holding at the time. Siege winner unit owner in the 'new_character' scope, lost holding title in FROM, local character in ROOT.
on_siege_over_loc_chars = {
	events = {
		SoA.5406 # Shepherds' Crusade kills Jews and priests
	}
	random_events = {
 		1000 = 0 # Nothing happens
 		400 = SSI.61 # Aztec sacrifice
 		200 = TOG.1190 # Rebels kill character
 	}
}

#character
on_failed_assassination = {
	random_events = {
 		85 = 156 # No harm done
 		10 = 157 # Wounded
 		5 = 158 # Maimed
 	}
}

#character
on_failed_assassination_disc = {
	random_events = {
 		85 = 159 # No harm done
 		10 = 160 # Wounded
 		5 = 161 # Maimed
 	}
}

#character
on_assassination = {
	events = {
 		162
 	}
}

#character
on_assassination_disc = {
	events = {
 		163
 	}
}

# character
on_birth = {
	events = {
		300 # A Bastard is born
		312 # The child of a consort is born		
		318 # A Bastard is born, but is not recognized as such by the mother's spouse (cuckoo!)
		335 # Hidden utility event for all children born
		TOG.3206 # Child Perceived to be Demon Born
		CM.10011 # Chronicle entry
		HL.1000 # Child born with Wolf's Blood
		HL.1700 # Wolf's Blood inheritance
		TOG.6001 # Children gains Saoshyant Descendant trait from Saoshyant
		Plus.324 # Passes on various traits at birth (plus father/uncle opinion fix)
		ancrel.215 # Child Perceived to be a Changeling
		Plus.2004 # Cathar parents lose prestige/piety		
		RIP.11064 # Babies born in seclusion get seclusion modifier
		MNM.7508 # DW Demon child
	}
	random_events = {
		200 = 0
		100000 = MNM.1206 # A Child is born, Hermetic Scrying vision fulfilled
		50 = RIP.29600 # Firstborn/first son reaction 
		1 = RoI.10000 # Reincarnation?
		1 = RIP.29805 # Reincarnation for non west_african
	}
}

# character
on_adulthood = {
	events = {
		HL.1040 # Wolf Child reaches maturity
		ancrel.184 # Celtic child comes of age
		ancrel.241   # Changeling child's true nature asserts itself
		ZE.13998 # Clear adolescence trait event chain flags on adulthood
		
		# Childhood Traits mature if they haven't yet
		ZE.13000 # Haughty
		ZE.13010 # Affectionate
		ZE.13020 # Timid
		ZE.13030 # Rowdy
		ZE.13040 # Willful
		ZE.13050 # Brooding
		ZE.13060 # Indolent
		ZE.13070 # Playful
		ZE.13080 # Conscientious
		ZE.13090 # Fussy
		ZE.13100 # Curious
		ZE.13110 # Idolizer
		
		# Resolve education and add trait
		ZE.14100 # Diplomacy
		ZE.14200 # Martial
		ZE.14300 # Stewardship
		ZE.14400 # Intrigue
		ZE.14500 # Learning
		ZE.14700 # Lack of focus

		SoA.3020 # Demon child's true nature asserts itself
		
		MNM.1269 # Horoscoped child gets new modifiers
		MNM.4302 # Monastic Order education bonus purity effect
		# Childhood traits revealed if they haven't yet		
		Plus.4061 # Child is fair or ugly
	}
}

on_adolescence = { # Checked on 12th birthday.
	events = {
		ZE.12998 # Clear childhood event chain flags
		
		# Childhood traits revealed if they haven't yet
		Plus.4055 # Child is smart or stupid
		Plus.4059 # Child is strong or weak
	}
}

# baby scope
on_post_birth = {
	events = {
		313 # Possible complications for the mother and child
		314 # Possible complications for the mother after stillbirth
	}
}

#character (at 2 months)
on_pregnancy = {
	events = {
 		400 # Pregnancy in matrimony
 		401 # Pregnancy out of wedlock
 		402 # Pregnancy in matrimony, with another father!
 		410 # Pregnancy as consort
 		412 # Pregnancy as consort, with another father!		
 	}
}

#character
on_crusade_creation = {
	events = {
 		200 # Christian Crusade against Muslims
 		201 # Christian Crusade against Pagans
 		321 # Christian Crusade against Heretics
 		320 # Jihad against Christians
 		322 # Jihad against Pagans
 		323 # Jihad against Heretics
 		324 # Pagan Holy War against Christians
 		325 # Pagan Holy War against Muslims
 		326 # Pagan Holy War against other Pagans
		327 # Zoroastrian Great Holy War
		328 # Jewish Great Holy War
		CM.10015  # Chronicle entry
 	}
}

# Sent to employers of both spouses - ROOT is employer. FROM is employers "employee". new_character is the other spouse.
on_marriage = {
	events = {
		Plus.361 # Lowborn marries a Duke or above
 		500 # Royal Marriage Aid Duty
 		501 # Zoroastrian "Xwedodah" marriage
 		502 # Messalian close kin marriage
		CM.10023  # Chronicle entry
		CM.10036 # Chronicle entry - primary heir
		Plus.620 # Egyptian Pagan marriage
		ZE.1015 # Disobedient daughter is unhappy with marriage
		GBC.199 # Game book event, falling in love with someone else at marriage feast
 	}
	random_events = {
		10 = ZE.1010 # Daughter becomes disobedient - undesired marriage
		2000 = 0 # No random event
	} 	
}

#character. Triggers when someone gets imprisoned for any reason. - ROOT is prisoner, FROM is imprisoner
on_become_imprisoned_any_reason = {
	events = {
		HL.190
		Plus.2759 # Rollo is imprisoned by a Christian king and offers to kneel
		ZE.14600 # Being thrown in prison affects education negatively
		RIP.12097 # Being thrown in prison removes seclusion modifier
		Plus.337 # Clear siege modifiers/hiding trait if imprisoned
		MNM.9033 # Imprisoned councillor cannot hunt for relics
		685 # Remove in-hiding trait on imprisonment
	}
}

#character. Triggers if someone tries to imprison someone landed and fails. This leads to an automatic war declaration(independece)
on_avoided_imprison_started_war = {
	events = {
 		150 # Avoided imprison, declared independece
 	}
}

#character. Triggers if someone becomes imprisoned by the diplo-action - ROOT is prisoner, FROM is imprisoner
on_became_imprisoned = {
	events = {
 		151 # Was imprisoned
		CM.10024  # Chronicle entry
 	}
}

#character. Triggers if someone tries to imprison someone unlanded and fails. Character is exiled to another country
on_avoided_imprison_fled_country = {
	events = {
 		152
 	}
}

#character. Triggers if someone is released from prison - ROOT is prisoner, FROM is imprisoner
on_released_from_prison = {
	events = {
 		153
		CM.10025  # Chronicle entry
		CM.15002  # Free anyone thrown into the desert
		ZE.12219  # Released from dungeon must choose whether to leave pet rat behind
		Plus.1116 # Disinherited heir finally gets out of prison -- now what?
 	}
}

#character. Triggers if someone is executed, character not dead yet
on_executed = {
	events = {
 		154
 	}
}

#character. Triggers if someone is exiled
on_exiled = {
	events = {
 		155
		Plus.110 #Removal of Estates
 	}
}

#character. Fires every month for characters who are preparing an invasion.
on_prepared_invasion_monthly = {
	random_events = {
		15 = 0
		15 = 62322 	# A small force flocks to your banner
		15 = 62320 	# A significant force flocks to your banner
		2 = 62321 	# A Hero joins your cause with his retinue
	}
}

#character. Fires if a prepared invasion becomes invalid.
on_prepared_invasion_aborts = {
	events = {
		62300 # Handle abort
	}
}

#character. Fires if a prepared invasion expires.
on_prepared_invasion_expires = {
	events = {
		62310 # Handle expiration
	}
}

on_death = {
	events = {
		650 # Clears diplomatic immunity for faction members
		20355 # Heir inherits half of the spy network value
		24500 # Mourning event check for dying wife
		24502 # Mourning event check for dying son
		#60002 # Genghis Khan dies
		#60006 # Sons of Genghis Khan die
		70041 # Tournament ends if ruler dies
		SoA.5306 # Check for Cadaver Synod
		CM.1068 # Carloman dies
		CM.1069 # Charlemagne dies
		CM.10010 # Chronicle entry
		CM.6185 # Dies of other causes while assassination is in progress - clear flags
		WoL.6335 # Owner of Necronomicon dies...
		HL.8001 # Sky Burial
		HL.12 # End blood oath on death
		HL.4998
		ZE.1030 # Daughter becomes disobedient - killed lover
		ZE.1040 # Daughter becomes disobedient - killed friend
		532 #Clears regents if heir has one already
		RIP.4400 #Nicknames for executions
		GR.10
		MNM.6844 #Removes mark of death block for Assassins GM
		MNM.6991 #Clears any quests targeting this character
		MNM.6012 #Transfers assassins debt to heir
		MNM.1415 #Announces hermetics apprentice death
		SoA.3091 # The Death of the Demon Child?
		RoI.248 # clearing inventory of cursed diamond
		MNM.9030 # Notify of dead relic hunter
		MNM.1611 # Clears Apprentice minor titles
		JD.60210 # Destroy Pretender Chinese Empire if heir is not same dynasty and chinese
		680
		JD.60015 # Notify of Suzerain dying and you being free
		JD.60006 # Destroy prosthetics
		JD.3042 # Clear Supply Horses modifier if no longer Nomadic
		JD.10080 # Your Chinese Prince/Princess has died (for children or spouse - must be read before JD.60310!)
		JD.60310 # Courtier from China dies
		TOG.1055 # Nationalist revolter dies
		Plus.111 # Estates passed onto children
		Plus.306 # Inherit Half of Dishonourable and Tyrant
		Plus.321 # Remove Favored Son trait
		ancrel.206 # Parent dies while child is off learning druidic arts
		ancrel.1194 # Ruler has died, the Aonach is over
		ancrel.2123 # Cleanup when a Vestalis dies
		Plus.304 # Pass down lifetime appointments law to heir
		Plus.340 # Cleanup "child serving abroad" event chains (Varangian/Celtic Holy Orders) when parent dies
		Plus.1130 # Remove Disinherited trait
		Plus.1213 # Ruler has died, the coronation is cancelled
		Plus.1405 # Temple builder dies during the construction
		FemRule.300 # Usurper husband dies but has no living sons by usurped wife
		FemRule.303 # Usurped wife dies but has no living sons by usurper husband
		Plus.348 # Viceroys pass on wealth to a relative
		Plus.136 # Tanist titles give strong claims to non-inheriting children
		Plus.138 # Feudal Elective titles gives strong non-inheritable claims to Pretenders
		Plus.1610 # King/Emperor dies at low CA with possibly unsuitable heir
		Plus.2019 # Lollard ruler dies while Bible is being translated
		Plus.1960 # Shiite claimant passes on trait to heir
		Plus.2290 # Pope/Patriarch dies
		Plus.2294 # Chalcedonian Pope dies
		Plus.2601 # Check for chance of sainthood
		GoPagan.276 # Yazidi ruler dies while holding the Peacock Festival
		Plus.411 # Ruler dies who is a tributary or has them
		Plus.2655 # Nomadic ruler of a large realm dies with multiple sons
		Plus.3329 # Ruler dies while a relative is away at the capital
		
		# Clean up traits as we don't keep zoroastrian pets in death
		ZP.5
		
		Plus.1761 # Player dies with non-dynasty heir
		Plus.1767 # hired educator dies
	}
	random_events = {
		1 = RIP.29800 #reincarnation investigation
		10 = 24505 # Suspicious death
		10 = 24510 # Death of a Councillor
		25 = RIP.29000 #Lovers/rivals/friends react
		100 = MNM.1207 # Hermetic Scrying vision fulfilled
		100 = 0
	}
}

on_merc_rampage = {
	events = {
 		38050
 	}
}

on_merc_leave = {
	events = {
 		38051
 	}
}

on_merc_turn_coat_from = {
	events = {
 		38052
 	}
}

on_merc_turn_coat_to = {
	events = {
 		38053
 	}
}

on_holy_order_leave = {
	events = {
 		38054
 	}
}

#Note: Unsynchronised, this message should not execute an event which changes the gamestate to prevent out of sync
on_letter_event_message = {
	events = {
		1
	}
}

#Note: Unsynchronised, this message should not execute an event which changes the gamestate to prevent out of sync
on_character_event_message = {
	events = {
		2
	}
}

on_loot_settlement = {
	random_events = {
		5 = TOG.3300
		5 = TOG.3301
		5 = TOG.3302
		5 = TOG.3303
		35 = TOG.3320
		250 = 0
	}
	events = {
		TOG.3321
		TOG.3322
		TOG.3323
		RIP.11720
		MNM.9899 # Chance to steal artifact from capital holdings
	}
}

# When someone is looting currently in a province
# ROOT = Looter, FROM = Province
on_loot_province = {
	random_events = {
		1 = HL.8
		49 = 0
	}
}


###########################
# DIPLOMATIC NOTIFICATIONS
###########################

# FROM is the character recieving the event
# FROMFROM is the person sending the event
# ROOT is empty or a third party
# new_character is empty or a third party

DEMAND_RELIGIOUS_CONVERSION_INTERACTION_ACCEPT_EVENT = {
	events = {
		202
	}
}

DEMAND_RELIGIOUS_CONVERSION_INTERACTION_DECLINE_EVENT = {
	events = {
		203
	}
}

REVOKE_TITLE_INTERACTION_ACCEPT_EVENT = {
	events = {
		204
	}
}

REVOKE_TITLE_INTERACTION_DECLINE_EVENT = {
	events = {
		205
	}
}

OFFER_PEACE_INTERACTION_ACCEPT_EVENT = {
	events = {
		206
		CM.1407 # Charlemagne in Spain
	}
}

OFFER_PEACE_INTERACTION_DECLINE_EVENT = {
	events = {
		207
	}
}

SEND_GIFT_INTERACTION_ACCEPT_EVENT = {
	events = {
		208
	}
}

SEND_GIFT_INTERACTION_DECLINE_EVENT = {
	events = {
		209
	}
}

ASK_FOR_MONEY_INTERACTION_ACCEPT_EVENT = {
	events = {
		SoA.3100
	}
}

ASK_FOR_MONEY_INTERACTION_DECLINE_EVENT = {
	events = {
		SoA.3101
	}
}

ASK_FOR_CLAIM_INTERACTION_ACCEPT_EVENT = {
	events = {
		SoA.3104
	}
}

ASK_FOR_CLAIM_INTERACTION_DECLINE_EVENT = {
	events = {
		SoA.3105
	}
}

NOMINATE_BISHOP_TO_POPE_INTERACTION_ACCEPT_EVENT = {
	events = {
		SoA.3102
	}
}

NOMINATE_BISHOP_TO_POPE_INTERACTION_DECLINE_EVENT = {
	events = {
		SoA.3103
	}
}


OFFER_VASSALIZATION_INTERACTION_ACCEPT_EVENT = {
	events = {
		210
	}
}

OFFER_VASSALIZATION_INTERACTION_DECLINE_EVENT = {
	events = {
		211
	}
}

ARRANGE_BETROTHAL_INTERACTION_ACCEPT_EVENT = {
	events = {
		212
	}
}

ARRANGE_BETROTHAL_INTERACTION_DECLINE_EVENT = {
	events = {
		213
	}
}

ARRANGE_SUCC_BETROTHAL_INTERACTION_ACCEPT_EVENT = {
	events = {
		330
	}
}

ARRANGE_SUCC_BETROTHAL_INTERACTION_DECLINE_EVENT = {
	events = {
		331
	}
}

OFFER_SUCCESSION_MARRIGE_INTERACTION_ACCEPT_EVENT = {
	events = {
		214
		37255
	}
}

OFFER_SUCCESSION_MARRIGE_INTERACTION_DECLINE_EVENT = {
	events = {
		215
	}
}

OFFER_MARRIGE_INTERACTION_ACCEPT_EVENT = {
	events = {
		216
		37255
	}
}

OFFER_MARRIGE_INTERACTION_DECLINE_EVENT = {
	events = {
		217
	}
}

RANSOM_CHARACTER_INTERACTION_ACCEPT_EVENT = {
	events = {
		218
	}
}

RANSOM_CHARACTER_INTERACTION_DECLINE_EVENT = {
	events = {
		219
	}
}

EDUCATE_CHARACTER_INTERACTION_ACCEPT_EVENT = {
	events = {
		220
	}
}

EDUCATE_CHARACTER_INTERACTION_DECLINE_EVENT = {
	events = {
		221
	}
}

ABANDON_AMBITION_INTERACTION_ACCEPT_EVENT = {
	events = {
		222
	}
}

ABANDON_AMBITION_INTERACTION_DECLINE_EVENT = {
	events = {
		223
	}
}

STOP_BACKING_AMBITION_INTERACTION_ACCEPT_EVENT = {
	events = {
		224
	}
}

STOP_BACKING_AMBITION_INTERACTION_DECLINE_EVENT = {
	events = {
		225
	}
}

JOIN_AMBITION_INTERACTION_ACCEPT_EVENT = {
	events = {
		226
	}
}

JOIN_AMBITION_INTERACTION_DECLINE_EVENT = {
	events = {
		227
	}
}

GRANT_LANDED_TITLE_INTERACTION_ACCEPT_EVENT = {
	events = {
		MNM.1217
		228
	}
}

GRANT_LANDED_TITLE_INTERACTION_DECLINE_EVENT = {
	events = {
		229
	}
}

APPOINT_TO_OFFICE_INTERACTION_ACCEPT_EVENT = {
	events = {
		230
	}
}

APPOINT_TO_OFFICE_INTERACTION_DECLINE_EVENT = {
	events = {
		231
	}
}

ASK_FOR_INVASION_INTERACTION_ACCEPT_EVENT = {
	events = {
		232
	}
}

ASK_FOR_INVASION_INTERACTION_DECLINE_EVENT = {
	events = {
		233
	}
}

#
ASK_FOR_DIVORCE_INTERACTION_ACCEPT_EVENT = {
	events = {
		234
		# 717 # Achievement #removed 2.4
		# CM.10037 #removed 2.4
	}
}

ASK_FOR_DIVORCE_INTERACTION_DECLINE_EVENT = {
	events = {
		235
	}
}

ASK_FOR_EXCOMMUNICATION_INTERACTION_ACCEPT_EVENT = {
	events = {
		236
	}
}

ASK_FOR_EXCOMMUNICATION_INTERACTION_DECLINE_EVENT = {
	events = {
		237
	}
}

CALL_ALLY_INTERACTION_ACCEPT_EVENT = {
	events = {
		238 # Ally accepts
		41000 # Vassal accepts
		CM.10014
	}
}

CALL_ALLY_INTERACTION_DECLINE_EVENT = {
	events = {
		239 # Ally 
		41001 # Vassal
	}
}

DECLARE_WAR_INTERACTION_ACCEPT_EVENT = {
	events = {
		240
		241
	}
}

RETRACT_VASSAL_INTERACTION_ACCEPT_EVENT = {
	events = {
		274
	}
}

RETRACT_VASSAL_INTERACTION_DECLINE_EVENT = {
	events = {
		275
	}
}

INVITE_TO_COURT_INTERACTION_ACCEPT_EVENT = {
	events = {
		280
	}
}

INVITE_TO_COURT_INTERACTION_DECLINE_EVENT = {
	events = {
		281
	}
}

ASK_FOR_VASSALIZATION_INTERACTION_ACCEPT_EVENT = {
	events = {
		282
	}
}

ASK_FOR_VASSALIZATION_INTERACTION_DECLINE_EVENT = {
	events = {
		283
	}
}

ASK_TO_LIFT_EXCOMMUNICATION_INTERACTION_ACCEPT_EVENT = {
	events = {
		284
	}
}

ASK_TO_LIFT_EXCOMMUNICATION_INTERACTION_DECLINE_EVENT = {
	events = {
		285
	}
}

ASK_TO_RANSOM_CHARACTER_INTERACTION_ACCEPT_EVENT = {
	events = {
		286
	}
}

ASK_TO_RANSOM_CHARACTER_INTERACTION_DECLINE_EVENT = {
	events = {
		287
	}
}

SETTLE_ADVENTURER_INTERACTION_ACCEPT_EVENT = {
	events = {
		288
	}
}

SETTLE_ADVENTURER_INTERACTION_DECLINE_EVENT = {
	events = {
		289
	}
}


ASK_TO_JOIN_WAR_INTERACTION_ACCEPT_EVENT = {
	events = {
		293
		CM.10013
	}
}

ASK_TO_JOIN_WAR_INTERACTION_DECLINE_EVENT = {
	events = {
		294
	}
}

ASK_TO_EMBARGO_INTERACTION_ACCEPT_EVENT = {
	events = {
		295
	}
}

ASK_TO_EMBARGO_INTERACTION_DECLINE_EVENT = {
	events = {
		296
	}
}

MAKE_CONSORT_INTERACTION_ACCEPT_EVENT = {
	events = {
		297
	}
}

MAKE_CONSORT_INTERACTION_DECLINE_EVENT = {
	events = {
		298
	}
}

ABSORB_CLAN_INTERACTION_ACCEPT_EVENT = {
	events = {
		503
	}
}

ABSORB_CLAN_INTERACTION_DECLINE_EVENT = {
	events = {
		504
	}
}

SPLIT_CLAN_INTERACTION_ACCEPT_EVENT = {
	events = {
		509
	}
}

SPLIT_CLAN_INTERACTION_DECLINE_EVENT = {
	events = {
		510
	}
}

FORM_BLOOD_OATH_INTERACTION_ACCEPT_EVENT = {
	events = {
		505
	}
}

FORM_BLOOD_OATH_INTERACTION_DECLINE_EVENT = {
	events = {
		506
	}
}

SETTLE_FEUD_INTERACTION_ACCEPT_EVENT = {
	events = {
		507
	}
}

SETTLE_FEUD_INTERACTION_DECLINE_EVENT = {
	events = {
		508
	}
}

FORM_ALLIANCE_INTERACTION_ACCEPT_EVENT = {
	events = {
		diploresponse.1
	}
}

FORM_ALLIANCE_INTERACTION_DECLINE_EVENT = {
	events = {
		diploresponse.2
	}
}

DISSOLVE_ALLIANCE_INTERACTION_ACCEPT_EVENT = {
	events = {
	}
}

DISSOLVE_ALLIANCE_INTERACTION_DECLINE_EVENT = {
	events = {
	}
}

BUY_FAVOR_INTERACTION_ACCEPT_EVENT = {
	events = {
		520
	}
}
BUY_FAVOR_INTERACTION_DECLINE_EVENT = {
	events = {
		521
	}
}

REQUEST_SUPPORT_INTERACTION_ACCEPT_EVENT = {
	events = {
		522
	}
}
REQUEST_SUPPORT_INTERACTION_DECLINE_EVENT = {
	events = {
		523
	}
}

FORM_NON_AGGRESSION_PACT_INTERACTION_ACCEPT_EVENT = {
	events = {
		524
	}
}
FORM_NON_AGGRESSION_PACT_INTERACTION_DECLINE_EVENT = {
	events = {
		525
	}
}

ASK_COUNCIL_POSITION_INTERACTION_ACCEPT_EVENT = {
	events = {
		526
	}
}
ASK_COUNCIL_POSITION_INTERACTION_DECLINE_EVENT = {
	events = {
		527
	}
}

ASK_REALM_PEACE_INTERACTION_ACCEPT_EVENT = {
	events = {
		528
	}
}
ASK_REALM_PEACE_INTERACTION_DECLINE_EVENT = {
	events = {
		529
	}
}

FORCE_JOIN_FACTION_INTERACTION_ACCEPT_EVENT = {
	events = {
		530
	}
}
FORCE_JOIN_FACTION_INTERACTION_DECLINE_EVENT = {
	events = {
		531
	}
}

ASK_TO_JOIN_AMBITION_INTERACTION_ACCEPT_EVENT = {
	events = {
		535
	}
}
ASK_TO_JOIN_AMBITION_INTERACTION_DECLINE_EVENT = {
	events = {
		536
	}
}
OFFER_CONSORT_INTERACTION_ACCEPT_EVENT = {
	events = {
		537
	}
}
GIVE_ARTIFACT_INTERACTION_ACCEPT_EVENT = {
	events = {
		538
	}
}

# never triggered, but reserved for CB use
on_warleader_death = {
	events = {
		251
		252
	}
}

# Respond to a proposed change of law
on_approve_law = {
	events = {
		290
		675
	}
}

# Respond to a proposed change of law
councilor_on_approve_law = {
	events = {
		750
	}
}

# Respond to a proposed change of de jure law
on_approve_de_jure_law = {
	events = {
		291
		292
		676
	}
}

# When rebels appear
on_rebel_revolt = {
	events = {
		600 		# Only valid without "The Old Gods" DLC
		TOG.1010 	# Peasant rebels reinforced
		TOG.1030 	# Heretic rebels reinforced
		TOG.1050 	# Nationalist rebels reinforced
		TOG.1070 	# Religious rebels reinforced
		TOG.1090	# Decadence rebels reinforced
		TOG.1000 	# Peasant rebels rise up
		TOG.1020	# Heretic rebels rise up
		TOG.1040	# Nationalist rebels rise up
		TOG.1060	# Religious rebels rise up
		TOG.1080	# Decadence rebels rise up
		HL.2010		# Minor Clan rebels reinforced
		HL.2000		# Minor Clan rebels rise up
	}
}

# When province defects to rebels
on_defect_to_rebels = {
	events = {
		610			# Only valid without "The Old Gods" DLC
	}
}

# When rebels disperse
on_defect_from_rebels = {
	events = {
		615			# Only valid without "The Old Gods" DLC
	}
}

# When a mission succeeds
on_crusade_success = {
	events = {
		620
		CM.10016  # Chronicle entry
	}
}

# When a mission fails
on_crusade_failure = {
	events = {
		621
		CM.10017  # Chronicle entry
	}
}

# When a mission invalidates
on_crusade_invalid = {
	events = {
		534
	}
}

# When a pagan ruler forces a prisoner to be his consort
on_forced_consort = {
	events = {
		660
	}
}

# When a pagan religion is reformed
on_reform_religion = {
	events = {
		670
	}
}

# When the religion changes in a county, ROOT is province. FROM has the old religion.
on_county_religion_change = {
	events = {
		SoA.4121
		MNM.6206 #Convert province assassin quest
		Plus.726 #Jewish majority turns into a minority
		Plus.685 #Add special Bon recent flag thing
	}
}

# When a character accepts religious conversion (the diplomatic action)
# FROMFROM is the demander. FROM is the vassal. ROOT is the character. Fires for the vassal and each of his courtiers and vassals.
on_vassal_accepts_religious_conversion = {
	events = { 
		39700 # Hidden event actually changing the religion
	}
}

# A heresy has become the new norm, replacing the old orthodoxy
on_heresy_takeover = {
	events = {
		SoA.4200
	}
}

# Fires for a newly elected Doge. FROM is the previous (dying or abdicating) doge.
on_become_doge = {
	events = {
	}
}

on_elective_gavelkind_succession = {
	events = {
		63103
	}
}

# Fires when a navy moves into a port. Starts in unit scope, FROM is the owner.
on_entering_port = {
	events = {
	}
}

# Fires when a cardinal is elected. SoA only! FROM is the Religious head.
on_rel_elector_chosen = {
}

# Fires when a Pope is elected. SoA only! FROM is the previous Religious Head
on_rel_head_chosen = {
	events = {
	}
}

# ROOT is the looter, FROM is the settlement title
on_settlement_looted = {
}

# ROOT is the navy's owner, FROM is the province
on_navy_returns_with_loot = {
	events = {
		TOG.3404 #Prosperity gain from loot
	}
}

# ROOT is the creating character, FROM is the title
on_create_title = {
	events = {
		CM.10021
		CM.1501
		Plus.2289 # Check relations between Greek and Latin Chalcedonian realms
		PlusFaction.216 # Update matrilineal marriage status for created titles
		Plus.565 # Determine the name and CoA for Polish kingdom
		Plus.1872 #Make capital kingdom de jure to empire if kingdom entirely controled
	}
}

# gain_title, create_title, grant_title - on_new_holder
# usurp_title - on_new_holder_usurpation
# inheritance, abdicate - on_new_holder_inheritance

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder = {
	events = {
		HL.4999 #Preserve Nomad Culture
		HL.4996 #Clear Nomad Agitation when conquered by a non-nomad
		HL.4812 #Clear nomadic pillage holding modifiers upon succession/conquest
		HL.4811 #Clear the 'Rampaging Nomads'-Modifier when conquered by a non-nomad
		HL.140 #Landless nomad gains a title.
		60504 #Landless status clean-up for e_mongol_empire.
		#ZE.7000 #Check for Gain Any Title ambition.
		Plus.351 # Adds province chaos modifier
		Plus.356 # Removes claims for dead rulers
		ZE.6010 #ambition event for unlanded son.
		RIP.12098 #check if we need to remove in_seclusion.
		RIP.11715 #Removes crown focus on new holder
		533
		MNM.6990 #Makes sure d_hashshashin owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
		MNM.1216 # The Hermetics Scrying Power result (for old holder)
		SSI.40 #Aztecs conquer X events
		SSI.41
		SSI.42
		SSI.43
		SSI.44
		SSI.45
		SSI.46
		SSI.47
		SSI.48
		Plus.359 # Removes religion head title if wrong religion
		Plus.1853 # Emperor inherits a second imperial title and must choose between them
		Plus.1850 # Decadence check for imperial titles
		PlusFaction.213 # Check for invalidated succession law
		Plus.364 # Fix Gender + Succession law when passed over
		Plus.327 # Convert Latin Empire to Byzantine Empire if the holder is no longer Catholic
		Plus.328 # Byzantium Auto-Destroy Mechanic. Destroys Byzantium if the title holder is not Orthodox or Hellenic
		Plus.338 # HRE Auto-Destroy Mechanic. Destroys the HRE if the ruler is no longer Catholic (or replacement heresy)
		Plus.535 # Byzantine Emperor conquers Bulgaria (flag set in history file -- only valid between 998 and 1018 )
		Plus.1186 # The Carolongian Emperor inherits both Lotharingia and Burgundy
		Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		Plus.2200 # Rome Re-Established
		Plus.2202 # Constantinople Re-Established
		Plus.2205 # Alexandria Re-Established
		Plus.2208 # Antioch Re-Established
		Plus.2211 # Jerusalem Re-Established
		Plus.2214 # Latin Patriarchate of Constantinople Re-Established
		Plus.2216 # Latin Patriarchate of Alexandria Re-Established
		Plus.2218 # Latin Patriarchate of Antioch Re-Established
		Plus.2220 # Latin Patriarchate of Jerusalem Re-Established
		Plus.2201 # Rome De-Established
		Plus.2203 # Constantinople De-Established
		Plus.2206 # Alexandria De-Established
		Plus.2209 # Antioch De-Established
		Plus.2212 # Jerusalem De-Established
		Plus.2204 # Constantinople Reformed
		Plus.2207 # Alexandria Reformed
		Plus.2210 # Antioch Reformed
		Plus.2213 # Establishing Liege for the Pentarchs
		Plus.2215 # Latin Patriarchate of Constantinople De-Established
		Plus.2217 # Latin Patriarchate of Alexandria De-Established
		Plus.2219 # Latin Patriarchate of Antioch De-Established
		Plus.2221 # Latin Patriarchate of Jerusalem De-Established
		Plus.2272 # Remove Papal title for non-Chalcedonians
		Plus.2275 # Choosing Latin/Greek Rites for Chalcedonian priests
		Plus.368 # Deal with landed Varangians
		ancrel.144 # Cleanup for a Fian/Son of Gwydion that inherits a title
		Plus.2111 # Initialization event for Bogomilist laws
		43305 #handle tyranny for going against council
		ancrel.260 # add Druid trait to Celtic temple holders
		ancrel.115 # add relevant traits to Celtic holy order heads
		Plus.1759 # Small demesne modifier
		Plus.1760 # Overextended republic
		Plus.370 #Gender law Plus
		Plus.2680 # Clean up pillage flag
		
		# Clean up zoroastrian pets on province modifiers in case capital lost
		ZP.7

		JD.60204 # Rebel General's Empire continues temple names, triggers for any title with the uses_temple_names_by_script title flag
		
		539 # Fix adventurers turning Tribal land Feudal
		
		Plus.373 # ERE roman localisation
	}
}

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder_inheritance = {
	events = {
		HL.4812 #Clear nomadic pillage holding modifiers upon succession/conquest
		CM.10039 #Chronicle entry
		HL.140 #Landless nomad gains a title.
		60504 #Landless status clean-up for e_mongol_empire.
		RIP.11715 #Removes crown focus on new holder
		533
		MNM.6990 #Makes sure d_hashshashin owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
		MNM.1216 # The Hermetics Scrying Power result (for old holder)
		JD.60204 # Rebel General's Empire continues temple names, triggers for any title with the uses_temple_names_by_script title flag
		JD.9000 # Reapply Scholar Bureaucrat bonus on death/inheritance
		ZE.6010 #ambition event for unlanded son.
		#Plus.311 # Destroy extra trade posts gained by non-merchant republics
		Plus.314 # Triggers removal of Crowned by Pope or Crowned held by old title owner
		Plus.341 # Check if overthrown ruler is re-inheriting
		Plus.356 # Removes claims for dead rulers
		Plus.359 # Removes religion head title if wrong religion
		Plus.360 # Religion head loses all claims as they gain the title
		Plus.1150 # Upon a new Carolingian emperor ascending to the throne
		Plus.1320 # Upon a new Byzantine emperor ascending to the throne
		Plus.1331 # Upon a former Byzantine emperor regaining the throne
		Plus.1360 # Ruler inherits who has an older bastard sibling
		Plus.1750 # Ruler inherits kingdom without any of its de jure land
		Plus.1850 # Decadence check for imperial titles
		Plus.1853 # Emperor inherits a second imperial title and must choose between them
		Plus.1901 # Sunni Caliph gains title during Anarchy at Samarra
		Plus.2289 # Check relations between Greek and Latin Chalcedonian realms
		Plus.2650 # New nomadic clan holder is different dynasty than previous
		Plus.3200 # Duke/King title inherited in Imperial realm
		Plus.1759 # Small demesne modifier
		Plus.1760 # Overextended republic
		43305 #handle tyranny for going against council
		Plus.2111 # Initialization event for Bogomilist laws
		Plus.368 # Deal with landed Varangians
		ancrel.144 # Cleanup for a Fian/Son of Gwydion that inherits a title
		Plus.2200 # Rome Re-Established
		Plus.2202 # Constantinople Re-Established
		Plus.2205 # Alexandria Re-Established
		Plus.2208 # Antioch Re-Established
		Plus.2211 # Jerusalem Re-Established
		Plus.2214 # Latin Patriarchate of Constantinople Re-Established
		Plus.2216 # Latin Patriarchate of Alexandria Re-Established
		Plus.2218 # Latin Patriarchate of Antioch Re-Established
		Plus.2220 # Latin Patriarchate of Jerusalem Re-Established
		Plus.2201 # Rome De-Established
		Plus.2203 # Constantinople De-Established
		Plus.2206 # Alexandria De-Established
		Plus.2209 # Antioch De-Established
		Plus.2212 # Jerusalem De-Established
		Plus.2204 # Constantinople Reformed
		Plus.2207 # Alexandria Reformed
		Plus.2210 # Antioch Reformed
		Plus.2213 # Establishing Liege for the Pentarchs
		Plus.2215 # Latin Patriarchate of Constantinople De-Established
		Plus.2217 # Latin Patriarchate of Alexandria De-Established
		Plus.2219 # Latin Patriarchate of Antioch De-Established
		Plus.2221 # Latin Patriarchate of Jerusalem De-Established
		Plus.2272 # Remove Papal title for non-Chalcedonians
		Plus.2275 # Choosing Latin/Greek Rites for Chalcedonian priests
		SSI.40 #Aztecs conquer X events
		SSI.41
		SSI.42
		SSI.43
		SSI.44
		SSI.45
		SSI.46
		SSI.47
		SSI.48
		PlusFaction.213 # Check for invalidated succession law
		Plus.327 # Convert Latin Empire to Byzantine Empire if the holder is no longer Catholic
		Plus.328 # Byzantium Auto-Destroy Mechanic. Destroys Byzantium if the title holder is not Orthodox or Hellenic
		Plus.338 # HRE Auto-Destroy Mechanic. Destroys the HRE if the ruler is no longer Catholic (or replacement heresy)
		Plus.535 # Byzantine Emperor conquers Bulgaria (flag set in history file -- only valid between 998 and 1018 )
		Plus.1186 # The Carolongian Emperor inherits both Lotharingia and Burgundy
		Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		Plus.370 #Gender law Plus
		Plus.2680 # Clean up pillage flag
		Plus.373 # ERE roman localisation
	}
}

# ROOT is the character, FROM is the title, FROMFROM is the old holder
on_new_holder_usurpation = {
	events = {
		HL.4999 #Preserve Nomad Culture
		HL.4996 #Clear Nomad Agitation when conquered by a non-nomad
		HL.4812 #Clear nomadic pillage holding modifiers upon succession/conquest
		HL.4811 #Clear the 'Rampaging Nomads'-Modifier when conquered by a non-nomad
		HL.140 # Landless nomad gains a title.
		CM.10022
		60504 # Landless status clean-up for e_mongol_empire.
		RIP.11715 #Removes crown focus on new holder
		533
		MNM.6990 #Makes sure d_hashshashin owner is always shiite & member of the_assassins
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
		MNM.1216 # The Hermetics Scrying Power result (for old holder)
#		MNM.6230 # Clearing covert province quest if new owner
		JD.60204 # Rebel General's Empire continues temple names, triggers for any title with the uses_temple_names_by_script title flag		
		539 # Fix adventurers turning Tribal land Feudal
		#Plus.311 # Destroy extra trade posts gained by non-merchant republics
		Plus.314 # Triggers removal of Crowned by Pope or Crowned held by old title owner
		Plus.351 # Adds province chaos modifier
		Plus.359 # Removes religion head title if wrong religion
		Plus.1150 # Upon a new Carolingian emperor ascending to the throne
		Plus.1320 # Upon a new Byzantine emperor ascending to the throne
		Plus.1331 # Upon a former Byzantine emperor regaining the throne
		Plus.1850 # Decadence check for imperial titles
		Plus.1853 # Emperor inherits a second imperial title and must choose between them
		Plus.1901 # Sunni Caliph gains title during Anarchy at Samarra
		Plus.2289 # Check relations between Greek and Latin Chalcedonian realms
		Plus.2650 # New nomadic clan holder is different dynasty than previous
		emf_nomad.20 # Catch all for empty provinces being usurped
		Plus.3201 # Duke/King title usurped in Imperial realm
		Plus.1759 # Small demesne modifier
		Plus.1760 # Overextended republic
		43305 #handle tyranny for going against council
		Plus.2111 # Initialization event for Bogomilist laws
		Plus.368 # Deal with landed Varangians
		ancrel.144 # Cleanup for a Fian/Son of Gwydion that inherits a title
		Plus.2200 # Rome Re-Established
		Plus.2202 # Constantinople Re-Established
		Plus.2205 # Alexandria Re-Established
		Plus.2208 # Antioch Re-Established
		Plus.2211 # Jerusalem Re-Established
		Plus.2214 # Latin Patriarchate of Constantinople Re-Established
		Plus.2216 # Latin Patriarchate of Alexandria Re-Established
		Plus.2218 # Latin Patriarchate of Antioch Re-Established
		Plus.2220 # Latin Patriarchate of Jerusalem Re-Established
		Plus.2201 # Rome De-Established
		Plus.2203 # Constantinople De-Established
		Plus.2206 # Alexandria De-Established
		Plus.2209 # Antioch De-Established
		Plus.2212 # Jerusalem De-Established
		Plus.2204 # Constantinople Reformed
		Plus.2207 # Alexandria Reformed
		Plus.2210 # Antioch Reformed
		Plus.2213 # Establishing Liege for the Pentarchs
		Plus.2215 # Latin Patriarchate of Constantinople De-Established
		Plus.2217 # Latin Patriarchate of Alexandria De-Established
		Plus.2219 # Latin Patriarchate of Antioch De-Established
		Plus.2221 # Latin Patriarchate of Jerusalem De-Established
		Plus.2272 # Remove Papal title for non-Chalcedonians
		Plus.2275 # Choosing Latin/Greek Rites for Chalcedonian priests
		SSI.40 #Aztecs conquer X events
		SSI.41
		SSI.42
		SSI.43
		SSI.44
		SSI.45
		SSI.46
		SSI.47
		SSI.48
		PlusFaction.213 # Check for invalidated succession law
		Plus.327 # Convert Latin Empire to Byzantine Empire if the holder is no longer Catholic
		Plus.328 # Byzantium Auto-Destroy Mechanic. Destroys Byzantium if the title holder is not Orthodox or Hellenic
		Plus.338 # HRE Auto-Destroy Mechanic. Destroys the HRE if the ruler is no longer Catholic (or replacement heresy)
		Plus.535 # Byzantine Emperor conquers Bulgaria (flag set in history file -- only valid between 998 and 1018 )
		Plus.1186 # The Carolongian Emperor inherits both Lotharingia and Burgundy
		Plus.366 # Restore original name if title with regnal names is inherited by secular ruler
		Plus.370 #Gender law Plus
		Plus.2680 # Clean up pillage flag
		Plus.373 # ERE roman localisation
	}
}

on_unlanded = {
	events = {
		HL.130 # Landless nomad clean-up.
		Plus.305 # Remove Crowned by Pope or Crowned or Uncrowned if not a ruler
		Plus.3330 # Ruler is unlanded while a relative is away at the capital
		Plus.309 # Remove Tyrant Trait on non-rulers
		Plus.1759 # Small demesne modifier
		Plus.1760 # Overextended republic
		Plus.2276 # Removing Latin/Greek Rites for non-priests
	}
}

# Fires at the end of each year if the chronicle is empty
on_create_chronicle_if_empty = {
	random_events = {
		100 = CM.10500
		100 = CM.10502
		100 = CM.10504
		100 = CM.10506
		100 = CM.10507
		100 = CM.10509
		100 = CM.10511
		100 = CM.10513
		100 = CM.10515
		100 = CM.10517
		100 = CM.10519
		100 = CM.10521
		100 = CM.10523
		100 = CM.10525
		100 = CM.10527
		100 = CM.10529
	}
}

# Fires when the player changes character
# FROM is the old character, ROOT is the new holder
on_chronicle_owner_change = {
	events = {
		CM.10001
	}
}

# Fires when the game starts (not from saves)
on_chronicle_start = {
	events = {
		CM.10000
	}
}

# Character converts religion, for whatever reason. ROOT is the character after conversion and the FROM scope has the old religion.
on_character_convert_religion = {
	events = {
		CM.10026
		671 #set rival conversion flag if eligible
		63105
		TOG.7101 #Removes main deity for defensive pagans
		39804 # Remove BÃ¶n patron dieties
		39805 # Remove Kurmazta patron dieties
		39806 # Remove Taoist Schools
		ancrel.258 # Loses Celtic traits for characters who convert away from Celtic Paganism
		Plus.327 # Convert Latin Empire to Byzantine Empire if the holder is no longer Catholic
		Plus.328 # Byzantium Auto-Destroy Mechanic. Destroys Byzantium if the title holder is not Orthodox or Hellenic
		Plus.338 # HRE Auto-Destroy Mechanic. Destroys the HRE if the ruler is no longer Catholic (or replacement heresy)
		RoI.110 # Converted to Hinduism - choose branch
		RoI.111 # Converted to Buddhism - choose branch
		RoI.112 # Converted to Jainism - choose branch
		
		# If switched religion then trait is gone and we need to clean up modifiers for zoroastrian pets
		ZP.6

		GoPagan.287 # Loses Zoroastrian Modifier
	}
}

# Character converts secret religion, for whatever reason. ROOT is the character after conversion and the FROM scope has the old religion. Note that this fires even when the secret religion is reset as a result of the character converting to it, or if the character didn't previously have a secret religion
on_character_convert_secret_religion = {
	events = {
	}
}

# Character converts culture, for whatever reason. ROOT is the character after conversion and the FROM scope has the old culture.
on_character_convert_culture = {
	events = {
		CM.10027
		Plus.373 # ERE roman localisation
	}
}

on_acquire_nickname = {
	events = {
		CM.10028
	}
}

# Fires for vassals that can become independent as a result of liege being over vassal limit
on_over_vassal_limit_succession = {
	events = {
		63100
	}
}

# From = Attacker, Root = Defender
on_war_started = {
	events = {
		CM.10012
		JD.30020 # Western protectorate receives reinforcements from China
		JD.30030 # Western protectorate receives reinforcements from China
		JD.30015 # Clean up trade contracts
		Plus.1211 # Coronation cancelled due to war
		43303 #check for tyranny from going against council
		Plus.2011 # Cathars are allowed to use holy wars once Catholic holy war is used against them
		Plus.2754 # Rollo offers to kneel before an attacking Christian king
		Plus.548 # Rightful religion head is declared war upon by a member of their own religion
	}
}

# From = Attacker, Root = Defender
on_war_ended_victory = {
	events = {
		CM.10038
		Plus.536 # Bulgaria is not conquered by the Byzantines (flag set in history file -- only valid between 998 and 1018 )
		SSI.105
		Plus.518 # Maintenance Check for Failed Invasion (landless or vassal invaders)
		JD.30051 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_whitepeace = {
	events = {
		CM.10040
		Plus.518 # Maintenance Check for Failed Invasion (landless or vassal invaders)
		JD.30050 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_defeat = {
	events = {
		CM.10041
		Plus.518 # Maintenance Check for Failed Invasion (landless or vassal invaders)
		JD.30052 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_invalid = {
	events = {
		Plus.518 # Maintenance Check for Failed Invasion (landless or vassal invaders)
		JD.30050
	}
}

# From = Divorcer, Root = Spouse, New = Religious head if applicable
on_divorce = {
	events = {
		CM.10037
	}
}

# ROOT = Builder, FROM = Title
on_settlement_construction_start = {
	events = {
		JD.40002 # Start constructing a city on the Silk Road for trade competition
	}
}

# ROOT = Builder, FROM = Province
on_trade_post_construction_start = {
	events = {
	}
}

# ROOT = Builder, FROM = Province
on_fort_construction_start = {
	events = {
	}
}

# ROOT = Builder, FROM = Province
on_hospital_construction_start = {
	events = {
	}
}

# ROOT = Builder, FROM = Title
on_settlement_construction_completed = {
	events = {
		44482		
		HL.4
		MNM.4024
		JD.40003 # Finish constructing a city on the Silk Road for trade competition
	}
}

# ROOT = Builder, FROM = Province
on_trade_post_construction_completed = {
	events = {
	}
}

# ROOT = Builder, FROM = Province
on_fort_construction_completed = {
	events = {
	}
}

# ROOT = Builder, FROM = Province
on_hospital_construction_completed = {
	events = {
	}
}

# ROOT = Builder, FROM = The Holding Title
on_holding_building_start = {
	events = {
		RIP.30100
	}
}

# ROOT = Starter, FROM = Target 
on_feud_started = {
	events = {
		HL.6
	}
}

# ROOT = Ender, FROM = Target 
on_feud_ended = {
}

on_blood_brother_death = {
	events = {
		HL.10
	}
}

# ROOT = AI character
on_ai_end_raid = {
	events = {
		HL.191
	}
}

on_mercenary_hired = {
	events = {
		ZE.10038
	}
}

on_mercenary_dismissed = {
	events = {
		ZE.10039
	}
}
# ROOT = target, FROM = starter, FROMFROM = chosen replacement
on_mercenary_captain_replacement = {
	events = {
		ZE.11040
	}
}

on_enforce_peace = {
}

on_enforce_peace_start = {
}

on_enforce_peace_six_vassals = {
	events = {
	}
}

on_law_vote_passed = {
	events = {
	}
}

on_law_vote_failed = {
}

on_player_mercenary_income = {
	events = {
	}
}

on_outbreak = {
	events = {
		RIP.10000
		RIP.4000
	}
}

on_province_major_modifier = {
	events = {
		RIP.10030
	}
}

# Fires every two years for characters who are members of any society
on_society_bi_yearly_pulse = {
	events = {
		MNM.6199 # Assassins quest tombola
		MNM.7200 # Devil Worshipers quest tombola
		MNM.4000 # Monastic order quest tombola
		#MNM.3000 # Secret religious society quest tombola
		MNM.1000 # Hermetics quest tombola
		MNM.7000 # Devil Worshipers: soul corruption chance
	}
	
	random_events = {
		50 = MNM.10020 # Criminal societies: stressed
		100 = MNM.20000 # Devil Worshippers: Orgy
		100 = MNM.20010 # Devil Worshippers: Night on the Town
		75 = MNM.20030 # Devil Worshippers: Grand Summoning
		100 = MNM.20040 # Devil Worshippers: Impersonating Priests
		100 = MNM.20060 # Devil Worshippers: Infernal Choir (only with Rivals)
		75 = MNM.7854 # Devil Worshipers: Demon Hunters Attack
		100 = MNM.6899 # Assassins: friend or foe?
		100 = MNM.6910 # Assassins: assisting a murder plot
		50 = MNM.6920 # Assassins: blackmailing superior
		100 = MNM.3260 # Monastic Orders: Advising a Poet
		100 = MNM.4200 # Monastic Orders: Learning about Roses
		100 = MNM.4210 # Monastic Orders: Fellow member drowsing off
		100 = MNM.4435 # Monastic Orders: Friendship & Love
		100 = MNM.4217 # Monastic Order: Burn heretical books
		50 = MNM.4610 # Monastic Orders: Monastery has Artifact
		50 = MNM.1620 # Hermetic Society: Divine Summoning
		50 = MNM.1460 # Hermetic Society: Gathering of the Minds
		50 = MNM.5110 # Hermetic Society: Warding off Evil
		50 = MNM.10040 # Every society: Gain rival
		50 = MNM.10043 # Every society: Gain friend (or possibly lover...?)
		200 = 0 # Nothing
	}
}

# A character has switched their society interest
# Root = Character
# From = Society
on_character_switch_society_interest = {
	events = {
		MNM.10010
		MNM.10024 # Backup for refounding societies
	}
}

# A character ranks up in their society, or becomes grandmaster
# Root = Character
# From = Society
on_character_society_rank_up = {
	events = {
		MNM.1750 # Grandmaster notification event
	}
}

# A character ranks down in their society
# Root = Character
# From = Society
on_character_society_rank_down = {
	events = {
	}
}

# A character joins a society. The has_game_started trigger can be useful to avoid firing events from auto-assignment of characters at game start
# Root = Character
# From = Society
on_character_join_society = {
	events = {
	}
}

# A character leaves or is forced to leave a society
# Root = Character
# From = Society
on_character_leave_society = {
	events = {
		MNM.10018 #clears on-going event flags and effects
		MNM.1611 # Clears Apprentice minor titles
	}
}
# A character asks to join a society. Only works on player
# Root = Character
# From = Society
on_character_ask_to_join_society = {
	events = {
		MNM.4450 #Join Monastic Order
		MNM.100 #Join Hermetics
		MNM.10024 # Backup for refounding societies
	}
}

# A character is removed from society for failing the potential trigger.
# Root = Character
# From = Society
on_character_kicked_from_society = {
	events = {
		MNM.10021
	}
}

# A character stops showing interest in a society for failing the CanJoin trigger.
# Root = Character
# From = Society
on_character_stop_showing_interest = {
	events = {
		MNM.10019
	}
}

# Someone joins a society that has no members
# Root = Character
# From = Society
on_society_created = {
	events = {
	}
}

# The last member of a society leaves the society and is not replaced
# Root = Character
# From = Society
on_society_destroyed = {
	events = {
	}
}

# A character selects a focus
# Root = Character
on_focus_selected = {
	events = {
	}
}

# A character succeeds in a quest. This happens just before the quest disappears, so you can access the quest itself. Only invoked when a quest is cleared via script. E.G., does not happen on death
# Root = Character
on_quest_success = {
	events = {
		MNM.6666
	}
}

# A character fails a quest. This happens just before the quest disappears, so you can access the quest itself. Only invoked when a quest is cleared via script. E.G., does not happen on death
# Root = Character
on_quest_failure = {
	events = {
		MNM.6667
	}
}

# An indestructible society failed to find a new leader from existing characters
# Root = Society
# From = Previous leader
on_society_failed_to_find_new_leader = {
	events = {
	}
}

on_artifact_inheritance = {
	events = {
		MNM.5107 # for inheriting ingredients
	}
}

# An offmap power changes its policy. Triggers for the governor
# Root = Governor
# From = Offmap
on_offmap_policy_changed = {
	events = {
		JD.30501 # Print policy update to logs
		JD.50020 # News from China about Policy Change
		JD.50400 # Update Silk Road values
		JD.32298 # Abandon kowtow when China goes Isolationist
	}
}

# An offmap power changes its status. Triggers for the governor
# Root = Governor
# From = Offmap
on_offmap_status_changed = {
	events = {
		JD.30502 # Print status update to logs
		JD.50030 # News from China about Status Change
		JD.50400 # Update Silk Road values
	}
}


# An offmap power changes its governor. Triggers for the new governor
# Root = New governor
# From = Old governor
# FromFrom = Offmap
on_offmap_governor_changed = {
	events = {
	}
}

# An offmap power changes its ruler. Triggers for the new ruler
# Root = New ruler
# From = Old ruler
# FromFrom = Offmap
on_offmap_ruler_changed = {
	events = {
		JD.30503 # Logging new ruler data
		JD.10005 # In case of dynasty change...
		JD.10202 # Delayed cleanup event. Makes sure the new administration may also launch Chinese invasions.
		JD.50000 # Select a new Policy and send News Event
		JD.31000 # Logging for emperor statistics
	}
}

# Happens once a month on a random day. Triggers for the governor
# Root = Governor
# From = Offmap
on_offmap_monthly_pulse = {
	events = {
		JD.10121 #Fallback event to make sure that Displaced Royals, Jurchen Invaders, and Rebel Generals actually appear (regardless of new administration in China or not)
	}
	random_events = {
	}
}

# Happens once a year during a random monthly update. Triggers for the governor (once for each offmap governor, if there's more than one)
# Root = Governor
# From = Offmap
on_offmap_yearly_pulse = {
	events = {
		JD.10100 # Chinese Invasion tombola
		#JD.40000 # Chinese Trade Competition
		JD.30500 # China logging variable increment
		JD.10200 # Chinese Invasion clean-up event - REGULAR (tributary invasion + other flags)
		JD.10201 # Chinese Invasion clean-up event - MAJOR Invasion (rare)
	}
	
	random_events = {
		10000 = 0
		300 = JD.50100 # Status returns to 'Stable'
		150 = JD.50120 # Status changes to 'Unrest'
		50 = JD.50140 # Status changes to 'Mongol Invasion'
		450 = JD.50160 # 'Mongol Invasion' Resolution
		50 = JD.50180 # Status changes to 'Jurchen Invasion'
		450 = JD.50200 # 'Jurchen Invasion' Resolution
		100 = JD.50220 # Status changes to 'Great Famine'
		100 = JD.50240 # Status changes to 'Devastating Plague'
		100 = JD.50260 # Status changes to 'Golden Age'
		350 = JD.50280 # Status changes to 'Civil War'
		400 = JD.50300 # 'Civil War' Resolution
	}
}

# Happens just prior to the EU4 converter converting the game
# Root = Player. Random character if in observe mode
on_eu4_conversion_start = {
	events = {
		JD.60205 # Prepare on map China for conversion
	}
}

# Happens just after the EU4 converter is done converting the game
# Root = Player. Random character if in observe mode
on_eu4_conversion_done = {
	events = {
		JD.60206 # Restore on map China after conversion
	}
}

# Happens when tyranny is caused by the code rather than script. That is; won't trigger if you use "add_opinion_modifier" to add tyranny. Fires for every character that gets the "tyrant" opinion penalty towards the tyrant
# Root = Upset character
# From = Tyrant
on_tyranny_gained = {
	events = {
	}
}

# Happens when tyranny is caused by the code rather than script. That is; won't trigger if you use "add_opinion_modifier" to add tyranny. Only happens for the tyrant themselves, rather than for each of their "victims", so happens exactly once per tyranny-giving action
# Root = Tyrant
on_tyranny_gained_tyrant_only = {
	events = {
	}
}

# Triggers if someone tries to revoke someone's title, and the person refuses and starts a war in response
# Root = The person declaring war
# From = The revoker
# FromFrom = The title being revoked
on_revoke_attempted_started_war = {
	events = {
		681
 	}
}

# Triggers if someone tries to retract someone's vassal, and the person refuses and starts a war in response
# Root = The person declaring war
# From = The revoker
# FromFrom = The vassal title being retracted
on_retract_vassal_attempted_started_war = {
	events = {
		682
 	}
}

# Triggers if someone tries to absorb a clan, and the person refuses and starts a war in response
# Root = The person declaring war
# From = The revoker
on_absorb_clan_attempted_started_war = {
	events = {
		683
 	}
}

# Triggers if someone tries to split a clan, and the person refuses and starts a war in response
# Root = The person declaring war
# From = The revoker
on_split_clan_attempted_started_war = {
	events = {
		684
 	}
}