namespace = FEE_Hungary_Events
#Jay DoubleU

# Bohemian Raids
country_event = {
	id = FEE_Hungary_Events.1
	title = FEE_Hungary_Events.1.T
	desc = FEE_Hungary_Events.1.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HAB
		is_year = 1466
		exists = BOH
		BOH = {
			is_free_or_tributary_trigger = yes
			has_ruler_modifier = fee_boh_infertility
		}
	}

	mean_time_to_happen = {
		months = 120
		modifier = {
			factor = 2
			is_at_war = yes
		}
		modifier = {
			factor = 0.50
			is_at_war = no
		}
		modifier = {
			factor = 0.25
			NOT = {
				OR = {
					BOH = {
						truce_with = HUN
					}
					HUN = {
						truce_with = BOH
					}
				}
			}
		}
	}

	immediate = {
		hidden_effect = {
			every_owned_province = {
				limit = {
					any_neighbor_province = {
						owner = {
							tag = BOH
						}
					}
				}
				add_devastation = 15
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.1.OPT1
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				NOT = {
					is_at_war = yes
				}
			}
		}

		add_stability = -1
		every_owned_province = {
			limit = {
				any_neighbor_province = {
					owner = {
						tag = BOH
					}
				}
			}
			add_base_tax = -1
			add_base_production = -1
			add_base_manpower = -1
		}
	}

	option = {
		name = FEE_Hungary_Events.1.OPT2
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				is_at_war = yes
			}
		}

		custom_tooltip = fee_hun_austria_demands_reparations_tt
		tooltip = {
			HAB = {
				add_casus_belli = {
					target = BOH
					type = cb_border_war
					months = 12
				}
			}
		}
		BOH = {
			country_event = {
				id = FEE_Hungary_Events.2
				days = 30
			}
		}
		custom_tooltip = fee_hun_austria_calls_for_aid_tt
	}
}

# Austrian Reparations
country_event = {
	id = FEE_Hungary_Events.2
	title = FEE_Hungary_Events.2.T
	desc = FEE_Hungary_Events.2.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.2.OPT1
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				is_at_war = no
			}
		}

		add_treasury = -250
		tooltip = {
			HAB = {
				add_treasury = 250
			}
		}
		HAB = {
			country_event = {
				id = FEE_Hungary_Events.3
				days = 30
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.2.OPT2
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				is_at_war = yes
			}
		}

		HAB = {
			declare_war_with_cb = {
				who = BOH
				casus_belli = cb_liberation
			}
		}
		if = {
			limit = {
				HUN = {
					is_free_or_tributary_trigger = yes
				}
			}
			HUN = {
				country_event = {
					id = FEE_Hungary_Events.4
					days = 30
				}
			}
			HAB = {
				set_country_flag = fee_hun_promised_hungary_bag_of_gold
			}
		}
		custom_tooltip = fee_hun_catholic_sympathizers_tt
	}
}

# Bohemia The Just
country_event = {
	id = FEE_Hungary_Events.3
	title = FEE_Hungary_Events.3.T
	desc = FEE_Hungary_Events.3.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.3.OPT1

		add_treasury = 250
		tooltip = {
			BOH = {
				add_treasury = -250
			}
		}
	}
}

# Crusade of Prague
country_event = {
	id = FEE_Hungary_Events.4
	title = FEE_Hungary_Events.4.T
	desc = FEE_Hungary_Events.4.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.4.OPT1
		ai_chance = {
			factor = 5
			modifier = {
				factor = 0
				is_at_war = yes
			}
		}

		HUN = {
			join_all_offensive_wars_of = HAB
		}
		custom_tooltip = fee_hun_and_hungary_will_answer_tt
		hidden_effect = {
			country_event = {
				id = FEE_Hungary_Events.5
				days = 60
			}
		}
	}
	option = {
		name = FEE_Hungary_Events.4.OPT2
		ai_chance = {
			factor = 1
			modifier = {
				factor = 0
				is_at_war = no
			}
		}

		add_legitimacy_equivalent = { amount = -10 republican_tradition = -5 }
		add_prestige = -15
	}
}

