#character
on_startup = {
	events = {
		GR.13 #True cognatic for rule gender = all
		MNM.10025 #Save game conversion of secret_traits to secret religions
		JD.10006#Save game fix for setting the name of the Chinese empire
		741 #Block "Beyond the Indus" achievement for dynasty if you start and meet the conditions for it
		ZP.5 #Change Zorastrian pet traits into modifiers
		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
	}
}

#character
on_yearly_pulse = {
	events = {
		CM.5000 # Ragnar Lodbrok
		CM.503 # Start of Viking Age
		CM.1011 # Lombard Queen
		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
		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
	}
	
	random_events = {
		
		# Feudal Life Events
		100 = 4000
		100 = 4005
		100 = 4010
		100 = 4015
		100 = 4020
		100 = 4035
		100 = 4036
		100 = 4040
		100 = 4041
		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
		100 = 75040
		100 = 75050
		100 = 75060
		100 = 75065
		100 = 75070
		100 = 75075
		100 = 75080
		100 = 75085
		100 = 75090
		100 = 75095
		100 = 75105
		100 = 75110
		100 = 75120

		#Dynasty requests
		#250 = 66000
		250 = 66099 # Landless claimant asks dynasty head to press the claim in a war
		
		#Hedge Knights Events
		100 = 71000 
		100 = 71006 
		
		#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
		
		#Religious Events
		100 = 39230
		
		#Bastard Events
		100 = 76000
		100 = 76005
		100 = 76010
		100 = 76015
		100 = 76020
		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
		50 = RoI.3500
		50 = RoI.3506
		50 = RoI.3510
		50 = RoI.3516
		10 = RoI.3520
		50 = RoI.3530
#		50 = 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
		200 = CM.2020
#		200 = CM.2100
		
		# 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
		300 = HL.10500
		300 = 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
		100 = ZE.8000
		100 = ZE.8010
		300 = 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
		50 = ZE.23150 # Band Leader Speaks Highly of Employer
		
		#AI secretly convert event
		35 = MNM.3948 # Convert to spouse/friend/province

		#Female councillors
		100 = 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
		25 = 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
		25 = 6360 #Mittens

		#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
		
		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

		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 pries
	}
	
	
	random_events = {

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

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

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

		
		#Deceitful
		10 = 3260
		10 = 3261
		10 = 3262
		10 = 3263
	

		#Lifestyle events
		10 = 3520
		10 = 3525
		10 = 3530
		10 = 3535
		10 = 3540
		10 = 3543
		10 = 3546
		10 = 3550
		10 = 3555
		10 = 3560
		10 = 3563
		10 = 3568
		10 = 3570
		10 = 3575
		10 = 3585
		10 = 3590
		10 = 3593
		10 = 3600
		10 = 3605
		10 = 3610
		10 = 3615
		10 = 3620
		10 = 3625
		10 = 3630
		10 = 3635
		10 = 3640
		10 = 3645
		10 = 3650
		10 = 3655
		10 = 3660
		10 = 3665
		10 = 3675
		10 = 3680
		10 = 3685
		10 = 3690
		10 = 3700
		
		20 = TOG.3009
		
		2000 = 0 # Chance of no bi-yearly event
	}
}

#character
on_five_year_pulse = {
	events = {
		GR.1
		MNM.10030 # Have AI characters join societies
		JD.1000 # Muslim Adventurers targeting India
	}
	
	random_events = {
		#----  misc traits needing revision below...

		
		
		#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 = 1002
		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 = 1049
		10 = 1050
		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
		
		40 = 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 = 0
	}
}

