# Flavour events for Teutonic Order - The Prussian Confederation
# By Daniel Tolman

namespace = flavor_teu
normal_or_historical_nations = yes

# Prussian Confederation rises up
country_event = {
	id = flavor_teu.1
	title = "flavor_teu.EVTNAME1"
	desc = "flavor_teu.EVTDESC1"
	picture = ANGRY_MOB_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		is_year = 1460
		NOT = { is_year = 1500 }
		tag = TEU
		NOT = { has_country_flag = pru_confederation_curtailed }
		NOT = { has_country_flag = pru_confederation_happened }
		NOT = { has_country_flag = pru_danzig_victory_happend }
		NOT = { has_estate_privilege = estate_burghers_prussian_confederation }
		has_disaster = prussian_confederation_disaster
		is_subject = no
		exists = POL
		is_neighbor_of = POL
		is_at_war = no
		NOT = { alliance_with = POL }
		POL = { is_subject = no }
		POL = { num_of_cities = 10 }
		num_of_cities = 5
		OR = {
			NOT = { exists = DNZ }
			DNZ = {
				is_subject_of = ROOT
			}
		}
		OR = {
			AND = {
				owns = 43
				controls = 43
			}
			DNZ = { owns = 43 controls = 43 }
		}
	}
	
	mean_time_to_happen = {
		months = 6
		modifier = {
			factor = 0.1
			is_year = 1466
		}
	}
	
	immediate = {
		hidden_effect = {
			set_country_flag = pru_confederation_happened
			# add cores to DNZ based on burgher land share
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 40
					}
				}
				random_owned_province = {
					limit = {
						is_capital = no
						NOT = { is_core = DNZ }
						OR = {
							area = east_prussia_area
							area = west_prussia_area
						}
						any_neighbor_province = {
							is_core = DNZ
						}
					}
					add_core = DNZ
					if = {
						limit = { is_part_of_hre = yes }
						set_in_empire = no
					}
				}
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 50
					}
				}
				random_owned_province = {
					limit = {
						is_capital = no
						NOT = { is_core = DNZ }
						OR = {
							area = east_prussia_area
							area = west_prussia_area
						}
						any_neighbor_province = {
							is_core = DNZ
						}
					}
					add_core = DNZ
					if = {
						limit = { is_part_of_hre = yes }
						set_in_empire = no
					}
				}
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 60
					}
				}
				random_owned_province = {
					limit = {
						is_capital = no
						NOT = { is_core = DNZ }
						OR = {
							area = east_prussia_area
							area = west_prussia_area
						}
						any_neighbor_province = {
							is_core = DNZ
						}
					}
					add_core = DNZ
					if = {
						limit = { is_part_of_hre = yes }
						set_in_empire = no
					}
				}
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 70
					}
				}
				random_owned_province = {
					limit = {
						is_capital = no
						NOT = { is_core = DNZ }
						OR = {
							area = east_prussia_area
							area = west_prussia_area
						}
						any_neighbor_province = {
							is_core = DNZ
						}
					}
					add_core = DNZ
					if = {
						limit = { is_part_of_hre = yes }
						set_in_empire = no
					}
				}
			}
			if = {
				limit = {
					estate_influence = {
						estate = estate_burghers
						influence = 80
					}
				}
				random_owned_province = {
					limit = {
						is_capital = no
						NOT = { is_core = DNZ }
						OR = {
							area = east_prussia_area
							area = west_prussia_area
						}
						any_neighbor_province = {
							is_core = DNZ
						}
					}
					add_core = DNZ
					if = {
						limit = { is_part_of_hre = yes }
						set_in_empire = no
					}
				}
			}
			if = {
				limit = {
					NOT = {
						exists = DNZ
					}
				}
				release = DNZ
				DNZ = {
					change_government = republic
					add_government_reform = oligarchy_reform
					adopt_reform_progress = ROOT
					hidden_effect = {
						if = { limit = { is_part_of_hre = yes } set_in_empire = no }
					}
				}
			}
			else = {
				every_owned_province = {
					limit = {
						is_core = DNZ
					}
					cede_province = DNZ
				}
			}
			DNZ = {
				capital_scope = {
					build_to_forcelimit = {
						infantry = 0.6
						cavalry = 0.3
					}
				}
				random_owned_province = {
					limit = {
						has_port = yes
					}
					build_to_forcelimit = {
						galley = 0.3
						light_ship = 0.3
						transport = 0.2
					}
				}
			}
		}
	}
	
	option = { # Go to war
		name = "flavor_teu.1.a"
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				OR = {
					is_bankrupt = yes
					war_exhaustion = 10
				}
			}
			 
		}
		declare_war_with_cb = {
			who = DNZ
			casus_belli = cb_core
			war_goal_province = 43
		}
		custom_tooltip = flavor_teu.1.tooltip
		hidden_effect = {
			POL = {
				country_event = { id = flavor_teu.2 }
			}
			POL = {
				create_guarantee = DNZ
			}
		}
	}
	option = { # Let them go
		name = "flavor_teu.1.b"
		ai_chance = { 
			factor = 100 
			modifier = {
				factor = 0
				OR = {
					is_bankrupt = no
					NOT = { war_exhaustion = 10 }
				}
			}
		}
		add_stability = -1
		add_prestige = -20
	}
}

# Prussian Confederation seeks Polish support
country_event = {
	id = flavor_teu.2
	title = "flavor_teu.EVTNAME2"
	desc = "flavor_teu.EVTDESC2"
	picture = BATTLE_VISTULA_LAGOON_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	major = yes
	
	option = {
		name = "flavor_teu.2.a"
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				OR = {
					is_bankrupt = yes
					war_exhaustion = 10
				}
			}
		}
		set_country_flag = supported_prussian_confederation_flag
		add_opinion = {
			who = DNZ
			modifier = supported_prussian_confederation
		}
		DNZ = {
			add_opinion = {
				who = ROOT
				modifier = supported_prussian_confederation
			}
		}
		create_alliance = DNZ
	}
	option = { # stay out of this
		name = "flavor_teu.2.b"
		ai_chance = { 
			factor = 100
			modifier = {
				factor = 0
				OR = {
					is_bankrupt = no
					NOT = { war_exhaustion = 10 }
				}
			}
		}
		add_prestige = -10
	}
}

