unite_austria = {
	
	type = country

	allow = {
		tag = HAB
		or = {
			exists = STY
			exists = TIR
		}
		STY = { owns = 132 }
		TIR = { owns = 73 }
	}
	abort = {}
	success = {
		not = { exists = STY }
		not = { exists = TIR }
		owns = 132
		owns = 73
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			relation = { who = TIR value = 100 }
		}
		modifier = {
			factor = 2
			relation = { who = STY value = 100 }
		}
	}
	effect = {
		prestige = 0.1
	}
}

recover_silesia = {
	
	type = country

	allow = {
		tag = HAB
		not = { owns = 264 }	# Silesia
		264 = { is_core = this }
	}
	abort = {}
	success = {
		owns = 264
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}	
	}
	effect = {
		prestige = 0.1
	}
}

reclaim_the_empire = {
	
	type = country

	allow = {
		tag = HAB
		is_emperor = no
		female = no
		regency = no
		not = { government = republic }
		134 = {
			hre = yes # Vienna is still part of the HRE
		}
	}
	abort = {
		or = {
			regency = yes
			female = yes
			government = republic
			134 = {
				hre = no
			}
		}
	}
	success = {
		is_emperor = yes
	}
	chance = {
		factor = 1000
	}
	effect = {
		prestige = 0.1
	}
}

subjugate_bohemia = {
	
	type = country

	allow = {
		tag = HAB
		exists = BOH
		is_lesser_in_union = no
		is_subject = no
		BOH = {
			is_emperor = no
			neighbour = this
			not = { vassal_of = HAB }
			not = { num_of_cities = this }
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes
			not = { exists = BOH }
			BOH = { is_lesser_in_union = yes }
		}
	}
	success = {
		BOH = { vassal_of = HAB }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = BOH value = 0 } }
		}
	}
	immediate = {
		casus_belli = {
			type = cb_vassalize_mission
			months = 120
			target = BOH
		}
	}
	abort_effect = {
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = BOH
		}
	}
	effect = {
		prestige = 0.1
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = BOH
		}
	}
}

subjugate_hungary = {
	
	type = country

	allow = {
		tag = HAB
		exists = HUN
		is_lesser_in_union = no
		is_subject = no
		HUN = {
			neighbour = this
			is_subject = no
			not = { vassal_of = HAB }
			not = { num_of_cities = this }
			is_lesser_in_union = no
		}
	}
	abort = {
		or = {
			not = { exists = HUN }
			HUN = { is_lesser_in_union = yes }
			is_lesser_in_union = yes
			is_subject = yes
		}
	}
	success = {
		HUN = { vassal_of = HAB }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = HUN value = 0 } }
		}
	}
	immediate = {
		casus_belli = {
			type = cb_vassalize_mission
			months = 120
			target = HUN
		}
	}
	abort_effect = {
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = HUN
		}
	}
	effect = {
		prestige = 0.1
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = HUN
		}
	}
}

subjugate_burgundy = {
	
	type = country

	allow = {
		tag = HAB
		exists = BUR
		is_lesser_in_union = no
		is_subject = no
		BUR = {
			neighbour = this
			not = { vassal_of = HAB }
			not = { num_of_cities = this }
			is_lesser_in_union = no
		}
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes
			not = { exists = BUR }
			BUR = { is_lesser_in_union = yes }
		}
	}
	success = {
		BUR = { vassal_of = HAB }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = BUR value = 0 } }
		}
	}
	immediate = {
		casus_belli = {
			type = cb_vassalize_mission
			months = 120
			target = BUR
		}
	}
	abort_effect = {
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = BUR
		}
	}
	effect = {
		prestige = 0.1
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = BUR
		}
	}
}

