# country
on_startup = {
	events = {
		rnw_dev_boost.1
		rnw_dev_boost.2
	}
}

# country
on_religion_change = {
	if = {
		limit = {
			NOT = { religion = confucianism }
		}
		remove_country_modifier = neo_confucianism
	}
	if = {
		limit = {
			religion_group = christian
		}
		remove_country_modifier = the_anti_christian_edict
	}
	if = {
		limit = {
			NOT = { religion = orthodox }
		}
		every_known_country = {
			limit = {
				reverse_has_opinion_modifier = {
					who = ROOT
					modifier = closed_down_the_patriarchate
				}
			}
			reverse_remove_opinion = {
				who = ROOT
				modifier = closed_down_the_patriarchate
			}
		}
	}
	if = {
		limit = {
			religion = catholic
			has_ruler_flag = personal_catholic_sympathies
		}
		country_event = { id = protestantism_events.19 }
	}
	if = {
		limit = {
			NOT = { religion = catholic }
			has_ruler_modifier = catholic_zealot
		}
		remove_country_modifier = catholic_zealot
	}
	if = {
		limit = {
			NOT = { religion = catholic }
			has_country_modifier = spanish_bible_translation
		}
		remove_country_modifier = spanish_bible_translation
	}
	if = {
		limit = {
			NOT = { religion = catholic }
			has_country_modifier = supressing_spanish_protestantism
		}
		remove_country_modifier = supressing_spanish_protestantism
	}
	if = {
		limit = {
			NOT = { religion = catholic }
			has_country_modifier = counter_reformation
		}
		remove_country_modifier = counter_reformation
	}
	if = {
		limit = {
			religion = protestant
		}
		set_country_flag = converted_to_protestantism
	}
}

# country.
on_secondary_religion_change = {
	# Done from code: add_prestige = -50 (Define: CHANGE_SECONDARY_PRESTIGE_HIT)
	every_owned_province = {
		limit = { has_province_modifier = tengri_monastic_order }
		remove_province_modifier = tengri_monastic_order
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_shiite_settled_in_capital }
		remove_province_modifier = tengri_shiite_settled_in_capital
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_insincere_leadership }
		remove_province_modifier = tengri_insincere_leadership
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_religious_influx }
		remove_province_modifier = tengri_religious_influx
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_ruler_questioned }
		remove_province_modifier = tengri_ruler_questioned
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_strengthened_local_clans }
		remove_province_modifier = tengri_strengthened_local_clans
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_growing_cities }
		remove_province_modifier = tengri_growing_cities
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_christian_mission }
		remove_province_modifier = tengri_christian_mission
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_unchristian_values }
		remove_province_modifier = tengri_unchristian_values
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_monastic_order }
		remove_province_modifier = tengri_monastic_order
	}
	every_owned_province = {
		limit = { has_province_modifier = hindufication }
		remove_province_modifier = hindufication
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_influx_of_monks }
		remove_province_modifier = tengri_influx_of_monks
	}
	every_owned_province = {
		limit = { has_province_modifier = tengri_abandoning_the_old_ways }
		remove_province_modifier = tengri_abandoning_the_old_ways
	}
	remove_country_modifier = tengri_devout_muslim
	remove_country_modifier = tengri_confucian_elites_alienated
	remove_country_modifier = tengri_confucian_titles
	remove_country_modifier = tengri_traditionalists_strengthened
	remove_country_modifier = tengri_confucian_nobles
	remove_country_modifier = tengri_pali_legal_traditions
	remove_country_modifier = tengri_religious_pilgrimages
	remove_country_modifier = tengri_monks_in_capital
	remove_country_modifier = tengri_influx_of_monks
	remove_country_modifier = tengri_shiite_immigration
	remove_country_modifier = support_of_the_khojas
	remove_country_modifier = black_shamanism_modifier
	remove_country_modifier = tengri_animist_pantheon
	remove_country_modifier = zoroastrian_traders
	remove_country_modifier = spread_of_tengri_tea_ceremony
	remove_country_modifier = tengri_tea_ceremony
	remove_country_modifier = tengri_japanese_swordsmithing
	remove_country_modifier = tengri_bow_and_arrow_defended
	remove_country_modifier = tengri_support_of_shamans
	remove_country_modifier = tengri_hindu_conflict
	remove_country_modifier = tengri_hindu_syncretism
	remove_country_modifier = tengri_devout_christian_ruler
	remove_country_modifier = tengri_personal_confessor
	remove_country_modifier = tengri_zoroastrian_traders
	remove_country_modifier = tengri_confucian_administrators
	remove_country_modifier = tengri_traditional_elites_alienated
	remove_country_modifier = tengri_jihad
	remove_country_modifier = tengri_stood_up_for_yassa
	remove_country_modifier = tengri_sufi_teacher
	remove_country_modifier = tengri_qadi
	remove_country_modifier = tengri_religious_influx
	remove_country_modifier = tengri_ibadi_scholars
	remove_country_modifier = tengri_clergy_conflicts
	remove_country_modifier = tengri_shamans_spurned
	clr_country_flag = khojas_established
	clr_country_flag = tengri_christian_devout_court
	clr_ruler_flag = tengri_muslim_ruler_questioned
	if = {
		limit = {
			check_variable = { which = khojas_retained value = 1 }
		}
		set_variable = {
			which = khojas_retained value = 0
		}
	}
}