# Prussian Confederation accepts Polish rule
country_event = {
	id = flavor_teu.3
	title = "flavor_teu.EVTNAME3"
	desc = "flavor_teu.EVTDESC3"
	picture = SEJM_eventPicture
	
	fire_only_once = yes
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_teu.3.a"
		vassalize = DNZ
		if = {
			limit = {
				1859 = {
					owned_by = DNZ
					culture = polish
				}
			}
			1859 = {
				cede_province = ROOT
				add_core = ROOT
				remove_core = DNZ
			}
		}
		west_prussia_area = {
			limit = {
				NOT = { is_permanent_claim = ROOT }
				NOT = { is_core = ROOT	}
				NOT = { is_permanent_claim = DNZ }
				NOT = { is_core = DNZ }
			}
			add_permanent_claim = ROOT
		}
	}
	
	option = {
		name = "flavor_teu.3.b"
		
		trigger = {
			PRU = { exists = no } 
		}
		highlight = yes 
		vassalize = DNZ
		if = {
			limit = {
				1859 = {
					owned_by = DNZ
					culture = polish
				}
			}
			1859 = {
				cede_province = ROOT
				add_core = ROOT
				remove_core = DNZ
			}
		}
		west_prussia_area = {
			limit = { country_or_non_sovereign_subject_holds = ROOT }
			cede_province = ROOT 
			add_core = ROOT 
		}
		custom_tooltip = pol_delegate_the_formation_of_royal_prussia_tt
		hidden_effect = {
			DNZ = { 
				change_tag = PRU
				on_change_tag_effect = yes
				override_country_name = RPR
				set_country_flag = is_RPR_flag
			}
		}
		if = {
			limit = { has_dlc = "Cradle of Civilization" }
			custom_tooltip = pol_more_army_prof_per_general_tt
			hidden_effect = {
				add_country_modifier = {
					name = pol_trigger_for_army_professionalism_modifier
					duration = 7300 
					hidden = yes 
				}
			}
		}
		else = { 
			add_country_modifier = {
				name = pol_overlordship_in_prussia_modifier
				duration = 5475 
			}
		}
	}
}

# The Prussian Confederation
country_event = {
	id = flavor_teu.4
	title = "flavor_teu.EVTNAME4"
	desc = "flavor_teu.EVTDESC4"
	picture = SEJM_eventPicture
	is_triggered_only = yes
	
	option = {
		name = "flavor_teu.4.a"
		custom_tooltip = dnz_decision_available_tooltip
		add_estate_loyalty = {
			estate = estate_burghers
			loyalty = -20
		}
		add_estate_influence_modifier = {
			estate = estate_burghers
			desc = EST_VAL_PRUSSIAN_CONFEDERATION
			influence = 10
			duration = 7300
		}
		give_estate_land_share_gigantic = { estate = estate_burghers }
	}
}
	
