namespace = nhs2_countryevents

###################################################
### MISCELLANEOUS EVENTS
###################################################

# Removed since we can now remove the modifier via idea
# Lose the extra colonist when another is gained from idea groups
# country_event = {
# 	id = nhs2_countryevents.14
# 	title = nhs2_countryevents.14.t
# 	desc = nhs2_countryevents.14.d
# 	picture = NATIVES_eventPicture

#     trigger = {
# 		has_country_modifier = nhs_new_world
# 		num_of_colonists = 2
# 	}

# 	option = {
# 		name = "nhs2_countryevents.14.a"	
# 		remove_country_modifier = nhs_new_world
# 		every_neighbor_country = {
# 			limit = {
# 				religion = totemism
# 				NOT = { is_subject_of = ROOT }
# 				NOT = { alliance_with = ROOT }
# 			}
# 			add_opinion = {
# 				who = ROOT
# 				modifier = nhs_reduced_friction
# 			}
# 		}
# 	}
# }

# Insta cores on homeland provinces
province_event = {
	id = nhs2_countryevents.2
	title = nhs2_countryevents.2.t 
	desc = {
		trigger = {
			owner = {
				NOT = { has_country_flag = had_event_nhs2_countryevents_2 }
			}
		}
		desc = nhs2_countryevents.2.da
	}
	desc = {
		trigger = {
			owner = {
				has_country_flag = had_event_nhs2_countryevents_2
			}
		}
		desc = nhs2_countryevents.2.db
	}
	picture = CITY_VIEW_eventPicture

	goto = root
	is_triggered_only = yes

    trigger = {
		nhs_homelands_no_capital = yes
		NOT = { has_province_flag = nhs_got_core }
		# NOT = { province_id = 952 }
		owner = {
			nhs_check_all_elysian_tags = { CONDITION = tag }
		}
	}
	
	immediate = {
		hidden_effect = {
			set_province_flag = nhs_got_core
			set_province_flag = nhs_had_dev_events_2
			set_province_flag = nhs_got_core_culture_change_delay
			owner = {
				set_country_flag = to_homelands_event_active
				remove_core = ROOT
				add_core = ROOT
			}
		}
	}

	after = {
		owner = {
			clr_country_flag = to_homelands_event_active
			set_country_flag = had_event_nhs2_countryevents_2
		}
		clr_province_flag = nhs_got_core_culture_change_delay
		random_province = {
			limit = {
				is_colony = no
				nhs_homelands_no_capital = yes
				NOT = { has_province_flag = nhs_is_colony }
				NOT = { has_province_flag = nhs_got_core }
				owner = {
					nhs_check_all_elysian_tags = { CONDITION = tag }
				}
			}
			province_event = { id = nhs2_countryevents.2 days = 1 }
		}
	}

	option = {
		name = "nhs2_countryevents.2.a"
		tooltip = {
			owner = {
				add_core = ROOT
			}
		}
		if = {
			limit = {
				province_id = 952 # Powhattan, Alouion
			}
			rename_capital = "Pyrgos"
		}
		else_if = {
			limit = {
				province_id = 957 # Delaware, Methanai
			}
			rename_capital = "Troizen"
		}
		else_if = {
			limit = {
				province_id = 2550 # Doeg, Odessos
			}
			rename_capital = "Neriton"
		}
		else_if = {
			limit = {
				province_id = 2554 # Nanticoke, Nea Aleksandra
			}
			rename_capital = "Kleomenon"
		}
		else_if = {
			limit = {
				province_id = 950 # Eiros
			}
			rename_capital = "Prosphorion"
		}
		add_base_tax = 1
		add_base_manpower = 1
		if = {
			limit = {
				NOT = { has_albanian_majority_modifier = yes }
			}
			change_culture = owner
			change_religion = owner
		}
		hidden_effect = {
			to_set_appropriate_elysian_culture = yes
		}
	}
}

# Powhattan conquered
province_event = {
	id = nhs2_countryevents.21
	title = nhs2_countryevents.21.t
	desc = nhs2_countryevents.21.d
	picture = CITY_VIEW_eventPicture

	goto = root
	is_triggered_only = yes

    trigger = {
		province_id = 952
		nhs_check_all_elysian_tags = { CONDITION = owned_by }
		NOT = { has_province_flag = nhs_got_core }
	}
	
	immediate = {
		hidden_effect = {
			set_province_flag = nhs_got_core
			set_province_flag = nhs_had_dev_events_2
		}
	}

	option = {
		name = nhs2_countryevents.21.a
		rename_capital = "Pyrgos"
		add_base_tax = 1
		add_base_manpower = 1
		add_nationalism = -5
	}
}

# Discover sorrounding provinces
country_event = {
	id = nhs2_countryevents.13
	title = nhs2_countryevents.13.t
	desc = nhs2_countryevents.13.d
	picture = nat_NATIVES_LOW_eventPicture

	is_triggered_only = yes

	option = {
		name = "nhs2_countryevents.13.a"
		every_country = {
			limit = {
				OR = {
					tag = PIA
					tag = LEN
					tag = POW
				}
			}
			add_opinion = {
				who = ROOT
				modifier = nhs_first_contact_o
			}
		}

		every_country = {
			limit = {
				OR = {
					tag = PIA
					tag = LEN
					tag = POW
				}
			}
			country_event = { id = nhs2_countryevents.12 days = 3 }
		}
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = to_disable_cb_humiliate_rotw_tt
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = nhs_new_line_tt
		country_event = { id = nhs2_countryevents.37 days = 3 }
		hidden_effect = {
			every_country = {
				limit = {
					OR = {
						tag = SUS
						tag = TSC
					}
				}
				country_event = { id = nhs2_countryevents.12 days = 30 }
			}

			every_country = {
				limit = {
					OR = {
						is_iroquois = yes
						tag = PEQ
						tag = WAM
						tag = MAH
						tag = WEN
						tag = ERI
					}
				}
				country_event = { id = nhs2_countryevents.12 days = 60 }
			}
		}
	}
}

# Native reaction
country_event = {
	id = nhs2_countryevents.12
	title = nhs2_countryevents.12.t
	desc = nhs2_countryevents.12.d
	picture = EXPLORERS_eventPicture

	is_triggered_only = yes

	option = {
		name = nhs2_countryevents.12.a
	}
}

# Overburdened Administration
country_event = {
	id = nhs2_countryevents.37
	title = nhs2_countryevents.37.t
	desc = nhs2_countryevents.37.d
	picture = BANKRUPTCY_eventPicture

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			set_country_flag = to_enables_overburdened_administration
			if = {
				limit = {
					NOT = { has_government_mechanic = to_administrative_burden_mechanic }
				}
				regenerate_government_mechanics = yes
			}
		}
	}
	
	option = {
		name = nhs2_countryevents.37.a
		custom_tooltip = to_overburdened_administration_tt
		custom_tooltip = nhs_new_line_tt
		if = {
			limit = {
				OR = {
					has_country_flag = nhs_new_flight_food_status_0
					has_country_flag = nhs_new_flight_food_status_1
				}
			}
			custom_tooltip = to_overburdened_administration_low_supplies_tt
			add_government_power = {
				mechanic_type = to_administrative_burden_mechanic
				power_type = to_administrative_burden
				value = 10
			}
			custom_tooltip = nhs_new_line_tt
		}
		custom_tooltip = nhs_new_line_tt
		country_event = { id = nhs2_countryevents.33 days = 2 }
		clr_country_flag = to_block_ai_ab_interactions
		hidden_effect = {
			set_country_flag = to_enables_overburdened_administration
			if = {
				limit = {
					NOT = { has_government_mechanic = to_administrative_burden_mechanic }
				}
				regenerate_government_mechanics = yes
			}
		}
	}
}

# Tribal development tutorial
country_event = {
	id = nhs2_countryevents.33
	title = nhs2_countryevents.33.t
	desc = nhs2_countryevents.33.d
	picture = NATIVES_eventPicture

	is_triggered_only = yes

	option = {
		name = nhs2_countryevents.33.a
		
		if = {
			limit = {
				OR = {
					has_country_flag = nhs_new_flight_food_status_2
					has_country_flag = nhs_new_flight_food_status_1
					has_country_flag = nhs_new_flight_food_status_0
				}
			}
			add_country_modifier = {
				name = nhs_new_world
				duration = -1
				desc = "UNTIL_SECOND_COLONIST"
			}
		}
		else = {
			if = {
				limit = {
					has_country_flag = nhs_new_flight_food_status_3
				}
				custom_tooltip = nhs_generous_supplies_dev_ideas_bonus_tt
			}
			else = {
				custom_tooltip = nhs_plentiful_supplies_dev_ideas_bonus_tt
			}
			add_idea_group = development_ideas
			custom_tooltip = nhs_a_new_start_idea_tt
			hidden_effect = {
				add_idea = a_new_start
				if = {
					limit = {
						has_dlc = "Rule Britannia"
					}
					change_innovativeness = 2
				}
			}
			if = {
				limit = {
					has_country_flag = nhs_new_flight_food_status_4
				}
				custom_tooltip = nhs_population_boom_idea_tt
				custom_tooltip = nhs_planned_metropoles_idea_tt
				hidden_effect = {
					add_idea = population_boom
					add_idea = planned_metropoles
					# add_idea = controlled_treasury
					if = {
						limit = {
							has_dlc = "Rule Britannia"
						}
						change_innovativeness = 4
					}
				}
			}
			custom_tooltip = nhs_dotted_line_tt
		}
		if = {
			limit = {
				OR = {
					has_country_flag = nhs_new_flight_food_status_4
					has_country_flag = nhs_new_flight_food_status_3
					has_country_flag = nhs_new_flight_food_status_2
				}
			}
			custom_tooltip = nhs_lots_of_ppl1_add_tt
			hidden_effect = {
				add_country_modifier = {
					name = nhs_lots_of_ppl1
					duration = -1
					desc = "UNTIL_TWO_COLONIES_FINISHED"
				}
			}
		}
		else = {
			custom_tooltip = nhs_lots_of_ppl1_halved_add_tt
			hidden_effect = {
				add_country_modifier = {
					name = nhs_lots_of_ppl1_halved
					duration = -1
					desc = "UNTIL_TWO_COLONIES_FINISHED"
				}
			}
		}
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = nhs_culture_changes_in_capital_area_tt
		custom_tooltip = nhs_new_line_tt
		add_country_modifier = {
			name = nhs_early_uprising_reduction
			duration = 7300
		}
		custom_tooltip = nhs2_countryevents.33.tt
		to_trigger_extra_post_flight_events = yes
		to_trigger_galata_arrival_event = yes
	}
}

# Breaks Vassalisation over Spartans
country_event = {
	id = nhs2_countryevents.18
	title = nhs2_countryevents.18.t
	desc = nhs2_countryevents.18.d
	picture = DIPLOMACY_eventPicture

	trigger = {
		NOT = { had_global_flag = { flag = nhs_msg_spartans_in_mesoamerica days = 18250 } }
		NOT = { mission_completed = to_taming_the_northmen_mission }
		OR = {
			MS1 = {
				is_subject_of = ROOT
			}
			MSN = {
				is_subject_of = ROOT
			}
		}
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					MS1 = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = {
						MS1 = {
							junior_union_with = ROOT
						}
					}
					MS1 = {
						grant_independence = yes
						define_ruler = {
							dynasty = ROOT
						}
					}
				}
				else = {
					MS1 = {
						grant_independence = yes
					}
				}
			}
			if = {
				limit = {
					MSN = {
						is_subject_of = ROOT
					}
				}
				if = {
					limit = {
						MSN = {
							junior_union_with = ROOT
						}
					}
					MSN = {
						grant_independence = yes
						define_ruler = {
							dynasty = ROOT
						}
					}
				}
				else = {
					MSN = {
						grant_independence = yes
					}
				}
			}
		}
	}

	option = {
		name = "nhs2_countryevents.18.a"
		tooltip = {
			if = {
				limit = {
					MS1 = {
						vassal_of = ROOT
					}
				}
				MS1 = {
					grant_independence = yes
				}
			}
			if = {
				limit = {
					MSN = {
						vassal_of = ROOT
					}
				}
				MSN = {
					grant_independence = yes
				}
			}
		}
	}
}

# The Marble Emperors
# country_event = {
# 	id = nhs2_countryevents.20
# 	title = nhs2_countryevents.20.t
# 	desc = nhs2_countryevents.20.d
# 	picture = UNIVERSITY_eventPicture

# 	fire_only_once = yes

# 	trigger = {
# 		nhs_check_all_elysian_tags = { CONDITION = tag }
# 		is_year = 1525
# 	}

# 	mean_time_to_happen = {
# 		months = 120
# 		modifier = {
# 			factor = 0.5
# 			AND = {
# 				has_country_flag = nhs_invasion_begins
# 				NOT = { owns = 151 }
# 			}
# 		}
# 		modifier = {
# 			factor = 1.5
# 			OR = {
# 				owns = 151
# 				has_country_flag = nhs_invasion_over
# 			}
# 		}
# 	}