# country. Spawned when Enforcing Rebel Demands through a Support Rebels-war.
on_enforce_rebel_demands = {
	# ROOT = The winning country
	# FROM = The loosing country
	set_country_flag = helped_rebels_win_war
}

# country
on_colonial_liberation = {
	events = {
		colonial_nation.90
	}
}

# country
on_colonial_reintegration = {
	events = {
		colonial_nation.91
	}
}

# country
on_peace_actor = {
	events = {
		usa_dlc.36				# Evacuation Day
		native_americans.7		# Appoint Peace Chief
	}
}

# country
on_peace_recipient = {
	events = {
		native_americans.7		# Appoint Peace Chief
	}
}

# country
# root = winning country, from = loser country
on_war_won = {
}

# country
# root = loser country, from = winner country
on_war_lost = {
}

# country
# root = winning country, from = loser country
on_battle_won_country = {
}

# country
# root = loser country, from = winner country
on_battle_lost_country = {
	random_events = {
		90 = 0
		10 = friendship_events.1 #Historical Friendship Broken
	}
}

# province
# root = location, from = loser country
on_battle_won_province = {
	random_events = {
		1000 = 0
		100 = war_of_the_roses.6	# WotR - Rebel Leaders Captured
	}
}

# province
# root = location, from = country doing it
on_added_to_trade_company ={

}

# province
# root = location, from = country doing it
on_removed_from_company ={

}

# province
# root = location, from = country doing it
on_company_formed ={

}

# province
# root = location, from = country doing it
on_company_disolved ={

}

# province
# root = location, from = winner country
on_battle_lost_province = {
	random_events = {
		1000 = 0
		100 = tyw_events.22	# Capital Battle in Religious War
	}
}

# country
# root = winning country, from = location
on_siege_won_country = {
	events = {
		tyw_events.14 # Fall of Prague in Religious War
	}
}

# country
# root = losing country, from = location
on_siege_lost_country = {
}

# province
# root = location, from = losing country
on_siege_won_province = {
}

# province
# root = location, from = winning country
on_siege_lost_province =  {
	events = {
		war_of_the_roses.10		# Lancaster Stronghold
		war_of_the_roses.11		# York Stronghold
		french_wars_of_religion.7 #Ravening Religious Fanatics
		french_wars_of_religion.9 #french_wars_of_religion.9
	}
}

# province
# root = location, from = country that abandons colony
# Fired right before the colony is abandoned.
on_abandon_colony = {
}

# country 
on_new_monarch = {
	events = {
		tribal_succession.1	# Harsh anti-tribals.
		9492 			# Remove some event modifiers
		flavor_mlo.1	# The Ambrosian Republic
		flavor_boh.8	# Winter King in Prague
		flavor_kol.1	# Bavarian Archbishop
		war_of_the_roses.101	# WotR - House of Lancaster wins
		war_of_the_roses.102	# WotR - House of York wins
		flavor_tur.102	# Janissary Reward
		flavor_ori.7	# Hamvira Victorious
		flavor_kbo.1	# The two branches of the Sayfawa dynasty
		flavor_kbo.8	# Sayfawa pretenders
		flavor_zan.5	# Coup of Coup of Suleiman and Muhammad al-Mazlum.
		purple_phoenix.1 # BYZ pretenders
		flavor_pol.3480 #The Pacta Conventa
		protestantism_events.15 #Catholic Leaning Monarch
		tengri_events.17 #Keep the Khojas in Power?
	}
	random_events = { 
		1000 = 0
		100 = flavor_kol.1	# Bavarian Archbishop
		100 = flavor_tim.1	# The Disintegration of the Timurid Empire
		100 = flavor_hsa.3 	# Hansa: Tagfahrt
		100 = inti_events.1	# Birth of a Panaca
		50 = dynastic_events.4
		50 = dynastic_events.5
	}
}

# country 
on_regent = {
	events = {
		tribal_succession.1	# harsh anti-tribals.
		flavor_mlo.1	# The Ambrosian Republic
	}
}

# country 
on_new_term_election = {
	events = {
		700		# Election event
		elections.720		# Dutch Republic
	}
}

# country 
on_death_election = {
	events = {
		701		# Election event
		elections.721		# Dutch Republic
	}
}

# country 
on_replace_governor = {
	events = {
		elections.707
	}
}


# country
on_bankruptcy = {
}

# country (country annexing, root = target)
on_diplomatic_annex = {
	events = {
		610
	}
}

# country 
on_weak_heir_claim = {
	events = {
		611		# Pretenders rise up
	}
}

# country : no heir in theocracy
on_heir_needed_theocracy = {
	events = {
		theocracy.1
	}
}

# Emperor from same dynasty
on_successive_emperor = {
	events = {
		900
	}
}

# HRE Prince released by the emperor
on_released_hre_member = {
	events = {
	}
}

# HRE Prince converts to non-Emperor religion
on_hre_member_false_religion = {
	events = {
	}
}

# HRE Prince converts to Emperor religion
on_hre_member_true_religion = {
	events = {
	}
}

# Emperor wins HRE defensive war
on_hre_wins_defensive_war = {
	events = {
	}
}

# HRE member annexed by non-HRE country
on_hre_member_annexed = {
	events = {
	}
}

# HRE member released from non-HRE vassalage
on_hre_released_vassal = {
	events = {
	}
}

# Emperor coming to the defense of a HRE member
on_hre_defense = {
	events = {
	}
}

# Emperor NOT coming to the defense of a HRE member
on_hre_non_defense = {
	events = {
		909
	}
}

