Namespace = FEE_Bohemia_Events
#Jay DoubleU

# Death of Jiri Podebrad
country_event = {
	id = FEE_Bohemia_Events.3
	title = FEE_Bohemia_Events.3.T
	desc = FEE_Bohemia_Events.3.D
	picture = CITY_VIEW_eventPicture

	fire_only_once = yes
	is_triggered_only = yes

	trigger = {
		tag = BOH
		NOT = { has_ruler_modifier = fee_boh_infertility }
		has_country_flag = FEE_Podebrad
		is_free_or_tributary_trigger = yes
		NOT = { has_ruler_flag = ruler_cant_trigger_this_event_flag }
	}

	option = {
		name = FEE_Bohemia_Events.3.OPT1
		ai_chance = {
			factor = 1
		}

		add_stability_or_adm_power_per_stab = { amount = 2 }
		define_ruler = {
			name = "Vladislav"
			dynasty = "Jagiellon"
			adm = 2
			dip = 4
			mil = 2
		}
		kill_heir = {}
		if = {
			limit = {
				has_estate = estate_nobles
			}
			change_estate_land_share = {
				estate = estate_nobles
				share = 20
			}
			add_country_modifier = {
				name = fee_boh_noble_concesions
				duration = -1
			}
		}
		if = {
			limit = {
				exists = POL
			}
			POL = {
				country_event = {
					id = FEE_Bohemia_Events.4
					days = 30
				}
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 1
				leader_dynasty = "z Podebrad"
				leader = "Bocek 'the Disabled'"
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 1
				leader_dynasty = "z Podebrad"
				leader = "Henry 'the Younger'"
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 1
				leader_dynasty = "z Podebrad"
				leader = "Henry 'the Elder'"
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = pretender_rebels
				size = 2
				leader_dynasty = "z Podebrad"
				leader = "Victor"
			}
		}
	}

	option = {
		name = FEE_Bohemia_Events.3.OPT2
		ai_chance = {
			factor = 1
		}

		define_ruler = {
			name = "Victor z"
			dynasty = "z Podebrad"
			adm = 2
			dip = 4
			mil = 2
		}
		kill_heir = {}
		capital_scope = {
			spawn_rebels = {
				type = pretender_rebels
				size = 3
				leader_dynasty = "Jagiellon"
				leader = "Vladislav"
			}
		}
	}

	after = {
		hidden_effect = {
			clr_country_flag = FEE_Podebrad
		}
	}
}

# The Bohemian Throne
country_event = {
	id = FEE_Bohemia_Events.4
	title = FEE_Bohemia_Events.4.T
	desc = FEE_Bohemia_Events.4.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = FEE_Bohemia_Events.4.OPT1
		reverse_add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
		add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
	}
}

# Death of Matthias Corvinus
country_event = {
	id = FEE_Bohemia_Events.5
	title = FEE_Bohemia_Events.5.T
	desc = FEE_Bohemia_Events.5.D
	picture = CITY_VIEW_eventPicture

	trigger = {
		tag = HUN
		has_country_flag = fee_hungary_corvinus
		NOT = { has_ruler_flag = fee_hungary_matyas_reign }
		is_free_or_tributary_trigger = yes
	}

	fire_only_once = yes

	option = {
		name = FEE_Bohemia_Events.5.OPT1
		ai_chance = {
			factor = 1
		}

		if = {
			limit = {
				BOH = { valid_for_personal_unions_trigger = yes }
				HUN = { valid_for_personal_unions_trigger = yes }
			}
			BOH = {
				create_union = HUN
			}
		}
		kill_heir = {}
		add_stability_or_adm_power_per_stab = { amount = 2 }
		if = {
			limit = {
				has_estate = estate_nobles
			}
			change_estate_land_share = {
				estate = estate_nobles
				share = 20
			}
			add_country_modifier = {
				name = fee_boh_noble_concesions
				duration = -1
			}
		}
		if = {
			limit = {
				exists = HAB
			}
			HAB = {
				country_event = {
					id = FEE_Bohemia_Events.7
					days = 30
				}
			}
		}
		if = {
			limit = {
				exists = POL
			}
			POL = {
				country_event = {
					id = FEE_Bohemia_Events.6
					days = 30
				}
			}
		}
		if = {
			limit = {
				exists = BOH
			}
			BOH = {
				if = {
					limit = {
						overlord_of = SOR
					}
					inherit = SOR
				}
				if = {
					limit = {
						overlord_of = MVA
					}
					inherit = MVA
				}
				if = {
					limit = {
						SIL = {
							is_free_or_tributary_trigger = yes
							ai = yes
						}
					}
					vassalize = SIL
				}
			}
		}
	}

	option = {
		name = FEE_Bohemia_Events.5.OPT2
		ai_chance = {
			factor = 0
		}

		add_stability = -3
		define_ruler = {
			name = "Janos"
			dynasty = "Hunyadi"
			adm = 2
			dip = 3
			mil = 5
			age = 17
		}
		kill_heir = {}
		change_estate_land_share = {
			estate = all
			share = -10
		}
		add_country_modifier = {
			name = fee_hun_young_janos
			duration = -1
		}
		if = {
			limit = {
				exists = HAB
			}
			HAB = {
				country_event = {
					id = FEE_Bohemia_Events.7
					days = 30
				}
			}
		}
		if = {
			limit = {
				exists = TUR
			}
			TUR = {
				country_event = {
					id = FEE_Bohemia_Events.8
					days = 30
				}
			}
		}
	}

	option = {
		name = FEE_Bohemia_Events.5.OPT3
		ai_chance = {
			factor = 0
		}

		if = {
			limit = {
				HAB = { valid_for_personal_unions_trigger = yes }
				HUN = { valid_for_personal_unions_trigger = yes }
			}
			HAB = {
				create_union = HUN
			}
		}
	}
}