# 	immediate = {
# 	}

# 	option = {
# 		name = "nhs2_countryevents.20.a"
# 		add_treasury = -200
# 		add_prestige = 15
# 	}
# 	option = {
# 		name = "nhs2_countryevents.20.b"
# 		add_treasury = -50
# 		add_prestige = 5
# 	}
# }

# Integrate natives, more tax and manpower
# Could be converted in a way to reduce tribal dev?
# province_event = {
# 	id = nhs2_countryevents.15
# 	title = nhs2_countryevents.15.t
# 	desc = nhs2_countryevents.15.d
# 	picture = NATIVES_eventPicture

#     trigger = {
# 		owner = { has_idea = understandings_with_natives }
# 		is_colony = yes
# 		colonysize = 400
# 		NOT = { nhs_homelands = yes }
# 		NOT = { has_province_flag = nhs_integrate_natives_colony }
# 	}
	
# 	is_mtth_scaled_to_size = 1
# 	mean_time_to_happen = {
# 		months = 12
# 	}

# 	option = {
# 		name = "nhs2_countryevents.15.a"
# 		set_province_flag = nhs_integrate_natives_colony
# 		add_base_tax = 1
# 		add_base_production = 1
# 		add_base_manpower = 1
# 	}
# }

# Epilektoi
country_event = {
	id = nhs2_countryevents.16
	title = nhs2_countryevents.16.t
	desc = nhs2_countryevents.16.d
	picture = GOOD_WITH_MONARCH_eventPicture

    trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		NOT = { has_country_flag = to_established_epilektoi }
		OR = {
			total_development = 500
			mil_tech = 9
		}
		OR = {
			NOT = { has_country_flag = established_varangians } 
			has_country_flag = nhs_disbanded_varangians
			total_development = 1000
			mil_tech = 13
		}
	}

	mean_time_to_happen = {
		months = 6
	}

	option = {
		name = "nhs2_countryevents.16.a"
		set_country_flag = to_established_epilektoi
		custom_tooltip = to_enables_epilektoi_tt
		if = {
			limit = {
				has_dlc = "Cradle of Civilization"
			}
			custom_tooltip = to_enables_epilektoi_no_proff_loss_tt
			custom_tooltip = nhs_new_line_tt
		}
		capital_scope = {
			add_province_modifier = {
				name = to_epilektoi_garrison
				duration = -1
			}
		}
	}
}

# Marry native consort, ally with faction of origin
country_event = {
	id = nhs2_countryevents.31
	title = nhs2_countryevents.31.t
	desc = nhs2_countryevents.31.d
	picture = byz_COURT_eventPicture

	goto = selected_country_capital
	
	fire_only_once = yes
	
	trigger = {
		is_year = 1465
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_government_attribute = queen
		is_subject = no
		has_regency = no
		OR = {
			NOT = { has_dlc = "Rights of Man" }
			has_consort = no
		}
		any_neighbor_country = {
			native_culture_primary = yes
			has_native_government = yes
			is_at_war = no
			has_opinion = { who = ROOT value = -50 }
			is_subject = no
			knows_country = ROOT
			NOT = { alliance_with = ROOT }
			OR = {
				religion_group = christian
				ROOT = { NOT = { religion_group = christian } }
			}
		}
	}

	immediate = {
		hidden_effect = {
			random_neighbor_country = {
				limit = {
					native_culture_primary = yes
					has_native_government = yes
					is_at_war = no
					has_opinion = { who = ROOT value = -50 }
					is_subject = no
					knows_country = ROOT
					NOT = { alliance_with = ROOT }
					OR = {
						religion_group = christian
						ROOT = { NOT = { religion_group = christian } }
					}
				}
				save_event_target_as = selected_country
				capital_scope = {
					save_event_target_as = selected_country_capital
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 12
	}

	option = {		# Allow for it
		name = nhs2_countryevents.31.a
		ai_chance = { 
			factor = 60
			modifier = {
				factor = 2
				legitimacy = 95
			}
			modifier = {
				factor = 0.2
				NOT = {
					legitimacy = 60
				}
			}
		}
		add_legitimacy = -15
		event_target:selected_country = {
			create_alliance = ROOT
			create_marriage = ROOT
		}
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			define_consort = {
				country_of_origin = event_target:selected_country
				culture = event_target:selected_country
				religion = event_target:selected_country
			}
		}
	}
	option = {		# Reject
		name = nhs2_countryevents.31.b
		ai_chance = { 
			factor = 40
			modifier = {
				factor = 0.5
				legitimacy = 95
			}
			modifier = {
				factor = 2
				NOT = {
					legitimacy = 60
				}
			}
		}
		add_legitimacy = 10
		event_target:selected_country = {
			add_opinion = {
				who = ROOT
				modifier = insulted
			}
		}
	}
}

# Nobles trained as Cataphracts
# Move to the privilege
# country_event = {
# 	id = nhs_countryevents.6
# 	title = nhs_countryevents.6.t
# 	desc = nhs_countryevents.6.d
# 	picture = CATAPHRACT_eventPicture
	
# 	trigger = {
# 		nhs_check_all_elysian_tags = { CONDITION = tag }
# 		NOT = { has_country_flag = nhs_hadevent_countryevents6 }
# 		NOT = { has_country_modifier = nhs_noble_cataphracts }
# 		is_year = 1470
# 	}

# 	mean_time_to_happen = {
# 		months = 12
# 	}

# 	immediate = {
# 		set_country_flag = nhs_hadevent_countryevents6
# 	}

# 	option = {		# Accept the new noble class
# 		name = "NHSCOUNTRYEVENTSNAME6A"
# 		ai_chance = { 
# 			factor = 70
# 			modifier = {
# 				factor = 0.5
# 				NOT = {
# 					legitimacy = 60
# 				}
# 			}
# 			modifier = {
# 				factor = 1.5
# 				NOT = {
# 					prestige = 0
# 				}
# 			}
# 		}
# 		add_legitimacy = -5
# 		add_prestige = 10
# 		add_army_tradition = -10
# 		add_country_modifier = {
# 			name = "nhs_noble_cataphracts"
# 			duration = -1
# 		}
# 	}
# 	option = {		# Reject the new noble class
# 		name = "NHSCOUNTRYEVENTSNAME6B"
# 		ai_chance = { 
# 			factor = 30
# 			modifier = {
# 				factor = 0.5
# 				NOT = {
# 					prestige = 10
# 				}
# 				stability = 0
# 			}
# 			modifier = {
# 				factor = 4
# 				NOT = {
# 					stability = 0
# 				}
# 			}
# 		}
# 		add_prestige = -10
# 		add_stability_or_adm_power = yes
# 	}
# }

# Birth of Elysianism
country_event = {
	id = nhs2_countryevents.34
	title = nhs2_countryevents.34.t
	desc = nhs2_countryevents.34.d
	picture = SENATE_eventPicture

	is_triggered_only = yes
	
	option = {	# Let him
		name = nhs2_countryevents.34.a
		custom_tooltip = nhs_unlock_invasion_decision_tt
		clr_country_flag = to_block_invasion_and_abandon_heritage
	}
}

# Immigration from Free Haven
province_event = {
	id = nhs2_countryevents.36
	title = nhs2_countryevents.36.t
	desc = nhs2_countryevents.36.d
	picture = COLONIZATION_eventPicture

	goto = to_european_emigration_province

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			owner = {
				set_country_flag = to_has_european_immigration_event_active
			}
		}
	}

	after = {
		owner = {
			clr_country_flag = to_has_european_immigration_event_active
			if = {
				limit = {
					any_owned_province = {
						has_province_flag = to_european_immigration_event_pending
					}
				}
				random_owned_province = {
					limit = {
						has_province_flag = to_european_immigration_event_pending
					}
					clr_province_flag = to_european_immigration_event_pending
					province_event = { id = nhs2_countryevents.36 days = 1 }
				}
			}
		}
	}
	
	option = {	# Let him
		name = nhs2_countryevents.36.a
		goto = ROOT

		custom_tooltip = to_european_immigration_tt
		custom_tooltip = nhs_new_line_tt
		add_province_modifier = {
			name = to_recent_immigration
			duration = 3650
		}
	}
}

# Gold Rush
country_event = {
	id = nhs2_countryevents.14
	title = nhs2_countryevents.14.t
	desc = {
		trigger = {
			NOT = { gold = 1 }
		}
		desc = nhs2_countryevents.14.da
	}
	desc = {
		trigger = {
			gold = 1
			NOT = { gold = 2 }
		}
		desc = nhs2_countryevents.14.db
	}
	desc = {
		desc = nhs2_countryevents.14.dc
	}
	picture = TRADE_GOODS_METALS_AND_MINING_EQUIPENT_eventPicture

	is_triggered_only = yes

	trigger = {
		any_owned_province = {
			to_ely_high_income_mission_is_gold_province = yes
			NOT = { trade_goods = gold }
		}
	}

	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					trade_goods = gold
				}
				save_event_target_as = to_gold_mine_province_target
			}
		}
	}
	
	option = {
		name = nhs2_countryevents.14.a
		goto = 2563
		trigger = {
			owns = 2563
			2563 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		2563 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_hills
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.b
		goto = 936
		trigger = {
			owns = 936
			936 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		936 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_mountains
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.c
		goto = 2548
		trigger = {
			owns = 2548
			2548 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		2548 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_hills
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.e
		goto = 935
		trigger = {
			owns = 935
			935 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		935 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_hills
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.f
		goto = 2527
		trigger = {
			owns = 2527
			2527 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		2527 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_hills
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.g
		goto = 4879
		trigger = {
			owns = 4879
			4879 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		4879 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_mountains
				duration = -1
			}
		}
	}
	option = {
		name = nhs2_countryevents.14.h
		goto = 931
		trigger = {
			owns = 931
			931 = {
				is_city = yes
				NOT = { trade_goods = gold }
			}
		}
		931 = {
			change_trade_goods = gold
			add_base_production = 2
			add_permanent_province_modifier = {
				name = to_gold_rush_hills
				duration = -1
			}
		}
	}
}

# Hesperidian Wine
country_event = {
	id = nhs2_countryevents.77
	title = nhs2_countryevents.77.t
	desc = {
		trigger = {
			NOT = { owns_or_subject_of = 151 }
		}
		desc = nhs2_countryevents.77.da
	}
	desc = {
		desc = nhs2_countryevents.77.db
	}
	picture = barrels_eventpicture
	
	goto = to_wine_target
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		any_owned_province = {
			OR = {
				area = central_valley_area
				province_id = 2478
			}
		}
	}
	
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					OR = {
						area = central_valley_area
						province_id = 2478
					}
				}
				save_event_target_as = to_wine_target
			}			
		}
	}

	option = {
		name = "nhs2_countryevents.77.a"
		set_country_flag = to_enable_wineries_decision
		custom_tooltip = to_enable_wineries_tt
		custom_tooltip = nhs_new_line_tt
		event_target:to_wine_target = {
			change_trade_goods = wine
		}
	}
}