# HRE Member takes a HRE province from an outs100e country in a peace (province scope)
on_hre_province_reconquest = {
	events = {
	}
}

# When a native changes government after filling all their advancement groups.
on_native_change_government = {
}

# Nation is integrated after being in union
on_integrate = {
	events = {
		610
	}
}

# Nation annexed
on_annexed = {
	events = {
		japan.1
	}
}

# Nation westernized
# root = country
on_westernized = {
	events = {
		flavor_mng.17
	}
}

on_dismantle_revolution = {
	change_government = absolute_monarchy
	kill_ruler = yes
	set_revolution_target = xxx
	if = {
		limit = { has_heir = yes }
		kill_heir = yes
	}
}

on_lock_hre_religion = {
	events = {
		religious_leagues.1
		religious_leagues.8
	}
}

on_change_hre_religion = {
	events = {
		religious_leagues.2
		religious_leagues.3
	}
}

on_hre_religion_white_peace = {
	events = {
		religious_leagues.4
	}
}

on_overextension_pulse = {
	random_events = {
		100 = overextension.1
		100 = overextension.2
		100 = overextension.3
		100 = overextension.4
		100 = overextension.5
		100 = overextension.6
		100 = overextension.7
		100 = overextension.8
		100 = overextension.9
		100 = overextension.10
	}
}

on_westernisation_pulse = {
	random_events = {
		100 = westernisation.1
		100 = westernisation.2
		100 = westernisation.3
		100 = westernisation.4
		100 = westernisation.5
		100 = westernisation.6
		100 = westernisation.7
		100 = westernisation.8
		100 = westernisation.9
		100 = westernisation.10
		1000 = westernisation.11
		1000 = westernisation.12
		1000 = westernisation.13
	}
}

on_colonial_pulse = {
	random_events = {
		100 = colonial.1
		100 = colonial.2
		100 = colonial.3
		100 = colonial.4
		100 = colonial.5
		100 = colonial.6
		100 = colonial.7
		100 = colonial.8
		100 = colonial.9
		100 = colonial.10
		100 = colonial.11
		100 = colonial.12
		100 = colonial.13
		100 = colonial.14
		100 = colonial.15
		100 = colonial.16
		100 = colonial.17
		100 = colonial.18
		10000 = 0
	}
}

# country random events
on_bi_yearly_pulse = {
	random_events = {
		# randomevents.txt		
		100 = 3051
		100 = 5008
		100 = 5014
		100 = 5015
		100 = 5017
		100 = 5018
		100 = 5019
		100 = 5020
		100 = 5021
		100 = 5022
		100 = 5023
		100 = 5024
		100 = 5025
		100 = 5027
		100 = 5032
		100 = 5040
		100 = 5045
		100 = 5050
		100 = 5051
		100 = 5052
		100 = 5053
		100 = 5054
		100 = 5055
		100 = 5056
		100 = 5058
		100 = 5059
		100 = 5060
		100 = 5061
		100 = 5064
		100 = 5065
		100 = 5066
		100 = 5068
		100 = 5070
		100 = 5071
		100 = 5072
		100 = 5074
		100 = 5075
		100 = 5076
		100 = 5077
		100 = 5082
		100 = 5083
		100 = 5084
		100 = 5085
		100 = 5086
		100 = 5088
		100 = 5089
		100 = 5090
		100 = 5091
		100 = 5092
		100 = 5093
		100 = 5094
		100 = 5095
		100 = 5096
		100 = 5097
		100 = 5098
		100 = 5099
		100 = 6000
		100 = 6001
		100 = 6003
		100 = 6004
		100 = 6005
		100 = 6006
		100 = 6012
		100 = 6013
		100 = 6015
		100 = 710
		100 = 711
		100 = 712
		100 = 713
		100 = 714
		100 = 715
		100 = 716
		100 = 717
		100 = 718
		100 = 719
		100 = 720
		100 = 722
		100 = 723
		100 = 724
		100 = 725
		100 = 726
		100 = 727
		100 = 728
		100 = 729
		100 = 730
		100 = 731
		100 = 732
		100 = 733
		100 = 734
		100 = 735
		100 = 736
		100 = 737
		100 = 738
		100 = 739
		100 = 740
		100 = 741
		100 = 742
		
		100 = 850
		100 = 851
		100 = 852
		100 = 853
		100 = 854
		100 = 855
		100 = 857
		100 = 858
		100 = 859
		100 = 860
		100 = 861
		100 = 862
		100 = 863
		100 = 864
		100 = 865
		100 = 866
		100 = 867
		100 = 868
		100 = 869
		100 = 870
		100 = 871
		100 = 872
		100 = 873
		100 = 874
		100 = 875
		100 = 876
		100 = 877
		100 = 878
		100 = 879
		100 = 880
		100 = 881
		100 = 882
		100 = 883
		100 = 884
		100 = 885
		100 = 836
		100 = 837
		100 = 838
		
		100 = 9472
		100 = 3097
		100 = 5005
		100 = 5026
		100 = 5037
		100 = 5063
		100 = 6014
		
		100 = random_event.1
		100 = random_event.2
		100 = random_event.3
		100 = random_event.4
		100 = random_event.5
		100 = random_event.6
		100 = random_event.7
		100 = random_event.8
		100 = random_event.9
		100 = random_event.10
		100 = random_event.11
		100 = random_event.12
		100 = random_event.13
		100 = random_event.14
		100 = random_event.15
		100 = random_event.16
		
		100 = random_event.26

		# Old Centralisation/Decentralisation		
		100 = 806

		# Mercantilism
		100 = 6326
		100 = 6327
		100 = 6328
		100 = 6329

		# Trade Specific
		100 = trade.1
		100 = trade.2
		100 = trade.3
		100 = trade.4
		100 = trade.5
		100 = trade.6
		100 = trade.7
		100 = trade.8
		100 = trade.9
		100 = trade.10
		100 = trade.11
		100 = trade.12
		
		# Catholic  Events      
		100 = catholic_flavor.4 
		100 = catholic_flavor.5 
		100 = catholic_flavor.6 
		100 = catholic_flavor.7 
		100 = catholic_flavor.8 
		100 = catholic_flavor.9 
		100 = catholic_flavor.10
		
		# Tradegoods events
		100 = 6418
		100 = 6419
		100 = 6420
		100 = 6421
		100 = 6422
		100 = 6423
		100 = 6424
		100 = 6425
		100 = 6426
		100 = 6427
		100 = 6428
		100 = 6429
		100 = 6431
		100 = 6432
		100 = 6433
		100 = 6434

		# Refoms, when having parliaments.
		100 = reforms.1
		100 = reforms.2
		100 = reforms.3
		100 = reforms.4		

		100 = randomeventsstapehordes.1
		100 = randomeventsstapehordes.2
		100 = randomeventsstapehordes.3
		100 = randomeventsstapehordes.4
		100 = randomeventsstapehordes.5
		100 = randomeventsstapehordes.6
		100 = randomeventsstapehordes.7
		100 = randomeventsstapehordes.8
		100 = randomeventsstapehordes.13
		100 = randomeventsstapehordes.14
		100 = randomeventsstapehordes.17
		100 = randomeventsstapehordes.18
		100 = randomeventsstapehordes.19
		100 = randomeventsstapehordes.20
		100 = randomeventsstapehordes.21
		100 = randomeventsstapehordes.22
		100 = randomeventsstapehordes.23
		100 = randomeventsstapehordes.24
		
		1000 = 0
	}
}