# Papal Subsidies
country_event = {
	id = FEE_Hungary_Events.5
	title = FEE_Hungary_Events.5.T
	desc = FEE_Hungary_Events.5.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.5.OPT1

		add_ruler_modifier = {
			name = fee_hun_papal_subsidies #+24 yearly income
			duration = 3650
		}
	}
}

# King of Bohemia
country_event = {
	id = FEE_Hungary_Events.6
	title = FEE_Hungary_Events.6.T
	desc = FEE_Hungary_Events.6.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.6.OPT1
		ai_chance = {
			factor = 1
		}

		white_peace = BOH
		if = {
			limit = {
				SIL = {
					is_free_or_tributary_trigger = yes
					ai = yes
				}
			}
			vassalize = SIL
		}
		if = {
			limit = {
				SOR = {
					is_free_or_tributary_trigger = yes
					ai = yes
				}
			}
			vassalize = SOR
		}
		if = {
			limit = {
				MVA = {
					is_free_or_tributary_trigger = yes
					ai = yes
				}
			}
			vassalize = MVA
		}
		add_ruler_modifier = {
			name = fee_hun_elected_king_bohemia
			duration = -1
		}
		if = {
			limit = {
				exists = HUN
				HUN = { valid_for_personal_unions_trigger = yes }
				BOH = { valid_for_personal_unions_trigger = yes }
			}
			HUN = {
				add_casus_belli = {
					target = BOH
					type = cb_restore_personal_union
					months = 9125
				}
			}
		}
		if = {
			limit = {
				exists = HAB
			}
			HAB = {
				country_event = {
					id = FEE_Hungary_Events.7
					days = 30
				}
			}
		}
		silesia_area = {
			limit = {
				owner = {
					OR = {
						tag = BOH
						overlord = {
							tag = BOH
						}
					}
				}
			}
			cede_province = SIL
			add_core = SIL
		}
		lusatia_area = {
			limit = {
				owner = {
					OR = {
						tag = BOH
						overlord = {
							tag = BOH
						}
					}
				}
			}
			add_core = SOR
			cede_province = SOR
		}
		moravia_area = {
			limit = {
				owner = {
					OR = {
						tag = BOH
						overlord = {
							tag = BOH
						}
					}
				}
			}
			add_core = MVA
			cede_province = MVA
		}
	}

	option = {
		name = FEE_Hungary_Events.6.OPT2
		ai_chance = {
			factor = 0
		}

		add_prestige_or_monarch_power = { amount = 10 }
	}
}

# King of Bohemia
country_event = {
	id = FEE_Hungary_Events.7
	title = FEE_Hungary_Events.7.T
	desc = FEE_Hungary_Events.7.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.7.OPT1
		ai_chance = {
			factor = 1
		}

		white_peace = BOH
	}

	option = {
		name = FEE_Hungary_Events.7.OPT2
		ai_chance = {
			factor = 0
		}

		add_prestige_or_monarch_power = { amount = 5 }
	}
}