# Vatatzes, Laskaris, Kantakouzenos, and Metochites
country_event = {
	id = nhs2_countryevents.38
	title = nhs2_countryevents.38.t
	desc = nhs2_countryevents.38.d
	picture = byz_COURT_eventPicture
	
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		is_year = 1450
		NOT = { is_year = 1485 }
		ruler_age = 40
		government = monarchy
		has_heir = no
		dynasty = "Palaiologos"
	}
	
	mean_time_to_happen = {
		days = 30
	}

	# Theodoros Vatatzes (<1480)
	option = {
		name = "nhs2_countryevents.38.a"
		trigger = {
			NOT = { is_year = 1480 }
		}
		define_heir = {
			male = yes
			dynasty = "Vatatzes"
			name = "Theodoros"
			birth_date = 1430.7.12
			claim = 80
			dip = 5
			max_random_dip = 5
			max_random_mil = 3
			max_random_adm = 3
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		add_estate_loyalty = {
			estate = estate_nhs_nobles
			loyalty = 15
		}
		add_estate_influence_modifier = {
			estate = estate_nhs_nobles
			influence = 10
			desc = EST_VAL_to_noble_symbasileus
			duration = 7300
		}
		set_heir_flag = to_pala_noble_heir
	}

	# Ioannes Vatatzes (>1480)
	option = {
		name = "nhs2_countryevents.38.b"
		trigger = {
			is_year = 1480
		}
		define_heir = {
			male = yes
			dynasty = "Vatatzes"
			name = "Ioannes"
			birth_date = 1448.4.8
			claim = 80
			dip = 5
			max_random_dip = 5
			max_random_mil = 3
			max_random_adm = 3
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		add_estate_loyalty = {
			estate = estate_nhs_nobles
			loyalty = 15
		}
		add_estate_influence_modifier = {
			estate = estate_nhs_nobles
			influence = 10
			desc = EST_VAL_to_noble_symbasileus
			duration = 7300
		}
		set_heir_flag = to_pala_noble_heir
	}

	# Demetrios Kantakouzenos (<1460)
	# option = {
	# 	name = "nhs2_countryevents.38.b"
	# 	trigger = {
	# 		NOT = { is_year = 1460 }
	# 	}
	# 	define_heir = {
	# 		male = yes
	# 		dynasty = "Kantakouzenos"
	# 		name = "Demetrios"
	# 		birth_date = TOO OLD
	# 		claim = 80
	# 		mil = 5
	# 		max_random_dip = 3
	# 		max_random_mil = 5
	# 		max_random_adm = 3
	# 		no_consort_with_heir = yes
	# 	}
	# }

	# Michael Kantakouzenos (son of Grand Domestic Andronikos Palaiologos Kantakouzenos, according to Donald MacGillivray Nicol)
	# According to the author we don't actually know what his name was, so I just picked one
	option = {
		name = "nhs2_countryevents.38.c"
		# trigger = {
		# 	is_year = 1460
		# }
		define_heir = {
			male = yes
			dynasty = "Kantakouzenos"
			name = "Michael"
			birth_date = 1429.3.14
			claim = 80
			mil = 5
			max_random_dip = 3
			max_random_mil = 5
			max_random_adm = 3
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		add_estate_loyalty = {
			estate = estate_nhs_nobles
			loyalty = 15
		}
		add_estate_influence_modifier = {
			estate = estate_nhs_nobles
			influence = 10
			desc = EST_VAL_to_noble_symbasileus
			duration = 7300
		}
		set_heir_flag = to_pala_noble_heir
	}

	# Konstantinos Laskaris (a scholar descended from the Nikaian main dynasty the Palaialogos replaced right after 1261)
	option = {
		name = "nhs2_countryevents.38.e"
		define_heir = {
			male = yes
			dynasty = "Laskaris"
			name = "Konstantinos"
			birth_date = 1434.12.13
			claim = 80
			adm = 5
			max_random_dip = 3
			max_random_mil = 3
			max_random_adm = 5
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		add_estate_loyalty = {
			estate = estate_nhs_nobles
			loyalty = 15
		}
		add_estate_influence_modifier = {
			estate = estate_nhs_nobles
			influence = 10
			desc = EST_VAL_to_noble_symbasileus
			duration = 7300
		}
		set_heir_flag = to_pala_noble_heir
	}

	# (Alexios) Metochites (son of Demetrios Palaiologos Metochites)
	# Again we don't know the name(s) of Demetrios' descendards, or their birth dates so I just improvised
	option = {
		name = "nhs2_countryevents.38.f"
		define_heir = {
			male = yes
			dynasty = "Metochites"
			name = "Alexios"
			birth_date = 1434.3.14
			claim = 80
			adm = 5
			max_random_dip = 3
			max_random_mil = 3
			max_random_adm = 5
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		add_estate_loyalty = {
			estate = estate_nhs_nobles
			loyalty = 15
		}
		add_estate_influence_modifier = {
			estate = estate_nhs_nobles
			influence = 10
			desc = EST_VAL_to_noble_symbasileus
			duration = 7300
		}
		set_heir_flag = to_pala_noble_heir
	}

	option = {
		name = "nhs2_countryevents.38.g"
		define_heir = {
			male = yes
			dynasty = ROOT
			name = "Konstantinos"
			age = 22
			claim = 40
			change_adm = 1
			change_dip = 1
			change_mil = 1
			no_consort_with_heir = yes
		}

		custom_tooltip = nhs_new_line_tt
		custom_tooltip = to_add_adopted_an_heir_modifier_tt
		hidden_effect = {
			add_ruler_modifier = {
				name = to_pala_has_adopted_heir
				duration = -1
			}
		}
		set_heir_flag = to_pala_adopted_heir
	}

	option = {
		name = "nhs2_countryevents.38.h"
		add_legitimacy = 10
	}
}

###################################################
### SENATE OF CITIES EVENTS
###################################################

# City senator leaves in anger
country_event = {
	id = nhs2_countryevents.17
	title = nhs2_countryevents.17.t
	desc = nhs2_countryevents.17.d
	picture = SENATE_eventPicture
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		is_year = 1505
		OR = {
			has_reform = senatorial_empire
			has_reform = elysian_patriarchy
			# has_reform = nhs_noble_republic
		}
	}
	
	mean_time_to_happen = {
		months = 720
		modifier = {
			factor = 0.75
			has_country_modifier = nhs_extended_city_senate
		}
		modifier = {
			factor = 0.85
			any_owned_province = {
				NOT = { is_core = ROOT }
			}
		}
		modifier = {
			factor = 0.80
			NOT = { dip = 2 }
		}
		modifier = {
			factor = 1.5
			NOT = { num_of_cities = 10 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 1.2
			stability = 1
		}
		modifier = {
			factor = 1.2
			stability = 2
		}
		modifier = {
			factor = 1.2
			stability = 3
		}
		modifier = {
			factor = 1.5
			has_country_flag = nhs_hadevent_elysIdeaEvents21
		}
	}
	
	immediate = {
		set_country_flag = nhs_hadevent_elysIdeaEvents21
	}
	
	option = {	# Let him
		name = "nhs2_countryevents.17.a"
		add_prestige = -10
		add_legitimacy = -5
	}
	option = {	# Bribe him to keep quiet
		name = "nhs2_countryevents.17.b"
		add_prestige = -5
		add_years_of_income = -0.05
	}
}

# Senators divided over new laws
country_event = {
	id = nhs2_countryevents.19
	title = nhs2_countryevents.19.t
	desc = nhs2_countryevents.19.d
	picture = SENATE_eventPicture
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		is_year = 1505
		OR = {
			has_reform = senatorial_empire
			has_reform = elysian_patriarchy
		}
		NOT = { stability = 3 }
	}
	
	mean_time_to_happen = {
		months = 960
		modifier = {
			factor = 0.75
			# has_country_modifier = nhs_extended_city_senate
			OR = {
				has_reform = to_expand_senate_of_cities
				has_reform = to_expand_senate_of_cities_nodlc
			}
		}
		modifier = {
			factor = 0.8
			NOT = { dip = 2 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.75
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 1.25
			stability = 1
		}
		modifier = {
			factor = 1.25
			stability = 2
		}
		modifier = {
			factor = 1.5
			has_country_flag = nhs_hadevent_elysIdeaEvents22
		}
	}
	
	immediate = {
		set_country_flag = nhs_hadevent_elysIdeaEvents22
	}
	
	option = {	# Make sure the new laws pass
		name = "nhs2_countryevents.19.a"
		add_stability_or_adm_power = yes
		add_years_of_income = -0.25
	}
	option = {	# Accept bribes to avoid the laws passing
		name = "nhs2_countryevents.19.b"
		add_stability = -1
		add_years_of_income = 0.3
	}
}

# Christian Senator causes Unrest
country_event = {
	id = nhs2_countryevents.30
	title = nhs2_countryevents.30.t
	desc = nhs2_countryevents.30.d
	picture = SENATE_eventPicture
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_reform = senatorial_empire
		religion = pantheon_worship
		NOT = { has_country_modifier = nhs_hrv_peaceful_resolution }
		NOT = { has_country_modifier = nhs_hrv_tolerance }
		if = {
			limit = {
				OR = {
					has_reform = to_expand_senate_of_cities
					has_reform = to_expand_senate_of_cities_nodlc
				}
			}
			any_owned_province = {
				religion_group = christian
				NOT = { has_province_modifier = nhs_tolerated_minority }
				has_seat_in_parliament = yes
			}
		}
		else = {
			any_owned_province = {
				religion_group = christian
				culture_group = ROOT
				NOT = { has_province_modifier = nhs_tolerated_minority }
				has_seat_in_parliament = yes
			}
		}
	}
	
	mean_time_to_happen = {
		months = 360
		modifier = {
			factor = 0.90
			# has_country_modifier = nhs_extended_city_senate
			OR = {
				has_reform = to_expand_senate_of_cities
				has_reform = to_expand_senate_of_cities_nodlc
			}
		}
		modifier = {
			factor = 0.90
			has_country_modifier = nhs_consolidated_pantheon
		}
		# modifier = {
		# 	factor = 0.90
		# 	OR = {
		# 		num_of_religion = { religion = elysian_orthodoxy value = 3 }
		# 		num_of_religion = { religion = orthodox value = 3 }
		# 		num_of_religion = { religion = catholic value = 3 }
		# 		num_of_religion = { religion = protestant value = 3 }
		# 		num_of_religion = { religion = reformed value = 3 }
		# 	}
		# }
		# modifier = {
		# 	factor = 0.80
		# 	OR = {
		# 		num_of_religion = { religion = elysian_orthodoxy value = 3 }
		# 		num_of_religion = { religion = orthodox value = 5 }
		# 		num_of_religion = { religion = catholic value = 5 }
		# 		num_of_religion = { religion = protestant value = 5 }
		# 		num_of_religion = { religion = reformed value = 5 }
		# 	}
		# }
		modifier = {
			factor = 0.90
			NOT = { stability = -2 }
		}
		modifier = {
			factor = 0.90
			NOT = { stability = -1 }
		}
		modifier = {
			factor = 0.90
			NOT = { stability = 0 }
		}
		modifier = {
			factor = 1.10
			stability = 1
		}
		modifier = {
			factor = 1.10
			stability = 2
		}
		modifier = {
			factor = 1.10
			has_country_flag = nhs_hadevent_elysIdeaEvents23
		}
	}
	
	immediate = {
		set_country_flag = nhs_hadevent_elysIdeaEvents23
	}
	
	option = {	# Leave them more room
		name = "nhs2_countryevents.30.a"
		add_stability = -1
		add_legitimacy = -10
		add_country_modifier = {
			name = "innovative_modifier"
			duration = 3650
		}
	}
	option = {	# Ban Christians from public office
		name = "nhs2_countryevents.30.b"
		add_stability = -1
		add_legitimacy = 5
		add_country_modifier = {
			name = "narrowminded_modifier"
			duration = 3650
		}
	}
	option = {	# Persecute Christians
		name = "nhs2_countryevents.30.c"
		trigger = {
			has_country_modifier = nhs_consolidated_pantheon
		}
		add_stability = -1
		random_owned_province = {
			limit = {
				religion_group = christian
			}
			change_religion = ROOT
			add_unrest = 10
		}
		add_country_modifier = {
			name = "narrowminded_modifier"
			duration = 3650
		}
	}
}

###################################################
### LANDING EVENTS
###################################################

# Salvaging the fleet
country_event = {
	id = nhs2_countryevents.22
	title = nhs2_countryevents.22.t
	desc = nhs2_countryevents.22.d
	picture = ELYSIAN_HARBOUR_eventPicture

	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		NOT = { has_global_flag = nhs_started_at_bookmark }
	}
	
	immediate = {
		hidden_effect = {
			country_event = { id = nhs2_countryevents.1 days = 183 random = 30 }
			country_event = { id = nhs2_countryevents.24 days = 365 random = 30 }
		}
	}

	option = {
		name = "nhs2_countryevents.22.a"
		capital_scope = {
			add_base_tax = 1
			add_base_production = 1
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			set_country_flag = to_ab_no_recruit_penalty
			capital_scope = {
				light_ship = NHS
			}
			clr_country_flag = to_ab_no_recruit_penalty
		}
	}
	option = {
		name = "nhs2_countryevents.22.b"
		trigger = {
			capital_scope = {
				num_free_building_slots = 1
				NOT = {	has_building = fort_15th }
			}
		}
		add_mil_power = 15
		set_country_flag = to_ab_no_building_penalty
		capital_scope = {
			add_building = fort_15th
			add_province_modifier = {
				name = to_wooden_fortifications
				duration = 18250
			}
		}
		clr_country_flag = to_ab_no_building_penalty
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			set_country_flag = to_ab_no_recruit_penalty
			capital_scope = {
				light_ship = NHS
			}
			clr_country_flag = to_ab_no_recruit_penalty
		}
	}

	option = {
		name = "nhs2_countryevents.22.c"
		add_sailors = 500
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 1 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 2 } }
			}
			add_treasury = 30
			add_country_modifier = {
				name = nhs2_sold_the_ships_1
				duration = 18250
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 2 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 3 } }
			}
			add_treasury = 40
			add_country_modifier = {
				name = nhs2_sold_the_ships_1
				duration = 18250
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 3 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 4 } }
			}
			add_treasury = 50
			add_country_modifier = {
				name = nhs2_sold_the_ships_2
				duration = 18250
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 4 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 5 } }
			}
			add_treasury = 60
			add_country_modifier = {
				name = nhs2_sold_the_ships_2
				duration = 18250
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 5 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 6 } }
			}
			add_treasury = 80
			add_country_modifier = {
				name = nhs2_sold_the_ships_3
				duration = 18250
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			add_treasury = 100
			add_country_modifier = {
				name = nhs2_sold_the_ships_4
				duration = 18250
			}
		}
	}
	option = {
		name = "nhs2_countryevents.22.e"
		add_sailors = 1500
		add_country_modifier = {
			name = nhs2_kept_the_ships
			duration = 18250
		}
		set_country_flag = to_ab_no_recruit_penalty
		if = {
			limit = {
				has_dlc = "Golden Century"
			}
			custom_tooltip = nhs_starting_flagship_fixed_tt
			hidden_effect = {
				set_country_flag = nhs_first_flagship
				set_country_flag = nhs_first_flagship_fixed
				capital_scope = {
					if = {
						limit = {
							any_province = {
								heavy_ships_in_province = ROOT
							}
						}
						random_province = {
							limit = {
								heavy_ships_in_province = ROOT
							}
							kill_units = {
								who = ROOT
								type = heavy_ship
								amount = 1
							}
						}
					}
					else_if = {
						limit = {
							any_province = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
						}
						random_province = {
							limit = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
							sea_zone = {
								kill_units = {
									who = ROOT
									type = heavy_ship
									amount = 1
								}
							}
						}
					}
					953 = {
						create_flagship = {	
							name = "Aghia Theotoke"
							type = heavy_ship
						}
					}
				}
				clr_country_flag = nhs_first_flagship
				clr_country_flag = nhs_first_flagship_fixed
			}
		}
		else = {
			capital_scope = {
				heavy_ship = NHS
			}
		}
		custom_tooltip = nhs_new_line_tt
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 1 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 2 } }
			}
			add_treasury = -15
			capital_scope = {
				light_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 2 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 3 } }
			}
			add_treasury = -15
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 3 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 4 } }
			}
			add_treasury = -20
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 4 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 5 } }
			}
			add_treasury = -30
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 5 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 6 } }
			}
			add_treasury = -40
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			add_treasury = -50
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		clr_country_flag = to_ab_no_recruit_penalty
	}
}