on_bi_yearly_pulse_2 = {
}

on_bi_yearly_pulse_3 = {
}

on_bi_yearly_pulse_4 = {
}

# country random events
on_thri_yearly_pulse = {
	random_events = {
		# Republics
		100 = republics.4
		100 = republics.5
		100 = republics.6
		100 = republics.7
		100 = republics.8
		100 = republics.9
		100 = republics.10
		100 = republics.11
		100 = republics.12
		100 = republics.13
		100 = republics.14
		100 = republics.15
		100 = republics.16
		100 = republics.17
		100 = republics.18
		100 = republics.19
		100 = republics.20
		100 = republics.21
		100 = republics.22
		100 = republics.23
		100 = republics.24
		100 = republics.25
		100 = republics.26
		100 = republics.27
		100 = republics.28
		100 = republics.29
		100 = republics.30
		100 = republics.31
		100 = republics.32
		100 = republics.33
		100 = republics.34
		100 = republics.35
		100 = republics.36
		100 = republics.37
		100 = republics.38
		100 = republics.39
		100 = republics.40
		100 = republics.41
		100 = republics.42
		100 = republics.43		
		
		# Theocracies
		100 = devotion_events.1
		100 = devotion_events.2
		100 = devotion_events.3
		100 = devotion_events.4
		100 = devotion_events.5
		100 = devotion_events.6
		100 = devotion_events.7
		100 = devotion_events.8
		100 = devotion_events.9
		100 = devotion_events.10
		100 = devotion_events.11
		100 = devotion_events.12
		100 = devotion_events.13
		100 = devotion_events.14
		100 = devotion_events.15
		100 = devotion_events.16
		100 = devotion_events.18
		100 = devotion_events.19
		100 = devotion_events.22
		100 = devotion_events.23
		100 = devotion_events.24
		100 = devotion_events.100
		100 = devotion_events.101
		100 = devotion_events.102
		100 = devotion_events.104
		100 = devotion_events.107
		100 = devotion_events.110
		100 = devotion_events.117
		100 = devotion_events.118
		100 = devotion_events.119
		100 = devotion_events.100
		100 = devotion_events.201
		100 = devotion_events.202
		100 = devotion_events.203
		100 = devotion_events.204
		100 = devotion_events.205
		100 = devotion_events.207
		100 = devotion_events.208
		100 = devotion_events.209
		100 = devotion_events.210
		100 = devotion_events.211
		100 = devotion_events.212
		100 = devotion_events.213
		100 = devotion_events.214
		100 = devotion_events.215
		100 = devotion_events.216
		100 = devotion_events.217
		100 = devotion_events.218
		100 = devotion_events.219
		
		1000 = 0		
	}
}

on_thri_yearly_pulse_2 = {
	random_events = {
		# Random to increase or decrease patriarch authority.
		25 = orthodox_flavor.1
		25 = orthodox_flavor.2
		25 = orthodox_flavor.3
		25 = orthodox_flavor.4
		25 = orthodox_flavor.5
		
		# Muslim Piety Events
		50 = muslim_piety.1
		50 = muslim_piety.2
		50 = muslim_piety.3
		50 = muslim_piety.4
		50 = muslim_piety.5
		50 = muslim_piety.6
		50 = muslim_piety.7
		50 = muslim_piety.8
		50 = muslim_piety.9
		50 = muslim_piety.10
		50 = muslim_piety.11
		50 = muslim_piety.12
		50 = muslim_piety.13
		50 = muslim_piety.14
		50 = muslim_piety.15
		50 = muslim_piety.16
		300 = 0		
	}
}