# Austrian Gold
country_event = {
	id = FEE_Hungary_Events.8
	title = FEE_Hungary_Events.8.T
	desc = FEE_Hungary_Events.8.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		HAB = { has_country_flag = fee_hun_promised_hungary_bag_of_gold }
		is_at_war = no
		had_recent_war = 5
	}

	mean_time_to_happen = {
		days = 120
	}

	immediate = {
		hidden_effect = {
			HAB = {
				clr_country_flag = fee_hun_promised_hungary_bag_of_gold
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.8.OPT1
		ai_chance = {
			factor = 1
		}

		HAB = {
			country_event = {
				id = FEE_Hungary_Events.9
				days = 30
			}
		}
	}
	option = {
		name = FEE_Hungary_Events.8.OPT2
		ai_chance = {
			factor = 1
		}

		change_religious_influence_equivalent_fee = { add = 10 }
	}
}

# Austrian Gold
country_event = {
	id = FEE_Hungary_Events.9
	title = FEE_Hungary_Events.9.T
	desc = FEE_Hungary_Events.9.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.9.OPT1
		ai_chance = {
			factor = 2
			modifier = {
				factor = 0.25
				is_at_war = yes
			}
			modifier = {
				factor = 2
				current_income_balance = 1
			}
			modifier = {
				factor = 10
				current_income_balance = 5
			}
			modifier = {
				factor = 5
				NOT = {
					num_of_loans = 1
				}
			}
		}

		add_treasury = -500
		tooltip = {
			HUN = {
				add_treasury = 500
			}
		}
		hidden_effect = {
			HUN = {
				country_event = {
					id = FEE_Hungary_Events.10
					days = 30
				}
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.9.OPT2
		ai_chance = {
			factor = 1
		}

		HUN = {
			country_event = {
				id = FEE_Hungary_Events.11
				days = 30
			}
		}
	}
}

# Austrian Payments
country_event = {
	id = FEE_Hungary_Events.10
	title = FEE_Hungary_Events.10.T
	desc = FEE_Hungary_Events.10.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.10.OPT1

		add_treasury = 500
	}
}

# Austrian Betrayal
country_event = {
	id = FEE_Hungary_Events.11
	title = FEE_Hungary_Events.11.T
	desc = FEE_Hungary_Events.11.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	option = {
		name = FEE_Hungary_Events.11.OPT1

		add_casus_belli = {
			target = HAB
			type = cb_loan_cancelled
			months = 120
		}
	}
	option = {
		name = FEE_Hungary_Events.11.OPT2

		add_prestige = -10
	}
}

# Diet of 1468
country_event = {
	id = FEE_Hungary_Events.12
	title = FEE_Hungary_Events.12.T
	desc = FEE_Hungary_Events.12.D
	picture = ELECTION_REPUBLICAN_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		offensive_war_with = BOH
		NOT = { is_year = 1490 }
		dynasty = "Hunyadi"
	}

	option = {
		name = FEE_Hungary_Events.12.OPT1

		add_country_modifier = {
			name = fee_hun_royal_prerogative
			duration = 3650
		}
	}
}

# The Extraordinary Tax
country_event = {
	id = FEE_Hungary_Events.13
	title = FEE_Hungary_Events.13.T
	desc = FEE_Hungary_Events.13.D
	picture = ELECTION_REPUBLICAN_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		offensive_war_with = BOH
		NOT = { is_year = 1490 }
		dynasty = "Hunyadi"
		has_country_modifier = fee_hun_royal_prerogative
	}

	mean_time_to_happen = {
		days = 730
	}

	option = {
		name = FEE_Hungary_Events.13.OPT1

		add_country_modifier = {
			name = fee_hun_taxes_without_diet
			duration = 3650
		}
		if = {
			limit = {
				has_estate = estate_church
			}
			add_estate_loyalty = {
				estate = estate_church
				loyalty = -5
			}
		}
		else = {
			add_adm_power = -50
		}
		if = {
			limit = {
				has_estate = estate_burghers
			}
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = -5
			}
		}
		else = {
			add_dip_power = -50
		}
		if = {
			limit = {
				has_estate = estate_nobles
			}
			add_estate_loyalty = {
				estate = estate_nobles
				loyalty = -5
			}
		}
		else = {
			add_mil_power = -50
		}
	}

	option = {
		name = FEE_Hungary_Events.13.OPT2

		add_legitimacy_equivalent = { amount = 5 republican_tradition = 3 }
	}
}