# Church gets power on your arrival
country_event = {
	id = nhs2_countryevents.1
	title = nhs2_hidden.t
	desc = nhs2_hidden.d
	picture = RELIGION_eventPicture

	is_triggered_only = yes
	hidden = yes

    trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		religion = orthodox
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = disables_estate_church_flag
			set_country_flag = nhs_setting_church_land
			if = {
				limit = {
					any_country = {
						exists = yes
						ai = yes
					}
				}
				random_country = {
					limit = {
						ai = yes
					}
					country_event = { id = nhs2_countryevents.1000 days = 0 }
				}
				random_country = {
					limit = {
						ai = yes
					}
					country_event = { id = nhs2_countryevents.1000 days = 1 }
				}
				country_event = { id = nhs2_countryevents.1002 days = 3 }
			}
			else = {
				country_event = { id = nhs2_countryevents.1002 days = 3 }
			}
		}
	}

	option = {
		name = nhs2_hidden.a
	}
}

# Sets church land
country_event = {
	id = nhs2_countryevents.1000
	title = nhs2_hidden.t
	desc = nhs2_hidden.d
	picture = RELIGION_eventPicture

	is_triggered_only = yes
	hidden = yes

	immediate = {
		FROM = {
			to_nhs_setup_church_land = yes
		}
	}

	option = {
		name = nhs2_hidden.a
		FROM = {
			to_nhs_setup_church_land = yes
		}
	}
}

# Church gets power on your arrival
country_event = {
	id = nhs2_countryevents.1002
	title = nhs2_countryevents.1.t
	desc = nhs2_countryevents.1.d
	picture = RELIGION_eventPicture

	is_triggered_only = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		religion = orthodox
	}

	immediate = {
		hidden_effect = {
			to_nhs_setup_church_land = yes
		}
	}

	option = {
		name = "nhs2_countryevents.1.a"
		set_country_flag = nhs_patriarch_in_power
		custom_tooltip = nhs_enables_church_estate_tt
		custom_tooltip = nhs_church_estate_initial_land_tt
		hidden_effect = {
			add_patriarch_authority = 1
			add_patriarch_authority = -0.5	
		}
		custom_tooltip = set_patriarch_authority_later_tt
	}
}

# Organising the masses
country_event = {
	id = nhs2_countryevents.24
	title = nhs2_countryevents.24.t
	desc = nhs2_countryevents.24.d
	picture = FARMING_eventPicture
	
	fire_only_once = yes
	is_triggered_only = yes
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
	}

	immediate = {
		hidden_effect = {
			country_event = { id = nhs2_countryevents.25 days = 183 random = 20 }
		}
	}

	option = {
		name = "nhs2_countryevents.24.a"
		capital_scope = {
			add_base_tax = 1
		}
	}
	option = {
		name = "nhs2_countryevents.24.b"
		capital_scope = {
			add_base_production = 1
		}
	}
	option = {
		name = "nhs2_countryevents.24.c"
		capital_scope = {
			add_base_manpower = 1
		}
	}
}

# Militia Matters
country_event = {
	id = nhs2_countryevents.25
	title = nhs2_countryevents.25.t
	desc = nhs2_countryevents.25.d
	picture = elysian_army_eventPicture
	
	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
	}

	immediate = {
		hidden_effect = {
			# country_event = { id = nhs2_countryevents.23 days = 183 random = 20 }
			# country_event = { id = nhs2_countryevents.26 days = 183 random = 20 }
			country_event = { id = nhs2_countryevents.27 days = 183 random = 20 }
			country_event = { id = nhs2_countryevents.73 days = 91 random = 10 }
		}
	}

	option = {
		name = "nhs2_countryevents.25.a"
		capital_scope = {
			add_base_tax = 1
		}
	}
	option = {
		name = "nhs2_countryevents.25.b"
		capital_scope = {
			add_base_production = 1
		}
	}
}


#  Nobles request housing and land for farming estates
# Now triggers upon gaining a second province
country_event = {
	id = nhs2_countryevents.23
	title = nhs2_countryevents.23.t
	desc = nhs2_countryevents.23.d
	picture = byz_COURT_eventPicture
	
	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_estate = estate_nhs_nobles
	}

	after = {
		clr_country_flag = nhs_disable_noble_privileges
	}

	option = {
		name = "nhs2_countryevents.23.a"
		ai_chance = {
			factor = 100
		}
		add_treasury = 20
		set_estate_privilege = to_nhs_estate_nhs_nobles_land_sale_privilege
	}
	option = {
		name = "nhs2_countryevents.23.b"
		ai_chance = {
			factor = 0
		}
		custom_tooltip = to_nhs_enables_estate_nhs_nobles_land_sale_privilege_tt
	}
}

# # A Basic Temple
# country_event = {
# 	id = nhs2_countryevents.26
# 	title = nhs2_countryevents.26.t
# 	desc = nhs2_countryevents.26.d
# 	picture = OLYMPIANS_eventPicture

# 	fire_only_once = yes
# 	is_triggered_only = yes

# 	trigger = {
# 		religion_group = pagan
# 		nhs_check_all_elysian_tags = { CONDITION = tag }
# 		NOT = { has_country_flag = had_nhs2_countryevents26 }
# 		NOT = { has_country_flag = had_nhs2_countryevents27 }
# 	}

# 	immediate = {
# 		set_country_flag = had_nhs2_countryevents26
# 	}

# 	option = {
# 		name = "nhs2_countryevents.26.a"
# 		trigger = {
# 			capital_scope = {
# 				NOT = { has_building = temple }
# 				num_free_building_slots = 1
# 			}
# 		}
# 		add_treasury = -80
# 		capital_scope = {
# 			add_building = temple
# 		}
# 		add_country_modifier = {
# 			name = centralised_state
# 			duration = 3650
# 		}
# 	}
# 	option = {
# 		name = "nhs2_countryevents.26.e"
# 		trigger = {
# 			capital_scope = {
# 				NOT = { has_building = temple }
# 				num_free_building_slots = 1
# 			}
# 		}
# 		add_prestige = -5
# 		capital_scope = {
# 			add_building = temple
# 		}
# 	}
# 	option = {
# 		name = "nhs2_countryevents.26.c"
# 		add_prestige = -5
# 		capital_scope = {
# 			add_base_tax = 1
# 		}
# 	}
# }

# A Modest Church
country_event = {
	id = nhs2_countryevents.27
	title = nhs2_countryevents.27.t
	desc = nhs2_countryevents.27.d
	picture = ST_PETERS_CHURCH_eventPicture

	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		religion_group = christian
		nhs_check_all_elysian_tags = { CONDITION = tag }
		NOT = { has_country_flag = had_nhs2_countryevents27 }
		NOT = { has_country_flag = had_nhs2_countryevents26 }
	}

	immediate = {
		set_country_flag = had_nhs2_countryevents27
	}

	option = {
		name = "nhs2_countryevents.27.a"
		trigger = {
			capital_scope = {
				NOT = { has_building = temple }
				num_free_building_slots = 1
			}
		}
		add_treasury = -80
		set_country_flag = to_ab_no_building_penalty
		capital_scope = {
			add_building = temple
		}
		clr_country_flag = to_ab_no_building_penalty
		add_estate_loyalty = {
			estate = estate_church
			loyalty = 15
		}
	}
	option = {
		name = "nhs2_countryevents.27.e"
		trigger = {
			capital_scope = {
				NOT = { has_building = temple }
				num_free_building_slots = 1
			}
		}
		add_prestige = -5
		add_patriarch_authority = -0.05
		if = {
			limit = {
				has_estate = estate_church
			}
			add_estate_loyalty = {
				estate = estate_church
				loyalty = -10
			}
		}
		capital_scope = {
			add_building = temple
		}
	}
	option = {
		name = "nhs2_countryevents.27.c"
		add_patriarch_authority = -0.05
		if = {
			limit = {
				has_estate = estate_church
			}
			add_estate_loyalty = {
				estate = estate_church
				loyalty = -10
			}
			add_estate_influence_modifier = {
				estate = estate_church
				desc = EST_VAL_DENIED_CHURCH
				influence = -10
				duration = 3650
			}
		}
		capital_scope = {
			add_base_tax = 1
		}
	}
}

# Expanding city limits
# Could be reworked as a barbaroi estate event
# country_event = {
# 	id = nhs2_countryevents.28
# 	title = nhs2_countryevents.28.t
# 	desc = nhs2_countryevents.28.d
# 	picture = CITY_VIEW_eventPicture

# 	fire_only_once = yes

# 	trigger = {
# 		is_year = 1450
# 		num_of_cities = 4
# 		nhs_check_all_elysian_tags = { CONDITION = tag }
# 		NOT = { has_country_flag = had_nhs2_countryevents28 }
# 		NOT = { has_global_flag = nhs_started_at_bookmark }
# 	}

# 	immediate = {
# 		set_country_flag = had_nhs2_countryevents28
# 	}

# 	option = {
# 		name = "nhs2_countryevents.28.a"
# 		capital_scope = {
# 			add_base_tax = 2
# 			add_base_production = 2
# 			add_base_manpower = 2
# 		}
# 		every_country = {
# 			limit = {
# 				NOT = { border_distance = { who = ROOT distance = 100 } }
# 				technology_group = north_american
# 			}
# 			add_opinion = {
# 				who = ROOT
# 				modifier = nhs2_expansion
# 			}
# 		}
# 		set_country_flag = nhs_expanded_the_limits
# 	}
# 	option = {
# 		name = "nhs2_countryevents.28.b"
# 		capital_scope = {
# 			add_base_production = 1
# 			add_base_manpower = 1
# 		}
# 		add_treasury = 100
# 		add_adm_power = 10
# 		add_dip_power = 50
# 		add_mil_power = 50
# 		set_country_flag = nhs_didnot_expand_the_limits
# 	}
# }

###################################################
### APPALACHIAN EVENTS
###################################################

# pathways through the appalachian mountains, intro flavor
country_event = {
	id = nhs2_countryevents.3
	title = nhs2_countryevents.3.t
	desc = nhs2_countryevents.3.d
	picture = TO_ROAD_TO_MOUNTAINS_eventPicture

	is_triggered_only = yes

	option = {
		name = "nhs2_countryevents.3.a"
	}
}