on_thri_yearly_pulse_3 = {
	random_events = {
		# Subject Interactions
		50 = subject_interaction_events.1
		50 = subject_interaction_events.4
		50 = subject_interaction_events.5
		50 = subject_interaction_events.6
		50 = subject_interaction_events.7
		50 = subject_interaction_events.9
		50 = subject_interaction_events.11
		50 = subject_interaction_events.14
		50 = subject_interaction_events.15
		50 = subject_interaction_events.17
		50 = subject_interaction_events.18
		50 = subject_interaction_events.19
		50 = subject_interaction_events.20
		50 = subject_interaction_events.21
		50 = subject_interaction_events.22
		50 = subject_interaction_events.23
		50 = subject_interaction_events.24
		50 = subject_interaction_events.25
		50 = subject_interaction_events.26
		50 = subject_interaction_events.27
		50 = subject_interaction_events.28
		50 = subject_interaction_events.29
		50 = subject_interaction_events.30
		50 = subject_interaction_events.31
		50 = subject_interaction_events.32
		50 = subject_interaction_events.34
		50 = subject_interaction_events.35
		50 = subject_interaction_events.36
		50 = subject_interaction_events.38
		50 = subject_interaction_events.40
		50 = subject_interaction_events.43
		1000 = 0
	}
}

on_thri_yearly_pulse_4 = {
}

on_four_year_pulse = {
	random_events = {
		# Colonial Nations
		100 = colonial_nation.1
		100 = colonial_nation.4
		100 = colonial_nation.10
		100 = colonial_nation.12
		100 = colonial_nation.14
		100 = colonial_nation.77
		100 = colonial_nation.100
		100 = colonial_nation.102
		100 = colonial_nation.104
		100 = colonial_nation.106
		100 = colonial_nation.108
		100 = colonial_nation.110
		100 = colonial_nation.112
		100 = colonial_nation.114
		100 = colonial_nation.116
		100 = colonial_nation.118
		100 = colonial_nation.120
		100 = colonial_nation.122
		100 = colonial_nation.124
		100 = colonial_nation.126
		100 = colonial_nation.128
		100 = colonial_nation.130
		100 = colonial_nation.132
		100 = colonial_nation.134

		# Dutch Republic
		100 = dutch_republic.1
		100 = dutch_republic.2
		100 = dutch_republic.3
		100 = dutch_republic.4
		100 = dutch_republic.5
		100 = dutch_republic.6
		100 = dutch_republic.7
		100 = dutch_republic.8
		100 = dutch_republic.9
		100 = dutch_republic.10
		150 = dutch_republic.11
		100 = dutch_republic.13
		100 = dutch_republic.14
		100 = dutch_republic.15
		100 = dutch_republic.16
		100 = dutch_republic.17
		100 = dutch_republic.18
		100 = dutch_republic.19
		100 = dutch_republic.20
		100 = dutch_republic.21
		100 = dutch_republic.22
		100 = dutch_republic.23
		100 = dutch_republic.24
		100 = dutch_republic.25
		100 = dutch_republic.27
		
		# Republic Factions
		100 = republic_factions.2
		100 = republic_factions.5
		100 = republic_factions.7
		100 = republic_factions.9
		100 = republic_factions.10
		100 = republic_factions.12
		100 = republic_factions.13
		100 = republic_factions.14
		100 = republic_factions.15
		100 = republic_factions.16
		100 = republic_factions.17
		100 = republic_factions.18
		100 = republic_factions.19
		100 = republic_factions.20
		100 = republic_factions.22
		100 = republic_factions.23
		100 = republic_factions.24

		# Republican Dictatorship
		100 = republican_dictatorship.1
		100 = republican_dictatorship.2
		100 = republican_dictatorship.3
		100 = republican_dictatorship.4
		100 = republican_dictatorship.5
		100 = republican_dictatorship.6
		100 = republican_dictatorship.7
		100 = republican_dictatorship.8

		# Elective Monarchy
		150 = elective_monarchy.1
		150 = elective_monarchy.2
		25 = elective_monarchy.3
		25 = elective_monarchy.4
		150 = elective_monarchy.6
		150 = elective_monarchy.8
		150 = elective_monarchy.9
		150 = elective_monarchy.10
		150 = elective_monarchy.11
		150 = elective_monarchy.12
		150 = elective_monarchy.14
		150 = elective_monarchy.17

		# Free Cities
		25 = free_cities.3
		25 = free_cities.7
		25 = free_cities.8
		25 = free_cities.10
		25 = free_cities.13
		25 = free_cities.17
		25 = free_cities.19
		
		1000 = 0	
	}
}

on_four_year_pulse_2 = {
}

on_four_year_pulse_3 = {
}

on_four_year_pulse_4 = {
}