# The End of the Teutonic State
country_event = {
	id = flavor_teu.5
	title = flavor_teu.5.t
	desc = flavor_teu.5.d
	picture = SEJM_eventPicture
	
	trigger = {
		is_year = 1460
		NOT = { is_year = 1500 }
		tag = TEU
		NOT = { has_country_flag = pru_confederation_curtailed }
		NOT = { has_country_flag = pru_danzig_victory_happend }
		has_disaster = prussian_confederation_disaster
		has_estate_privilege = estate_burghers_prussian_confederation
		is_subject = no
		is_at_war = no
		NOT = {
			exists = DNZ
		}
	}

	immediate = {
		on_non_estate_disaster_end = yes
		hidden_effect = {
			set_country_flag = pru_danzig_victory_happend
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = flavor_teu.5.a
		end_disaster = prussian_confederation_disaster
		change_tag = DNZ
		on_change_tag_effect = yes
		if = {
			limit = {
				owns = 43
			}
			set_capital = 43
		}
		change_government = republic
		add_government_reform = oligarchy_reform
		remove_estate_privilege = estate_burghers_prussian_confederation
		if = {
			limit = {
				has_dlc = "Lions of the North"
			}
			swap_non_generic_missions = yes
		}
		add_stability = -1
		add_prestige = -25
		if = {
			limit = { has_custom_ideas = no }
			country_event = { id = ideagroups.1 } #Swap Ideas
		}
		ai_chance = {
			factor = 1
		}
	}
	
	option = {	#Only over my dead body!
		name = flavor_teu.5.b
		end_disaster = prussian_confederation_disaster
		add_stability = -4
		add_prestige = -50
		random_owned_province = {
			spawn_rebels = {
				type = particularist_rebels
				size = 4
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = particularist_rebels
				size = 3
			}
		}
		random_owned_province = {
			spawn_rebels = {
				type = particularist_rebels
				size = 2
			}
		}
		every_owned_province = {
			add_local_autonomy = 50
		}
		ai_chance = {
			factor = 0
		}
	}
}

########################################
# DLC Events for Teutonic Order
#
# written by Ogulcan Yildirim
########################################

# Teutonic Path between Prussia and Crusader State
country_event = {
	id = flavor_teu.10
	title = flavor_teu.10.t
	desc = flavor_teu.10.desc
	picture = CROSSROAD_eventPicture
	is_triggered_only = yes
	
	option = {	# The time of knights is coming to its end. We will form our own Kingdom instead!
		name = flavor_teu.10.a
		custom_tooltip = flavor_teu.10.a.tt
		hidden_effect = {
			set_country_flag = teu_prussian_path
			clr_country_flag = teu_crusader_path
			if = {
				limit = {
					has_country_flag = formed_prussia_flag
					NOT = { tag = PRU }
					NOT = { was_tag = PRU }
				}
				clr_country_flag = formed_prussia_flag
			}
		}
		if = {
			limit = {
				has_mission = teu_defeat_the_poles
			}
			swap_non_generic_missions = yes
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {	# The Crusade has not ended yet. This entire heresy must be purged!
		name = flavor_teu.10.b
		custom_tooltip = flavor_teu.10.b.tt
		hidden_effect = {
			set_country_flag = teu_crusader_path
			clr_country_flag = teu_prussian_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_conquest_hre_path
			set_country_flag = formed_prussia_flag
		}
		if = {
			limit = {
				has_mission = teu_defeat_the_poles
			}
			swap_non_generic_missions = yes
			hidden_effect = {
				if = {
					limit = {
						has_mission = teu_crusader_mil_reform_1
						NOT = { mission_completed = teu_crusader_mil_reform_1 }
					}
					set_country_flag = teu_crusader_battle_counter
				}
				else = {
					clr_country_flag = teu_crusader_battle_counter
				}
			}
		}
		custom_tooltip = flavor_teu.10.b.ct
		if = {
			limit = { is_part_of_hre = yes }
			set_in_empire = no
		}
		samogitia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		lithuania_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mazovia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		malopolska_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		central_poland_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		ai_chance = {
			factor = 100
		}
	}
}

# Teutonic/Prussian Path between Diplomatic HRE, Conquest of Germany and becoming an own kingdom
country_event = {
	id = flavor_teu.11
	title = flavor_teu.11.t
	desc = {
		desc = flavor_teu.11.desc.a
		trigger = {
			is_part_of_hre = yes
		}
	}
	desc = {
		desc = flavor_teu.11.desc.b
		trigger = {
			is_part_of_hre = no
		}
	}
	picture = HRE_eventPicture
	is_triggered_only = yes
	
	option = {	# The HRE is our home now. We shall thrive in it
		name = flavor_teu.11.a
		custom_tooltip = flavor_teu.11.a.tt
		if = {
			limit = { 
				is_part_of_hre = no
				hre_size = 1
			}
			set_in_empire = yes
			emperor = { add_imperial_influence = 10 }
		}
		hidden_effect = {
			set_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_joined_the_hre
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		if = {
			limit = {
				tag = TEU
			}
			country_event = {
				id = flavor_teu.34
			}
		}
		if = {
			limit = {
				exists = BRA
			}
			add_casus_belli = {
				type = cb_vassalize_mission
				target = BRA
				months = 240
			}
		}			
		mittelmark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		neumark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {	# The HRE needs to be united, not through words, but by blood and iron.
		name = flavor_teu.11.b
		custom_tooltip = flavor_teu.11.b.tt
		if = {
			limit = { 
				is_part_of_hre = no
				hre_size = 1
			}
			set_in_empire = yes
			emperor = { add_imperial_influence = 10 }
		}
		hidden_effect = {
			set_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_joined_the_hre
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		if = {
			limit = {
				tag = TEU
			}
			country_event = {
				id = flavor_teu.34
			}
		}
		mittelmark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		neumark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		vorpommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		hinter_pommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mecklenburg_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		add_country_modifier = {
			name = teu_pru_prussian_unification_wars
			duration = 9125
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {	# We make our own Empire to defend the HRE from the forces of the East.
		name = flavor_teu.11.c
		custom_tooltip = flavor_teu.11.c.tt
		if = {
			limit = { is_part_of_hre = yes }
			set_in_empire = no
		}
		add_prestige = 50
		if = {
			limit = { has_country_flag = teu_is_allowed_to_stay_in_the_hre }
			reverse_add_opinion = {
				who = emperor
				modifier = hre_country_left
			}
		}
		hidden_effect = {
			set_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_joined_the_hre
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		samogitia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		lithuania_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mazovia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		malopolska_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		central_poland_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		ai_chance = {
			factor = 100
		}
	}
}

# Teutonic Victories
country_event = {
	id = flavor_teu.12
	title = flavor_teu.12.t
	desc = flavor_teu.12.desc
	picture = BATTLE_VISTULA_LAGOON_eventPicture
	is_triggered_only = yes
	
	option = {	# 
		name = flavor_teu.12.a
		if = {
			limit = { has_dlc = "Cradle of Civilization" }
			PA_random_army_exp_between_2_and_10_effect = yes    #PA: replaced flat gain with random dynamic gain. -- 200e200w
		}
		else = {
			add_army_tradition = 15
		}
		add_mil_power = 50
		ai_chance = {
			factor = 100
		}
	}
}

# The Teutonic and Livonian Orders
country_event = {
	id = flavor_teu.13
	title = flavor_teu.13.t
	desc = flavor_teu.13.desc
	picture = DIPLOMACY_eventPicture
	is_triggered_only = yes
	
	option = {	# Ask Livonia to become our vassal
		name = flavor_teu.13.a
		custom_tooltip = flavor_teu.13.a.tt
		hidden_effect = {
			LIV = {
				country_event = {
					id = flavor_teu.14
				}
			}
		}
		ai_chance = {
			factor = 0
		}
	}
	
	option = {	# Keep the Livonian Alliance
		name = flavor_teu.13.b
		add_trust = {
			who = LIV
			value = 10
			mutual = yes
		}
		define_advisor = {
			type = statesman
			skill = 1
			cost_multiplier = 0.25
		}
		ai_chance = {
			factor = 100
		}
	}
}

# The Teutonic ask for our vassalizing
country_event = {
	id = flavor_teu.14
	title = flavor_teu.14.t
	desc = flavor_teu.14.desc
	picture = DIPLOMACY_eventPicture
	is_triggered_only = yes
	
	option = {	# Accept to become vassals of the Teutons
		name = flavor_teu.14.a
		tooltip = {
			FROM = {
				vassalize = ROOT
			}
		}
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.15
				}
			}
		}
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				OR = {
					ai = no
					was_player = yes
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_enemy = FROM
					is_rival = FROM
				}
			}
			modifier = {
				factor = 2
				FROM = { 
					diplomatic_reputation = 1
					NOT = { diplomatic_reputation = 2 }
				}
			}
			modifier = {
				factor = 3
				FROM = { diplomatic_reputation = 2 }
			}
			modifier = {
				factor = 0.5
				FROM = { NOT = { diplomatic_reputation = 0 }}
			}
		}
	}
	
	option = {	# Refuse
		name = flavor_teu.14.b
		tooltip = {
			reverse_add_casus_belli = {
				type = cb_vassalize_mission
				target = FROM
				months = 360
			}
		}
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.16
				}
			}
		}
		ai_chance = {
			factor = 70
			modifier = {
				factor = 0.57
				FROM = { 
					diplomatic_reputation = 1
					NOT = { diplomatic_reputation = 2 }
				}
			}
			modifier = {
				factor = 0.29
				FROM = { diplomatic_reputation = 2 }
			}
			modifier = {
				factor = 1.21
				FROM = { NOT = { diplomatic_reputation = 0 } }
			}
		}
	}
}

# Accept vassalizing
country_event = {
	id = flavor_teu.15
	title = flavor_teu.15.t
	desc = flavor_teu.15.desc
	picture = DIPLOMACY_SIGNING_eventPicture
	is_triggered_only = yes
	
	option = {	# Livonian Order accepts to be our vassal
		name = flavor_teu.15.a
		vassalize = FROM
		ai_chance = {
			factor = 100
		}
	}
}

# Decline vassalizing
country_event = {
	id = flavor_teu.16
	title = flavor_teu.16.t
	desc = flavor_teu.16.desc
	picture = ACCUSATION_eventPicture
	is_triggered_only = yes
	
	option = {	# This will mean war
		name = flavor_teu.16.a
		add_casus_belli = {
			type = cb_vassalize_mission
			target = FROM
			months = 360
		}
		ai_chance = {
			factor = 100
		}
	}
}

# Join the HRE?
country_event = {
	id = flavor_teu.17
	title = flavor_teu.17.t
	desc = flavor_teu.17.desc
	picture = HRE_eventPicture
	is_triggered_only = yes
	
	option = {	# We must seek out the protection of the HRE
		name = flavor_teu.17.a
		trigger = {
			hre_size = 1
		}
		if = {
			limit = { has_dlc = "Emperor" }
			custom_tooltip = burgundy_asks_to_join_empire_tt
			emperor = {
				set_imperial_incident = incident_teutonic_order_wants_to_join
			}
		}
		else = {
			custom_tooltip = flavor_teu.17.a.tt
			hidden_effect = {
				emperor = {
					country_event = {
						id = flavor_teu.28
					}
				}
			}
		}
		ai_chance = {
			factor = 0
		}
	}
	
	option = {	# We can hold the ground by our own
		name = flavor_teu.17.b
		add_mil_power = 100
		add_country_modifier = {
			name = teu_rejects_imperial_protection
			duration = 9125
		}
		reverse_add_opinion = {
			who = emperor
			modifier = teu_rejects_the_hre
		}
		ai_chance = {
			factor = 0
		}
	}
}

# Teutonic/Prussian Path between Conquest of Germany and becoming an own kingdom
country_event = {
	id = flavor_teu.18
	title = flavor_teu.18.t
	desc = flavor_teu.18.desc
	picture = CROSSROAD_eventPicture
	is_triggered_only = yes

	option = {	# The HRE is dead. It needs a new might to unite it.
		name = flavor_teu.18.a
		custom_tooltip = flavor_teu.11.b.tt
		hidden_effect = {
			set_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_kingdom_prussia_path
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		mittelmark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		neumark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		vorpommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		hinter_pommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mecklenburg_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		add_country_modifier = {
			name = teu_pru_prussian_unification_wars
			duration = 9125
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {	# Our fate is not in Germany but in Ruthenia
		name = flavor_teu.18.b
		custom_tooltip = flavor_teu.11.c.tt
		hidden_effect = {
			set_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_conquest_hre_path
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		if = {
			limit = {
				has_mission = teu_pru_teutonic_order_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		samogitia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		lithuania_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mazovia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		malopolska_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		central_poland_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		ai_chance = {
			factor = 100
		}
	}
}

# Free flavor event - Burzenland
country_event = {
	id = flavor_teu.19
	title = flavor_teu.19.t
	desc = flavor_teu.19.desc
	picture = CASTLE_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		owns_core_province = 4128
		owns_core_province = 1841
	}
	mean_time_to_happen = {
		months = 12
	}
	option = {
		name = flavor_teu.19.a
		goto = 4128
		if = {
			limit = { has_dlc = "Leviathan" }
			custom_tooltip = teu_can_utilize_bran_castle_tt
		}
		set_country_flag = teu_can_utilize_bran_castle
		set_capital = 4128
		4128 = {
			set_great_project_tier_3 = {
				type = bran_castle
			}
			add_province_modifier = {
				name = teu_expanded_resources_bran_castle
				duration = -1
			}
			add_base_production = 2
			add_base_manpower = 4
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = flavor_teu.19.b
		goto = 1841
		if = {
			limit = { has_dlc = "Leviathan" }
			custom_tooltip = teu_can_utilize_bran_castle_tt
		}
		set_country_flag = teu_can_utilize_bran_castle
		1841 = {
			set_great_project_tier_3 = {
				type = malbork_castle
			}
			add_province_modifier = {
				name = teu_expanded_resources_marienburg
				duration = -1
			}
			add_base_production = 2
			add_base_manpower = 4
		}
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - Seasonal Campaigns
country_event = {
	id = flavor_teu.20
	title = flavor_teu.20.t
	desc = flavor_teu.20.desc
	picture = TOURNAMENT_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		current_age = age_of_discovery
	}
	mean_time_to_happen = {
		months = 60
	}
	immediate = {
		set_country_flag = last_jousting_tournament_held
	}
	option = {
		name = flavor_teu.20.a
		add_country_modifier = {
			name = teu_the_last_reyse
			duration = 9125
		}
		add_army_tradition = 15
		add_adm_power = -100
		add_yearly_manpower = 0.5
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - Reclamation of the Holy Land
country_event = {
	id = flavor_teu.21
	title = flavor_teu.21.t
	desc = flavor_teu.21.desc
	picture = JERUSALEM_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		owns = 379
		religion_group = christian
	}
	mean_time_to_happen = {
		months = 12
	}
	option = {
		name = flavor_teu.21.a
		add_papal_influence = 100
		add_stability_or_adm_power = yes
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - The Peasant Wars in the HRE
country_event = {
	id = flavor_teu.22
	title = flavor_teu.22.t
	desc = flavor_teu.22.desc
	picture = MARCHING_PEASANTS_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		has_global_flag = great_peasants_war_flag
	}
	mean_time_to_happen = {
		months = 100
	}
	option = {
		name = flavor_teu.22.a
		add_years_of_income = -3
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - Schmalkaldic League
country_event = {
	id = flavor_teu.23
	title = flavor_teu.23.t
	desc = flavor_teu.23.desc
	picture = RELIGIOUS_WARS_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		culture_group = germanic
		religion = catholic
		NOT = { in_league = catholic }
		NOT = { in_league = protestant }
		hre_leagues_enabled = yes
		is_free_or_tributary_trigger = yes
	}
	mean_time_to_happen = {
		months = 3
	}
	option = {
		name = flavor_teu.23.a
		join_league = catholic
		add_papal_influence = 50
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = flavor_teu.23.b
		add_prestige = -5
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - Hansa and the Order
country_event = {
	id = flavor_teu.24
	title = flavor_teu.24.t
	desc = flavor_teu.24.desc
	picture = MERCHANTS_ARGUING_eventPicture
	fire_only_once = yes
	trigger = {
		tag = TEU
		exists = HSA
		has_country_flag = pru_confederation_curtailed
		NOT = { war_with = HSA }
		NOT = { is_rival = HSA }
		NOT = { is_enemy = HSA }
	}
	mean_time_to_happen = {
		months = 120
	}
	option = {
		name = flavor_teu.24.a
		create_guarantee = HSA
		add_historical_friend = HSA
		HSA = { add_historical_friend = ROOT }
		add_country_modifier = {
			name = teu_renewed_hanseatic_relations
			duration = 7300
		}
		ai_chance = {
			factor = 1
		}
	}
	option = {
		name = flavor_teu.24.b
		add_adm_power = 50
		add_dip_power = 50
		add_mil_power = 50
		ai_chance = {
			factor = 1
		}
	}
}

# Free flavor event - Hussite Stress
country_event = {
	id = flavor_teu.25
	title = flavor_teu.25.t
	desc = flavor_teu.25.desc
	picture = BATTLE_VISTULA_LAGOON_eventPicture
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = TEU
		exists = BOH
		war_with = BOH
		FROM = {
			owned_by = BOH
			is_capital_of = BOH
		}
	}
	option = {
		name = flavor_teu.25.a
		add_power_projection = {
			type = mission_rewards_power_projection
			amount = 50
		}
		BOH = {
			capital_scope = {
				add_loot_from_rich_province_general_effect = {
					LOOTER = ROOT
				}
			}
		}
		ai_chance = {
			factor = 1
		}
	}
}

# Formation of the Kingdom of Prussia
country_event = {
	id = flavor_teu.26
	title = flavor_teu.26.t
	desc = flavor_teu.26.desc
	picture = PRUSSIA_eventPicture
	is_triggered_only = yes
	
	option = {	# From this day forward we shall be known as the Kingdom of Prussia!
		name = flavor_teu.26.a
		#if = {
		#	limit = { religion = catholic }
		#	change_religion = protestant
		#	hidden_effect = {
		#		add_prestige = 100
		#	}
		#}
		hidden_effect = {
			unlock_government_reform = {
				government_reform = prussian_monarchy_base
			}
			unlock_government_reform = {
				government_reform = prussian_republic_reform
			}
			unlock_government_reform = {
				government_reform = prussian_theocratic_reform
			}
		}
		if = {
			limit = { NOT = { government = monarchy } }
			change_government = monarchy
		}
		add_government_reform = prussian_monarchy_base
		if = {
			limit = { NOT = { government_rank = 2 } }
			set_government_rank = 2
		}
		add_prestige = 25
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	# Nah
		name = flavor_teu.26.b
		add_devotion = 100
		add_papal_influence = 100
		add_church_power = 100
		add_fervor = 50
		add_stability_or_adm_power = yes
		ai_chance = {
			factor = 0
		}
	}
}

# Joined the HRE not through the mission tree - Emperor gets asked if they want to keep TO
country_event = {
	id = flavor_teu.27
	title = flavor_teu.27.t
	desc = flavor_teu.27.desc
	picture = KNIGHTS_eventPicture
	major = yes
	is_triggered_only = yes
	
	option = {	# Accept the order as part of the HRE
		name = flavor_teu.28.a
		custom_tooltip = flavor_teu.28.a.tt
		FROM = {
			add_opinion = {
				who = ROOT
				modifier = teu_allowed_us_to_join
			}
		}
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.29
				}
				every_neighbor_country = {
					limit = {
						is_part_of_hre = yes
					}
					add_opinion = {
						who = ROOT
						modifier = teu_allowed_the_teutons_into_the_hre
					}
				}
			}
		}
		ai_chance = {
			factor = 0
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
	
	option = {	# Accept the order, but they need to become a proper nation within the HRE
		name = flavor_teu.28.b
		custom_tooltip = flavor_teu.28.b.tt
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.30
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
	
	option = {	# The Teutonic Order has no business in the HRE.
		name = flavor_teu.28.c
		custom_tooltip = flavor_teu.28.c.tt
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.31
				}
			}
		}
		reverse_add_opinion = {
			who = FROM
			modifier = teu_rejected_us_from_joining
		}
		add_opinion = {
			who = FROM
			modifier = teu_does_not_want_the_order_in_the_hre
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
}

# The Order is requesting to join the HRE
country_event = {
	id = flavor_teu.28
	title = flavor_teu.28.t
	desc = flavor_teu.28.desc
	picture = KNIGHTS_eventPicture
	is_triggered_only = yes
	major = yes
	
	option = {	# Accept the order as part of the HRE
		name = flavor_teu.28.a
		custom_tooltip = flavor_teu.28.a.tt
		FROM = {
			add_opinion = {
				who = ROOT
				modifier = teu_allowed_us_to_join
			}
		}
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.29
				}
				every_neighbor_country = {
					limit = {
						is_part_of_hre = yes
					}
					add_opinion = {
						who = ROOT
						modifier = teu_allowed_the_teutons_into_the_hre
					}
				}
			}
		}
		ai_chance = {
			factor = 0
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
	
	option = {	# Accept the order, but they need to become a proper nation within the HRE
		name = flavor_teu.28.b
		custom_tooltip = flavor_teu.28.b.tt
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.30
				}
			}
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				OR = {
					ai_attitude = { who = FROM attitude = attitude_hostile }
					ai_attitude = { who = FROM attitude = attitude_domineering }
					ai_attitude = { who = FROM attitude = attitude_outraged }
					ai_attitude = { who = FROM attitude = attitude_rivalry }
				}
			}
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
	
	option = {	# The Teutonic Order has no business in the HRE.
		name = flavor_teu.28.c
		custom_tooltip = flavor_teu.28.c.tt
		hidden_effect = {
			FROM = {
				country_event = {
					id = flavor_teu.31
				}
			}
		}
		reverse_add_opinion = {
			who = FROM
			modifier = teu_rejected_us_from_joining
		}
		add_opinion = {
			who = FROM
			modifier = teu_does_not_want_the_order_in_the_hre
		}
		ai_chance = {
			factor = 100
			modifier = {
				factor = 0
				OR = {
					ai_attitude = { who = FROM attitude = attitude_allied }
					ai_attitude = { who = FROM attitude = attitude_defensive }
					ai_attitude = { who = FROM attitude = attitude_friendly }
					ai_attitude = { who = FROM attitude = attitude_neutral }
					ai_attitude = { who = FROM attitude = attitude_protective }
				}
			}
		}
	}
}

# The Teutonic Order is allowed to stay in the HRE indefinitely
country_event = {
	id = flavor_teu.29
	title = flavor_teu.29.t
	desc = flavor_teu.29.desc
	picture = DIPLOMACY_SIGNING_eventPicture
	is_triggered_only = yes
	
	option = {	# Nice
		name = flavor_teu.29.a
		custom_tooltip = flavor_teu.29.a.tt
		set_in_empire = yes
		set_country_flag = teu_is_allowed_to_stay_in_the_hre
		ai_chance = {
			factor = 100
		}
	}
}

# The Teutonic Order is allowed to stay in the HRE, but has to become a proper bishopric
country_event = {
	id = flavor_teu.30
	title = flavor_teu.30.t
	desc = flavor_teu.30.desc
	picture = DIPLOMAT_INTERROGATION_eventPicture
	is_triggered_only = yes
	
	option = {	# Okay.
		name = flavor_teu.30.a
		custom_tooltip = flavor_teu.30.a.tt
		if = {
			limit = {
				NOT = { has_country_flag = teu_crusader_path }
			}
			set_in_empire = yes
			set_country_flag = teu_joined_the_hre
		}
		else = {
			custom_tooltip = flavor_teu.30.a.bt
			if = {
				limit = { is_part_of_hre = yes }
				set_in_empire = no
			}
		}
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	# This is outrageous! This is unfair!
		name = flavor_teu.30.b
		custom_tooltip = flavor_teu.30.b.tt
		if = {
			limit = { is_part_of_hre = yes }
			set_in_empire = no
		}
		add_opinion = {
			who = FROM
			modifier = teu_unfair_conditions
		}
		reverse_add_opinion = {
			who = FROM
			modifier = teu_rejected_our_offer
		}
		ai_chance = {
			factor = 0
		}
	}
}

# The Teutonic Order has to go.
country_event = {
	id = flavor_teu.31
	title = flavor_teu.31.t
	desc = flavor_teu.31.desc
	picture = ACCUSATION_eventPicture
	is_triggered_only = yes
	
	option = {	# Okay.
		name = flavor_teu.31.a
		custom_tooltip = flavor_teu.31.a.tt
		tooltip = {
			reverse_add_opinion = {
				who = FROM
				modifier = teu_rejected_us_from_joining
			}
			add_opinion = {
				who = FROM
				modifier = teu_does_not_want_the_order_in_the_hre
			}
		}
		if = {
			limit = { is_part_of_hre = yes }
			set_in_empire = no
		}
		ai_chance = {
			factor = 0
		}
	}
}

# TO declares war while being on probation - Check for the HRE member being attacked
#country_event = {
#	id = flavor_teu.32
#	title = none
#	desc = none
#	picture = none
#	trigger = {
#		is_part_of_hre = yes
#		is_in_war = {
#			defender_leader = ROOT
#			attacker_leader = TEU
#		}
#		TEU = { has_country_flag = teu_joined_the_hre }
#	}
#	mean_time_to_happen = {
#		days = 10
#	}
#	hidden = yes
#	
#	option = {
#		TEU = {
#			clr_country_flag = teu_joined_the_hre
#			country_event = {
#				id = flavor_teu.33
#			}
#		}
#		ai_chance = {
#			factor = 100
#		}
#	}
#}

# TO declares war while being on probation
country_event = {
	id = flavor_teu.33
	title = flavor_teu.33.t
	desc = flavor_teu.33.desc
	picture = BATTLE_VISTULA_LAGOON_eventPicture
	is_triggered_only = yes
	
	option = {	#Oh oh...
		name = flavor_teu.33.a
		set_in_empire = no
		declare_war = emperor
		ai_chance = {
			factor = 100
		}
	}
}

# Conversion of the Teutonic Order into a Bishopric
country_event = {
	id = flavor_teu.34
	title = flavor_teu.34.t
	desc = {
		desc = flavor_teu.34.desc.a
		trigger = { NOT = { has_country_flag = teu_is_allowed_to_stay_in_the_hre } }
	}
	desc = {
		desc = flavor_teu.34.desc.b
		trigger = { has_country_flag = teu_is_allowed_to_stay_in_the_hre }
	}
	picture = POPE_PREACHING_eventPicture
	is_triggered_only = yes
	
	option = {	#We shall be known as the Bishopric of Prussia
		name = flavor_teu.34.a
		trigger = {
			NOT = { has_country_flag = teu_is_allowed_to_stay_in_the_hre }
		}
		change_tag = PRU
		on_change_tag_effect = yes
		restore_country_name_effect = yes
		if = {
			limit = {
				has_custom_ideas = no
				NOT = { has_idea_group = PRU_ideas }
			}
			country_event = { id = ideagroups.1 } #Swap Ideas
		}
		if = {
			limit = {
				41 = { NOT = { is_capital_of = ROOT } }
			}
			41 = {
				if = {
					limit = {
						is_part_of_hre = no
						ROOT = { is_part_of_hre = yes }
					}
					set_in_empire = yes
				}
				ROOT = { set_capital = PREV }
			}
		}
		set_country_flag = formed_prussia_flag
		if = {
			limit = { NOT = { government = theocracy } }
			change_government = theocracy
		}
		add_government_reform = teutonic_bishopric_reform
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	#The Empire needs our knightly services.
		name = flavor_teu.34.b
		trigger = {
			has_country_flag = teu_is_allowed_to_stay_in_the_hre
		}
		add_adm_power = 150
		add_dip_power = 150
		add_mil_power = 150
		ai_chance = {
			factor = 0
		}
	}
}

# Formation of Germany
country_event = {
	id = flavor_teu.35
	title = flavor_teu.35.t
	desc = {
		desc = flavor_teu.35.desc.a
		trigger = {
			is_part_of_hre = yes
		}
	}
	desc = {
		desc = flavor_teu.35.desc.b
		trigger = {
			is_part_of_hre = no
			hre_size = 1
		}
	}
	desc = {
		desc = flavor_teu.35.desc.c
		trigger = {
			is_part_of_hre = no
			NOT = { hre_size = 1 }
		}
	}
	picture = GERMAN_UNIFICATION_eventPicture
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.35.a
		change_tag = GER
		on_change_tag_effect = yes
		restore_country_name_effect = yes
		if = {
			limit = {
				is_emperor = yes
			}
			dismantle_hre = yes
		}
		else_if = {
			limit = { hre_size = 1 }
			emperor = {
				add_opinion = {
					who = root
					modifier = opinion_left_empire
				}
			}
			set_in_empire = no
			emperor = {
				country_event = { id = hre_event.5 }
			}
		}
		if = {
			limit = { is_part_of_hre = yes }
			custom_tooltip = SET_RANK_EMPIRE_TOOLTIP
		}
		else = {
			tooltip = {
				set_government_rank = 3
			}
		}
		hidden_effect = {
			GER = { set_government_rank = 3 }
		}
		north_german_region = {
			limit = {
				NOT = { owned_by = ROOT }
			}
			add_permanent_claim = GER
		}
		south_german_region = {
			limit = {
				NOT = { owned_by = ROOT }
			}
			add_permanent_claim = GER
		}			
		add_country_modifier = {
			name = "centralization_modifier"
			duration = 7300
		}
		add_prestige = 25
		set_country_flag = formed_germany_flag
		if = {
			limit = {
				has_custom_ideas = no
			}
			country_event = { id = ideagroups.1 } #Swap Ideas
		}
		swap_non_generic_missions = yes
		ai_chance = {
			factor = 100
		}
	}
	option = {
		name = flavor_teu.35.b
		custom_tooltip = flavor_teu.35.b.tt
		set_country_flag = teu_can_form_germany
	}
}

# The Ruthenians and the Orthodox faith
country_event = {
	id = flavor_teu.36
	title = flavor_teu.36.t
	desc = flavor_teu.36.desc
	picture = ORTHODOX_eventPicture
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.36.a
		unlock_estate_privilege = {
			estate_privilege = estate_church_anti_heresy_act
		}
		add_estate_loyalty = {
			estate = estate_burghers
			loyalty = 30
		}
		add_estate_loyalty = {
			estate = estate_church
			loyalty = -30
		}
		ai_chance = {
			factor = 100
		}
	}
	
	option = {
		name = flavor_teu.36.b
		unlock_estate_privilege = {
			estate_privilege = estate_church_anti_heresy_act
		}
		add_estate_loyalty = {
			estate = estate_burghers
			loyalty = -30
		}
		add_estate_loyalty = {
			estate = estate_church
			loyalty = 30
		}
		ai_chance = {
			factor = 100
		}
	}
}

# The Fate of Moscow
country_event = {
	id = flavor_teu.37
	title = flavor_teu.37.t
	desc = flavor_teu.37.desc
	picture = KREMLIN_eventPicture
	is_triggered_only = yes
	goto = 295
	option = {	#Integrate the Muscovites
		name = flavor_teu.37.a
		if = {
			limit = {
				has_updated_culture = { culture = slavic }
			}
			add_accepted_culture_or_dip_power = {
				culture = russian_new
				dip_reward = yes
			}
		}
		else = {
			add_accepted_culture_or_dip_power = {
				culture = russian
				dip_reward = yes
			}
		}
		add_dip_power = 100
		295 = {
			add_base_tax = 3
			add_base_production = 3
			add_base_manpower = 2
			add_devastation = -100
		}
		moscow_area = {
			limit = {
				country_or_non_sovereign_subject_holds = ROOT
				NOT = { religion = ROOT }
			}
			add_province_modifier = {
				name = teu_crusade_resistant_orthodox_belief
				duration = 9125
			}
		}
		tver_area = {
			limit = {
				country_or_non_sovereign_subject_holds = ROOT
				NOT = { religion = ROOT }
			}
			add_province_modifier = {
				name = teu_crusade_resistant_orthodox_belief
				duration = 9125
			}
		}
		vladimir_area = {
			limit = {
				country_or_non_sovereign_subject_holds = ROOT
				NOT = { religion = ROOT }
			}
			add_province_modifier = {
				name = teu_crusade_resistant_orthodox_belief
				duration = 9125
			}
		}
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	#Repurpose the churches
		name = flavor_teu.37.b
		add_papal_influence = 50
		295 = {
			add_base_tax = 3
			change_religion = ROOT
			if = { limit = { NOT = { has_building = temple } } add_building = temple }
			spawn_rebels = {
				type = orthodox_rebels
				size = 1
			}
		}
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	#Commit a Fourth Crusade.
		name = flavor_teu.37.c
		add_papal_influence = 100
		295 = {
			add_loot_from_rich_province_general_effect = {
				LOOTER = ROOT
			}
			if = {
				limit = {
					exists = RUS
				}
				spawn_rebels = {
					type = nationalist_rebels
					friend = RUS
					size = 3
				}
			}
			else = {
				spawn_rebels = {
					type = nationalist_rebels
					friend = MOS
					size = 3
				}
			}
			add_base_tax = -2
			add_base_production = -2
			add_base_manpower = -1
			if = {
				limit = { NOT = { base_tax = 1 } }
				set_base_tax = 1
			}
			if = {
				limit = { NOT = { base_production = 1 } }
				set_base_production = 1
			}
			if = {
				limit = { NOT = { base_manpower = 1 } }
				set_base_manpower = 1
			}
		}
		ai_chance = {
			factor = 100
		}
	}
}

# The Teutonic Order declares the Great Schism mended
country_event = {
	id = flavor_teu.38
	title = flavor_teu.38.t
	desc = flavor_teu.38.desc
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.38.a
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0
				ai_attitude = {
					who = FROM
					attitude = attitude_rivalry
				}
				ai_attitude = {
					who = FROM
					attitude = attitude_hostile
				}
				ai_attitude = {
					who = FROM
					attitude = attitude_outraged
				}
			}
		}
		change_religion = catholic
		capital_scope = {
			if = {
				limit = {
					NOT = { religion = catholic }
				}
				change_religion = catholic
			}
		}
		add_stability = -1
		add_prestige = -30
	}
	option = {
		name = flavor_teu.38.b
		ai_chance = {
			factor = 1
		}
		add_stability = -2
	}
}

# The Teutonic Order reforms into a Crusader Order
country_event = {
	id = flavor_teu.39
	title = flavor_teu.39.t
	desc = flavor_teu.39.desc
	picture = BATTLE_VISTULA_LAGOON_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.39.a
		if = { 
			limit = {
				NOT = { government = theocracy } 
			}
			change_government = theocracy
		}
		unlock_government_reform = {
			government_reform = crusading_kingdom_reform
		}
		add_government_reform = crusading_kingdom_reform
		ai_chance = {
			factor = 10
		}
	}
	option = {
		name = flavor_teu.39.b
		unlock_government_reform = {
			government_reform = crusading_kingdom_reform
		}
		change_government_reform_progress = 50
		ai_chance = {
			factor = 1
		}
	}
}

# Defeated the Ottomans
country_event = {
	id = flavor_teu.40
	title = flavor_teu.40.t
	desc = flavor_teu.40.desc
	picture = IMPALED_SOLDIERS_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.40.a
		add_power_projection = {
			type = mission_rewards_power_projection
			amount = 100
		}
		add_country_modifier = {
			name = teu_crusade_ottomans_vanquished
			duration = -1
		}
		custom_tooltip = flavor_teu.40.a.tt
		hidden_effect = {
			TUR = {
				every_owned_province = {
					limit = {
						religion_group = christian
						NOT = { religion = catholic }
					}
					change_religion = catholic
				}
				every_owned_province = {
					limit = { religion_group = christian }
					add_province_modifier = {
						name = teu_crusade_inspired_by_the_teutons
						duration = 3650
					}
				}
			}
		}
		ai_chance = {
			factor = 10
		}
	}
}

# The Teutonic Order reforms into a Holy Horde
country_event = {
	id = flavor_teu.41
	title = flavor_teu.41.t
	desc = flavor_teu.41.desc
	picture = CRUSADER_HORDE_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = flavor_teu.41.a
		set_country_flag = teu_crusader_has_holy_horde_gov
		capital_scope = { add_province_triggered_modifier = holy_horde_capital }
		if = { 
			limit = {
				NOT = { government = theocracy } 
			}
			change_government = theocracy
		}
		unlock_government_reform = {
			government_reform = holy_horde_reform
		}
		add_government_reform = holy_horde_reform
		if = {
			limit = {
				NOT = { has_dlc = "The Cossacks" }
			}
			add_country_modifier = {
				name = teu_holy_horde_modifier
				duration = -1
			}
		}
		ai_chance = {
			factor = 10
		}
	}
}