# pathways through the appalachian mountains, provinces getting their paths
country_event = {
	id = nhs2_countryevents.4
	title = nhs2_countryevents.4.t
	desc = nhs2_countryevents.4.d
	picture = TO_APPALACHIAN_PATH_eventPicture

	goto = nhs_appalachian_pathways_et

	trigger = {
		NOT = { has_country_flag = nhs_apworkstopped }
		has_country_flag = nhs_appalachian_pathways
		NOT = { has_country_modifier = nhs_timer_pathways }
		any_province = {
			country_or_subject_or_ally_or_ally_subject_holds = { TAG = ROOT }
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
	}
	
	mean_time_to_happen = {
		months = 8
		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.75
			stability = 3
		}
		modifier = {
			factor = 0.9
			num_of_cities = 10
		}
		modifier = {
			factor = 0.9
			adm = 4
		}
		modifier = {
			factor = 1.2
			is_at_war = yes
		}	
		modifier = {
			factor = 1.5
			war_exhaustion = 2
		}
		modifier = {
			factor = 5
			war_exhaustion = 5
		}
		modifier = {
			factor = 20
			war_exhaustion = 10
		}		
	}
	
	immediate = {
		hidden_effect = {
			random_owned_province = {
				limit = {
					is_city = yes
					nhs_appalachian_pathways_province = yes
					NOT = { to_has_appalachian_pathways_modifier = yes }
				}
				save_event_target_as = nhs_appalachian_pathways_et
			}
			if = {
				limit = {
					NOT = { has_saved_event_target = nhs_appalachian_pathways_et }
				}
				random_province = {
					limit = {
						owner = {
							is_subject_of = ROOT
						}
						is_city = yes
						nhs_appalachian_pathways_province = yes
						NOT = { to_has_appalachian_pathways_modifier = yes }
					}
					save_event_target_as = nhs_appalachian_pathways_et
				}
			}
			if = {
				limit = {
					NOT = { has_saved_event_target = nhs_appalachian_pathways_et }
				}
				random_province = {
					limit = {
						owner = {
							alliance_with = ROOT
						}
						is_city = yes
						nhs_appalachian_pathways_province = yes
						NOT = { to_has_appalachian_pathways_modifier = yes }
					}
					save_event_target_as = nhs_appalachian_pathways_et
				}
			}
			if = {
				limit = {
					NOT = { has_saved_event_target = nhs_appalachian_pathways_et }
				}
				random_province = {
					limit = {
						owner = {
							is_subject = yes
							overlord = {
								OR = {
									alliance_with = ROOT
									AND = {
										is_subject = yes
										overlord = {
											alliance_with = ROOT
										}
									}
								}
							}
						}
						is_city = yes
						nhs_appalachian_pathways_province = yes
						NOT = { to_has_appalachian_pathways_modifier = yes }
					}
					save_event_target_as = nhs_appalachian_pathways_et
				}
			}
			clr_country_flag = nhs_appalachian_pathways_cash1m
			clr_country_flag = nhs_appalachian_pathways_cash2m
			clr_country_flag = nhs_appalachian_pathways_admm
			clr_country_flag = nhs_appalachian_pathways_dipm
			clr_country_flag = nhs_appalachian_pathways_milm
			
			clr_country_flag = nhs_appalachian_pathways_cash1
			clr_country_flag = nhs_appalachian_pathways_cash2
			clr_country_flag = nhs_appalachian_pathways_cash3	
			clr_country_flag = nhs_appalachian_pathways_cash4
			clr_country_flag = nhs_appalachian_pathways_large_jewel
			
			random_list = {
				39 = { set_country_flag = nhs_appalachian_pathways_cash1 }
				29 = { set_country_flag = nhs_appalachian_pathways_cash2 }
				14 = { set_country_flag = nhs_appalachian_pathways_cash3 }
				13 = { set_country_flag = nhs_appalachian_pathways_cash4 }
				5 = { set_country_flag = nhs_appalachian_pathways_large_jewel }
			}
			random_list = {
				20 = { set_country_flag = nhs_appalachian_pathways_cash1m }
				20 = { set_country_flag = nhs_appalachian_pathways_cash2m }
				20 = { set_country_flag = nhs_appalachian_pathways_admm }
				20 = { set_country_flag = nhs_appalachian_pathways_dipm }
				20 = { set_country_flag = nhs_appalachian_pathways_milm }
			}
			set_country_flag = enable_bonus
			set_country_flag = enable_malus
			add_country_modifier = {
				name = nhs_timer_pathways
				duration = 365 # 1 year
				hidden = yes
			}
		}
	}
	
	option = {
		name = "nhs2_countryevents.4.a"
		event_target:nhs_appalachian_pathways_et = {
			add_permanent_province_modifier = {
				name = "nhs_appalachian_pathways"
				duration = -1
			}
			# add_base_tax = 1
			add_base_production = 1
		}
		# add_adm_power = 10
		# if = {
		# 	limit = {
		# 		any_neighbor_country = {
		# 			technology_group = north_american
		# 			has_opinion = { who = ROOT value = 100 }
		# 		}
		# 	}
		# 	add_dip_power = 10
		# }

		if = {
			limit = {
				NOT = { has_country_flag = nhs_haudenosaunee_trade_boom_happened }
				960 = {
					owner = {
						primary_culture = iroquois
						historical_friend_with = ROOT
						alliance_with = ROOT
					}
				}
				2557 = {
					OR = {
						to_has_appalachian_pathways_modifier = yes
						event_target:nhs_appalachian_pathways_et = {
							province_id = PREV
						}
					}
				}
				2556 = {
					OR = {
						to_has_appalachian_pathways_modifier = yes
						event_target:nhs_appalachian_pathways_et = {
							province_id = PREV
						}
					}
				}
				2553 = {
					OR = {
						to_has_appalachian_pathways_modifier = yes
						event_target:nhs_appalachian_pathways_et = {
							province_id = PREV
						}
					}
				}
			}
			set_country_flag = nhs_haudenosaunee_trade_boom_happened
			random_country = {
				limit = {
					owns = 960
					primary_culture = iroquois
					historical_friend_with = ROOT
					alliance_with = ROOT
				}
				country_event = {
					id = to_nat_haudenosaunee.11
				}
			}
		}
	}
}

# Work stops couse of Natives
country_event = {
	id = nhs2_countryevents.5
	title = nhs2_countryevents.5.t
	desc = nhs2_countryevents.5.d
	picture = TO_APPALACHIAN_PATH_eventPicture
	
	trigger = {
		has_country_flag = nhs_appalachian_pathways
		NOT = { has_country_flag = nhs_apworkstopped }
		NOT = { has_country_modifier = nhs_timer_pathways }
		NOT = { num_of_cities = 15 }
		any_province = {
			country_or_subject_holds = ROOT
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
		NOT = {
			OR = {
				dip = 5
				any_known_country = {
					OR = {
						technology_group = north_american
						# technology_group = hellenised_american
					}
					has_opinion = { who = ROOT value = 100 }
				}
			}
		}
	}

	mean_time_to_happen = {
		months = 5
	}
	
	immediate = {
		set_country_flag = nhs_apworkstopped
	}

	option = {
		name = "nhs2_countryevents.5.a"
	}
	
}

country_event = {
	id = nhs2_countryevents.6
	title = nhs2_countryevents.6.t
	desc = nhs2_countryevents.6.d
	picture = TO_APPALACHIAN_PATH_eventPicture

	trigger = {
		has_country_flag = nhs_appalachian_pathways
		has_country_flag = nhs_apworkstopped
		NOT = { has_country_modifier = nhs_timer_pathways }
		OR = {
			dip = 5
			any_known_country = {
				OR = {
					technology_group = north_american
					# technology_group = hellenised_american
				}
				has_opinion = { who = ROOT value = 100 }
			}
		}
		NOT = { num_of_cities = 15 }
		any_province = {
			country_or_subject_holds = ROOT
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
	}
	
	mean_time_to_happen = {
		days = 1	
	}
	
	immediate = {
		clr_country_flag = nhs_apworkstopped
	}
	
	option = {
		name = "nhs2_countryevents.6.a"		
	}
}

# pathways through the appalachian mountains, work back on track (cities)
country_event = {
	id = nhs2_countryevents.7
	title = nhs2_countryevents.7.t
	desc = nhs2_countryevents.7.d
	picture = TO_APPALACHIAN_PATH_eventPicture

	trigger = {
		has_country_flag = nhs_appalachian_pathways
		has_country_flag = nhs_apworkstopped
		NOT = { has_country_modifier = nhs_timer_pathways }
		num_of_cities = 15
		any_province = {
			country_or_subject_holds = ROOT
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
	}
	
	mean_time_to_happen = {
		days = 1	
	}
	
	immediate = {
		clr_country_flag = nhs_apworkstopped
	}
	
	option = {
		name = "nhs2_countryevents.7.a"
	}
}

country_event = {
	id = nhs2_countryevents.8
	title = nhs2_countryevents.8.t
	desc = nhs2_countryevents.8.d
	picture = MINE_2_eventPicture

	trigger = {
		NOT = { has_country_flag = nhs_apworkstopped }
		NOT = { has_country_modifier = nhs_timer_pathways }
		has_country_flag = nhs_appalachian_pathways
		has_country_flag = enable_bonus
		any_province = {
			country_or_subject_holds = ROOT
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.75
			stability = 3
		}
		modifier = {
			factor = 0.9
			num_of_cities = 10
		}
		modifier = {
			factor = 0.9
			adm = 4
		}
		modifier = {
			factor = 1.2
			is_at_war = yes
		}	
		modifier = {
			factor = 1.5
			war_exhaustion = 2
		}
		modifier = {
			factor = 5
			war_exhaustion = 5
		}
		modifier = {
			factor = 20
			war_exhaustion = 10
		}		
	}
	
	immediate = {
		clr_country_flag = enable_bonus
	}
	
	
	option = {
		name = "nhs2_countryevents.8.a"
		trigger = {
			OR = {
				has_country_flag = nhs_appalachian_pathways_cash1
				has_country_flag = nhs_appalachian_pathways_cash2
				has_country_flag = nhs_appalachian_pathways_cash3
				has_country_flag = nhs_appalachian_pathways_cash4
			}
		}	
		if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash1
			}
			add_treasury = 50
		}
		else_if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash2
			}
			add_years_of_income = 0.1
			
		}
		else_if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash3
			}
			add_years_of_income = 0.2
			
		}
		else_if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash4
			}
			add_treasury = 100
			
		}
		add_prestige = 5
	}
	
	
	option = {
		name = "nhs2_countryevents.8.b"
		trigger = {
			has_country_flag = nhs_appalachian_pathways_large_jewel
		}
		add_treasury = 300
		add_prestige = 15
	}
	
	after = {
		clr_country_flag = nhs_appalachian_pathways_cash1
		clr_country_flag = nhs_appalachian_pathways_cash2
		clr_country_flag = nhs_appalachian_pathways_cash3	
		clr_country_flag = nhs_appalachian_pathways_cash4
		clr_country_flag = nhs_appalachian_pathways_large_jewel
	}
}

# pathways through the appalachian mountains, incident (malus)
country_event = {
	id = nhs2_countryevents.9
	title = nhs2_countryevents.9.t
	desc = nhs2_countryevents.9.d
	picture = ANGRY_MOB_eventPicture

	trigger = {
		NOT = { has_country_flag = nhs_apworkstopped }
		NOT = { has_country_modifier = nhs_timer_pathways }
		has_country_flag = nhs_appalachian_pathways
		has_country_flag = enable_malus
		any_province = {
			country_or_subject_holds = ROOT
			is_city = yes
			nhs_appalachian_pathways_province = yes
			NOT = { to_has_appalachian_pathways_modifier = yes }
		}
	}
	
	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 0.9
			stability = 1
		}
		modifier = {
			factor = 0.9
			stability = 2
		}
		modifier = {
			factor = 0.75
			stability = 3
		}
		modifier = {
			factor = 0.9
			num_of_cities = 10
		}
		modifier = {
			factor = 0.9
			adm = 4
		}
		modifier = {
			factor = 1.2
			is_at_war = yes
		}	
		modifier = {
			factor = 1.5
			war_exhaustion = 2
		}
		modifier = {
			factor = 5
			war_exhaustion = 5
		}
		modifier = {
			factor = 20
			war_exhaustion = 10
		}		
	}
	
	
	immediate = {
		clr_country_flag = enable_malus
	}
	
	
	option = {
		name = "nhs2_countryevents.9.a"
		trigger = {
			OR = {
				has_country_flag = nhs_appalachian_pathways_cash1m
				has_country_flag = nhs_appalachian_pathways_cash2m
			}
		}
		
		if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash1m
			}
			add_treasury = -50

		}
		else_if = {
			limit = {
				has_country_flag = nhs_appalachian_pathways_cash2m
			}
			add_years_of_income = -0.1	
		}
	}
	
	
	option = {
		name = "nhs2_countryevents.9.b"
		trigger = {
			has_country_flag = nhs_appalachian_pathways_admm
		}
		add_adm_power = -30
	}
	
	
	option = {
		name = "nhs2_countryevents.9.c"
		trigger = {
			has_country_flag = nhs_appalachian_pathways_dipm
		}
		add_dip_power = -30
	}
	
	
	option = {
		name = "nhs2_countryevents.9.e"
		trigger = {
			has_country_flag = nhs_appalachian_pathways_milm
		}
		add_mil_power = -10
		add_manpower = -2
	}
	
	
	option = {
		name = "nhs2_countryevents.9.f"
		custom_tooltip = nhs2_countryevents9_tooltip
		hidden_effect = {
			add_country_modifier = {
				name = nhs_timer_pathways
				duration = 1825 # 5 years
				hidden = yes
			}
		}
	}

	after = {
		clr_country_flag = nhs_appalachian_pathways_cash1m
		clr_country_flag = nhs_appalachian_pathways_cash2m
		clr_country_flag = nhs_appalachian_pathways_admm
		clr_country_flag = nhs_appalachian_pathways_dipm
		clr_country_flag = nhs_appalachian_pathways_milm
	}
	
}