# Diet of 1470"
country_event = {
	id = FEE_Hungary_Events.14
	title = FEE_Hungary_Events.14.T
	desc = FEE_Hungary_Events.14.D
	picture = ELECTION_REPUBLICAN_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		has_country_modifier = fee_hun_royal_prerogative
		has_country_modifier = fee_hun_taxes_without_diet
	}

	mean_time_to_happen = {
		days = 365
	}

	option = {
		name = FEE_Hungary_Events.14.OPT1
		trigger = {
			OR = {
				dynasty = "Hunyadi"
				MIL = 6
			}
		}
		highlight = yes

		add_stability_or_adm_power = yes
		if = {
			limit = {
				exists = POL
				POL = { valid_for_personal_unions_trigger = yes}
			}
			POL = {
				add_casus_belli = {
					target = ROOT
					type = cb_restore_personal_union
					months = 9125
				}
			}
		}
		else_if = {
			limit = {
				exists = PLC
				PLC = { valid_for_personal_unions_trigger = yes}
			}
			PLC = {
				add_casus_belli = {
					target = ROOT
					type = cb_restore_personal_union
					months = 9125
				}
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.14.OPT2
		trigger = {
			NOT = {
				OR = {
					dynasty = "Hunyadi"
					mil = 6
				}
			}
		}
		highlight = yes

		random_owned_province = {
			limit = { culture = hungarian }
			spawn_rebels = {
				size = 2
				type = noble_rebels
			}
		}
		random_owned_province = {
			limit = { culture = hungarian }
			spawn_rebels = {
				size = 3
				type = noble_rebels
			}
		}
	}
}

# Uprising of the Catholic Estates
country_event = {
	id = FEE_Hungary_Events.15
	title = FEE_Hungary_Events.15.T
	desc = FEE_Hungary_Events.15.D
	picture = CITY_VIEW_eventPicture

	trigger = {
		tag = BOH
		has_ruler_modifier = fee_boh_infertility
		HUN = {
			has_ruler_flag = fee_hungary_matyas_reign
			is_free_or_tributary_trigger = yes
		}
		is_in_war = {
			attacker_leader = HAB
			attackers = HUN
			defender_leader = BOH
			duration = 1
		}
		NOT = { is_year = 1500 }
		calc_true_if = {
			all_province = {
				area = silesia_area
				owner = {
					OR = {
						tag = BOH
						overlord = {
							tag = BOH
						}
					}
				}
			}
			amount = 4
		}
		silesia_area = {
			owner = {
				OR = {
					tag = BOH
					overlord = {
						tag = BOH
					}
				}
			}
			controller = {
				OR = {
					tag = HUN
					tag = HAB
					any_ally = {
						OR = {
							tag = HUN
							tag = HAB
						}
					}
				}
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.15.OPT1
		ai_chance = {
			factor = 0
		}

		add_stability = -2
		random_owned_province = {
			spawn_rebels = {
				type = catholic_rebels
				size = 2
				friend = HUN
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = catholic_rebels
				size = 3
				friend = HUN
			}
		}
	}
	option = {
		name = FEE_Hungary_Events.15.OPT2
		ai_chance = {
			factor = 1
		}

		custom_tooltip = fee_hun_revolt_of_the_estates_tt
		HUN = {
			country_event = {
				id = FEE_Hungary_Events.6
			}
		}
	}
}

# Union of Three Nations
country_event = {
	id = FEE_Hungary_Events.16
	title = FEE_Hungary_Events.16.T
	desc = FEE_Hungary_Events.16.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		NOT = { has_country_flag = fee_hun_union_nations_flag }
	}

	mean_time_to_happen = {
		months = 12
	}

	immediate = {
		hidden_effect = {
			set_country_flag = fee_hun_union_nations_flag
		}
	}

	option = {
		name = FEE_Hungary_Events.16.OPT1

		transylvania_area = {
			add_province_modifier = {
				name = fee_hun_union_trium_nationum
				duration = -1
			}
		}
		southern_transylvania_area = {
			add_province_modifier = {
				name = fee_hun_union_trium_nationum
				duration = -1
			}
		}
	}
}

# Crush the Estates
country_event = {
	id = FEE_Hungary_Events.17
	title = FEE_Hungary_Events.17.T
	desc = FEE_Hungary_Events.17.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		is_year = 1467
		any_owned_province = {
			has_province_modifier = fee_hun_union_trium_nationum
		}
	}

	mean_time_to_happen = {
		days = 30
		modifier = {
			factor = 0.1
			is_year = 1468
		}
	}

	option = {
		name = FEE_Hungary_Events.17.OPT1

		random_list = {
			50 = {
				random_owned_province = {
					limit = {
						has_province_modifier = fee_hun_union_trium_nationum
					}
					spawn_rebels = {
						size = 2
						type = anti_tax_rebels
					}
				}
				random_owned_province = {
					limit = {
						has_province_modifier = fee_hun_union_trium_nationum
					}
					spawn_rebels = {
						size = 1
						type = anti_tax_rebels
					}
				}
				set_country_flag = CE_fought_union_of_nations
			}
			50 = {
				country_event = {
					id = FEE_Hungary_Events.18
					days = 30
				}
			}
		}
		# if = {
			# limit = {
				# NOT = {
					# has_opinion = {
						# who = MOL
						# value = 0
					# }
				# }
			# }
			# random_owned_province = {
				# limit = {
					# has_province_modifier = fee_hun_union_trium_nationum
				# }
				# spawn_rebels = {
					# size = 1
					# type = anti_tax_rebels
					# friend = MOL
				# }
			# }
		# }
	}

	option = {
		name = FEE_Hungary_Events.17.OPT2

		if = {
			limit = {
				has_estate = estate_nobles
			}
			change_estate_land_share = {
				estate = estate_nobles
				share = 2.5
			}
		}
		every_owned_province = {
			limit = {
				has_province_modifier = fee_hun_union_trium_nationum
			}
			add_local_autonomy = 25
		}
	}
}

# Crushed the Estates
country_event = {
	id = FEE_Hungary_Events.18
	title = FEE_Hungary_Events.18.T
	desc = FEE_Hungary_Events.18.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes

	trigger = {
		tag = HUN
		has_country_flag = CE_fought_union_of_nations
		NOT = {
			OR = {
				num_of_rebel_armies = 1
				num_of_rebel_controlled_provinces = 1
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.18.OPT1

		if = {
			limit = {
				has_estate = estate_nobles
			}
			change_estate_land_share = {
				estate = estate_nobles
				share = -2
			}
		}
		random_owned_province = {
			limit = {
				has_province_modifier = fee_hun_union_trium_nationum
			}
			spawn_rebels = {
				size = 3
				type = noble_rebels
			}
		}
		random_owned_province = {
			limit = {
				has_province_modifier = fee_hun_union_trium_nationum
			}
			spawn_rebels = {
				size = 2
				type = noble_rebels
			}
		}
		every_owned_province = {
			limit = {
				has_province_modifier = fee_hun_union_trium_nationum
			}
			remove_province_modifier = fee_hun_union_trium_nationum
		}
	}

	option = {
		name = FEE_Hungary_Events.18.OPT2

		every_owned_province = {
			limit = {
				has_province_modifier = fee_hun_union_trium_nationum
			}
			remove_province_modifier = fee_hun_union_trium_nationum
		}
	}

	option = {
		name = FEE_Hungary_Events.18.OPT3

		if = {
			limit = {
				has_estate = estate_church
			}
			add_estate_loyalty = {
				estate = estate_church
				loyalty = 5
			}
		}
		else = {
			add_adm_power = 50
		}
		if = {
			limit = {
				has_estate = estate_burghers
			}
			add_estate_loyalty = {
				estate = estate_burghers
				loyalty = 5
			}
		}
		else = {
			add_dip_power = 50
		}
		if = {
			limit = {
				has_estate = estate_nobles
			}
			add_estate_loyalty = {
				estate = estate_nobles
				loyalty = 5
			}
		}
		else = {
			add_mil_power = 50
		}
	}

	# after = {
		# if = {
			# NOT = {
				# has_opinion = {
					# who = MOL
					# value = 0
				# }
			# }
		# }
		# add_casus_belli = {
			# target = MOL
			# type = cb_insult
			# months = 9125
		# }
	# }

}

# Matyas is dead, justice is lost
country_event = {
	id = FEE_Hungary_Events.19
	title = FEE_Hungary_Events.19.T
	desc = FEE_Hungary_Events.19.D
	picture = CITY_VIEW_eventPicture

	trigger = {
		tag = HUN
		is_free_or_tributary_trigger = yes
		exists = BOH
		NOT = { war_with = BOH }
		OR = {
			SIL = {
				is_subject_of = HUN
			}
			MVA = {
				is_subject_of = HUN
			}
			SOR = {
				is_subject_of = HUN
			}
		}
		NOT = {
			has_ruler_flag = fee_hungary_matyas_reign
		}
		has_country_flag = fee_hungary_corvinus
		NOT = {
			has_country_flag = fee_hun_bohemian_revolt
		}
	}

	mean_time_to_happen = {
		days = 365
	}

	immediate = {
		hidden_effect = {
			set_country_flag = fee_hun_bohemian_revolt
			if = {
				limit = {
					SIL = {
						is_subject_of = HUN
					}
				}
				SIL = {
					add_liberty_desire = 50
				}
			}
			if = {
				limit = {
					MVA = {
						is_subject_of = HUN
					}
				}
				MVA = {
					add_liberty_desire = 50
				}
			}
			if = {
				limit = {
					SOR = {
						is_subject_of = HUN
					}
				}
				SOR = {
					add_liberty_desire = 50
				}
			}
		}
	}

	option = {
		name = FEE_Hungary_Events.19.OPT1
		ai_chance = {
			factor = 1
		}

		BOH = {
			if = {
				limit = {
					SIL = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				tooltip = {
					vassalize = SIL
				}
				set_country_flag = fee_hun_integrate_silesia
			}
			if = {
				limit = {
					MVA = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				tooltip = {
					inherit = MVA
				}
				set_country_flag = fee_hun_integrate_moravia
			}
			if = {
				limit = {
					SOR = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				tooltip = {
					inherit = SOR
				}
				set_country_flag = fee_hun_integrate_lusatia
			}
			if = {
				limit = {
					has_country_flag = fee_hun_integrate_silesia
				}
				vassalize = SIL
			}
			if = {
				limit = {
					has_country_flag = fee_hun_integrate_moravia
				}
				inherit = MVA
			}
			if = {
				limit = {
					has_country_flag = fee_hun_integrate_lusatia
				}
				inherit = SOR
			}
			silesia_area = {
				limit = {
					owned_by = ROOT
				}
				add_core = BOH
				cede_province = BOH
			}
			lusatia_area = {
				limit = {
					owned_by = ROOT
				}
				add_core = BOH
				cede_province = BOH
			}
			moravia_area = {
				limit = {
					owned_by = ROOT
				}
				add_core = BOH
				cede_province = BOH
			}
			clr_country_flag = fee_hun_integrate_silesia
			clr_country_flag = fee_hun_integrate_moravia
			clr_country_flag = fee_hun_integrate_lusatia
		}
	}
	option = {
		name = FEE_Hungary_Events.19.OPT2
		ai_chance = {
			factor = 0
		}

		add_stability = -3
		HUN = {
			if = {
				limit = {
					SIL = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				SIL = {
					capital_scope = {
						spawn_rebels = {
							type = nationalist_rebels
							size = 3
						}
					}
				}
			}
			if = {
				limit = {
					MVA = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				MVA = {
					capital_scope = {
						spawn_rebels = {
							type = nationalist_rebels
							size = 3
						}
					}
				}
			}
			if = {
				limit = {
					SOR = {
						is_subject_of = HUN
						liberty_desire = 50
					}
				}
				SOR = {
					capital_scope = {
						spawn_rebels = {
							type = nationalist_rebels
							size = 3
						}
					}
				}
			}
		}
	}
}

# Bibliotheca Corvinia
country_event = {
	id = FEE_Hungary_Events.20
	title = FEE_Hungary_Events.20.T
	desc = FEE_Hungary_Events.20.D
	picture = BIG_BOOK_eventPicture

	trigger = {
		tag = HUN
		ADM = 3
		NOT = { is_year = 1526 }
	}

	fire_only_once = yes

	mean_time_to_happen = {
		months = 360
	}

	option = {
		name = FEE_Hungary_Events.20.OPT1

		add_country_modifier = {
			name = fee_hun_hungarian_renaissance
			duration = 9125
		}
	}

	option = {
		name = FEE_Hungary_Events.20.OPT2

		add_adm_power = 100
		add_prestige_or_monarch_power = { amount = 10 }
	}
}