on_five_year_pulse = {
	random_events = {

		# Aristocracy 		13  (8g 5b)
		100 = ideagroups.100
		100 = ideagroups.101
		100 = ideagroups.102
		100 = ideagroups.103
		100 = ideagroups.104
		100 = ideagroups.105
		100 = ideagroups.106
		100 = ideagroups.107
		100 = ideagroups.108
		100 = ideagroups.109
		100 = ideagroups.110
		100 = ideagroups.111
		100 = ideagroups.112

	
		# Plutocracy 		19 (12g 7b)
		100 = ideagroups.200
		100 = ideagroups.201
		100 = ideagroups.202
		100 = ideagroups.203
		100 = ideagroups.204
		100 = ideagroups.205
		100 = ideagroups.206
		100 = ideagroups.207
		100 = ideagroups.208
		100 = ideagroups.209
		100 = ideagroups.210
		100 = ideagroups.211
		100 = ideagroups.212
		100 = ideagroups.213
		100 = ideagroups.214
		100 = ideagroups.215
		100 = ideagroups.216
		100 = ideagroups.217
		100 = ideagroups.218

		# Innovativenes		11 (7g 4b)
		100 = ideagroups.300
		100 = ideagroups.301
		100 = ideagroups.302
		100 = ideagroups.303
		100 = ideagroups.304
		100 = ideagroups.305
		100 = ideagroups.306
		100 = ideagroups.307
		100 = ideagroups.308
		100 = ideagroups.309
		100 = ideagroups.310

		# Religious		18 (11g 7b)
		100 = ideagroups.400
		100 = ideagroups.401
		100 = ideagroups.402
		100 = ideagroups.403
		100 = ideagroups.404
		100 = ideagroups.405
		100 = ideagroups.406
		100 = ideagroups.407
		100 = ideagroups.408
		100 = ideagroups.409
		100 = ideagroups.410
		100 = ideagroups.411
		100 = ideagroups.412
		100 = ideagroups.413
		100 = ideagroups.414
		100 = ideagroups.415
		100 = ideagroups.416
		100 = ideagroups.417
		

		# Spy			9 (6g 3b)
		100 = ideagroups.500
		100 = ideagroups.501
		100 = ideagroups.502
		100 = ideagroups.503
		100 = ideagroups.504
		100 = ideagroups.505
		100 = ideagroups.506
		100 = ideagroups.507
		100 = ideagroups.508
		
		
		# Diplomatic		9 (6g 3b)
		100 = ideagroups.600
		100 = ideagroups.601
		100 = ideagroups.602
		100 = ideagroups.603
		100 = ideagroups.604
		100 = ideagroups.605
		100 = ideagroups.606
		100 = ideagroups.607
		100 = ideagroups.608


		# Offensive 		14 (9g 5b)
		100 = ideagroups.700
		100 = ideagroups.701
		100 = ideagroups.702
		100 = ideagroups.703
		100 = ideagroups.704
		100 = ideagroups.705
		100 = ideagroups.706
		100 = ideagroups.707
		100 = ideagroups.708
		100 = ideagroups.709
		100 = ideagroups.710
		100 = ideagroups.711
		100 = ideagroups.712
		100 = ideagroups.713

		
		# Defensive		11 (5g 6b)
		100 = ideagroups.800
		100 = ideagroups.801
		100 = ideagroups.802
		100 = ideagroups.803
		100 = ideagroups.804
		100 = ideagroups.805
		100 = ideagroups.806
		100 = ideagroups.807
		100 = ideagroups.808
		100 = ideagroups.809
		100 = ideagroups.810
		100 = ideagroups.811
		100 = ideagroups.812
		100 = ideagroups.813
		100 = ideagroups.814
		100 = ideagroups.815

		
		# Trade			6 (7g 4b)
		100 = ideagroups.900
		100 = ideagroups.901
		100 = ideagroups.902
		100 = ideagroups.903
		100 = ideagroups.904
		100 = ideagroups.905
		100 = ideagroups.906
		100 = ideagroups.907
		100 = ideagroups.908
		100 = ideagroups.909
		100 = ideagroups.910
		
		# Maritime			22 (14g 8b)
		100 = ideagroups.1000
		100 = ideagroups.1001
		100 = ideagroups.1002
		100 = ideagroups.1003
		100 = ideagroups.1004
		100 = ideagroups.1005
		100 = ideagroups.1006
		100 = ideagroups.1007
		100 = ideagroups.1008
		100 = ideagroups.1009
		100 = ideagroups.1010
		100 = ideagroups.1011
		100 = ideagroups.1012
		100 = ideagroups.1013
		100 = ideagroups.1014
		100 = ideagroups.1015
		100 = ideagroups.1016
		100 = ideagroups.1017
		100 = ideagroups.1018
		100 = ideagroups.1019
		100 = ideagroups.1020
		100 = ideagroups.1021
		
		# Economic		11 (7g 4b)
		100 = ideagroups.1100
		100 = ideagroups.1101
		100 = ideagroups.1102
		100 = ideagroups.1103
		100 = ideagroups.1104
		100 = ideagroups.1105
		100 = ideagroups.1106
		100 = ideagroups.1107
		100 = ideagroups.1108
		100 = ideagroups.1109
		100 = ideagroups.1110
		
		# Exploration		11 (7g 4b)
		100 = ideagroups.1200
		100 = ideagroups.1201
		100 = ideagroups.1202
		100 = ideagroups.1203
		100 = ideagroups.1204
		100 = ideagroups.1205
		100 = ideagroups.1206
		100 = ideagroups.1207
		100 = ideagroups.1208
		100 = ideagroups.1209
		100 = ideagroups.1210
		
		# Quality		11 (7g 4b)
		100 = ideagroups.1300
		100 = ideagroups.1301
		100 = ideagroups.1302
		100 = ideagroups.1303
		100 = ideagroups.1304
		100 = ideagroups.1305
		100 = ideagroups.1306
		100 = ideagroups.1307
		100 = ideagroups.1308
		100 = ideagroups.1309
		100 = ideagroups.1310
		
		# Quantity		11 (7g 4b)
		100 = ideagroups.1400
		100 = ideagroups.1401
		100 = ideagroups.1402
		100 = ideagroups.1403
		100 = ideagroups.1404
		100 = ideagroups.1405
		100 = ideagroups.1406
		100 = ideagroups.1407
		100 = ideagroups.1408
		100 = ideagroups.1409
		100 = ideagroups.1410
		

		# Expansion		11 (7g 4b)
		100 = ideagroups.1500
		100 = ideagroups.1501
		100 = ideagroups.1502
		100 = ideagroups.1503
		100 = ideagroups.1504
		100 = ideagroups.1505
		100 = ideagroups.1506
		100 = ideagroups.1507
		100 = ideagroups.1508
		100 = ideagroups.1509
		100 = ideagroups.1510
		
		# Administrative	3 (1g 2b)
		100 = ideagroups.1600
		100 = ideagroups.1601
		100 = ideagroups.1602
		100 = ideagroups.1603
		100 = ideagroups.1604
		100 = ideagroups.1605
		100 = ideagroups.1606
		100 = ideagroups.1607
		100 = ideagroups.1608
		100 = ideagroups.1609
		100 = ideagroups.1610

		# Naval		11 (7g 4b)
		100 = ideagroups.1700
		100 = ideagroups.1701
		100 = ideagroups.1702
		100 = ideagroups.1703
		100 = ideagroups.1704
		100 = ideagroups.1705
		100 = ideagroups.1706
		100 = ideagroups.1707
		100 = ideagroups.1708
		100 = ideagroups.1709
		100 = ideagroups.1710

		# Influence		11 (7g 4b)
		100 = ideagroups.1800
		100 = ideagroups.1801
		100 = ideagroups.1802
		100 = ideagroups.1803
		100 = ideagroups.1804
		100 = ideagroups.1805
		100 = ideagroups.1806
		100 = ideagroups.1807
		100 = ideagroups.1808
		100 = ideagroups.1809
		100 = ideagroups.1810
		
		# Humanist		11 (7g 4b)
		100 = ideagroups.1900
		100 = ideagroups.1901
		100 = ideagroups.1902
		100 = ideagroups.1903
		100 = ideagroups.1904
		100 = ideagroups.1905
		100 = ideagroups.1906
		100 = ideagroups.1907
		100 = ideagroups.1908
		100 = ideagroups.1909
		100 = ideagroups.1910
		
		1000 = 0
	}
}