no_ottomans_in_eastern_balkans = {
	
	type = country

	allow = {
		tag = HAB
		exists = TUR
		TUR = { neighbour = this }
		eastern_balkans = { owned_by = TUR }
	}
	abort = {
		not = { eastern_balkans = { owned_by = TUR } }
	}
	success = {
		eastern_balkans = { owned_by = this }
		not = { eastern_balkans = { owned_by = TUR } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = TUR value = 0 } }
		}
		modifier = {
			factor = 2
			TUR = { not = { num_of_cities = this } }
		}
	}
	effect = {
		prestige = 0.1
	}
}


no_ottomans_in_western_balkans = {
	
	type = country

	allow = {
		tag = HAB
		exists = TUR
		TUR = { neighbour = this }
		western_balkans = { owned_by = TUR }
	}
	abort = {
		not = { western_balkans = { owned_by = TUR } }
	}
	success = {
		not = { western_balkans = { owned_by = TUR } }
		western_balkans = { owned_by = HAB }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = TUR value = 0 } }
		}
		modifier = {
			factor = 2
			TUR = { not = { num_of_cities = this } }
		}
	}
	effect = {
		prestige = 0.1
	}
}

partition_poland = {
	
	type = country

	allow = {
		tag = HAB
		year = 1700
		exists = POL
		exists = PRU
		exists = RUS
		neighbour = POL
		POL = {
			owns = 259
			owns = 260
			owns = 262
			neighbour = PRU
			neighbour = RUS
		}
		or = {
			is_core = 259
			is_core = 260
			is_core = 262
		}
		relation = { who = RUS value = 0 }
		relation = { who = PRU value = 0 }
	}
	abort = {
		or = {
			not = { exists = POL }
			not = { neighbour = POL }
		}
	}
	success = {
		or = {
			owns = 259
			owns = 260
			owns = 262
		}
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			POL = { not = { num_of_cities = this } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = POL value = 0 } }
		}
	}
	effect = {
		prestige = 0.1
	}
}

austria_spain_relations = {
	
	type = country

	allow = {
		tag = HAB
		exists = SPA
		not = { war_with = SPA }
		not = { marriage_with = SPA }
		is_lesser_in_union = no
		is_subject = no
		government = monarchy
		SPA = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = SPA
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			SPA = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = SPA
		relation = { who = SPA value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = SPA value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = SPA value = -100 } }
		}
	}
	effect = {
		stability = 1
		diplomats = 3
	}
}

austria_burgundy_relations = {
	
	type = country

	allow = {
		tag = HAB
		exists = BUR
		not = { war_with = BUR }
		not = { marriage_with = BUR }
		is_lesser_in_union = no
		is_subject = no
		government = monarchy
		num_of_cities = 4
		BUR = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
			num_of_cities = 4
			neighbour = FRA
		}
	}
	abort = {
		or = {
			war_with = BUR
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			BUR = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = BUR
		relation = { who = BUR value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = BUR value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = BUR value = -100 } }
		}
	}
	effect = {
		infamy = -3
	}
}

austria_bavaria_relations = {
	
	type = country

	allow = {
		tag = HAB
		exists = BAV
		not = { war_with = BAV }
		not = { marriage_with = BAV }
		is_lesser_in_union = no
		is_subject = no
		government = monarchy
		BAV = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = BAV
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			BAV = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}	
			}
		}
	}
	success = {
		marriage_with = BAV
		relation = { who = BAV value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = BAV value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = BAV value = -100 } }
		}
	}
	effect = {
		stability = 1
	}
}