# For characters 2 to 16 years old
on_yearly_childhood_pulse = {

	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
		
		#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 = 1934
		50 = 1935
		
		# Childhood Personality Events (Lost Content)
		
		#Age 6-11, aiming to get at least 4 traits before adult.
		100 = LC.1500
		100 = LC.1510
		100 = LC.1520
		100 = LC.1530
		100 = LC.1540
		100 = LC.1550
		100 = LC.1560
		100 = LC.1570
		100 = LC.1580
		100 = LC.1590
		100 = LC.1600
		100 = LC.1610
		100 = LC.1620
		100 = LC.1630
		100 = LC.1632
		100 = LC.1640
		100 = LC.1650
		100 = LC.1660
		100 = LC.1670
		100 = LC.1680
		100 = LC.1690
		100 = LC.1700
		100 = LC.1710
		100 = LC.1720
		100 = LC.1730
		100 = LC.1732
		100 = LC.1965
		
		#Toddler flavour events (age 2-5), not very common, but some will get them.
		10 = LC.1900 
		10 = LC.1901
		10 = LC.1902
		10 = LC.1903
		10 = LC.1904
		
		#Young children flavour events, (age 6-10), not very common, but some will get then..
		20 = LC.1905
		20 = LC.1906
		20 = LC.1907
		20 = LC.1908
		20 = LC.1909
		20 = LC.1910
		20 = LC.1911
		20 = LC.1912
		
		#Youngsters flavour events (age -11), not very common, but some will get then..
		50 = LC.1921
		50 = LC.1923
		50 = LC.1925
		50 = LC.1926
		50 = LC.1927
		50 = LC.1928
		50 = LC.1929
		50 = LC.1931
		50 = LC.1932
		50 = LC.1935
		
		# Adolescence Personality Events (Lost Content)
		
		#Age 12-16, aiming to get at least 4 traits before adult.
		100 = LC.2500
		100 = LC.2510
		100 = LC.2520
		100 = LC.2530
		100 = LC.2540
		100 = LC.2550
		100 = LC.2560
		100 = LC.2570
		100 = LC.2580
		100 = LC.2590
		100 = LC.2600
		100 = LC.2610
		100 = LC.2620
		100 = LC.2630
		100 = LC.2632
		100 = LC.2640
		100 = LC.2650
		100 = LC.2660
		100 = LC.2670
		100 = LC.2680
		100 = LC.2690
		100 = LC.2700
		100 = LC.2710
		100 = LC.2720
		100 = LC.2730
		100 = LC.2732
		100 = LC.2965
		
		#Youngsters flavour events (age 12-15), not very common, but some will get then..
		50 = LC.2913
		50 = LC.2914
		50 = LC.2915
		50 = LC.2916
		50 = LC.2917
		50 = LC.2918
		50 = LC.2919
		50 = LC.2920
		50 = LC.2921
		50 = LC.2922
		50 = LC.2923
		50 = LC.2924
		50 = LC.2925
		50 = LC.2926
		50 = LC.2927
		50 = LC.2928
		50 = LC.2929
		50 = LC.2930
		50 = LC.2931
		50 = LC.2932
		50 = LC.2935
		
		#Friends rival flavour events moved from MTTH to childhood pulse.
		1000 = 100005
		1000 = 100015
		
		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
		10 = 242 # Killed
		20 = 243 # Wounded
		10 = 244 # Maimed
		5 = 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 = {
	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
	}
}

# any leader in battle on winning side is ROOT - opponent army leader is FROM
on_battle_won = {
	random_events = {
		800 = 0
		10 = 260 # Heroism shown
		10 = 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
	}
}

# 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
	}
}

# 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
	}
}

# Losing army owner is ROOT - opponent army owner is FROM
on_battle_lost_owner = {
	events = {
		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
	}
	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
		CM.1101 # Destruction of Irminsul
		CM.10035 # Chronicle for certain major locations
		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		
	}
}

# 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
 		100 = 62100 # Character imprisoned
 		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
		706 # Full House achievement
		707 # Keeping it in the Family achievement
		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
		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 
		5 = RoI.10000 # Reincarnation?
		1 = RIP.29805 # Reincarnation for non west_african
	}
}

# character
on_adulthood = {
	events = {
		HL.1040 # Wolf Child reaches maturity
		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
	}
}