# intro to AM events
country_event = {
	id = nhs2_countryevents.11
	title = nhs2_countryevents.11.t
	desc = nhs2_countryevents.11.d
	picture = TO_ROAD_TO_MOUNTAINS_eventPicture
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		num_of_cities = 6
		NOT = { has_country_flag = nhs_appalachian_pathways_allowed }
		OR = {
			NOT = { has_global_flag = nhs_started_at_bookmark }
			is_year = 1481
		}
	}
	
	mean_time_to_happen = {
		months = 1
	}
	
	option = {
		name = "nhs2_countryevents.11.a"
		custom_tooltip = nhs_enable_appalachian_pathways_decision_tt
		set_country_flag = nhs_appalachian_pathways_allowed
	}
}


###################################################
### IDEA GROUPS SWITCH
###################################################

# Idea Group Choice
country_event = {
	id = nhs2_countryevents.29
	title = nhs2_countryevents.29.t
	desc = nhs2_countryevents.29.d
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = "nhs2_countryevents.29.a"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				any_owned_province = {
					any_neighbor_province = {
						is_empty = yes
					}
				}
			}
			modifier = {
				factor = 2
				is_subject = yes
			}
			modifier = {
				factor = 1.2
				culture_group = byzantine
			}
		}
		remove_idea_group = exploration_ideas
		custom_tooltip = nhs_add_full_development_ideas_tt
		hidden_effect = {
			add_idea_group = development_ideas
			add_idea = never_again_left_behind
		}
	}
	option = {
		name = "nhs2_countryevents.29.b"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				NOT = {
					any_owned_province = {
						any_neighbor_province = {
							is_empty = yes
						}
					}
				}
			}
			modifier = {
				factor = 0.5
				is_subject = yes
			}
		}
		remove_idea_group = exploration_ideas
		custom_tooltip = nhs_add_full_discovery_ideas_tt
		hidden_effect = {
			add_idea_group = discovery_ideas
			# add_idea = prospecting_settlers
			add_idea = adventurers
		}
	}
	option = {
		name = "nhs2_countryevents.29.c"
		ai_chance = {
			factor = 30
			modifier = {
				factor = 1.5
				any_owned_province = {
					any_neighbor_province = {
						owner = {
							OR = {
								technology_group = north_american
								technology_group = mesoamerican
								technology_group = south_american
								technology_group = andean
							}
						}
					}
				}
			}
			modifier = {
				factor = 0
				is_subject = yes
			}
			modifier = {
				factor = 2
				tag = VGD
				is_subject = no
				num_of_cities = 5
			}
		}
		remove_idea_group = exploration_ideas
		custom_tooltip = nhs_add_full_domination_ideas_tt
		hidden_effect = {
			add_idea_group = domination_ideas
			add_idea = spread_our_dominion
		}
	}
	option = {
		name = "nhs2_countryevents.29.e"
		hidden_effect = {
			remove_country_modifier = nhs_idea_swap_cooldown_cd
		}
	}
}

###################################################
### CRETAN INHERITANCE
###################################################

# Kaudan Question
country_event = {
	id = nhs2_countryevents.47
	title = nhs2_countryevents.47.t
	desc = nhs2_countryevents.47.d
	picture = ELYSIAN_HARBOUR_eventPicture

	goto = kretan_colony
	
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		NOT = { has_reform = elysian_empire }
		exists = CM1
		CM1 = {
			is_subject_of = ROOT
		}
		OR = {
			NOT = { mission_completed = to_a_true_nation_mission }
			had_country_flag = { flag = to_completed_a_true_nation_mission days = 10 }
		}
	}

	immediate = {
		hidden_effect = {
			to_nhs_discover_carribean = { TAG = ROOT }
			to_nhs_discover_carribean = { TAG = CM1 }
			CM1 = {
				add_country_modifier = {
					name = nhs_early_uprising_reduction
					duration = 7300
				}
				to_cm1_spawn_carribean_colony = { EVENT_TARGET = kretan_colony }
			}
		}
	}

	option = {
		name = "nhs2_countryevents.47.a"
		ai_chance = {
			factor = 20
			modifier = {
				factor = 2
				ruler_has_personality = conqueror_personality
			}
			modifier = {
				factor = 2
				ruler_has_personality = greedy_personality
			}
			modifier = {
				factor = 0.6
				ruler_has_personality = benevolent_personality
			}
			modifier = {
				factor = 0
				CM1 = { ai = no }
			}
		}
		hidden_effect = {
			if = {
				limit = {
					NOT = { has_country_flag = nhs_europe_discovered_got }
				}
				europe = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				africa = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				asia = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				european_seas_lakes = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				north_atlantic_region = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				mediterrenean_region = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
				west_african_coast_sea_area = {
					every_country = {
						limit = { tag = CM1 }
						undiscover_province = PREV
					}
				}
			}
		}
		inherit = CM1
	}

	option = {
		name = "nhs2_countryevents.47.b"
		ai_chance = {
			factor = 80
			modifier = {
				factor = 2
				ruler_has_personality = benevolent_personality
			}
		}
		set_global_flag = nhs_ctm_allowed_to_exist
		# custom_tooltip = nhs_ctm_starts_colonising_tt
		CM1 = {
			if = {
				limit = {
					NOT = { num_of_colonists = 1 }
				}
				tooltip = {
					add_country_modifier = {
						name = nhs_new_world
						duration = -1
						DESC = "UNTIL_SECOND_COLONIST"
					}
				}
			}
		}
		custom_tooltip = nhs_creta_minor_colonisation_hint_tt
		custom_tooltip = nhs_new_line_tt
		tooltip = {
			if = {
				limit = {
					CM1 = {
						NOT = { has_country_flag = nhs_europe_discovered_got }
					}
				}
				CM1 = {
					custom_tooltip = to_cm1_modify_constrained_resources_tt
				}
				custom_tooltip = nhs_new_line_tt
			}
			else_if = {
				limit = {
					CM1 = {
						has_country_modifier = nhs_constrained_resources
					}
				}
				CM1 = {
					remove_country_modifier = nhs_constrained_resources
				}
			}
			else_if = {
				limit = {
					CM1 = {
						has_country_modifier = nhs_constrained_resources_cm1
					}
				}
				CM1 = {
					remove_country_modifier = nhs_constrained_resources_cm1
				}
			}
		}
		CM1 = {
			country_event = { id = oth_ctm_events.5 }
		}
	}
}

###################################################
### MAINTENANCE EVENTS
###################################################

# Remove modifiers #2
country_event = {
	id = nhs2_countryevents.66
	title = nhs2_hidden.t
	desc = nhs2_hidden.d
	picture = BATTLE_eventPicture
	
	hidden = yes

	trigger = {
		has_dlc = "Emperor"
		OR = {
			mission_completed = to_eternal_empire_mission
			mission_completed = to_eternal_empire_mission_ely
		}
		if = {
			limit = {
				is_hegemon_of_type = economic_hegemon
			}
			OR = {
				has_country_modifier = to_economic_hegemon
				OR = {
					NOT = { has_country_modifier = to_naval_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = naval_hegemon
					}
				}
				OR = {
					NOT = { has_country_modifier = to_military_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = military_hegemon
					}
				}
			}
		}
		else_if = {
			limit = {
				is_hegemon_of_type = naval_hegemon
			}
			OR = {
				has_country_modifier = to_naval_hegemon
				OR = {
					NOT = { has_country_modifier = to_economic_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = economic_hegemon
					}
				}
				OR = {
					NOT = { has_country_modifier = to_military_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = military_hegemon
					}
				}
			}
		}
		else_if = {
			limit = {
				is_hegemon_of_type = military_hegemon
			}
			OR = {
				has_country_modifier = to_military_hegemon
				OR = {
					NOT = { has_country_modifier = to_economic_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = economic_hegemon
					}
				}
				OR = {
					NOT = { has_country_modifier = to_naval_hegemon }
					any_country = {
						NOT = { tag = ROOT }
						is_hegemon_of_type = naval_hegemon
					}
				}
			}
		}
		else = {
			OR = {
				has_country_modifier = to_economic_hegemon
				has_country_modifier = to_naval_hegemon
				has_country_modifier = to_military_hegemon
			}
		}
	}
	
	immediate = {
		if = {
			limit = {
				is_hegemon_of_type = economic_hegemon
			}
			remove_country_modifier = to_economic_hegemon
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = naval_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_naval_hegemon
					duration = -1
				}
			}
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = military_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_military_hegemon
					duration = -1
				}
			}
		}
		else_if = {
			limit = {
				is_hegemon_of_type = naval_hegemon
			}
			remove_country_modifier = to_naval_hegemon
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = economic_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_economic_hegemon
					duration = -1
				}
			}
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = military_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_military_hegemon
					duration = -1
				}
			}
		}
		else_if = {
			limit = {
				is_hegemon_of_type = military_hegemon
			}
			remove_country_modifier = to_military_hegemon
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = economic_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_economic_hegemon
					duration = -1
				}
			}
			if = {
				limit = {
					NOT = {
						any_country = {
							NOT = { tag = ROOT }
							is_hegemon_of_type = naval_hegemon
						}
					}
				}
				add_country_modifier = {
					name = to_naval_hegemon
					duration = -1
				}
			}
		}
		else = {
			remove_country_modifier = to_economic_hegemon
			remove_country_modifier = to_naval_hegemon
			remove_country_modifier = to_military_hegemon
		}
	}

	option = {
		name = "nhs2_hidden.a"
	}
}

###################################################
### SILK EVENTS
###################################################
# Starts the production of Skoros silk
country_event = {
	id = nhs2_countryevents.71
	title = nhs2_countryevents.71.t
	desc = nhs2_countryevents.71.d
	picture = WESTERNISATION_eventPicture
	
	fire_only_once = yes
	is_triggered_only = yes
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_country_modifier = nhs_secrets_silk
	}

	option = {
		name = "nhs2_countryevents.71.a"
		capital_scope = {
			change_trade_goods = skoros_silk
		}
		if = {
			limit = {
				mission_completed = to_the_merchant_class_mission
			}
			custom_tooltip = nhs_new_line_tt
			country_event = { id = nhs2_countryevents.35 days = 720 }
		}
	}
}

# Skoros Silk Trade, triggered by the Merchant Class mission
country_event = {
	id = nhs2_countryevents.35
	title = nhs2_countryevents.35.t
	desc = nhs2_countryevents.35.d
	picture = nat_REFORM_eventPicture
	
	is_triggered_only = yes
	trigger = {
		any_owned_province = {
			trade_goods = skoros_silk
			NOT = { has_province_modifier = to_silk_quarter_early_tm }
		}
	}

	option = {
		name = nhs2_countryevents.35.a
		random_owned_province = {
			limit = {
				trade_goods = skoros_silk
			}
			tooltip = {
				add_province_modifier = {
					name = to_silk_quarter_early
					duration = -1
				}
			}
			hidden_effect = {
				add_province_triggered_modifier = to_silk_quarter_early_tm
			}
		}
	}
}

# Discover clams for Elysian silk if you took the secret
country_event = {
	id = nhs2_countryevents.68
	title = nhs2_countryevents.68.t
	desc = nhs2_countryevents.68.d
	picture = caribbean_arrival_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_country_modifier = nhs_secrets_silk
		dip_tech = 6
		OR = {
			dip_tech = 8
			has_discovered = 1525
			has_discovered = 1503
			has_discovered = 1505
		}
	}
	
	immediate = {
		set_country_flag = nhs_discovered_new_source_of_silk
	}

	option = {
		name = "nhs2_countryevents.68.a"
		if = {
			limit = {
				NOT = { has_discovered = 1525 }
			}
			discover_province = 1525
		}
		if = {
			limit = {
				NOT = { has_discovered = 1503 }
			}
			discover_province = 1503
		}
		if = {
			limit = {
				NOT = { has_discovered = 1505 }
			}
			discover_province = 1505
		}
		if = {
			limit = {
				NOT = { has_discovered = 926 }
			}
			discover_province = 926
		}
		if = {
			limit = {
				NOT = { has_discovered = 2536 }
			}
			discover_province = 2536
		}
		if = {
			limit = {
				NOT = { has_discovered = 482 }
			}
			discover_province = 482
		}
		if = {
			limit = {
				NOT = { has_discovered = 484 }
			}
			discover_province = 484
		}
		if = {
			limit = {
				NOT = { has_discovered = 2656 }
			}
			discover_province = 2656
		}
		if = {
			limit = {
				NOT = { has_discovered = 2654 }
			}
			discover_province = 2654
		}
	}
}

