WoC_austria_1 = {
	slot = 1
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		NOT = { has_country_flag = hab_hre_branch }
		NOT = { has_country_flag = hab_germany_branch }
	} 

	hab_branching3 = {
		icon = mission_unknown_mission
		position = 2
		required_missions = { hab_secure_electors } 

		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}

	hab_branching4 = {
		icon = mission_unknown_mission
		position = 3
		required_missions = { hab_branching3 } 

		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}
}

WoC_austria_1_holy_roman_empire = {
	slot = 1
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_hre_branch
	} 

	hab_imperial_borders = {
		icon = the_imperial_border
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {
            OR = {
                AND = {
                    owner = { is_emperor = yes }
                    root = { is_emperor = no }
                }
                AND = {
                    is_part_of_hre = yes
                    owner = {
						if = {
							limit = {
								is_part_of_hre = yes
								is_subject = yes
                                overlord = { is_part_of_hre = no }
							}
							is_part_of_hre = yes
						}
						else_if = {
							limit = {
								is_subject = no
							}
							is_part_of_hre = no
						}
						else = {
							overlord = { is_part_of_hre = no }
						}
                    }
                }
            }
        }
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			is_emperor = yes
			custom_trigger_tooltip = {
				tooltip = no_hre_province_owned_by_non_hre_member_or_overlord_trigger
				europe = {
					type = all
					OR = {
						is_part_of_hre = no
						AND = {
							is_part_of_hre = yes
							owner = {
								OR = {
									AND = {
										is_part_of_hre = yes
										OR = {
											is_subject = no
											AND = {
												is_subject = yes
												overlord = { is_part_of_hre = yes }
											}
										}
									}
									AND = {
										is_part_of_hre = no
										is_subject = yes
										overlord = { is_part_of_hre = yes }
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			add_imperial_influence = 15
			if = {
				limit = {
					has_dlc = "The Cossacks"
				}
				add_dip_power = 100
				custom_tooltip = emp_hab_imperial_border_effect_tooltip
				custom_tooltip = SEPERATOR_TOOLTIP
				hidden_effect = {
					every_country = {
						limit = {
							is_part_of_hre = yes
							NOT = { is_rival = root }
							NOT = { root = { is_rival = prev } }
						}
						add_trust = {
							who = root
							value = 10
						}
					}
				}
			}
			else = { add_dip_power = 200 }

			custom_tooltip = HAB_EVERY_IMPERIAL_CAPITAL_GAINS_FOLLOWING_MODIFIER
			tooltip = {
				capital_scope = {
					add_province_modifier = {
						name = hab_capitals_of_the_empire
						duration = 7300
					}
				}
			}
			hidden_effect = {
				every_known_country = {
					limit = {
						is_part_of_hre = yes
					}
					capital_scope = {
						add_province_modifier = {
							name = hab_capitals_of_the_empire
							duration = 7300
						}
					}
				}
				if = {
					limit = {
						is_part_of_hre = yes
					}
					capital_scope = {
						add_province_modifier = {
							name = hab_capitals_of_the_empire
							duration = 7300
						}
					}
				}
			}
		}
	}

	hab_imperial_capitals = {
		icon = imperial_capitals
		position = 3
		required_missions = { hab_imperial_borders } 
		provinces_to_highlight = {
			OR = {
				AND = {
					owner = { is_emperor = yes }
					root = { is_emperor = no }
				}
				AND = {
					continent = europe
					owned_by = root
					development = 20
					OR = {
						NOT = { development = 30 }
						is_part_of_hre = no
					}
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								value = 5
								development = 30
								is_part_of_hre = yes
							}
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			if = {
				limit = {
					is_part_of_hre = yes
				}
				is_emperor = yes
				num_of_owned_provinces_with = {
					value = 5
					development = 25
					num_of_buildings_in_province = 3
					is_part_of_hre = yes
				}
			}
			else = {
				num_of_owned_provinces_with = {
					value = 5
					development = 25
					num_of_buildings_in_province = 3
				}
			}
		}
		effect = {
			add_prestige_or_monarch_power = { amount = 25 }
			add_country_modifier = {
				name = hab_flourishing_in_empire
				duration = 7300
			}
			custom_tooltip = HAB_5_RANDOM_PROVINCES_THAT_MEET_REQUIREMENT_GAIN
			tooltip = {
				add_province_modifier = {
					name = hab_imperial_cities
					duration = -1
				}
			}
			hidden_effect = {
				if = {
					limit = {
						is_part_of_hre = yes
					}
					for = {
						amount = 5
						effect = "
							random_owned_province = {
								limit = {
									is_part_of_hre = yes
									development = 25
									num_of_buildings_in_province = 3
									NOT = {
										has_province_modifier = hab_imperial_cities
									}
								}
								add_province_modifier = {
									name = hab_imperial_cities
									duration = -1
								}
								add_or_upgrade_production_building = yes
							}
						"
					}
				}
				else = {
					for = {
						amount = 5
						effect = "
							random_owned_province = {
								limit = {
									development = 25
									num_of_buildings_in_province = 3
									NOT = {
										has_province_modifier = hab_imperial_cities
									}
								}
								add_province_modifier = {
									name = hab_imperial_cities
									duration = -1
								}
								add_or_upgrade_production_building = yes
							}
						"
					}
				}
			}
		}
	}
}

WoC_austria_1_germany = {
	slot = 1
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_germany_branch
	} 

	hab_switzerland = {
		icon = consolidate_switzerland
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {  
			OR = {
				area = switzerland_area
				area = romandie_area
			}
		} 

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 5
				OR = {
					area = switzerland_area
					area = romandie_area
				}
			}
		} 

		effect = {  
			custom_tooltip = HAB_GAIN_10_MIL_POWER_PER_SWISS_PROVINCE
			hidden_effect = {
				every_owned_province = {
					limit = {
						culture = swiss
					}
					owner = {
						add_mil_power = 10
					}
				}
			}

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_BREISGAU_CONNECTED
				first_limit = "
					72 = {
						is_in_capital_area = yes
					}
				"
				first_effect = "
					72 = {
						add_or_upgrade_fort_building = yes
						add_province_modifier = {
							name = hab_fort_of_breisgau
							duration = -1
						}
					}
				"
			}
		} 
	}

	hab_develop_southern_germany = {
		icon = mission_hanseatic_city
		position = 3
		required_missions = { hab_switzerland } 
		provinces_to_highlight = {  
			region = south_german_region
			country_or_non_sovereign_subject_holds = ROOT
			OR = {
				NOT = { development = 20 }
				NOT = { num_of_buildings_in_province = 3 }
			}
		} 

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 5
				region = south_german_region
				development = 20
				num_of_buildings_in_province = 3
			}
		} 

		effect = {  
			change_government_reform_progress = 50
			custom_tooltip = HAB_5_RANDOM_PROVINCES_THAT_MEET_REQUIREMENT_GAIN
			tooltip = {
				add_province_modifier = {
					name = hab_south_german_cities
					duration = -1
				}
				1872 = { add_or_upgrade_tax_building = yes }
			}
			hidden_effect = {
				for = {
					amount = 5
					effect = "
						random_owned_province = {
							limit = {
								region = south_german_region
								development = 20
								num_of_buildings_in_province = 3
								NOT = {
									has_province_modifier = hab_south_german_cities
								}
							}
							add_province_modifier = {
								name = hab_south_german_cities
								duration = -1
							}
							add_or_upgrade_tax_building = yes
						}
					"
				}
			}
		} 
	}
}