# Estates pulse
on_five_year_pulse_2 = {
	random_events = {	
		# Burghers	
		100 = burghers_estate_events.1
		100 = burghers_estate_events.2
		100 = burghers_estate_events.3
		100 = burghers_estate_events.4
		100 = burghers_estate_events.5
		100 = burghers_estate_events.6
		100 = burghers_estate_events.7
		100 = burghers_estate_events.8
		100 = burghers_estate_events.9
		400 = burghers_estate_events.10 #Demands
		100 = burghers_estate_events.11 #Bonus
		100 = burghers_estate_events.12
		100 = burghers_estate_events.13
		400 = burghers_estate_events.14 #Demands
		100 = burghers_estate_events.15 #Disloyal
		100 = burghers_estate_events.17 #Loyalty Hit
		# Nobles
		100 = nobles_estate_events.1 #Demands
		100 = nobles_estate_events.2
		100 = nobles_estate_events.3
		100 = nobles_estate_events.4
		400 = nobles_estate_events.5 #Demands
		100 = nobles_estate_events.6
		100 = nobles_estate_events.7
		400 = nobles_estate_events.8 #Disloyal
		400 = nobles_estate_events.9 #Disloyal
		50 = nobles_estate_events.10
		100 = nobles_estate_events.11 #Bonus
		100 = nobles_estate_events.13 #Loyalty Hit
		# Clergy
		100 = church_estate_events.1
			#Regional Variations:
			100 = church_estate_events.101 
			100 = church_estate_events.102
			100 = church_estate_events.103
			100 = church_estate_events.104
			100 = church_estate_events.105
		100 = church_estate_events.2
		100 = church_estate_events.3
		100 = church_estate_events.4
		400 = church_estate_events.5 #Disloyal
		400 = church_estate_events.6 #Demands
		100 = church_estate_events.7 #Bonus
		100 = church_estate_events.8
		100 = church_estate_events.9
		100 = church_estate_events.10
		100 = church_estate_events.12 #Loyalty Hit
		# Dhimmi
		100 = dhimmi_estate_events.1
		400 = dhimmi_estate_events.2 #Demands
		100 = dhimmi_estate_events.3
		100 = dhimmi_estate_events.4
		100 = dhimmi_estate_events.5
		100 = dhimmi_estate_events.6
		400 = dhimmi_estate_events.7 #Disloyal
		100 = dhimmi_estate_events.8
		100 = dhimmi_estate_events.10 #Loyalty Hit
		# Cossacks
		100 = cossack_estate_events.1
		#100 = cossack_estate_events.2 (triggers in neighbor country)
		100 = cossack_estate_events.8
		100 = cossack_estate_events.9
		100 = cossack_estate_events.10
		100 = cossack_estate_events.11
		400 = cossack_estate_events.12 #Disloyal
		100 = cossack_estate_events.13
		400 = cossack_estate_events.14 #Demands
		100 = cossack_estate_events.16 #Loyalty Hit
		# Tribes
		100 = tribal_estate_events.1
		100 = tribal_estate_events.2
		100 = tribal_estate_events.3
		100 = tribal_estate_events.4
		100 = tribal_estate_events.5
		100 = tribal_estate_events.6
		100 = tribal_estate_events.7
		100 = tribal_estate_events.8
		100 = tribal_estate_events.9
		150 = tribal_estate_events.11 #Demands
		150 = tribal_estate_events.12 #Demands
		150 = tribal_estate_events.13 #Demands
		150 = tribal_estate_events.14 #Demands
		100 = tribal_estate_events.15 #Loyalty Hit
		
		1000 = 0              
	}
}