on_adolescence = { # Checked on 12th birthday.
	events = {
		ZE.12998 # Clear childhood event chain flags
		MNM.3429 # Educator/guardian/parent with secret religion get a chance to convince child to convert secretly
	}
}

# 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 = {
 		500 # Royal Marriage Aid Duty
 		501 # Zoroastrian "Xwedodah" marriage
 		502 # Messalian close kin marriage
		708 # Marriage Game achievement
		CM.10023  # Chronicle entry
		CM.10036 # Chronicle entry - primary heir
		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
		ZE.14600 # Being thrown in prison affects education negatively
		RIP.12097 # Being thrown in prison removes seclusion modifier
		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
 	}
}

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

#character. Triggers if someone is exiled
on_exiled = {
	events = {
 		155
 	}
}

#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 = {
#		8250
		650
		24500
		24502
		70041
		88291
		SoA.5306
		705
		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...
		722 # Until Death Do Us Part achievement check
		HL.8001 # Sky Burial
		HL.12
		HL.4998
		ZE.1030 # Daughter becomes disobedient - killed lover
		ZE.1040 # Daughter becomes disobedient - killed friend
		731 #Achievement Eternity Denied
		732 #Achievement Papal Mache
		734 #Achievement Aptly Named	
		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
		740 # Achievement Unwelcome Visitors
		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
	}
	random_events = {
		1 = RIP.29800 #reincarnation investigation
		10 = 24505
		10 = 24510
		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
	}
}

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
		725
	}
}

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.1030 	# Heretic rebels reinforced
		TOG.1020	# Heretic rebels rise up
		TOG.1050 	# Nationalist rebels reinforced
		TOG.1040	# Nationalist rebels rise up
		TOG.1070 	# Religious rebels reinforced
		TOG.1060	# Religious rebels rise up
		TOG.1010 	# Peasant rebels reinforced
		TOG.1000 	# Peasant 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
	}
}

# 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 = {
		701
	}
}

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 = {
		700
	}
}

# 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 = {
		704
	}
}

# 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
		739 # Got Land achievement
	}
}

# 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.
		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
		738 # Black Pope achievement
		MNM.1215 # The Hermetics Scrying Power result (for new holder)
		MNM.1216 # The Hermetics Scrying Power result (for old holder)

		# 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
	}
}

# 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
		738 # Black Pope achievement
		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
	}
}

# 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
		738 # Black Pope achievement
		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
	}
}

on_unlanded = {
	events = {
		HL.130 #Landless nomad clean-up.
	}
}

# 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

		# If switched religion then trait is gone and we need to clean up modifiers for zoroastrian pets
		ZP.6
	}
}

# 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
	}
}

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
	}
}

# From = Attacker, Root = Defender
on_war_ended_victory = {
	events = {
		CM.10038
		729
		JD.30051 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_whitepeace = {
	events = {
		CM.10040
		JD.30050 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_defeat = {
	events = {
		CM.10041
		730
		JD.30052 # Offmap China end of war clean-up
	}
}

# From = Attacker, Root = Defender
on_war_ended_invalid = {
	events = {
		JD.30050
	}
}

# From = Divorcer, Root = Spouse, New = Religious head if applicable
on_divorce = {
	events = {
		717 # Achievement
		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 = {
		733 # Achievement Hospitable
	}
}

# 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 = {
		727
	}
}

on_law_vote_passed = {
	events = {
		726
	}
}

on_law_vote_failed = {
}

on_player_mercenary_income = {
	events = {
		728
	}
}

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
		100 = MNM.3920 # Secret Religious societies: Worried member
		100 = MNM.3930 # Secret Religious societies: Fellow society member goes for a round
		100 = MNM.3505 # Secret Religious societies: Get help from another member with problematic trait
		100 = MNM.3500 # Secret Religious societies: I am so stressed
		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...?)
		150 = 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 = {
		735 # Dark Lord achievement
		736 # Birthright achievement
		737 # Jihad Sultan achievement
		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
 	}
}