no_territory_to_the_ottomans = {
	
	type = country

	allow = {
		tag = HAB
		exists = TUR
		war_with = TUR
		neighbour = TUR
		not = { austria = { owned_by = TUR } }
	}
	abort = {
		not = { war_with = TUR }
	}
	success = {
		not = { war_with = TUR }
		not = { austria = { owned_by = TUR } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	effect = {
		stability = 2
		war_exhaustion = -5
	}
}


hegemony_over_north_italy = {
	
	type = country

	allow = {
		tag = HAB
		not = { owns = 104 }	# Lombardia
		not = { owns = 109 }	# Mantua
	}
	abort = {}
	success = {
		owns = 104
		owns = 109
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 2
			mil = 8
		}
	}
	immediate = {
		add_temp_claim = 104
		add_temp_claim = 109
	}
	abort_effect = {
		remove_temp_claim = 104
		remove_temp_claim = 109
	}
	effect = {
		add_core = 104
		add_core = 109
	}
}

annex_bohemia = {
	
	type = country

	allow = {
		tag = HAB
		is_subject = no
		is_lesser_in_union = no
		exists = BOH
		BOH = {
			vassal_of = HAB
			neighbour = this
			not = { num_of_cities = this }
			owns = 266
			religion_group = this
		}
	}
	abort = {
		or = {
			not = { exists = BOH }
			is_lesser_in_union = yes
			is_subject = yes
			BOH = { not = { religion_group = this } }
		}
	}
	success = {
		not = { exists = BOH }
		owns = 266
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			relation = { who = BOH value = 100 }
		}
		modifier = {
			factor = 2
			relation = { who = BOH value = 200 }
		}
	}
	effect = {
		prestige = 0.1
	}
}

annex_hungary = {
	
	type = country

	allow = {
		tag = HAB
		is_lesser_in_union = no
		is_subject = no
		exists = HUN
		HUN = {
			vassal_of = HAB
			neighbour = this
			not = { num_of_cities = this }
			owns = 155
			religion_group = this
		}
	}
	abort = {
		or = {
			not = { exists = HUN }
			is_lesser_in_union = yes
			is_subject = yes
			HUN = { not = { religion_group = this } }
		}
	}
	success = {
		not = { exists = HUN }
		owns = 155
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			relation = { who = HUN value = 100 }
		}
		modifier = {
			factor = 2
			relation = { who = HUN value = 200 }
		}
	}
	effect = {
		prestige = 0.1
	}
}

protect_belgium_from_the_french = {
	
	type = country

	allow = {
		tag = HAB
		exists = FRA
		war_with = FRA
		FRA = { neighbour = this }
		owns = 90	# Vlaanderen
		owns = 91	# Hainaut
		owns = 1744	# Antwerpen
	}
	abort = {
		not = { war_with = FRA }
	}
	success = {
		not = { war_with = FRA }
		owns = 90
		owns = 91
		owns = 1744
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	effect = {
		stability = 1
		war_exhaustion = -5
	}
}

protect_hungary_from_the_ottomans = {
	
	type = country

	allow = {
		tag = HAB
		exists = TUR
		war_with = TUR
		TUR = { neighbour = this }
		hungary = { owned_by =  this }
	}
	abort = {
		not = { war_with = TUR }
	}
	success = {
		not = { war_with = TUR }
		not = { hungary = { owned_by =  TUR } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	effect = {
		stability = 1
		war_exhaustion = -5
	}
}

protect_italy_from_the_french = {
	
	type = country

	allow = {
		tag = HAB
		exists = FRA
		war_with = FRA
		FRA = { neighbour = this }
	}
	abort = {
		not = { war_with = FRA }
	}
	success = {
		not = { war_with = FRA }
		not = { italian_region = { owned_by = FRA } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	effect = {
		prestige = 0.1
	}
}

protect_italy_from_the_french_republic = {
	
	type = country

	allow = {
		tag = HAB
		exists = RFR
		war_with = RFR
		RFR = { neighbour = this }
	}
	abort = {
		not = { war_with = RFR }
	}
	success = {
		not = { war_with = RFR }
		not = { italian_region = { owned_by = RFR } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	effect = {
		prestige = 0.1
	}
}

free_transylvania_from_the_ottomans = {
	
	type = country

	allow = {
		tag = HAB
		exists = TUR
		is_lesser_in_union = no
		is_subject = no
		dacia = { owned_by = TUR }
	}
	abort = {
		or = {
			not = { exists = TUR }
			is_lesser_in_union = yes
			is_subject = yes		
		}
	}
	success = {
		not = { dacia = { owned_by = TUR } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = TUR value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = TUR value = -100 } }
		}
	}
	effect = {
		prestige = 0.1
	}
}