WoC_austria_1_1 = {
	slot = 1
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	 } 

	hab_milan = {
		icon = milan_victorious
		position = 5
		required_missions = { hab_italian_ambition } 
		provinces_to_highlight = {
			OR = {
				province_id = 104
				AND = {
					OR = {
						area = lombardy_area
						area = po_valley_area
					}
					ROOT = {
						NOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 5
								OR = {
									area = lombardy_area
									area = po_valley_area
								}
							}
						}
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		trigger = {
			owns_or_non_sovereign_subject_of = 104
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 5
				OR = {
					area = lombardy_area
					area = po_valley_area
				}
			}
		}
		effect = {
			add_prestige_or_monarch_power = { amount = 20 }
			
			custom_tooltip = SEPERATOR_TOOLTIP

			if = {
				limit = {
					has_dlc = "Leviathan"
				}
				104 = {
					add_great_project_tier = {
						type = duomo_milano
						tier = 1
					}
				}
			}
			else = {
				104 = {
					add_base_tax = 3
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_NAPLES_VALID_PU
				first_limit = "
					exists = NAP
					valid_for_personal_unions_trigger = yes
					NAP = {
						valid_for_personal_unions_trigger = yes
					}
				"
				first_effect = "
					add_casus_belli = {
						type = cb_restore_personal_union
						months = 300
						target = NAP
					}
				"
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
			modifier = {
				factor = 0	#Shadow Kingdom and Emperorship though
				is_emperor = yes
				NOT = { is_year = 1490 }
			}
		}
	}

	hab_croatia = {
		icon = mission_integrate_croatia
		position = 8
		required_missions = { hab_decline_of_hungary } 
		ai_weight = {
			factor = 500
			modifier = {
				factor = 2
				east_adriatic_coast_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
			modifier = {
				factor = 2
				OR = {
					croatia_area = {
						country_or_non_sovereign_subject_holds = ROOT
					}
					slavonia_area = {
						country_or_non_sovereign_subject_holds = ROOT
					}
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				area = east_adriatic_coast_area
				area = croatia_area
				area = slavonia_area
			}
			NOT = {
				ROOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 9
						OR = {
							area = east_adriatic_coast_area
							area = croatia_area
							area = slavonia_area
						}
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 9
				OR = {
					area = east_adriatic_coast_area
					area = croatia_area
					area = slavonia_area
				}
			}
		}
		effect = {
			add_yearly_manpower = 0.8

			custom_tooltip = SEPERATOR_TOOLTIP
			
			4752 = {
				add_center_of_trade_level = 1
				add_base_manpower = 2
			}
		}
	}

	hab_beat_up_ottomans = {
		icon = mission_ottoman_diplomacy
		position = 9
		required_missions = { hab_crusade_ottomans } 
		provinces_to_highlight = {
			owned_by = TUR
			continent = europe
			NOT = { region = anatolia_region }
			NOT = { region = caucasia_region }
		}
		trigger = {
			NOT = {
				europe = {
					custom_trigger_tooltip = {
						tooltip = emp_hab_scourge_of_europe_trigger_tooltip
						owned_by = TUR
						NOT = { region = anatolia_region }
						NOT = { region = caucasia_region }
					}
				}
			}
		}
		effect = {
			country_event_with_effect_insight = {
				id = flavor_hab.27
				effect = "
					add_country_modifier = {
						name = hab_bulwark_of_catholicism
						duration = -1
					}

					add_prestige_or_monarch_power = { amount = 20 }
				"
			}
			if = {
				limit = {
					151 = { culture = turkish }
				}
				country_event = { id = new_flavour_hun.3 } #event used by Hungary too
			}
		}
		ai_weight = {
			factor = 500	#Historical rivalry conquest
		}
	}

	hab_tirol_silver_mine = {
		icon = mission_zambezi_gold
		position = 11
		required_missions = { } 
		provinces_to_highlight = {
			province_id = 73
			OR = {
				NOT = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				NOT = {
					base_production = 7
				}
			}
		}
		trigger = {
			gold_income = 5
			73 = {
				country_or_non_sovereign_subject_holds = ROOT
				base_production = 7
			}
		}
		effect = {
			73 = {
				add_province_modifier = {
					name = hab_tirol_mine
					duration = -1
				}
			}

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_NO_TIROL_EVENT
				first_limit = "
					73 = {
						NOT = { has_province_modifier = hab_schwaz_mine }
					}
				"
				first_effect = "
					set_country_flag = hab_guaranteed_silver_mine_flag
					country_event = { id = flavor_hab.11 }
				"
			}
		}
	}

	hab_austria_prospers = {
		icon = austria_prospers
		position = 12
		required_missions = { hab_balance_estates hab_tirol_silver_mine } 
		provinces_to_highlight = {
			culture = austrian
			OR = {
				ROOT = {
					NOT = {
						development_in_provinces = {
							value = 180 #start:122
							culture = austrian
						}
					}
				}
				AND = {
					ROOT = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 5
								culture = austrian
								has_manufactory_trigger = yes
							}
						}
					}
					has_manufactory_trigger = no
					owned_by = root
				}
			}
		}
		trigger = {
			development_in_provinces = {
				value = 180 #start:122
				culture = austrian
			}
			num_of_owned_provinces_with = {
				value = 5
				culture = ROOT
				num_of_buildings_in_province = 3
				development = 20
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				distribute_development = {
					amount = 10
					type = tax
				}
				custom_tooltip = HAB_UNLOCK_PROSPERITY_EDICT
				set_country_flag = hab_prosperity_edict
			}
			else = {
				change_government_reform_progress = 50
				distribute_development = {
					amount = 15
					type = tax
				}
				add_country_modifier = {
					name = hab_prosperity_windfall
					duration = 7300
				}
			}
		}
	}

	hab_vienna_waltz = {
		icon = the_viennese_waltz
		position = 13
		required_missions = { hab_austria_prospers } 
		provinces_to_highlight = {
			province_id = 134
			OR = {
				NOT = { owned_by = root }
				NOT = { development = 50 }
				NOT = { num_of_buildings_in_province = 6 }
			}
		}
		trigger = {
			134 = {
				owned_by = root
				development = 50
				num_of_buildings_in_province = 6
			}
			has_adm_advisor_3 = yes
			has_dip_advisor_3 = yes
			has_mil_advisor_3 = yes
			is_in_deficit = no
		}
		effect = {
			add_prestige_or_monarch_power = { amount = 15 }
			134 = {
				add_province_triggered_modifier = hab_vienna_ballrooms
			}
		}
	}
}
WoC_austria_2 = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	} 

	hab_secure_electors = {
		icon = mission_alliances
		position = 1
		provinces_to_highlight = {
			OR = {
				AND = {
					owner = { is_emperor = yes }
					root = { is_emperor = no }
				}
				AND = {
					owner = {
						is_elector = yes
						OR = {
							NOT = { preferred_emperor = ROOT }
							NOT = { has_opinion = { who = ROOT value = 75 } }
						}
					}
					NOT = {
						ROOT = {
							calc_true_if = {
								all_elector = {
									preferred_emperor = ROOT
									has_opinion = { who = ROOT value = 75 }
								}
								amount = 4
							}
						}
					}
				}
			}
		}

		trigger = {
			if = {
				limit = {
					hre_size = 1
				}
				is_emperor = yes
				calc_true_if = {
					desc = WOC_secure_the_imperial_crown.tooltip
					all_elector = {
						preferred_emperor = ROOT
						has_opinion = { who = ROOT value = 75 }
					}
					amount = 4
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 20
					region = south_german_region
				}
			}
		}
		effect = {
			if = {
				limit = {
					ai = yes
				}
				random_list = {
					50 = { set_country_flag = hab_hre_branch }
					10 = { set_country_flag = hab_germany_branch }
				}
				swap_non_generic_missions = yes
			}
			else = {
				enable_branching_mission_review_without_ai = {
					key = HAB
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			if = {
				limit = {
					exists = BOH
					valid_for_personal_unions_trigger = yes
					BOH = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = BOH
				}
			}
			else = {
				bohemia_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				erzgebirge_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
				moravia_area = {
					limit = {
						NOT = { is_permanent_claim = ROOT }
						NOT = { is_core = ROOT	}
					}
					add_permanent_claim = ROOT
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier = {
				name = "succesful_bid_for_imperial_crown"
				duration = 5475 #15 years
			}
		}
		ai_weight = {
			factor = 500	#Austria should ALWAYS want to be the Emperor
		}
	}
}

WoC_austria_2_branching = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		NOT = { has_country_flag = hab_hre_branch }
		NOT = { has_country_flag = hab_germany_branch }
	} 

	hab_branching1 = {
		icon = mission_unknown_mission
		position = 2
		required_missions = { hab_secure_electors } 
		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}

	hab_branching6 = {
		icon = mission_unknown_mission
		position = 3
		required_missions = {
			hab_branching2
			hab_branching1
			hab_branching3
		}
		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}
}

WoC_austria_2_holy_roman_empire = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_hre_branch
	} 

	hab_a_holy_empire = {
		icon = holy_state
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {
			OR = {
				AND = {
					owner = { is_emperor = yes }
					root = { is_emperor = no }
				}
				AND = {
					owner = {
						is_part_of_hre = yes
						NOT = { religion = root }
					}
					hre_religion_locked = no
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			is_emperor = yes
			if = {
				limit = {
					has_dlc = "Art of War"
				}
				OR = {
					hre_religion_locked = yes
					AND = {
						custom_trigger_tooltip = {
							tooltip = emp_bav_center_of_counter_reformation_tooltip2
							had_global_flag = {
								flag = reformation_started
								days = 18250
							}
						}
						custom_trigger_tooltip = {
							tooltip = emp_hab_empire_united_in_religion_trigger_tooltip
							NOT = {
								any_country = {
									is_part_of_hre = yes
									NOT = { religion = root }
								}
							}
						}
					}
				}
				is_all_concessions_in_council_taken = yes
			}
			else = {
				OR = {
					AND = {
						custom_trigger_tooltip = {
							tooltip = emp_bav_center_of_counter_reformation_tooltip2
							had_global_flag = {
								flag = reformation_started
								days = 18250
							}
						}
						custom_trigger_tooltip = {
							tooltip = emp_hab_empire_united_in_religion_trigger_tooltip
							NOT = {
								any_country = {
									is_part_of_hre = yes
									NOT = { religion = root }
								}
							}
						}
					}
					if = {
						limit = {
							has_dlc = "Emperor"
						}
						is_all_concessions_in_council_taken = yes
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					religion = catholic
				}
				add_papal_influence = 25
				add_country_modifier = {
					name = hab_empire_united_in_religion_mod_catholic
					duration = -1
				}
			}
			else_if = {
				limit = {
					religion = protestant
					has_dlc = "Common Sense"
				}
				add_church_power = 100
				add_country_modifier = {
					name = hab_empire_united_in_religion_mod_protestant
					duration = -1
				}
			}
			else_if = {
				limit = {
					religion = reformed
					has_dlc = "Wealth of Nations"
				}
				add_fervor = 100
				add_country_modifier = {
					name = hab_empire_united_in_religion_mod_reformed
					duration = -1
				}
			}
			else = {
				add_country_modifier = {
					name = hab_empire_united_in_religion_mod_generic
					duration = -1
				}
			}
			custom_tooltip = emp_hab_empire_united_in_religion_effect_remove_tooltip

			custom_tooltip = SEPERATOR_TOOLTIP

			custom_tooltip = HAB_ALL_SAME_FAITH_NATIONS_GAIN_FOLLOWING
			tooltip = {
				add_country_modifier = {
					name = hab_maintaining_the_imperial_religion
					duration = 7300
				}
			}
			hidden_effect = {
				every_known_country = {
					limit = {
						is_part_of_hre = yes
						religion = ROOT
					}
					add_country_modifier = {
						name = hab_maintaining_the_imperial_religion
						duration = 7300
					}
				}
			}
		}
	}

	hab_true_holy_roman_emperor = {
		icon = switzerland_and_the_empire
		position = 3
		required_missions = { 
			hab_a_holy_empire 
			hab_imperial_ascendancy
			hab_imperial_borders
		} 
		provinces_to_highlight = {
			OR = {
				AND = {
					owner = { is_emperor = yes }
					root = { is_emperor = no }
				}
				AND = {
					is_part_of_hre = yes
					owner = {
						OR = {
							is_part_of_hre = no
							AND = {
								is_subject = yes
								overlord = { is_part_of_hre = no }
							}
						}
					}
				}
				owner = {
					is_part_of_hre = yes
					NOT = {
						has_opinion = {
							who = root
							value = 1
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			is_emperor = yes
			OR = {
				hre_reform_passed = emperor_reichskrieg
				if = {
					limit = {
						has_dlc = "Emperor"
					}
					hre_reform_passed = emperor_privilegia_de_non_appelando
				}
				else = {
					hre_reform_passed = privilegia_de_non_appelando
				}
			}
			custom_trigger_tooltip = {
				tooltip = emp_hab_empire_pass_reforms_trigger_tooltip
				NOT = {
					any_country = {
						is_part_of_hre = yes
						NOT = {
							has_opinion = {
								who = root
								value = 1
							}
						}
					}
				}
			}
			custom_trigger_tooltip = {
				tooltip = no_hre_province_owned_by_non_hre_member_or_overlord_trigger
				europe = {
					type = all
					OR = {
						is_part_of_hre = no
						AND = {
							is_part_of_hre = yes
							owner = {
								is_part_of_hre = yes
								OR = {
									is_subject = no
									AND = {
										is_subject = yes
										overlord = { is_part_of_hre = yes }
									}
								}
							}
						}
					}
				}
			}
		}
		effect = {
			add_power_projection = {
				type = mission_rewards_power_projection
				amount = 25
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_CENTRALIZATION
				first_limit = "
					OR = {
						hre_reform_passed = privilegia_de_non_appelando
						hre_reform_passed = emperor_privilegia_de_non_appelando
					}
				"
				first_effect = "
					add_prestige_or_monarch_power = { amount = 15 }

					custom_tooltip = SEPERATOR_TOOLTIP

					custom_tooltip = HAB_MODIFY_STRONG_DUCHIES
					set_country_flag = hab_upgraded_strong_duchies
				"
				second_custom_tooltip = HAB_IF_DECENTRALIZED
				second_limit = "
					hre_reform_passed = emperor_reichskrieg
				"
				second_effect = "
					add_adm_power = 50
					add_dip_power = 50
					add_mil_power = 50

					custom_tooltip = SEPERATOR_TOOLTIP

					custom_tooltip = HAB_UNLOCK_IMPERIAL_WARLEADER_PRIVILEGE
					set_country_flag = hab_imperial_warleader_flag
				"
			}
		}
	}
}

WoC_austria_2_germany = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_germany_branch
	} 

	hab_bavaria = {
		icon = duchy_of_bavaria
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {  
			OR = {
				area = east_bavaria_area
				area = upper_bavaria_area
				area = lower_bavaria_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			76 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 6
				OR = {
					area = east_bavaria_area
					area = upper_bavaria_area
					area = lower_bavaria_area
				}
			}
		} 

		effect = {  
			76 = {
				add_province_modifier = {
					name = hab_salt_mines
					duration = -1
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			add_mil_power = 50

			add_prestige_or_monarch_power = { amount = 10 }
		} 
	}

	hab_unify_germany = {
		icon = ger_kaiserreich
		position = 3
		required_missions = { 
			hab_bavaria 
			hab_brandenburg
			hab_switzerland
		} 
		provinces_to_highlight = {  
			OR = {
				AND = {
					OR = {
						region = north_german_region
						region = south_german_region
					}
					NOT = { area = erzgebirge_area }
					NOT = { area = bohemia_area }
					NOT = { area = moravia_area }
					root = {
						NOT = {
							num_of_owned_provinces_with = {
								is_core = ROOT
								OR = {
									region = north_german_region
									region = south_german_region
								}
								NOT = { area = erzgebirge_area }
								NOT = { area = bohemia_area }
								NOT = { area = moravia_area }
								value = 50
							}
						}
					}
				}
				province_id = 50
				province_id = 57
				province_id = 65
				AND = {
					ROOT = {
						NOT = { owns_core_province = 75 }
						NOT = { owns_core_province = 41 }
					}
					OR = {
						province_id = 75
						province_id = 41
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 1868 }
						NOT = { owns_core_province = 70 }
					}
					OR = {
						province_id = 1868
						province_id = 70
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 1876 }
						NOT = { owns_core_province = 67 }
					}
					OR = {
						province_id = 1876
						province_id = 67
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 1762 }
						NOT = { owns_core_province = 85 }
					}
					OR = {
						province_id = 1762
						province_id = 85
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 41 }
						NOT = { owns_core_province = 75 }
					}
					OR = {
						province_id = 41
						province_id = 75
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 44 }
						NOT = { owns_core_province = 45 }
					}
					OR = {
						province_id = 44
						province_id = 45
					}
				}
				AND = {
					ROOT = {
						NOT = { owns_core_province = 61 }
						NOT = { owns_core_province = 63 }
					}
					OR = {
						province_id = 61
						province_id = 63
					}
				}
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		} 

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			owns_core_province = 50	# Berlin
			owns_core_province = 57	# Brunswick
			owns_core_province = 65	# M�nchen
			OR = {
				owns_core_province = 1868 # Augsburg
				owns_core_province = 70 # Wurttemberg
			}
			OR = {
				owns_core_province = 67	# N�rnberg
				owns_core_province = 1876 # Frankfurt
			}
			OR = {
				owns_core_province = 1762 # Niederhessen
				owns_core_province = 85	# K�ln
			}
			OR = {
				owns_core_province = 41	# K�nigsberg
				owns_core_province = 75	# Strassburg
			}
			OR = {
				owns_core_province = 44	# Hamburg
				owns_core_province = 45	# Lubeck
			}
			OR = {
				owns_core_province = 61	# Dresden
				owns_core_province = 63	# Th�ringen
			}
			num_of_owned_provinces_with = {
				is_core = ROOT
				OR = {
					region = north_german_region
					region = south_german_region
				}
				NOT = { area = erzgebirge_area }
				NOT = { area = bohemia_area }
				NOT = { area = moravia_area }
				value = 50
			}
		} 

		effect = {  
			custom_tooltip = HAB_REMOVE_GERMANY_TECH_REQUIREMENT
			set_country_flag = remove_germany_tech_requirement_flag

			custom_tooltip = SEPERATOR_TOOLTIP

			add_permanent_power_projection = {
				amount = 10
				type = HAB_german_unity
			}
		} 
	}
}

WoC_austria_2_1 = {
	slot = 2
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	} 

	hab_italian_ambition = {
		icon = mission_conquer_north_italy
		position = 4
		ai_weight = {
			factor = 500
			modifier = {
				factor = 0.5
				venetia_area = {
					is_part_of_hre = yes
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
				}
			}
			modifier = {
				factor = 2
				venetia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		
		provinces_to_highlight = {
			region = italy_region
			is_part_of_hre = yes
		}
		trigger = {
			OR = {
				AND = {
					custom_trigger_tooltip = {
						tooltip = HAB_SHADOW_KINGDOM
						has_global_flag = emperor_trying_to_avert_shadow_kingdom
					}
					is_emperor = yes
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 4
					region = italy_region
				}
			}
		}
		effect = {
			complex_dynamic_effect_without_alternative = {
				first_custom_tooltip = HAB_IF_SHADOW_KINGDOM
				first_limit = "
					is_emperor = yes
					has_global_flag = emperor_trying_to_avert_shadow_kingdom
				"
				first_effect = "
					italian_ambitions_effect_1 = yes
				"
				second_custom_tooltip = HAB_IF_CONQUER_ITALY
				second_limit = "
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 4
						region = italy_region
					}
				"
				second_effect = "
					give_claims = { area = venetia_area }
					give_claims = { area = po_valley_area }
					give_claims = { area = lombardy_area }

					custom_tooltip = SEPERATOR_TOOLTIP

					add_country_modifier = {
						name = hab_italian_wars
						duration = 3650
					}
				"
			}
		}
	}

	hab_venetian_ports = {
		icon = mission_galleys_in_port
		position = 5
		ai_weight = {
			factor = 500
			modifier = {
				factor = 0.5
				venetia_area = {
					is_part_of_hre = yes
					NOT = { country_or_non_sovereign_subject_holds = ROOT }
				}
			}
			modifier = {
				factor = 2
				venetia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		
		required_missions = { hab_italian_ambition }
		provinces_to_highlight = {
			area = venetia_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 4
				area = venetia_area
			}
		}
		effect = {
			add_mercantilism_or_monarch_power = { amount = 3 }

			custom_tooltip = SEPERATOR_TOOLTIP

			venetia_area = {
				limit = {
					has_port = yes
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = "protected_italian_interests"
					duration = 3650
				}

				add_or_upgrade_shipyard_building = yes
			}
		}
	}

	hab_kingdom_of_italy = {
		icon = kingdom_of_lombardy
		position = 6
		required_missions = {
			hab_naples
			hab_milan
			hab_venetian_ports
		}
		provinces_to_highlight = {  
			region = italy_region
			province_is_on_an_island = no
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			italy_region = {
				type = all
				OR = {
					province_is_on_an_island = yes
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		} 

		effect = {  
			add_country_modifier = {
				name = hab_iron_crown
				duration = -1
			}

			change_ruler_stat = {
				type = adm
				amount = 2
			}
		} 
	}

	hab_decline_of_hungary = {
		icon = mission_destroy_the_hungarians
		position = 7
		trigger = {
			if = {
				limit = {
					exists = HUN
				}
				total_own_and_non_tributary_subject_development = HUN
				total_own_and_non_tributary_subject_development = 200
			}
			else = {
				total_own_and_non_tributary_subject_development = 200
			}
		}
		effect = {
			add_army_tradition_or_mil_power = { amount = 5 }

			custom_tooltip = SEPERATOR_TOOLTIP

			if = {
				limit = {
					exists = HUN
					valid_for_personal_unions_trigger = yes
					HUN = {
						valid_for_personal_unions_trigger = yes
					}
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					months = 300
					target = HUN
				}
			}
			else = {
				slovakia_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				transdanubia_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				alfold_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				slavonia_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				croatia_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
				east_adriatic_coast_area = {
					limit = {
						NOT = { is_core = ROOT }
						NOT = { is_permanent_claim = ROOT }
					}
					add_permanent_claim = ROOT
				}
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
		}
	}

	hab_crusade_ottomans = {
		icon = mission_ottoman_early_army
		position = 8
		required_missions = { hab_decline_of_hungary } 
		provinces_to_highlight = {  
			if = {
				limit = {
					exists = TUR
				}
				continent = europe
				owner = {
					tag = TUR
				}
			}
			else = {
				region = balkan_region
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
		} 

		trigger = {  
			if = {
				limit = {
					exists = TUR
				}
				has_won_war_against = {
					who = TUR
					max_years_since = 25
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 5
					region = balkan_region
				}
			}
		} 

		effect = { 
			give_claims = { region = balkan_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			add_army_professionalism = 0.05
		} 
	}

	hab_liberate_balkans = {
		icon = push_on_to_bulgaria
		position = 9
		required_missions = { hab_crusade_ottomans } 
		provinces_to_highlight = {
			region = balkan_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 25
				region = balkan_region
			}
		}
		effect = {
			add_country_modifier = {
				name = hab_into_the_balkans
				duration = 7300
			}

			add_adm_power = 100

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_WALLACHIA_AND_MOLDAVIA_VASSALS
				first_limit = "
					WAL = {
						is_subject_of = ROOT
					}
					MOL = {
						is_subject_of = ROOT
					}
					NOT = { 
						RMN = {
							exists = yes
						}
					}
				"
				first_effect = "
					hab_liberate_balkans_effect = yes
				"
			}
		}
		ai_weight = {
			factor = 500	#Historical rivalry conquest
		}
	}

	hab_eastern_roman_empire = {
		icon = take_constantinople
		position = 10
		required_missions = {
			hab_liberate_balkans
			hab_beat_up_ottomans
		}
		provinces_to_highlight = {  
			province_id = 151
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
			if = {
				limit = {
					exists = BYZ
					BYZ = {
						is_subject_of = ROOT
					}
				}
				owner = {
					tag = BYZ
				}
			}
		} 

		trigger = {
			151 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			OR = {
				NOT = { exists = BYZ }
				BYZ = { is_subject_of = ROOT }
			}
		} 

		effect = {  
			custom_tooltip = HAB_MODIFY_BULWARK_OF_CATHOLICISM
			hidden_effect = {
				remove_country_modifier = hab_bulwark_of_catholicism
				add_country_modifier = {
					name = hab_bulwark_of_catholicism_2
					duration = -1
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_BYZANTIUM_IS_OUR_SUBJECT
				first_limit = "
					BYZ = {
						is_subject_of = ROOT
					}
				"
				first_effect = "
					BYZ = { change_tag = LAE change_religion = ROOT set_dynasty = ROOT }
					if = { limit = { is_emperor =  yes } add_scaled_imperial_influence = 5 }
				"
			}
		} 
	}

	hab_balance_estates = {
		icon = balance_the_estates
		position = 11
		trigger = {
			crown_land_share = 40
			if = {
				limit = {
					has_estate = estate_nobles
				}
				estate_loyalty = {
					estate = estate_nobles
					loyalty = 60
				}
			}
			if = {
				limit = {
					has_estate = estate_burghers
				}
				estate_loyalty = {
					estate = estate_burghers
					loyalty = 60
				}
			}
			if = {
				limit = {
					has_estate = estate_church
				}
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
		}
		effect = {
			change_government_reform_progress = 25

			custom_tooltip = SEPERATOR_TOOLTIP

			add_estate_loyalty = {
				estate = all
				loyalty = 5
			}
			custom_tooltip = add_5_crown_land_share
			hidden_effect = {
				change_estate_land_share = {
					estate = all
					share = -5
				}
			}
		}
	}

	hab_vienna_university = {
		icon = mission_early_modern_university
		position = 12
		required_missions = { hab_balance_estates } 
		provinces_to_highlight = {  
			province_id = 134
			OR = {
				NOT = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				NOT = {
					development = 25
				}
				NOT = {
					num_of_buildings_in_province = 3
				}
			}
		} 

		trigger = {  
			134 = {
				country_or_non_sovereign_subject_holds = ROOT
				development = 25
				num_of_buildings_in_province = 3
			}
			if = {
				limit = {
					has_dlc = "Rule Britannia"
				}
				innovativeness = 15
			}
			else = {
				has_adm_advisor = yes
				has_dip_advisor = yes
				has_mil_advisor = yes
			}
		} 

		effect = {  
			134 = {
				add_or_upgrade_university_building = yes
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			custom_tooltip = emp_ven_plague_doctor_training_tt
			set_country_flag = has_competent_doctors

			custom_tooltip = SEPERATOR_TOOLTIP

			change_innovativeness = 5
		} 
	}

	hab_von_raab = {
		icon = rein_in_the_nobles
		position = 13
		required_missions = {
			hab_austria_prospers
			hab_vienna_university
		}

		trigger = {  
			OR = {
				NOT = {
					has_estate = estate_nobles
				}
				NOT = {
					estate_influence = {
						influence = 40
						estate = estate_nobles
					}
				}
			}
			total_development = 1000
		} 

		effect = {  
			define_advisor = {
				type = treasurer
				name = "Franz Anton von Raab"
				skill = 3
				cost_multiplier = 0.25
			}
			custom_tooltip = SEPERATOR_TOOLTIP
			country_event_with_option_insight = {
				id = flavor_hab.28
				option_1 = "
					capital_scope = {
						spawn_rebels = {
							size = 3
							type = noble_rebels
						}
						spawn_rebels = {
							size = 3
							type = noble_rebels
						}
					}

					custom_tooltip = SEPERATOR_TOOLTIP

					custom_tooltip = HAB_UNLOCK_RAAB_RESTRICTIONS_PRIVILEGE
					custom_tooltip = SEPERATOR_TOOLTIP
				"
				option_2 = "
					add_estate_loyalty = {
						estate = estate_nobles
						loyalty = 15
					}

					custom_tooltip = SEPERATOR_TOOLTIP

					custom_tooltip = HAB_MODIFY_SUPREMACY_OVER_THE_CROWN_PRIVILEGE
				"
			}
		} 
	}
}

WoC_austria_3 = {
	slot = 3
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		NOT = { has_country_flag = hab_hre_branch }
		NOT = { has_country_flag = hab_germany_branch }
	} 

	hab_branching2 = {
		icon = mission_unknown_mission
		position = 2
		required_missions = { hab_secure_electors } 
		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}

	hab_branching5 = {
		icon = mission_unknown_mission
		position = 3
		required_missions = { hab_branching2 } 
		trigger = {  
			custom_trigger_tooltip = { tooltip = HAB_this_is_a_branching_mission always = no }
		} 

		effect = {  
			custom_tooltip = HAB_this_is_a_branching_mission
		} 
	}
}

WoC_austria_3_holy_roman_empire = {
	slot = 3
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_hre_branch
	} 

	hab_imperial_ascendancy = {
		icon = imperial_ascendancy
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {
			owner = {
				NOT = { tag = root }
				NOT = { is_subject_of = ROOT }
				OR = {
					AND = {
						num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
							value = 10
							continent = europe
						}
						is_part_of_hre = yes
					}
					is_emperor = yes
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			is_emperor = yes
			OR = {
				hre_reform_passed = emperor_privilegia_de_non_appelando
				AND = {
					custom_trigger_tooltip = {
						tooltip = HAB_CONTAIN_IMPERIAL_PRINCES_TT
						NOT = {
							any_country = {
								NOT = { tag = root }
								NOT = { is_subject_of = ROOT }
								is_part_of_hre = yes
								NOT = {
									has_opinion = {
										who = ROOT
										value = 100
									}
								}
								num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
									value = 10
									is_part_of_hre = yes
								}
							}
						}
					}
					calc_true_if = {
						desc = emp_hab_no_one_to_threaten_us_trigger2_tooltip
						amount = 10
						all_country = {
							has_reform = free_city
						}
					}
				}
			}
		}
		effect = {
			add_dip_power = 50
			add_country_modifier = {
				name = hab_ascendancy_in_empire
				duration = 7300
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			custom_tooltip = HAB_ALL_HRE_NATIONS_GAIN_50_MANA
			hidden_effect = {
				every_known_country = {
					limit = {
						is_part_of_hre = yes
					}
					add_dip_power = 50
					add_mil_power = 50
					add_adm_power = 50
				}
			}
		}
	}

	hab_a_roman_empire = {
		icon = a_roman_empire
		position = 3
		required_missions = { hab_imperial_ascendancy } 
		provinces_to_highlight = {
			OR = {
				AND = {
					owner = { is_emperor = yes }
					root = { is_emperor = no }
				}
				AND = {
					province_id = 118
					OR = {
						is_part_of_hre = no
						owner = { is_part_of_hre = no }
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = HAB }
			is_emperor = yes
			118 = {
				is_part_of_hre = yes
				owner = {
					is_part_of_hre = yes
				}
			}
		}
		effect = {
			custom_tooltip = HAB_BUFF_RELIGIOUS_DIPLOMATS
			set_country_flag = hun_empower_religious_diplomats

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier = {
				name = hab_empire_has_rome
				duration = -1
			}
			custom_tooltip = emp_hab_empire_united_in_religion_effect_remove_tooltip
		}
	}
}

WoC_austria_3_germany = {
	slot = 3
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
		has_country_flag = hab_germany_branch
	} 

	hab_brandenburg = {
		icon = electorate_of_brandenburg
		position = 2
		required_missions = { hab_secure_electors } 
		provinces_to_highlight = {  
			OR = {
				area = neumark_area
				area = mittelmark_area
			}
			NOT = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 5
				OR = {
					area = neumark_area
					area = mittelmark_area
				}
			}
			50 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
		} 

		effect = {  
			give_claims = { region = north_german_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			add_army_tradition_or_mil_power = { amount = 10 }

			custom_tooltip = SEPERATOR_TOOLTIP

			if = {
				limit = {
					has_dlc = "Leviathan"
				}
				50 = {
					add_great_project_tier = {
						type = brandenburg_gate
						tier = 1
					}
				}
			}
			else = {
				50 = {
					add_base_manpower = 2
					add_or_upgrade_manpower_building = yes
				}
			}
		} 
	}

	hab_prussian_officers = {
		icon = professional_army
		position = 3
		required_missions = { hab_brandenburg }

		trigger = {  
			not_in_mission_preview_mode = { key = HAB }
			army_size = 35 # modified
			if = {
				limit = {
					has_dlc = "Cradle of Civilization"
				}
				army_professionalism = 0.3
			}
			else = {
				army_tradition = 40
			}
			OR = {
				monthly_mil = 10
				ruler_has_personality = martial_educator_personality
				full_idea_group = quality_ideas
			}
		} 

		effect = {  
			custom_tooltip = HAB_UPGRADE_OFFICERS_PRIVILEGE
			set_country_flag = hab_military_reform_flag

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier = {
				name = hab_haugwitz_reforms
				duration = 7300
			}

			define_advisor = {
				type = army_reformer
				name = "Friedrich Wilhelm von Haugwitz"
				skill = 3
				cost_multiplier = 0.25
			}
		} 
	}
}

WoC_austria_3_1 = {
	slot = 3
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = { 
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	} 

	hab_naples = {
		icon = union_with_naples
		position = 5
		required_missions = { hab_italian_ambition } 
		provinces_to_highlight = {
			OR = {
				province_id = 121
				AND = {
					OR = {
						area = naples_area
						area = apulia_area
						area = calabria_area
					}
					ROOT = {
						NOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 8
								OR = {
									area = naples_area
									area = apulia_area
									area = calabria_area
								}
							}
						}
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		trigger = {
			owns_or_non_sovereign_subject_of = 121
			OR = {
				NAP = {
					is_subject_of = ROOT
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 8
					OR = {
						area = naples_area
						area = apulia_area
						area = calabria_area
					}
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = hab_conquest_of_italy
				duration = 7300
			}

			121 = {
				add_center_of_trade_level = 1
				add_base_production = 2
			}

			italy_region = {
				limit = {
					NOT = { is_core = root }
					NOT = { is_permanent_claim = root }
				}
				add_permanent_claim = root
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
		}
	}

	hab_hungary = {
		icon = hungarian_union
		position = 8
		required_missions = { hab_decline_of_hungary } 
		ai_weight = {
			factor = 500
			modifier = {
				factor = 2
				slovakia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
			modifier = {
				factor = 2
				transdanubia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		
		provinces_to_highlight = {
			OR = {
				area = slovakia_area
				area = transdanubia_area
				area = alfold_area
				area = transylvania_area
				area = southern_transylvania_area
			}
			NOT = {
				ROOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 11 #out of 14
						OR = {
							area = slovakia_area
							area = transdanubia_area
							area = alfold_area
							area = transylvania_area
							area = southern_transylvania_area
						}
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 11 #out of 14
				OR = {
					area = slovakia_area
					area = transdanubia_area
					area = alfold_area
					area = transylvania_area
					area = southern_transylvania_area
				}
			}
		}
		effect = {
			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_COMPLETED_WITH_UNION
				first_limit = "
					HUN = {
						is_subject_of = ROOT
					}
				"
				first_effect = "
					create_subject = {
						subject_type = integrated_personal_union
						subject = HUN
					}

					custom_tooltip = SEPERATOR_TOOLTIP

					define_advisor = {
						type = diplomat
						skill = 2
						cost_multiplier = 0.5
						culture = hungarian
					}
				"

				second_custom_tooltip = HAB_IF_CONQUEST
				second_limit = "
					NOT = {
						HUN = {
							is_subject_of = ROOT
						}
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 11
						OR = {
							area = slovakia_area
							area = transdanubia_area
							area = alfold_area
							area = transylvania_area
							area = southern_transylvania_area
						}
					}
				"
				second_effect = "
					add_country_modifier = {
						name = royal_hungary
						duration = 7300
					}

					custom_tooltip = HAB_UNLOCK_BLACK_ARMY
					set_country_flag = hab_black_army_unlocked
				"
			}
		}
	}

	hab_multicultural_empire = {
		icon = multicultural_empire
		position = 9
		required_missions = { hab_hungary } 
		provinces_to_highlight = {
			owned_by = root
			NOT = { culture_group = root }
			OR = {
				unrest = 1
				nationalism = 1
				local_autonomy = 1
			}
			ROOT = {
				NOT = {
					num_of_owned_provinces_with = {
						value = 30
						NOT = { culture_group = root }
						NOT = { unrest = 1 }
						NOT = { nationalism = 1 }
						NOT = { local_autonomy = 1 }
					}
				}
			}
		}
		trigger = {
			adm_tech = 10
			num_of_owned_provinces_with = {
				value = 30
				NOT = { culture_group = root }
				NOT = { unrest = 1 }
				NOT = { nationalism = 1 }
				NOT = { local_autonomy = 1 }
			}
		}
		effect = {
			if = {
				limit = { 
					government = monarchy
					is_revolutionary = no 
				}
				country_event_with_option_insight = { 
					id = flavor_hab.20
					option_1 = "
						add_government_reform = austrian_dual_monarchy
					"
					option_2 = "
						add_dip_power = 100

						add_government_reform = austrian_absolute_monarchy
					"
				}
			}
			else = {
				add_country_modifier = {
					name = hab_tolerant_society
					duration = -1
				}
			}
		}
	}

	hab_the_last_knights = {
		icon = league_of_the_public_weal
		position = 12
		required_missions = {
			hab_balance_of_power
			hab_balance_estates
		}
	
		trigger = {  
			army_tradition = 40
			num_of_cavalry = 10 # modified
			OR = {
				mil = 5
				full_idea_group = aristocracy_ideas
				AND = {
					NOT = {
						current_age = age_of_discovery
					}
					num_of_cavalry = 15 # modified
				}
			}
		} 
	
		effect = {  
			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_AGE_OF_DISCOVERY
				first_limit = "
					current_age = age_of_discovery
				"
				first_effect = "
					add_country_modifier_for_age = {
						name = hab_onwards_for_glory
						age = age_of_discovery
						else = \"
							add_army_tradition_or_mil_power = { amount = 30 }
							custom_tooltip = SEPERATOR_TOOLTIP
						\"
					}
					
					add_mil_power = 100
				"
				second_custom_tooltip = HAB_IF_NOT_AGE_OF_DISCOVERY
				second_limit = "
					NOT = { current_age = age_of_discovery }
				"
				second_effect = "
					add_country_modifier = {
						name = hab_clinging_onto_past_tales
						duration = 7300
					}
	
					add_army_tradition_or_mil_power = { amount = 15 }
				"
			}
		} 
	}

	hab_aeiou = {
		icon = glory_to_von_habsburg
		position = 14
		required_missions = {
			hab_spread_dynasty
			hab_von_raab
		}

		trigger = {  
			if = {
				limit = {
					OR = {
						has_dlc = "Emperor"
						has_dlc = "Rights of Man"
					}
					NOT = {
						great_power_rank = 2
					}
				}
			}
			else = {
				total_own_and_non_tributary_subject_development = 1500
			}
			NOT = {
				any_country = {
					army_strength = {
						who = ROOT
						value = 1
					}
				}
			}
			army_size = 85 # modified
		} 

		effect = {  
			add_country_modifier = {
				name = hab_aeiou_modifier
				duration = -1
			}

			custom_tooltip = HAB_ALLOWS_CREATION_OF_INTEGRATED_VASSALS
			set_country_flag = hab_integrated_vassals_flag
		} 
	}
}
WoC_austria_4 = {
	slot = 4
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	} 

	hab_weaken_france = {
		icon = mission_the_french_menace
		position = 2
		required_missions = { hab_burgundy } 
		trigger = {
			if = {
				limit = {
					exists = FRA
					FRA = { 
						is_subject = no
					}
				}
				total_development = FRA
				has_won_war_against = {
					who = FRA
					max_years_since = 20
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 3
					region = france_region
				}
			}
		}
		effect = {
			give_claims = { region = france_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			add_power_projection_mission = {
				amount = 10
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier = {
				name = hab_war_against_the_french
				duration = 3650
			}
		}
		ai_weight = {
			factor = 500	#Historical rivalry
		}
	}

	hab_defeat_west_franks = {
		icon = king_of_the_franks
		position = 3
		required_missions = { hab_weaken_france } 
		provinces_to_highlight = {  
			region = france_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			OR = {
				FRA = {
					is_subject_of = ROOT
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 25
					region = france_region
				}
				AND = {
					is_emperor = yes
					calc_true_if = {
						all_province = {
							region = france_region
							is_part_of_hre = yes
						}
						amount = 25
					}
				}
			}
		} 

		effect = {

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_CONQUER
				first_limit = "
					OR = {
						num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
							value = 25
							region = france_region
						}
						FRA = {
							is_subject_of = ROOT
						}
					}
				"
				first_effect = "
					country_event_with_option_insight = {
						id = flavor_hab.29
						option_1 = \"
							custom_tooltip = HAB_SPLIT_FRANCE_INTO_HRE
						\"
						option_2 = \"
							add_army_tradition_or_mil_power = { amount = 10 }

							custom_tooltip = SEPERATOR_TOOLTIP

							create_general_with_pips = { tradition = 55 add_shock = 1 }
						\"
					}
				"

				second_custom_tooltip = HAB_IF_HRE
				second_limit = " 
					is_emperor = yes
					calc_true_if = {
						all_province = {
							region = france_region
							is_part_of_hre = yes
						}
						amount = 25
					}
				"
				second_effect = "
					add_scaled_imperial_influence = 5

					custom_tooltip = SEPERATOR_TOOLTIP

					change_ruler_stat = {
						type = dip
						amount = 1
					}
				"
			}
		} 
	}

	hab_western_europe = {
		icon = mission_establish_mint_towns
		position = 4
		required_missions = {
			hab_defeat_west_franks
			hab_spain_pu
		}
		provinces_to_highlight = {  
			OR = {
				region = france_region
				region = iberia_region
				region = british_isles_region
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		} 

		trigger = {  
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 140
				OR = {
					region = france_region
					region = iberia_region
					region = british_isles_region
				}
			}
		} 

		effect = {  
			add_country_modifier = {
				name = hab_hegemons_of_western_europe
				duration = -1
			}
			
			if = {
				limit = {
					has_dlc = "Rights of Man"
				}
				custom_tooltip = HAB_INCREASED_CHANCE_OF_CHARISMATIC_NEGOTIATOR
				set_country_flag = hab_higher_charismatic_negotiator_chance
			}
			else = {
				change_mil = 1
				change_dip = 1
				change_adm = 1
			}
		} 
	}

	hab_crown_of_bohemia = {
		icon = mission_crown_of_wenceslas 
		position = 5
		provinces_to_highlight = {
			OR = {
				province_id = 266
				AND = {
					ROOT = {
						NOT = {
							num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
								value = 8
								OR = {
									area = bohemia_area
									area = erzgebirge_area
									area = moravia_area
								}
							}
						}
					}
					OR = {
						area = bohemia_area
						area = erzgebirge_area
						area = moravia_area
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		
		trigger = {
			owns_or_non_sovereign_subject_of = 266
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 8
				OR = {
					area = bohemia_area
					area = erzgebirge_area
					area = moravia_area
				}
			}
		}
		effect = {
			give_claims = { area = silesia_area }

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_COMPLETED_WITH_UNION
				first_limit = "
					senior_union_with = BOH
				"
				first_effect = "
					custom_tooltip = HAB_BOHEMIA_INTEGRATES_SILESIA

					hidden_effect = { boh_integrate_silesian_subjects = yes }

					custom_tooltip = SEPERATOR_TOOLTIP

					add_country_modifier = {
						name = hab_union_with_bohemia
						duration = 5475
					}
				"
				second_custom_tooltip = HAB_IF_COMPLETED_WITH_CONQUEST
				second_limit = "
					NOT = { senior_union_with = BOH }
				"
				second_effect = "
					add_country_modifier = {
						name = habsburg_bohemia
						duration = 5475
					}

					add_scaled_imperial_influence = 5
				"
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest (though they got the crown not through war, but marriages are a little bit too mysterious and complex for the AI)
			modifier = {
				factor = 0
				bohemia_area = {
					owner = {
						alliance_with = ROOT
					}
				}
			}
		}
	}

	hab_surpass_poland = {
		icon = mission_partition_poland
		position = 6
		required_missions = { hab_crown_of_bohemia } 
		provinces_to_highlight = {  
			if = {
				limit = {
					exists = PLC
				}
				owner = {
					tag = PLC
				}
			}
			else_if = {
				limit = {
					exists = POL
				}
				owner = {
					tag = POL
				}
			}
			else = {
				region = poland_region
				NOT = { country_or_non_sovereign_subject_holds = ROOT }
			}
		} 

		trigger = {  
			OR = {
				if = {
					limit = {
						exists = PLC
					}
					army_strength = {
						who = PLC
						value = 2
					}
				}
				else_if = {
					limit = {
						exists = POL
					}
					army_strength = {
						who = POL
						value = 2
					}
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 3
					region = poland_region
				}
			}
		} 

		effect = {
			give_claims = { region = poland_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_POLAND_BELOW_300_DEV
				first_limit = "
					surpass_poland_complex_scripted_trigger = yes
				"
				first_effect = "
					austria_surpass_poland_effect = yes
				"
			}
		} 
	}

	hab_king_of_poland = {
		icon = king_of_poland
		position = 7
		required_missions = { hab_surpass_poland } 
		provinces_to_highlight = {
			region = poland_region
			ROOT = {
				NOT = {
					poland_region = {
						type = all
						country_or_non_sovereign_subject_holds = root
					}
				}
				NOT = {
					overlord_of = PLC
				}
				NOT = {
					AND = {
						NOT = { exists = PLC }
						overlord_of = POL
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			if = {
				limit = {
					exists = PLC
				}
				OR = {
					PLC = { is_subject_of = root }
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 15
						region = poland_region
					}
				}
			}
			else_if = {
				limit = {
					exists = POL
				}
				OR = {
					POL = { is_subject_of = root }
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 15
						region = poland_region
					}
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 15
					region = poland_region
				}
			}
		}
		effect = {
			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_POLISH_PU
				first_limit = "
					OR = {
						POL = { is_subject_of = ROOT }
						PLC = { is_subject_of = ROOT }
					}
				"
				first_effect = "
					custom_tooltip = HAB_UNLOCK_LOST_MEN_POLISH_COMPANY
					set_country_flag = lisowczyk_flag

					custom_tooltip = SEPERATOR_TOOLTIP

					add_army_tradition_or_mil_power = { amount = 15 }
				"
				second_custom_tooltip = HAB_IF_CONQUEST
				second_limit = "
					NOT = { POL = { is_subject_of = ROOT } }
					NOT = { PLC = { is_subject_of = ROOT } }
				"
				second_effect = "
					austria_king_of_poland_effect_2 = yes
				"
			}
			hidden_effect = {
				if = {
					limit = {
						NOT = { POL = { is_subject_of = ROOT } }
						NOT = { PLC = { is_subject_of = ROOT } }
					}
					country_event = { id = flavor_hab.31 }
				}
			}
		}
		ai_weight = {
			factor = 75	#Just a little bit of goodies for Austria
		}
	}

	hab_ostend_company = {
		icon = the_ostend_company
		position = 8
		trigger = {
			if = {
				limit = {
					OR = {
						has_dlc = "Dharma"
						has_dlc = "Wealth of Nations"
					}
				}
				any_owned_province = {
					is_owned_by_trade_company = yes
					continent = asia
				}
			}
			else = {
				num_of_owned_provinces_with = {
					value = 10
					is_overseas = yes
					NOT = { continent = north_america }
					NOT = { continent = south_america }
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = hab_ostend_company_1
				duration = -1
			}

			custom_tooltip = emp_hab_ostend_company_effect_tooltip
			hidden_effect = {
				india_superregion = {
					limit = {
						province_has_center_of_trade_of_level = 1
						has_port = yes
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
				east_indies_superregion = {
					limit = {
						province_has_center_of_trade_of_level = 1
						has_port = yes
						NOT = { is_core = root }
						NOT = { is_permanent_claim = root }
					}
					add_permanent_claim = root
				}
			}
		}
		ai_weight = {
			factor = 0	#AI AUstria shouldn't focus on colonizing
		}
	}

	hab_indian_trading = {
		icon = mission_indian_trade_company
		position = 9
		required_missions = { hab_ostend_company } 
		provinces_to_highlight = {
			OR = {
				region = bengal_region
				region = deccan_region
				region = west_india_region
				region = coromandel_region
			}
			has_port = yes
			province_has_center_of_trade_of_level = 1
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 3
				OR = {
					region = bengal_region
					region = deccan_region
					region = west_india_region
					region = coromandel_region
				}
				has_port = yes
				province_has_center_of_trade_of_level = 1
			}
		}
		effect = {
			custom_tooltip = HAB_GRANT_CLAIMS_ON_CHINESE_PORTS
			hidden_effect = {
				north_china_region = {
					limit = {
						NOT = { country_or_non_sovereign_subject_holds = ROOT }
						NOT = { is_permanent_claim = ROOT }
						NOT = { owned_by = ROOT }
						has_port = yes
						province_has_center_of_trade_of_level = 1
					}
					add_permanent_claim = ROOT
				}
				south_china_region = {
					limit = {
						NOT = { country_or_non_sovereign_subject_holds = ROOT }
						NOT = { is_permanent_claim = ROOT }
						NOT = { owned_by = ROOT }
						has_port = yes
						province_has_center_of_trade_of_level = 1
					}
					add_permanent_claim = ROOT
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			add_mercantilism_or_monarch_power = { amount = 3 }

			custom_tooltip = SEPERATOR_TOOLTIP
			
			add_dip_power = 50
		}
		ai_weight = {
			factor = 0	#Same as above
		}
	}

	hab_austrian_australia = {
		icon = colonize_australia
		position = 10
		required_missions = {
			hab_indian_trading
			hab_china
		}
		provinces_to_highlight = {
			region = australia_region
			ROOT = {
				NOT = {
					any_subject_country = {
						is_colonial_nation = yes
						capital_scope = {
							colonial_region = colonial_australia
						}
						any_owned_province = {
							region = australia_region
						}
					}
				}
			}
		}
		trigger = {
			any_subject_country = {
				is_colonial_nation = yes
				capital_scope = {
					colonial_region = colonial_australia
				}
				any_owned_province = {
					region = australia_region
				}
			}
		}
		effect = {
			custom_tooltip = HAB_MODIFY_OSTEND_COMPANY_1
			hidden_effect = {
				remove_country_modifier = hab_ostend_company_1
				add_country_modifier = {
					name = hab_ostend_company_2
					duration = -1
				}
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			4854 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 25
					key = LAND_DOWNUNDER
				}
			}
		}
		ai_weight = {
			factor = 0	#It's a meme mission.
		}
	}

	hab_balance_of_power = {
		icon = balance_of_power
		position = 11
		provinces_to_highlight = {
			is_capital = yes
			if = {
				limit = {
					ROOT = {
						total_development = 1000
						NOT = {
							any_country = {
								root = { is_rival = prev }
							}
						}
					}
				}
				is_capital = yes
				owner = {
					army_size = root
				}
			}
			else = {
				OR = {
					AND = {
						owned_by = root
						root = { is_great_power = no }
					}
					AND = {
						NOT = { owned_by = root }
						owner = {
							is_great_power = yes
							NOT = { alliance_with = root }
							NOT = { is_rival = root }
						}
						root = {
							OR = {
								NOT = {
									any_rival_country = {
										is_great_power = yes
									}
								}
								NOT = {
									any_ally = {
										is_great_power = yes
									}
								}
							}
						}
					}
				}
			}
		}
		trigger = {
			if = {
				limit = {
					total_development = 1000
					NOT = {
						any_country = {
							root = { is_rival = prev }
						}
					}
				}
				all_country = {
					NOT = {
						army_size = root
					}
				}
			}
			else = {
				if = {
					limit = {
						OR = {
							has_dlc = "Emperor"
							has_dlc = "Rights of Man"
						}
					}
					is_great_power = yes
				}
				else = {
					total_own_and_non_tributary_subject_development = 300
				}
				num_of_wars = { amount = 5 }
			}
		}
		effect = {
			add_country_modifier = {
				name = hab_balance_of_power_mod
				duration = 7300
			}

			custom_tooltip = HAB_MODIFY_DIPLOMAT_ADVISOR
			set_country_flag = hab_diplomat_grants_ae_impact
		}
	}

	hab_spread_dynasty = {
		icon = spread_the_von_wettins
		position = 13
		required_missions = { hab_shift_in_balance } 
		trigger = {
			if = {
				limit = {
					government = monarchy
					has_government_attribute = heir
				}
				OR = {
					calc_true_if = {
						desc = emp_hab_spread_dynasties_trigger_tooltip2
						amount = 5
						all_country = {
							OR = {
								junior_union_with = root
								dynasty = root
							}
							has_opinion = {
								who = root
								value = 120
							}
						}
					}
				}
			}
			else = {
				calc_true_if = {
					amount = 5
					all_country = {
						OR = {
							is_subject_of = root
							alliance_with = root
						}
						has_opinion = {
							who = root
							value = 120
						}
						custom_trigger_tooltip = {
							tooltip = same_government_as_root
							same_govt_as_root_trigger = yes
						}
					}
				}
			}
		}
		effect = {
			custom_tooltip = HAB_UNLOCK_SPREAD_DYNASTY_PEACE_OFFER
			set_country_flag = hab_spread_von_habsburgs_peace_offer

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier = {
				name = hab_many_thrones
				duration = 7300
			}

			add_power_projection_mission = {
				amount = 15
			}
		}
	}
}
WoC_austria_5 = {
	slot = 5
	generic = no
	ai = yes
	has_country_shield = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = HAB
			AND = {
				was_tag = HAB
				tag = AUH
			}
		}
	} 

	hab_burgundy = {
		icon = the_crown_of_lothair
		position = 1
		provinces_to_highlight = {
			if = {
				limit = {
					exists = BUR
				}
				owner = {
					tag = BUR
				}
			}
			else = {
				OR = {
					area = bourgogne_area
					area = lorraine_area
				}
				NOT = { country_or_non_sovereign_subject_holds = root }
			}
		}
		trigger = {
			OR = {
				senior_union_with = BUR
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					OR = {
						area = bourgogne_area
						area = lorraine_area
					}
					value = 4
				}
			}
		}
		effect = {
			if = {
				limit = {
					is_emperor = yes
				}
				add_scaled_imperial_influence = 5
				custom_tooltip = SEPERATOR_TOOLTIP
			}

			give_claims = { region = low_countries_region }

			custom_tooltip = SEPERATOR_TOOLTIP

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_BURGUNDY_VASSAL
				first_limit = "
					BUR = {
						junior_union_with = ROOT
					}
				"
				first_effect = "
					country_event_with_option_insight = {
						id = flavor_hab.25
						option_1 = \"
							add_country_modifier = {
								name = hab_dukes_of_burgundy_and_austria
								duration = 3650
							}
					
							custom_tooltip = HAB_DISABLE_HORSE_KISSING
						\"

						option_2 = \"
							add_adm_power = 100
							change_ruler_stat = {
								type = adm
								amount = 1
							}
						\"
					}
				"
	
				second_custom_tooltip = HAB_IF_BURGUNDY_HRE
				second_limit = "
					BUR = {
						NOT = { junior_union_with = ROOT }
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						OR = {
							area = bourgogne_area
							area = lorraine_area
						}
						value = 4
					}
				"
				second_effect = "
					define_advisor = {
						type = diplomat
						skill = 2
						cost_multiplier = 0.5
					}

					custom_tooltip = SEPERATOR_TOOLTIP

					add_dip_power = 100
				"
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
		}
	}

	hab_austrian_netherlands = {
		icon = mission_the_austrian_succession
		position = 2
		required_missions = { hab_burgundy } 
		provinces_to_highlight = {
			region = low_countries_region
			ROOT = {
				NOT = {
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						value = 16 #out of 21 (but at least 7 are not ruled by Burgundy at start)
						region = low_countries_region
					}
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = root }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 16 #out of 21 (but at least 7 are not ruled by Burgundy at start)
				region = low_countries_region
			}
		}
		effect = {
			add_years_of_income = 1
		
			custom_tooltip = SEPERATOR_TOOLTIP
			
			if = {
				limit = {
					has_dlc = "Domination"
				}
				custom_tooltip = HAB_UNLOCK_COUNCIL_OF_MECHELEN
				set_country_flag = council_of_mechelen_flag
			}
			else = {
				change_dip = 2
				add_dip_power = 100
			}
		
			custom_tooltip = SEPERATOR_TOOLTIP
		
			4383 = {
				add_trade_modifier = {
					who = ROOT
					duration = 7300
					power = 35
					key = HAB_CONQUEST_OF_NETHERLANDS
				}
			}
		}
		ai_weight = {
			factor = 0	#They get this usually through the Burgundian Inheritance. And if not, AI Austria should randomly stress a Netherland player because the Austria has little to gain from the Channel
		}
	}

	hab_spain_pu = {
		icon = mission_imperial_spain
		position = 3
		provinces_to_highlight = { 
			if = {
				limit = {
					exists = SPA
				}
				region = iberia_region
				owner = {
					tag = SPA
				}
			}
			else_if = {
				limit = {
					exists = CAS
				}
				region = iberia_region
				owner = {
					tag = CAS
				}
			}
			else = {
				region = iberia_region
				NOT = { country_or_non_sovereign_subject_holds = root }
			}
		}
	
		trigger = {
			if = {
				limit = {
					OR = {
						exists = SPA
						exists = CAS
					}
				}
				OR = {
					if = {
						limit = {
							exists = SPA
						}
						AND = {
							variable_arithmetic_trigger = {
								custom_tooltip = HAB_greater_development_than_SPA
								export_to_variable = {
									variable_name = SPA_Development
									value = total_development
									who = SPA
								}
								export_to_variable = {
									variable_name = HAB_Development
									value = total_development
									who = ROOT
								}
								multiply_variable = {
									which = SPA_Development
									value = 2
								}
								check_variable = {
									which = HAB_Development
									which = SPA_Development
								}
							}
							SPA = {
								dynasty = ROOT
							}
							legitimacy_equivalent = 100
						}
					}
					else_if = {
						limit = {
							exists = CAS
						}
						AND = {
							variable_arithmetic_trigger = {
								custom_tooltip = HAB_greater_development_than_CAS
								export_to_variable = {
									variable_name = CAS_Development
									value = total_development
									who = CAS
								}
								export_to_variable = {
									variable_name = HAB_Development
									value = total_development
									who = ROOT
								}
								multiply_variable = {
									which = CAS_Development
									value = 2
								}
								check_variable = {
									which = HAB_Development
									which = CAS_Development
								}
							}
							CAS = {
								dynasty = ROOT
							}
							legitimacy_equivalent = 100
						}
					}
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						region = iberia_region
						value = 4
					}
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					region = iberia_region
					value = 4
				}
			}
		} 
		effect = {
			if = {
				limit = {
					exists = SPA
					SPA = { valid_for_personal_unions_trigger = yes }
					valid_for_personal_unions_trigger = yes
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					target = SPA
					months = 120
				}

				custom_tooltip = SEPERATOR_TOOLTIP
			}
			else_if = {
				limit = {
					exists = CAS
					CAS = { valid_for_personal_unions_trigger = yes }
					valid_for_personal_unions_trigger = yes
				}
				add_casus_belli = {
					type = cb_restore_personal_union
					target = CAS
					months = 120
				}

				custom_tooltip = SEPERATOR_TOOLTIP
			}

			if = {
				limit = {
					OR = {
						exists = CAS
						exists = SPA
					}
					valid_for_personal_unions_trigger = yes
					if = {
						limit = {
							exists = SPA
						}
						SPA = {
							is_subject = no
							valid_for_personal_unions_trigger = yes
						}
					}
					else_if = {
						limit = {
							exists = CAS
						}
						CAS = {
							is_subject = no
							valid_for_personal_unions_trigger = yes
						}
					}
				}
				custom_tooltip = HAB_AS_LONG_AS_WE_HAVE_PU_CB_ON_CAS_OR_SPA_ALLOW_IBERIAN_PU_DECISION
				set_country_flag = hab_iberian_union_flag
				custom_tooltip = SEPERATOR_TOOLTIP
			}

			give_claims = { region = iberia_region }
		}
	}

	hab_iberian_hegemony = {
		icon = a_question_of_spain
		position = 4
		required_missions = { hab_spain_pu } 

		provinces_to_highlight = {
			region = iberia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}

		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 55
				region = iberia_region
			}
			if = {
				limit = {
					OR = {
						has_dlc = "Rights of Man"
						has_dlc = "Emperor"
					}
				}
				NOT = { great_power_rank = 5 }
			}
			else = {
				total_development = 1000
			}
		} 
		effect = {
			add_permanent_power_projection = {
				amount = 10
				type = HAB_hegemon_of_iberia
			}

			custom_tooltip = SEPERATOR_TOOLTIP

			add_country_modifier_for_age = {
				name = hab_crown_of_iberia
				age = age_of_reformation
				else = "
					add_dip_power = 100
				"
			}

			complex_dynamic_effect = {
				first_custom_tooltip = HAB_IF_WE_HAVE_IBERIAN_PU
				first_limit = "
					OR = {
						AND = {
							senior_union_with = CAS
							NOT = {
								CAS = { is_subject_of_type = integrated_personal_union }
							}
						}
						AND = {
							senior_union_with = SPA
							NOT = {
								SPA = { is_subject_of_type = integrated_personal_union }
							}
						}
					}
				"
				first_effect = "
					austria_iberian_hegemony_reward = yes
				"
			}
		}
	}

	hab_silesia = {
		icon = take_silesia
		position = 6
		required_missions = { hab_crown_of_bohemia } 
		provinces_to_highlight = {
			area = silesia_area
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 3
				area = silesia_area
				development = 15
				num_of_buildings_in_province = 3
			}
		}
		effect = {
			silesia_area = {
				limit = {
					country_or_non_sovereign_subject_holds = ROOT
				}
				add_province_modifier = {
					name = hab_silesian_economy
					duration = 7300
				}
			}
	
			custom_tooltip = HAB_RANDOM_SILESIAN_PROVINCE_GETS_FOLLOWING
			tooltip = {
				264 = {
					add_base_production = 2
					add_or_upgrade_production_building = yes
				}
			}

			hidden_effect = {
				random_province = {
					limit = {
						area = silesia_area
						country_or_non_sovereign_subject_holds = ROOT
						development = 15
					}
					add_base_production = 2
					add_or_upgrade_production_building = yes
				}
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
		}
	}

	hab_galicia = {
		icon = mission_noble_council
		position = 7
		required_missions = { hab_surpass_poland } 
		provinces_to_highlight = {
			OR = {
				area = malopolska_area
				area = red_ruthenia_area
				area = sandomierz_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 6
				OR = {
					area = malopolska_area
					area = red_ruthenia_area
					area = sandomierz_area
				}
			}
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_hab.30
				option_1 = "
					custom_tooltip = HAB_LOCK_AUSTRIA_HUNGARY
					override_country_name = AUSTRIAN_EMPIRE
					add_country_modifier = {
						name = hab_austrian_empire
						duration = -1
					}
				"

				option_2 = "
					custom_tooltip = HAB_UNLOCK_NOBLES_PRIVILEGE_FOR_CULTURAL_MINORITIES
				"
			}
		}
		ai_weight = {
			factor = 500	#Historical conquest
			modifier = {
				factor = 0
				malopolska_area = {
					owner = {
						alliance_with = ROOT
					}
				}
			}
			modifier = {
				factor = 2
				slovakia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
			modifier = {
				factor = 2
				malopolska_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
			modifier = {
				factor = 2
				red_ruthenia_area = {
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
	}

	hab_china = {
		icon = mission_open_up_china
		position = 9
		required_missions = { hab_ostend_company } 
		provinces_to_highlight = {
			OR = {
				region = north_china_region
				region = south_china_region
			}
			has_port = yes
			province_has_center_of_trade_of_level = 1
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 1
				OR = {
					region = north_china_region
					region = south_china_region
				}
				has_port = yes
				province_has_center_of_trade_of_level = 1
			}
		}
		effect = {
			custom_tooltip = HAB_RANDOM_PROVINCE_THAT_MEET_REQUIREMENTS_GETS_FOLLOWING
			tooltip = {
				add_center_of_trade_level = 1
				add_base_production = 2
				add_or_upgrade_trade_building = yes
			}
	
			hidden_effect = {
				random_province = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT
						OR = {
							region = north_china_region
							region = south_china_region
						}
						has_port = yes
						province_has_center_of_trade_of_level = 1
					}
					add_center_of_trade_level = 1
					add_base_production = 2
					add_or_upgrade_trade_building = yes
				}
			}
		}
		ai_weight = {
			factor = 0	#No
		}
	}

	hab_shift_in_balance = {
		icon = shift_the_balance
		position = 12
		required_missions = { hab_balance_of_power } 
		provinces_to_highlight = {
			is_capital = yes
			owner = {
				NOT = { tag = ROOT }
				is_great_power = yes
				NOT = { great_power_rank  = 4 }
			}
		}
		trigger = {
			if = {
				limit = {
					OR = {
						has_dlc = "Emperor"
						has_dlc = "Rights of Man"
					}
				}
				NOT = {
					great_power_rank = 4
				}
			}
			else = {
				total_own_and_non_tributary_subject_development = 800
			}
			army_size = 45 # modified
			OR = {
				full_idea_group = diplomatic_ideas
				diplomatic_reputation = 7
			}
		}
		effect = {
			custom_tooltip = HAB_UNLOCK_HABSBURG_CONNECTIONS_ESTATE_PRIVILEGE
			set_country_flag = hab_unlocked_habsburg_connections

			custom_tooltip = SEPERATOR_TOOLTIP

			change_ruler_stat = {
				type = dip
				amount = 2
			}
		}
	}
}