# Wladyslaw Jagiello, King of Hungary
country_event = {
	id = FEE_Bohemia_Events.6
	title = FEE_Bohemia_Events.6.T
	desc = FEE_Bohemia_Events.6.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = FEE_Bohemia_Events.6.OPT1

		add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
		reverse_add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
		create_alliance = HUN
		create_marriage = HUN
	}
}

# Civil War in Hungary
country_event = {
	id = FEE_Bohemia_Events.7
	title = FEE_Bohemia_Events.7.T
	desc = FEE_Bohemia_Events.7.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = FEE_Bohemia_Events.7.OPT1

		add_casus_belli = {
			type = cb_restore_personal_union
			target = PREV
		}
		add_opinion = {
			who = PREV
			modifier = fee_boh_claiming_thrones
		}
		reverse_add_opinion = {
			who = PREV
			modifier = fee_boh_claiming_thrones
		}
	}

	option = {
		name = FEE_Bohemia_Events.7.OPT2

		add_prestige = -10
		add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
		reverse_add_opinion = {
			who = PREV
			modifier = fee_boh_linked_thrones
		}
	}
}

# The Kingdom of Hungary
country_event = {
	id = FEE_Bohemia_Events.8
	title = FEE_Bohemia_Events.8.T
	desc = FEE_Bohemia_Events.8.D
	picture = CITY_VIEW_eventPicture

	is_triggered_only = yes

	fire_only_once = yes

	option = {
		name = FEE_Bohemia_Events.8.OPT1

		transylvania_area = { add_permanent_claim = ROOT }
		southern_transylvania_area = { add_permanent_claim = ROOT }
	}
}

#Lessons of the Hussite Wars
country_event = {
	id = FEE_Bohemia_Events.9
	title = FEE_Bohemia_Events.9.T
	desc = FEE_Bohemia_Events.9.D
	picture = MILITARY_CAMP_eventPicture

	fire_only_once = yes

	trigger = {
		tag = BOH
		NOT = { is_year = 1490 }
 	}

	mean_time_to_happen = {
		months = 120
	}

	option = {
		name = FEE_Bohemia_Events.9.OPT1 #Excellent

		add_mil_power = 100
		add_country_modifier = {
			name = fee_boh_hussite_ingenuity
			duration = 5475
		}
	}
}