# Elysian silk becomes even more valuable
country_event = {
	id = nhs2_countryevents.32
	title = nhs2_countryevents.32.t
	desc = nhs2_countryevents.32.d
	picture = TRADE_GOODS_PLANTATION_GOODS_IN_WAREHOUSE_eventPicture
	
	major = yes
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		if = {
			limit = {
				has_country_flag = to_elysian_silk_production_mechanic
			}
			has_global_flag = to_elysian_silk_price_increase_4_done
		}
		else = {
			had_global_flag = {
				flag = nhs_elysian_silk_exists
				days = 10950
			}
			OR = {
				elysian_silk = 1
				any_subject_country = {
					elysian_silk = 1
				}
			}
		}
	}
	
	option = {
		name = nhs2_countryevents.32.a
		change_price = {
			trade_goods = elysian_silk
			key = ELYSIAN_SILK_BETTER
			value = 0.50
			duration = -1
		}
		change_price = {
			trade_goods = silk
			key = ELYSIAN_SILK_BETTER
			value = -0.10
			duration = -1
		}
		hidden_effect = {
			change_variable = {
				which = to_elysian_silk_value
				value = 2
			}
		}
	}
}

# Elysian Silk Final Choice
country_event = {
	id = nhs2_countryevents.10
	title = nhs2_countryevents.10.t
	desc = nhs2_countryevents.10.d
	picture = byz_COURT_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = nhs2_countryevents.10.a
		custom_tooltip = nhs2_countryevents.10.a.tt
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = to_modify_silk_quarter_4_5_v2_tt
		hidden_effect = {
            953 = {
                remove_province_triggered_modifier = to_silk_quarter_4_tm
                add_province_triggered_modifier = to_silk_quarter_5_v2_tm
            }
        }
	}

	option = {
		name = nhs2_countryevents.10.b
		custom_tooltip = nhs2_countryevents.10.b.tt
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = to_modify_silk_quarter_4_5_v1_tt
		hidden_effect = {
            953 = {
                remove_province_triggered_modifier = to_silk_quarter_4_tm
                add_province_triggered_modifier = to_silk_quarter_5_v1_tm
            }
        }
	}
	
	option = {
		name = nhs2_countryevents.10.c
		custom_tooltip = nhs2_countryevents.10.c.tt
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = to_modify_silk_quarter_4_5_v3_tt
		hidden_effect = {
            953 = {
                remove_province_triggered_modifier = to_silk_quarter_4_tm
                add_province_triggered_modifier = to_silk_quarter_5_v3_tm
            }
        }
	}
}

# AI silk province assignment
country_event = {
	id = nhs2_countryevents.15
	title = nhs2_countryevents.15.t
	desc = nhs2_countryevents.15.d
	picture = AWESOMECITY_eventPicture
	
	is_triggered_only = yes
	hidden = yes

	trigger = {
		ai = yes
		has_country_flag = to_elysian_silk_production_mechanic
		if = {
			limit = {
				OR = {
					NOT = { has_global_flag = to_elysian_silk_price_increase_5_done }
					NOT = { total_own_and_non_tributary_subject_development = 1000 }    
				}
			}
			NOT = {
				check_variable = {
					which = to_elysian_silk_provinces
					which = to_base_elysian_silk_provinces
				}
			}
		}
		else_if = {
			limit = {
				total_own_and_non_tributary_subject_development = 21000
			}
			NOT = {
				check_variable = {
					which = to_elysian_silk_provinces
					value = 27
				}
			}
		}
		else = {
			to_can_add_additional_silk_province = yes
		}
		any_province = {
			owner = {
				OR = {
					tag = ROOT
					overlord = {
						tag = ROOT
					}
				}
			}
			has_port = yes
			OR = {
				area = florida_area
				area = lucayan_area
				area = cuba_area
				area = east_cuba_area
				area = hispaniola_area
				area = thrace_area
				area = macedonia_area
				area = corsica_sardinia_area
				area = catalonia_area
				area = valencia_area
				area = baleares_area
				area = tunisia_area
			}
			NOT = { province_id = 151 }
		}
	}

	immediate = {
		change_variable = {
			which = to_elysian_silk_provinces
			value = 1
		}
		if = {
			limit = {
				any_owned_province = {
					has_port = yes
					OR = {
						area = florida_area
						area = lucayan_area
						area = cuba_area
						area = east_cuba_area
						area = hispaniola_area
						area = thrace_area
						area = macedonia_area
						area = corsica_sardinia_area
						area = catalonia_area
						area = valencia_area
						area = baleares_area
						area = tunisia_area
					}
					NOT = { province_id = 151 }
				}
			}
			random_owned_province = {
				limit = {
					has_port = yes
					OR = {
						area = florida_area
						area = lucayan_area
						area = cuba_area
						area = east_cuba_area
						area = hispaniola_area
						area = thrace_area
						area = macedonia_area
						area = corsica_sardinia_area
						area = catalonia_area
						area = valencia_area
						area = baleares_area
						area = tunisia_area
					}
					NOT = { province_id = 151 }
				}
				change_trade_goods = elysian_silk
			}
		}
		else = {
			random_province = {
				limit = {
					owner = {
						OR = {
							tag = ROOT
							overlord = {
								tag = ROOT
							}
						}
					}
					has_port = yes
					OR = {
						area = florida_area
						area = lucayan_area
						area = cuba_area
						area = east_cuba_area
						area = hispaniola_area
						area = thrace_area
						area = macedonia_area
						area = corsica_sardinia_area
						area = catalonia_area
						area = valencia_area
						area = baleares_area
						area = tunisia_area
					}
					NOT = { province_id = 151 }
				}
				change_trade_goods = elysian_silk
			}
		}
	}
	
	option = {
		name = nhs2_countryevents.15.c
	}
}

###################################################
### BOOKS EVENTS
###################################################

# Enables Renaissance spread from books
country_event = {
	id = nhs2_countryevents.72
	title = nhs2_countryevents.72.t
	desc = nhs2_countryevents.72.d
	picture = BIG_BOOK_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_country_modifier = nhs_secrets_books
		is_institution_enabled = renaissance
		NOT = { is_institution_enabled = new_world_i }
		NOT = { has_institution = renaissance }
	}

	option = {
		name = "nhs2_countryevents.72.a"
		# The learning and knowledge that we have, is, at the most, but little compared with that of which we are ignorant.
		# Thinking: the talking of the soul with itself.
		# The mind is not a vessel to be filled but a fire to be kindled.
		# If a man neglects education, he walks lame to the end of his life.
		# Books give a soul to the universe, wings to the mind, flight to the imagination, and life to everything.
		if = {
			limit = {
				has_dlc = "Rights of Man"
				OR = {
					has_regency = no
					has_consort_regency = yes
				}
				NOT = { num_of_ruler_traits = { amount = 3 } }
			}
			custom_tooltip = nhs_institution_spread_from_books_tt
			custom_tooltip = nhs_new_line_tt
			random_list = {
				1 = {
					trigger = {
						NOT = { ruler_has_personality = righteous_personality }
					}
					add_ruler_personality = righteous_personality
				}
				1 = {
					trigger = {
						NOT = { ruler_has_personality = just_personality }
					}
					add_ruler_personality = just_personality
				}
				1 = {
					trigger = {
						NOT = { ruler_has_personality = free_thinker_personality }
					}
					add_ruler_personality = free_thinker_personality
				}
				1 = {
					trigger = {
						NOT = { ruler_has_personality = scholar_personality }
					}
					add_ruler_personality = scholar_personality
				}
			}
		}
		else = {
			add_prestige = 5
			custom_tooltip = nhs_institution_spread_from_books_tt
		}
	}
}

###################################################
### VENETIAN EVENTS
###################################################

# Salvaging the fleet -alternate with Venetians
country_event = {
	id = nhs2_countryevents.69
	title = nhs2_countryevents.69.t
	desc = nhs2_countryevents.69.d
	picture = ELYSIAN_HARBOUR_eventPicture

	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		NOT = { has_global_flag = nhs_started_at_bookmark }
	}
	
	immediate = {
		hidden_effect = {
			country_event = { id = nhs2_countryevents.1 days = 183 random = 30 }
			country_event = { id = nhs2_countryevents.24 days = 365 random = 30 }
		}
	}

	option = {
		name = "nhs2_countryevents.69.a"
		highlight = yes
		trigger = {
			custom_trigger_tooltip = {
				tooltip = nhs_has_taken_venetians_shipwrights_tt
				has_country_flag = nhs_new_flight_taken_venetians
			}
		}
		capital_scope = {
			add_base_tax = 1
			add_base_production = 1
		}
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = nhs_dotted_line_tt
		add_sailors = 1000
		add_country_modifier = {
			name = nhs2_kept_the_ships
			duration = 18250
		}
		set_country_flag = to_ab_no_recruit_penalty
		if = {
			limit = {
				has_dlc = "Golden Century"
			}
			custom_tooltip = nhs_starting_flagship_fixed_tt
			hidden_effect = {
				set_country_flag = nhs_first_flagship
				set_country_flag = nhs_first_flagship_fixed
				capital_scope = {
					if = {
						limit = {
							any_province = {
								heavy_ships_in_province = ROOT
							}
						}
						random_province = {
							limit = {
								heavy_ships_in_province = ROOT
							}
							kill_units = {
								who = ROOT
								type = heavy_ship
								amount = 1
							}
						}
					}
					else_if = {
						limit = {
							any_province = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
						}
						random_province = {
							limit = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
							sea_zone = {
								kill_units = {
									who = ROOT
									type = heavy_ship
									amount = 1
								}
							}
						}
					}
					953 = {
						create_flagship = {	
							name = "Aghia Theotoke"
							type = heavy_ship
						}
					}
				}
				clr_country_flag = nhs_first_flagship
				clr_country_flag = nhs_first_flagship_fixed
			}
		}
		else = {
			capital_scope = {
				heavy_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 1 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 2 } }
			}
			capital_scope = {
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 2 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 3 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 3 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 4 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 4 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 5 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 5 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 6 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		clr_country_flag = to_ab_no_recruit_penalty
	}
	option = {
		name = "nhs2_countryevents.69.b"
		highlight = yes
		trigger = {
			custom_trigger_tooltip = {
				tooltip = nhs_has_taken_venetians_shipwrights_tt
				has_country_flag = nhs_new_flight_taken_venetians
			}
			hidden_trigger = {
				capital_scope = {
					num_free_building_slots = 1
					NOT = {	has_building = fort_15th }
				}
			}
		}
		add_mil_power = 15
		set_country_flag = to_ab_no_building_penalty
		capital_scope = {
			add_building = fort_15th
			add_province_modifier = {
				name = to_wooden_fortifications
				duration = 18250
			}
		}
		clr_country_flag = to_ab_no_building_penalty
		custom_tooltip = nhs_dotted_line_tt
		add_sailors = 1000
		add_country_modifier = {
			name = nhs2_kept_the_ships
			duration = 18250
		}
		set_country_flag = to_ab_no_recruit_penalty
		if = {
			limit = {
				has_dlc = "Golden Century"
			}
			custom_tooltip = nhs_starting_flagship_fixed_tt
			hidden_effect = {
				set_country_flag = nhs_first_flagship
				set_country_flag = nhs_first_flagship_fixed
				capital_scope = {
					if = {
						limit = {
							any_province = {
								heavy_ships_in_province = ROOT
							}
						}
						random_province = {
							limit = {
								heavy_ships_in_province = ROOT
							}
							kill_units = {
								who = ROOT
								type = heavy_ship
								amount = 1
							}
						}
					}
					else_if = {
						limit = {
							any_province = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
						}
						random_province = {
							limit = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
							sea_zone = {
								kill_units = {
									who = ROOT
									type = heavy_ship
									amount = 1
								}
							}
						}
					}
					953 = {
						create_flagship = {	
							name = "Aghia Theotoke"
							type = heavy_ship
						}
					}
				}
				clr_country_flag = nhs_first_flagship
				clr_country_flag = nhs_first_flagship_fixed
			}
		}
		else = {
			capital_scope = {
				heavy_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 1 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 2 } }
			}
			capital_scope = {
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 2 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 3 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 3 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 4 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 4 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 5 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 5 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 6 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		clr_country_flag = to_ab_no_recruit_penalty
	}
	
	option = {
		name = "nhs2_countryevents.69.c"
		highlight = yes
		trigger = {
			custom_trigger_tooltip = {
				tooltip = nhs_has_taken_venetians_shipwrights_tt
				has_country_flag = nhs_new_flight_taken_venetians
			}
		}
		if = {
			limit = {
				any_owned_province = {
					is_colony = yes
				}
			}
			random_owned_province = {
				limit = {
					is_colony = yes
				}
				add_colonysize = 200
				add_base_tax = 1
				add_base_production = 1
			}
		}
		else = {
			random_owned_province = {
				limit = {
					any_empty_neighbor_province = {
						nhs_homelands_no_capital = yes
					}
				}
				random_empty_neighbor_province = {
					create_colony = 200
					add_base_tax = 1
					add_base_production = 1
				}
			}
		}
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = nhs_dotted_line_tt
		add_sailors = 1000
		add_country_modifier = {
			name = nhs2_kept_the_ships
			duration = 18250
		}
		set_country_flag = to_ab_no_recruit_penalty
		if = {
			limit = {
				has_dlc = "Golden Century"
			}
			custom_tooltip = nhs_starting_flagship_fixed_tt
			hidden_effect = {
				set_country_flag = nhs_first_flagship
				set_country_flag = nhs_first_flagship_fixed
				capital_scope = {
					if = {
						limit = {
							any_province = {
								heavy_ships_in_province = ROOT
							}
						}
						random_province = {
							limit = {
								heavy_ships_in_province = ROOT
							}
							kill_units = {
								who = ROOT
								type = heavy_ship
								amount = 1
							}
						}
					}
					else_if = {
						limit = {
							any_province = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
						}
						random_province = {
							limit = {
								sea_zone = {
									heavy_ships_in_province = ROOT
								}
							}
							sea_zone = {
								kill_units = {
									who = ROOT
									type = heavy_ship
									amount = 1
								}
							}
						}
					}
					953 = {
						create_flagship = {	
							name = "Aghia Theotoke"
							type = heavy_ship
						}
					}
				}
				clr_country_flag = nhs_first_flagship
				clr_country_flag = nhs_first_flagship_fixed
			}
		}
		else = {
			capital_scope = {
				heavy_ship = NHS
			}
		}
		if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 1 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 2 } }
			}
			capital_scope = {
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 2 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 3 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 3 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 4 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 4 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 5 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 5 }
				NOT = { check_variable = { which = nhs_num_of_light_ships value = 6 } }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		else_if = {
			limit = {
				check_variable = { which = nhs_num_of_light_ships value = 6 }
			}
			capital_scope = {
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
				light_ship = NHS
			}
		}
		clr_country_flag = to_ab_no_recruit_penalty
	}
}