# Info event - Teutonic Order
country_event = {
	id = flavor_teu.42
	title = flavor_teu.42.t
	desc = flavor_teu.42.desc
	picture = RELIGION_eventPicture
	fire_only_once = yes
	trigger = {
		ai = no
		has_dlc = "Lions of the North"
		tag = TEU
	}
	mean_time_to_happen = {
		months = 6
	}
	
	option = {
		name = flavor_teu.42.a
		custom_tooltip = flavor_teu.42.a.tt
		
		ai_chance = {
			factor = 1
		}
	}
}

# The Order is requesting to join the HRE - Imperial Incident
country_event = {
	id = flavor_teu.43
	title = flavor_teu.28.t
	desc = flavor_teu.28.desc
	picture = KNIGHTS_eventPicture
	is_triggered_only = yes
	major = yes
	
	option = {	# Accept the order as part of the HRE
		name = flavor_teu.28.a
		custom_tooltip = flavor_teu.43.a.tt
		TEU = {
			add_opinion = {
				who = Emperor
				modifier = teu_allowed_us_to_join
			}
		}
		hidden_effect = {
			TEU = {
				country_event = {
					id = flavor_teu.29
				}
				every_neighbor_country = {
					limit = {
						is_part_of_hre = yes
					}
					add_opinion = {
						who = Emperor
						modifier = teu_allowed_the_teutons_into_the_hre
					}
				}
			}
		}
		ai_chance = {
			factor = 1
			modifier = {
				factor = 2
				has_opinion = {
					who = TEU
					value = 100
				}
			}
			modifier = {
				factor = 0
				emperor = { is_rival = TEU }
			}
			modifier = {
				factor = 0
				TEU = { is_rival = emperor }
			}
			modifier = {
				factor = 2
				NOT = { emperor = { is_rival = TEU } }
			}
			modifier = {
				factor = 2
				NOT = { TEU = { is_rival = emperor } }
			}
			modifier = {
				factor = 3
				TEU = { diplomatic_reputation = 1 }
			}
			modifier = {
				factor = 3
				TEU = { diplomatic_reputation = 2 }
			}
			modifier = {
				factor = 3
				TEU = { diplomatic_reputation = 3 }
			}
			modifier = {
				factor = 0
				OR = {
					is_enemy = TEU
					is_rival = TEU
				}
			}
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
			modifier = {
				factor = 0.1
				is_neighbor_of = TEU
			}
		}
	}
	
	option = {	# Accept the order, but they need to become a proper nation within the HRE
		name = flavor_teu.28.b
		custom_tooltip = flavor_teu.28.b.tt
		hidden_effect = {
			TEU = {
				country_event = {
					id = flavor_teu.30
				}
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 0.5
				emperor = { is_rival = TEU }
			}
			modifier = {
				factor = 0.5
				TEU = { is_rival = emperor }
			}
			modifier = {
				factor = 2
				NOT = { emperor = { is_rival = TEU } }
			}
			modifier = {
				factor = 2
				NOT = { TEU = { is_rival = emperor } }
			}
			modifier = {
				factor = 10
				is_neighbor_of = TEU
			}
			modifier = {
				factor = 0
				OR = {
					is_enemy = TEU
					is_rival = TEU
				}
			}
			modifier = {
				factor = 0
				OR = {
					ai_attitude = { who = TEU attitude = attitude_hostile }
					ai_attitude = { who = TEU attitude = attitude_domineering }
					ai_attitude = { who = TEU attitude = attitude_outraged }
					ai_attitude = { who = TEU attitude = attitude_rivalry }
				}
			}
			modifier = {
				factor = 0
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
	
	option = {	# The Teutonic Order has no business in the HRE.
		name = flavor_teu.28.c
		custom_tooltip = flavor_teu.28.c.tt
		hidden_effect = {
			TEU = {
				country_event = {
					id = flavor_teu.31
				}
			}
		}
		emperor = {
			reverse_add_opinion = {
				who = TEU
				modifier = teu_rejected_us_from_joining
			}
			add_opinion = {
				who = TEU
				modifier = teu_does_not_want_the_order_in_the_hre
			}
		}
		ai_chance = {
			factor = 10
			modifier = {
				factor = 1.5
				NOT = {
					has_opinion = {
						who = emperor
						value = 0
					}
				}
			}
			modifier = {
				factor = 2
				is_rival = TEU
			}
			modifier = {
				factor = 2
				TEU = { is_rival = emperor }
			}
			modifier = {
				factor = 0
				alliance_with = TEU
			}
			modifier = {
				factor = 0
				OR = {
					ai_attitude = { who = TEU attitude = attitude_allied }
					ai_attitude = { who = TEU attitude = attitude_defensive }
					ai_attitude = { who = TEU attitude = attitude_friendly }
					ai_attitude = { who = TEU attitude = attitude_neutral }
					ai_attitude = { who = TEU attitude = attitude_protective }
				}
			}
			modifier = {
				factor = 10
				TEU = { has_country_flag = teu_crusader_path }
			}
		}
	}
}

# Joined the HRE not through the mission tree - Ask Emperor to stay
country_event = {
	id = flavor_teu.44
	title = flavor_teu.44.t
	desc = flavor_teu.44.desc
	picture = HRE_eventPicture
	fire_only_once = yes
	trigger = {
		has_dlc = "Lions of the North"
		tag = TEU
		is_part_of_hre = yes
		NOT = { has_country_flag = teu_joined_the_hre }
		NOT = { has_country_flag = teu_is_allowed_to_stay_in_the_hre }
		if = {
			limit = { has_dlc = "Emperor" }
			NOT = { active_imperial_incident = any }
		}
	}

	mean_time_to_happen = {
		days = 20
	}
	
	option = {	# ask the Emperor to stay
		name = flavor_teu.44.a
		if = {
			limit = { has_dlc = "Emperor" }
			custom_tooltip = burgundy_asks_to_join_empire_tt
			emperor = {
				set_imperial_incident = incident_teutonic_order_wants_to_join
			}
		}
		else = {
			custom_tooltip = flavor_teu.17.a.tt
			hidden_effect = {
				emperor = {
					country_event = {
						id = flavor_teu.27
					}
				}
			}
		}
		ai_chance = {
			factor = 100
		}
	}
}

# The Cossacks question
country_event = {
	id = flavor_teu.45
	title = flavor_teu.45.t
	desc = flavor_teu.45.desc
	picture = COSSACK_ESTATE_eventPicture
	is_triggered_only = yes
	
	option = {	# Allow the Cossacks to become an estate
		name = flavor_teu.45.a
		trigger = {
			has_dlc = "The Cossacks"
		}
		unlock_estate = {
			estate = estate_cossacks
			show_conditions = yes
		}
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	# Integrate the Cossacks into our military instead
		name = flavor_teu.45.b
		add_country_modifier = {
			name = teu_integrated_cossacks
			duration = -1
		}
		ai_chance = {
			factor = 0
		}
	}
}

########################################
# DLC Events for Danzig
#
# written by Ogulcan Yildirim
########################################

namespace = flavor_dnz
normal_or_historical_nations = yes


# Danzig/Prussian Path between Conquest of Germany and becoming an own great republic
country_event = {
	id = flavor_dnz.1
	title = flavor_dnz.1.t
	desc = flavor_dnz.1.desc
	picture = CROSSROAD_eventPicture
	is_triggered_only = yes
	
	option = {	# The HRE needs to be united, not through words, but by blood and iron.
		name = flavor_dnz.1.a
		custom_tooltip = flavor_teu.11.b.tt
		if = {
			limit = { 
				is_part_of_hre = no
				hre_size = 1
			}
			set_in_empire = yes
			emperor = { add_imperial_influence = 10 }
		}
		hidden_effect = {
			set_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_joined_the_hre
		}
		if = {
			limit = {
				has_mission = dnz_danzig_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		mittelmark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		neumark_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		vorpommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		hinter_pommern_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mecklenburg_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		add_country_modifier = {
			name = teu_pru_prussian_unification_wars
			duration = 9125
		}
		ai_chance = {
			factor = 100
		}
	}
	option = {	# We make our own Empire to defend the HRE from the forces of the East.
		name = flavor_dnz.1.b
		custom_tooltip = flavor_dnz.1.b.tt
		if = {
			limit = { is_part_of_hre = yes }
			set_in_empire = no
		}
		add_prestige = 50
		if = {
			limit = { has_country_flag = teu_is_allowed_to_stay_in_the_hre }
			reverse_add_opinion = {
				who = emperor
				modifier = hre_country_left
			}
		}
		hidden_effect = {
			set_country_flag = teu_kingdom_prussia_path
			clr_country_flag = teu_diplomacy_hre_path
			clr_country_flag = teu_conquest_hre_path
			clr_country_flag = teu_joined_the_hre
		}
		if = {
			limit = {
				has_mission = dnz_danzig_and_the_empire
			}
			swap_non_generic_missions = yes
		}
		hidden_effect = {
			unlock_government_reform = {
				government_reform = prussian_monarchy_base
			}
			unlock_government_reform = {
				government_reform = prussian_republic_reform
			}
			unlock_government_reform = {
				government_reform = prussian_theocratic_reform
			}
		}
		if = {
			limit = {
				NOT = { government = republic }
			}
			change_government = republic
			add_government_reform = prussian_republic_reform
		}
		samogitia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		lithuania_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		mazovia_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		malopolska_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		central_poland_area = {
			limit = {
				NOT = { is_core = ROOT }
				NOT = { is_permanent_claim = ROOT }
			}
			add_permanent_claim = ROOT
		}
		ai_chance = {
			factor = 100
		}
	}
}