#A Message of Peace
country_event = {
	id = FEE_Bohemia_Events.10
	title = FEE_Bohemia_Events.10.T
	desc = FEE_Bohemia_Events.10.D
	picture = REFORM_eventPicture

	fire_only_once = yes

	trigger = {
		tag = BOH
		has_ruler = "Jirí"
		dynasty = "z Podebrad"
		OR = {
			religion = hussite
			ruler_religion = hussite
		}
 	}

	mean_time_to_happen = {
		months = 12
	}

	option = {
		name = FEE_Bohemia_Events.10.OPT1 #Unfortunate, but we can make some good out of this.

		add_prestige_or_monarch_power = { amount = 15 }
		define_advisor = {
			type = statesman
			name = "Zdenek Lev of Rozmital"
			skill = 2
			culture = czech
			religion = catholic
			discount = yes
		}
		if = {
			limit = {
				exists = TUR
			}
			every_country = {
				limit = {
					is_rival = TUR
					religion_group = christian
				}
				add_opinion = {
					who = BOH
					modifier = fee_boh_charter_universal_peace_union_rivals
				}
			}
			TUR = {
				add_opinion = {
					who = BOH
					modifier = fee_boh_charter_universal_peace_union
				}
			}
		}
		if = {
			limit = {
				exists = FRA
				NOT = {
					FRA = {
						is_rival = TUR
					}
				}
			}
			FRA = {
				add_opinion = {
					who = BOH
					modifier = fee_boh_charter_universal_peace_union_france
				}
			}
		}
	}
	option = {
		name = FEE_Bohemia_Events.10.OPT2 #How naïve! Perhaps we should forget the whole thing.

		add_prestige = -10
		add_dip_power = 50
	}
}

#Thaler Coinage
country_event = {
	id = FEE_Bohemia_Events.11
	title = FEE_Bohemia_Events.11.T
	desc = FEE_Bohemia_Events.11.D
	picture = ECONOMY_eventPicture

	major = yes
	fire_only_once = yes

	trigger = {
		tag = BOH
		is_part_of_hre = yes
		owns_core_province = 2967
		is_year = 1500
		NOT = { is_year = 1550 }
 	}

	mean_time_to_happen = {
		months = 200
	}

	option = {
		name = FEE_Bohemia_Events.11.OPT1 #Wonderful news!

		2967 = {
			add_base_production = 2
		}
		give_estate_land_share_large = { estate = estate_nobles }
		add_innovativeness_or_monarch_power = {
			amount = 3
			adm = 30
			dip = 30
			mil = 30
		}
		add_country_modifier = {
			name = boh_coinage_pioneer
			duration = 7300
		}
		custom_tooltip = fee_boh_thaler_princes_tt
		hidden_effect = {
			every_country = {
				limit = {
					is_part_of_hre = yes
				}
				add_country_modifier = {
					name = fee_boh_thaler
					duration = 7300
				}
			}
		}
	}

	option = {
		name = FEE_Bohemia_Events.11.OPT2 #Yes yes, very nice, but what's in it for me?

		add_years_of_income = 1
		add_prestige = -10
		add_country_modifier = {
			name = fee_boh_greedy_rulership
			duration = 7300
		}
	}
}

# The Defenestration of Prague
country_event = {
	id = FEE_Bohemia_Events.12
	title = FEE_Bohemia_Events.12.T
	desc = FEE_Bohemia_Events.12.D
	picture = ANGRY_MOB_eventPicture

	fire_only_once = yes

	trigger = {
		tag = BOH
		is_subject_of = HAB
		overlord = {
			religion = catholic
		}
		OR = {
			religion = protestant
			religion = reformed
			religion = hussite
		}
		is_year = 1540
		NOT = { is_year = 1620 }
 	}

	mean_time_to_happen = {
		months = 300
		modifier = {
			factor = 0.5
			liberty_desire = 50
		}
	}

	option = {
		name = FEE_Bohemia_Events.12.OPT1 #Throw them out the window!

		add_liberty_desire = 100
		every_country = {
			limit = {
				is_rival = HAB
			}
			add_opinion = {
				who = BOH
				modifier = fee_boh_defenestration_prague
			}
		}
	}

	option = {
		name = FEE_Bohemia_Events.12.OPT2 #We have no choice but to submit.

		add_stability = -2
		change_religion = catholic
		add_country_modifier = {
			name = fee_boh_religion_enforced
			duration = 7300
		}
	}
}

#Sack of Prague
country_event = {
	id = FEE_Bohemia_Events.13
	title = FEE_Bohemia_Events.13.T
	desc = FEE_Bohemia_Events.13.D
	picture = SIEGE_eventPicture

	fire_only_once = yes

	trigger = {
		owns_core_province = 266
		any_country = {
			OR = {
				culture = saxon
				culture = prussian
			}
			controls = 266
		}
		is_year = 1720
 	}

	option = {
		name = FEE_Bohemia_Events.13.OPT1 #Will we ever recover?

		266 = {
			add_base_tax = -2
			add_base_production = -2
			add_base_manpower = -2
			add_devastation = 50
		}
	}
}