on_five_year_pulse_3 = {
}

on_five_year_pulse_4 = {
}

# El Dorado
on_explore_coast = {
	random_events = {
		10 = exploration_events.1
		10 = exploration_events.2
		10 = exploration_events.3
		10 = exploration_events.4
		10 = exploration_events.5
		10 = exploration_events.6
		10 = exploration_events.7
		10 = exploration_events.8
		10 = exploration_events.9
		10 = exploration_events.10
		10 = exploration_events.11
		10 = exploration_events.12
		10 = exploration_events.13
		10 = exploration_events.14
		10 = exploration_events.15
	}
}
on_conquistador_empty = {
	random_events = {
		10 = seven_cities_events.1
		10 = seven_cities_events.2
		10 = seven_cities_events.3
		10 = seven_cities_events.4
		10 = seven_cities_events.5
		10 = seven_cities_events.6
		10 = seven_cities_events.7
		10 = seven_cities_events.8
		
		10 = seven_cities_events.100
		10 = seven_cities_events.101
		10 = seven_cities_events.102
		10 = seven_cities_events.103
		10 = seven_cities_events.104
		10 = seven_cities_events.105
		
		50 = seven_cities_events.200
		50 = seven_cities_events.201
		50 = seven_cities_events.202
		50 = seven_cities_events.203
		50 = seven_cities_events.204
		50 = seven_cities_events.205
		50 = seven_cities_events.206
		50 = seven_cities_events.207
		50 = seven_cities_events.208
		50 = seven_cities_events.209
		50 = seven_cities_events.210
		50 = seven_cities_events.211
		50 = seven_cities_events.212
		50 = seven_cities_events.213
		50 = seven_cities_events.214
		50 = seven_cities_events.215
		50 = seven_cities_events.216
		50 = seven_cities_events.217
		50 = seven_cities_events.218
		50 = seven_cities_events.219
		50 = seven_cities_events.220
		50 = seven_cities_events.221
		50 = seven_cities_events.222
		50 = seven_cities_events.223
		
		10 = seven_cities_events.303
		10 = seven_cities_events.308
		10 = seven_cities_events.309
		
		10 = seven_cities_events.400
		10 = seven_cities_events.401
		10 = seven_cities_events.402
		10 = seven_cities_events.405
		10 = seven_cities_events.406
		10 = seven_cities_events.407
		10 = seven_cities_events.408
		10 = seven_cities_events.409
		10 = seven_cities_events.410
		10 = seven_cities_events.413
		10 = seven_cities_events.414
		
		2000 = 0
	}
}

on_conquistador_native = {
	random_events = {
		10 = seven_cities_events.300
		10 = seven_cities_events.301
		10 = seven_cities_events.302
		10 = seven_cities_events.303
		10 = seven_cities_events.304
		10 = seven_cities_events.305
		10 = seven_cities_events.306
		10 = seven_cities_events.307
		10 = seven_cities_events.308
		10 = seven_cities_events.309
		10 = seven_cities_events.310
		
		250 = 0
	}
}

on_buy_religious_reform = {
	events = {
		religious_reforms.1
		religious_reforms.2
		religious_reforms.3
	}
}

on_circumnavigation = {
	events = {
		exploration_events.17
		exploration_events.16
	}
}

on_become_free_city = {
	events = {
		free_cities.1
	}
}

on_remove_free_city = {
	events = {
		free_cities.2
	}
}

on_revoke_estate_land = {
	if = {
		limit = {
			has_estate = estate_cossacks
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_cossacks
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = cossack_rebels
			size = 1
		}
		province_event = { id = cossack_estate_events.15 }
	}
	if = {
		limit = {
			has_estate = estate_dhimmi
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_dhimmi
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = religious_rebels
			size = 1
		}
		province_event = { id = dhimmi_estate_events.9 }
	}
	if = {
		limit = {
			has_estate = estate_church
			has_owner_religion = yes
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = religious_rebels
			size = 1
		}
		province_event = { id = church_estate_events.11 }
	}
	if = {
		limit = {
			has_estate = estate_church
			has_owner_religion = no
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_church
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = particularist_rebels
			size = 1
		}
		province_event = { id = church_estate_events.11 }
	}
	if = {
		limit = {
			has_estate = estate_nobles
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_nobles
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = noble_rebels
			size = 1
		}
		province_event = { id = nobles_estate_events.12 }
	}
	if = {
		limit = {
			has_estate = estate_burghers
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_burghers
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = particularist_rebels
			size = 1
		}
		province_event = { id = burghers_estate_events.16 }
	}
	if = {
		limit = {
			has_estate = estate_nomadic_tribes
			owner = {
				NOT = {
					estate_loyalty = {
						estate = estate_nomadic_tribes
						loyalty = 30
					}
				}
			}
		}
		spawn_rebels = {
			type = tribal_rebels
			size = 1
		}
	}
}

on_grant_estate_land = {
}