# Establishment of Venetian Guild
country_event = {
	id = nhs2_countryevents.73
	title = nhs2_countryevents.73.t
	desc = {
		trigger = {
			has_country_flag = nhs_new_flight_sold_morea_to_venice
		}
		desc = nhs2_countryevents.73.da
	}
	desc = {
		trigger = {
			NOT = { has_country_flag = nhs_new_flight_sold_morea_to_venice }
		}
		desc = nhs2_countryevents.73.db
	}
	desc = nhs2_countryevents.73.d
	picture = nhs_ADVISOR_eventPicture

	is_triggered_only = yes
	fire_only_once = yes
	
	trigger = {
		has_country_flag = nhs_new_flight_taken_venetians
	}

	option = {
		name = "nhs2_countryevents.73.a"
		if = {
			limit = {
				has_country_flag = nhs_new_flight_sold_morea_to_venice
			}
			custom_tooltip = nhs_enables_venetian_guild_delfino_tt
		}
		else = {
			custom_tooltip = nhs_enables_venetian_guild_gabriele_tt
		}
		custom_tooltip = nhs_merchant_estate_improvements_indebted_tt
		custom_tooltip = nhs_merchant_estate_improvements_admirality_tt
		if = {
			limit = {
				has_dlc = "Emperor"
			}
			custom_tooltip = nhs_merchant_estate_improvements_monetary_policy_tt
		}
		custom_tooltip = nhs_merchant_estate_improvements_other_tt
		if = {
			limit = {
				has_dlc = "Res Publica"
			}
			custom_tooltip = nhs_merchant_estate_improvements_trade_posts_tt
		}
		# custom_tooltip = nhs_new_line_tt
		# if = {
		# 	limit = {
		# 		capital_scope = {
		# 			NOT = { has_building = marketplace }
		# 		}
		# 	}
		# 	if = {
		# 		limit = {
		# 			capital_scope = {
		# 				has_construction = marketplace
		# 			}
		# 		}
		# 		add_treasury = 100
		# 	}
		# 	capital_scope = {
		# 		add_building = marketplace
		# 	}
		# }
		# else = {
		# 	add_treasury = 100
		# }
		set_country_flag = nhs_enable_venetian_merchant_estate
		set_country_flag = nhs_setting_guilds_land
		hidden_effect = {
			if = {
				limit = {
					any_country = {
						exists = yes
						ai = yes
					}
				}
				random_country = {
					limit = {
						ai = yes
					}
					country_event = { id = nhs2_countryevents.1001 days = 0 }
				}
			}
			else = {
				country_event = { id = nhs2_countryevents.1001 days = 1 }
			}
		}
	}
}

# Sets merchants land
country_event = {
	id = nhs2_countryevents.1001
	title = nhs2_hidden.t
	desc = nhs2_hidden.d
	picture = RELIGION_eventPicture

	is_triggered_only = yes
	hidden = yes

	immediate = {
		FROM = {
			if = {
				limit = {
					has_country_flag = nhs_setting_guilds_land
					has_estate = estate_burghers
				}
				clr_country_flag = nhs_setting_guilds_land
				change_estate_land_share = {
					estate = estate_burghers
					share = -100
				}
				change_estate_land_share = {
					estate = estate_burghers
					share = 5
				}
				if = {
					limit = {
						check_variable = {
							which = to_reduce_starting_loyalty_estate_burghers
							value = 1
						}
					}
					for_variable_amount = {
						variable = to_reduce_starting_loyalty_estate_burghers
						effect = "
						add_estate_loyalty = {
							estate = estate_burghers
							loyalty = -10
						}"
					}
				}
			}	
		}
	}

	option = {
		FROM = {
			if = {
				limit = {
					has_country_flag = nhs_setting_guilds_land
					has_estate = estate_burghers
				}
				clr_country_flag = nhs_setting_guilds_land
				change_estate_land_share = {
					estate = estate_burghers
					share = -100
				}
				change_estate_land_share = {
					estate = estate_burghers
					share = 5
				}
				if = {
					limit = {
						check_variable = {
							which = to_reduce_starting_loyalty_estate_burghers
							value = 1
						}
					}
					for_variable_amount = {
						variable = to_reduce_starting_loyalty_estate_burghers
						effect = "
						add_estate_loyalty = {
							estate = estate_burghers
							loyalty = -10
						}"
					}
				}
			}	
		}
	}
}

###################################################
### WINTER EVENTS
###################################################

# Great Winter of 1445
country_event = {
	id = nhs2_countryevents.75
	title = nhs2_countryevents.75.t
	desc = nhs2_countryevents.75.d
	picture = FAMINE_eventPicture

	fire_only_once = yes
	
	trigger = {
		nhs_check_all_elysian_tags = { CONDITION = tag }
		has_country_flag = nhs_colonial_troubles_major
		is_year = 1445
		OR = {
			is_month = 11
			is_year = 1446
		}
		NOT = { is_year = 1450 }
	}

	immediate = {
		hidden_effect = {
			clr_country_flag = nhs_colonial_troubles_major
			if = {
				limit = {
					OR = {
						has_country_modifier = nhs_lots_of_ppl1
						has_country_modifier = nhs_lots_of_ppl1_halved
					}
				}
				remove_country_modifier = nhs_lots_of_ppl1
				remove_country_modifier = nhs_lots_of_ppl1_halved
				add_country_modifier = {
					name = nhs_lots_of_ppl1_winter
					duration = -1
				}
			}
			else_if = {
				limit = {
					OR = {
						has_country_modifier = nhs_lots_of_ppl2
						has_country_modifier = nhs_lots_of_ppl2_halved
					}
				}
				remove_country_modifier = nhs_lots_of_ppl2
				remove_country_modifier = nhs_lots_of_ppl2_halved
				add_country_modifier = {
					name = nhs_lots_of_ppl2_winter
					duration = -1
				}
			}
			else_if = {
				limit = {
					OR = {
						has_country_modifier = nhs_lots_of_ppl3
						has_country_modifier = nhs_lots_of_ppl3_halved
					}
				}
				remove_country_modifier = nhs_lots_of_ppl3
				remove_country_modifier = nhs_lots_of_ppl3_halved
				add_country_modifier = {
					name = nhs_lots_of_ppl3_winter
					duration = -1
				}
			}
		}
	}

	option = {
		name = "nhs2_countryevents.75.a"
		if = {
			limit = {
				has_country_flag = nhs_new_flightevents_lose_stats_storm
				has_heir = yes
			}
			custom_tooltip = to_flightevents_lose_stats_storm_heir_tt
			change_heir_adm = -1
			change_heir_dip = -1
			clr_country_flag = nhs_new_flightevents_lose_stats_storm
			custom_tooltip = nhs_new_line_tt
		}
		kill_ruler = yes
		add_stability = -2
		add_government_power = {
			mechanic_type = to_administrative_burden_mechanic
			power_type = to_administrative_burden
			value = 20
		}
		custom_tooltip = nhs_new_line_tt
		custom_tooltip = nhs_reduce_colonisation_bonus_tt
		custom_tooltip = nhs_new_line_tt
		if = {
			limit = {
				NOT = { mission_completed = to_secure_the_bay_mission }
			}
			if = {
				limit = {
					has_country_modifier = nhs2_colonial_needs_2
				}
				custom_tooltip = nhs_replace_cn2_with_breakdown_tt
				custom_tooltip = nhs_new_line_tt
				hidden_effect = {
					remove_country_modifier = nhs2_colonial_needs_2
					add_country_modifier = {
						name = nhs2_breakdown_of_society
						duration = -1
					}
				}
			}
			else = {
				add_country_modifier = {
					name = nhs2_breakdown_of_society
					duration = -1
				}
			}
		}
		add_country_modifier = {
			name = nhs2_colony_colapse
			duration = 730
		}
		hidden_effect = {
			country_event = { id = nhs2_countryevents.76 days = 45 }
		}
	}
}

# First Thanksgiving
country_event = {
	id = nhs2_countryevents.76
	title = nhs2_countryevents.76.t
	desc = nhs2_countryevents.76.d
	picture = nat_GOOD_WITH_MONARCH_eventPicture

	fire_only_once = yes
	is_triggered_only = yes
	
	trigger = {
		# If none of those are true for some reason you are just screwed
		any_country = {
			NOT = { tag = POW }
			technology_group = north_american
			capital_scope = {
				OR = {
					area = chesapeake_area
					area = carolinas_area
					area = piedmont_north_america_area
					area = great_valley_area
					area = susquehanna_area
					area = delaware_valley_area
					area = hudson_valley_area
				}
			}
			NOT = { war_with = ROOT }
		}
	}
	
	immediate = {
		hidden_effect = {
			if = {
				limit = {
					exists = PIA
					NOT = { war_with = PIA }
				}
				PIA = {
					save_event_target_as = nhs_helpers_in_need_et
				}
			}
			else_if = {
				limit = {
					exists = LEN
					NOT = { war_with = LEN }
				}
				LEN = {
					save_event_target_as = nhs_helpers_in_need_et
				}
			}
			else_if = {
				limit = {
					exists = SUS
					NOT = { war_with = SUS }
				}
				SUS = {
					save_event_target_as = nhs_helpers_in_need_et
				}
			}
			else_if = {
				limit = {
					any_known_country = {
						NOT = { tag = POW }
						technology_group = north_american
						NOT = { war_with = ROOT }
					}
				}
				random_known_country = {
					limit = {
						NOT = { tag = POW }
						technology_group = north_american
						NOT = { war_with = ROOT }
					}
					save_event_target_as = nhs_helpers_in_need_et
				}
			}
			else_if = {
				limit = {
					any_country = {
						NOT = { tag = POW }
						technology_group = north_american
						capital_scope = {
							OR = {
								area = chesapeake_area
								area = carolinas_area
								area = piedmont_north_america_area
								area = great_valley_area
								area = susquehanna_area
								area = delaware_valley_area
								area = hudson_valley_area
							}
						}
						NOT = { war_with = ROOT }
					}
				}
				random_country = {
					limit = {
						NOT = { tag = POW }
						technology_group = north_american
						capital_scope = {
							OR = {
								area = chesapeake_area
								area = carolinas_area
								area = piedmont_north_america_area
								area = great_valley_area
								area = susquehanna_area
								area = delaware_valley_area
								area = hudson_valley_area
							}
						}
						NOT = { war_with = ROOT }
					}
					save_event_target_as = nhs_helpers_in_need_et
				}
			}
			event_target:nhs_helpers_in_need_et = {
				if = {
					limit = {
						is_rival = ROOT
					}
					force_remove_rival = ROOT
				}
			}
		}
	}

	option = {
		name = "nhs2_countryevents.76.a"
		add_stability = 1
		add_prestige = -30
		remove_country_modifier = nhs2_colony_colapse
		if = {
			limit = {
				is_rival = event_target:nhs_helpers_in_need_et
			}
			remove_rival = event_target:nhs_helpers_in_need_et
		}
		event_target:nhs_helpers_in_need_et = {
			add_opinion = {
				who = ROOT
				modifier = nhs_helped_in_need
			}
			add_historical_friend = ROOT
			reverse_add_opinion = {
				who = ROOT
				modifier = nhs_been_helped_in_need
			}
			# hidden_effect = {
				ROOT = {
					add_historical_friend = PREV
				}
			# }
		}
		custom_tooltip = nhs_nothing_stopping_from_breaking_treaty_tt
	}
}