JHC_ITA_development_branch = {
	slot = 1
	generic = no
	ai = yes
	
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	
	has_country_shield = yes
	
	JHC_ITA_italia_transalpina = {
		icon = italia_transalpina
		position = 2
		required_missions = { ITA_rightful_heirs }
		
		provinces_to_highlight = {
			OR = {
				area = provence_area
				area = savoy_dauphine_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = provence_area
					area = savoy_dauphine_area
				}
				value = 6
			}
			205 = { owned_by = ROOT }
		}
		effect = {
			give_claims = { area = languedoc_area }
			give_claims = { area = guyenne_area }
			give_claims = { area = poitou_area }
			give_claims = { area = massif_central_area }
			give_claims = { area = pyrenees_area }
			
			custom_tooltip = " "
			
			205 = { center_of_trade = 1 }
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_lose_10_separatism
			hidden_effect = {
				provence_area = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT 
					}
					add_nationalism = -10
				}
				savoy_dauphine_area = {
					limit = {
						country_or_non_sovereign_subject_holds = ROOT 
					}
					add_nationalism = -10
				}
			}
		}
	}
	
	JHC_ITA_the_seven_provinces = {
		icon = the_seven_provinces
		position = 4
		required_missions = { JHC_ITA_italia_transalpina }
		
		provinces_to_highlight = {
			OR = {
				area = languedoc_area
				area = guyenne_area
				area = poitou_area
				area = massif_central_area
				area = pyrenees_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = languedoc_area
					area = guyenne_area
					area = poitou_area
					area = massif_central_area
					area = pyrenees_area
				}
				value = 16
			}
		}
		effect = {
			give_claims = { region = france_region }
			
			custom_tooltip = " "
			
			add_accepted_culture_or_dip_power = { culture = occitain free = yes }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_integration_with_southern_france
				duration = 10950
			}
		}
	}
	
	JHC_ITA_the_gallic_wars = {
		icon = mission_invade_england_ITA
		position = 5
		required_missions = { JHC_ITA_the_seven_provinces }
		
		provinces_to_highlight = {
			region = france_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 50
				region = france_region
			}
		}
		effect = {	
			#for english mission
			give_claims = { area = east_midlands_area }
			give_claims = { area = west_midlands_area }
			give_claims = { area = yorkshire_area }
			give_claims = { area = wessex_area }
			give_claims = { area = home_counties_area }
			give_claims = { area = east_anglia_area }
			give_claims = { area = wales_area }
			give_claims = { area = scottish_marches_area }
			
			#for rhenish mission
			give_claims = { area = romandie_area }
			give_claims = { area = upper_rhineland_area }
			give_claims = { area = romandie_area }
			give_claims = { area = alsace_area }
			give_claims = { area = palatinate_area }
			give_claims = { area = lower_rhineland_area }
			give_claims = { id = 85 }
			give_claims = { area = north_brabant_area }
			give_claims = { area = brabant_area }
			give_claims = { area = flanders_area }
			give_claims = { area = wallonia_area }
			give_claims = { id = 96 }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_conquest_of_west_1
				duration = -1
			}
			
			custom_tooltip = ITA_enable_privilege_for_military_governors
			set_country_flag = ITA_enable_privilege_for_military_governors_flag
		}
	}
	
	ITA_britain = {
		icon = defeat_the_english
		position = 7
		required_missions = { JHC_ITA_the_gallic_wars }
		provinces_to_highlight = {
			OR = {
				area = east_midlands_area
				area = west_midlands_area
				area = yorkshire_area
				area = wessex_area
				area = home_counties_area
				area = east_anglia_area
				area = wales_area
				area = scottish_marches_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				value = 20
				OR = {
					area = east_midlands_area
					area = west_midlands_area
					area = yorkshire_area
					area = wessex_area
					area = home_counties_area
					area = east_anglia_area
					area = wales_area
					area = scottish_marches_area
				}
			}
		}
		effect = {
			add_country_modifier_for_age = {
				name = ITA_conquest_of_britain
				age = age_of_absolutism
				else = "
					create_general_with_pips = { tradition = 80 add_manuever = 2 add_shock = 1 }
					
					custom_tooltip = \" \"
					
					add_mil_power = 100
				"
			}
			
			add_war_exhaustion = -2
			
			custom_tooltip = " "
			
			add_navy_tradition = 20
		}
	}
}

JHC_ITA_gallia_branch = {
	slot = 2
	generic = no
	ai = yes
	
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	
	has_country_shield = yes
	
	ITA_rightful_heirs = {
		icon = a_roman_empire
		position = 1
		required_missions = {  }
		provinces_to_highlight = {
			region = italy_region
			NOT = { owned_by = ROOT }
		}
		trigger = {
			total_development = 800
			num_of_owned_provinces_with = {
				region = italy_region
				value = 45
			}
		}
		effect = {
			give_claims = { area = provence_area }
			give_claims = { area = savoy_dauphine_area }
			give_claims = { area = tirol_area }
			give_claims = { area = east_adriatic_coast_area}
			give_claims = { id = 4174 }
			give_claims = { id = 130 }
			give_claims = { id = 1826 }
			give_claims = { id = 4738 }
			give_claims = { id = 4752 }
			give_claims = { id = 4754 }
			
			custom_tooltip = " "
			
			country_event_with_option_insight = {
				id = flavor_ita.1
				option_1 = "
					if = {
						limit = {
							NOT = { government_rank = 3 } 
						}
						set_government_rank = 3
						custom_tooltip = \" \"
					}
					add_country_modifier = {
						name = ITA_blatant_roman_larp
						duration = -1
						desc = ITA_until_roman_empire_is_formed
					}
					custom_tooltip = ITA_unlock_roman_ambition
					custom_tooltip = \" \"
					custom_tooltip = ITA_stylize
				"
				option_2 = "
					add_country_modifier = {
						name = ITA_permanent_absolutism_buff
						duration = -1
					}
					
					add_power_projection_mission = { amount = 10 }
				"
			}
		}
	}
	
	JHC_ITA_redeem_tirolo = {
		icon = claim_tirol
		position = 3
		required_missions = { ITA_rightful_heirs }
		
		provinces_to_highlight = {
			area = tirol_area
			NOT = { owned_by = ROOT }
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = emp_ita_redeem_tirolo_tt
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					value = 4
					area = tirol_area
				}
			}
		}
		effect = {
			#two claims for mission
			give_claims = { area = inner_austria_area }
			give_claims = { area = austria_proper_area }
			
			#Extra claims in the west which are otherwise missing for ROM formation
			give_claims = { area = upper_swabia_area }
			give_claims = { area = lower_swabia_area }
			give_claims = { area = switzerland_area }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ita_experienced_alpini
				duration = 7300
			}
			
			add_army_tradition_or_mil_power = { amount = 10 }
		}
	}
	
	JHC_ITA_humiliate_austria = {
		icon = humiliate_austria
		position = 4
		required_missions = { JHC_ITA_redeem_tirolo }
		provinces_to_highlight = {
			OR = {
				area = tirol_area
				area = inner_austria_area
				area = austria_proper_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = tirol_area
					area = inner_austria_area
					area = austria_proper_area
				}
				value = 10
			}
		}
		effect = {
			give_claims = { area = east_bavaria_area }
			give_claims = { area = lower_bavaria_area }
			give_claims = { area = upper_bavaria_area }
			
			give_claims = { area = transdanubia_area }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_humiliation_of_holy_roman_empire_1
				duration = -1
			}
			
			if = {
				limit = {
					hre_size = 1
					NOT = { has_global_flag = flavor_ita_7_fired }
				}
				add_casus_belli = {
					target = emperor
					type = cb_ita_dismantle_hre
					months = 240
				}
				
				custom_tooltip = ITA_how_cb_works
			}
		}
	}
	
	ITA_to_the_rhine = {
		icon = mission_rhine
		position = 6
		required_missions = { JHC_ITA_humiliate_austria JHC_ITA_the_gallic_wars }
		provinces_to_highlight = {
			OR = {
				area = romandie_area
				area = upper_rhineland_area
				area = romandie_area
				area = alsace_area
				area = palatinate_area
				area = lower_rhineland_area
				province_id = 85 #cologne
				area = north_brabant_area
				area = brabant_area
				area = flanders_area
				area = wallonia_area
				province_id = 96 #zeeland
				area = upper_swabia_area
				area = lower_swabia_area 
				area = switzerland_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				custom_trigger_tooltip = {
					tooltip = ITA_to_the_rhine_tt
					OR = {
						area = romandie_area
						area = upper_rhineland_area
						area = romandie_area
						area = alsace_area
						area = palatinate_area
						area = lower_rhineland_area
						province_id = 85 #cologne
						area = north_brabant_area
						area = brabant_area
						area = flanders_area
						area = wallonia_area
						province_id = 96 #zeeland
						area = upper_swabia_area
						area = lower_swabia_area 
						area = switzerland_area
					}
				}
				value = 35 
			}
		}
		effect = {
			give_claims = { area = holland_area }
			give_claims = { area = frisia_area }
			give_claims = { area = westphalia_area }
			give_claims = { area = north_westphalia_area }
			give_claims = { area = north_rhine_area }
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_conquest_of_west_1_2
			hidden_effect = {
				remove_country_modifier = ITA_conquest_of_west_1
				add_country_modifier = {
					name = ITA_conquest_of_west_2
					duration = -1
				}
			}
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_warriors_do_not_read_books_will_no_longer_happen
			set_country_flag = warriors_can_read_books
			
			country_event_with_option_insight = {
				id = flavor_ita.4 
				option_1 = "
					custom_tooltip = ITA_upgrade_military_governorship_with_abso
					
					custom_tooltip = \" \"
					
					add_rebel_progress = {
						value = -50
					}
				"
				option_2 = "
					custom_tooltip = ITA_upgrade_military_governorship_with_autonomy_in_terr
					
					custom_tooltip = \" \"
					
					custom_tooltip = ITA_all_provinces_lose_10_autonomy
				"
				option_3 = "
					custom_tooltip = ITA_upgrade_military_governorship_with_army_quality
					
					custom_tooltip = \" \"
					
					create_general_with_pips = { tradition = 80 add_siege = 2 add_fire = 1 }
				"
			}
		}
	}
	
	JHC_ITA_give_him_back_his_legions = {
		icon = give_him_back_his_legions
		position = 8
		required_missions = { ITA_to_the_rhine }
		
		provinces_to_highlight = {
			OR = {
				area = holland_area
				area = frisia_area
				area = westphalia_area
				area = north_westphalia_area
				area = north_rhine_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			2972 = {
				country_or_non_sovereign_subject_holds = ROOT
			}
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = holland_area
					area = frisia_area
					area = westphalia_area
					area = north_westphalia_area
					area = north_rhine_area
				}
				value = 14
			}
		}
		effect = {
			add_country_modifier = {
				name = ita_further_than_caesar
				duration = -1
			}
			
			custom_tooltip = ITA_lost_legions_merc_company
			set_country_flag = ITA_lost_legions_flag
		}
	}
}

JHC_ITA_war_branch = {
	slot = 3
	generic = no
	ai = yes
	
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	
	has_country_shield = yes
	
	JHC_ITA_take_the_littoral = {
		icon = take_the_littoral
		position = 2
		required_missions = { ITA_rightful_heirs }
		
		provinces_to_highlight = {
			OR = {
				area = east_adriatic_coast_area
				province_id = 4174
				province_id = 130
				province_id = 1826
				province_id = 4738
				province_id = 4752
				province_id = 4754
			}
			NOT = { owned_by = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = east_adriatic_coast_area
					province_id = 4174
					province_id = 130
					province_id = 1826
					province_id = 4738
					province_id = 4752
					province_id = 4754
				}
				value = 7
			}
		}
		effect = {
			# for next mission 
			give_claims = { area = albania_area }
			give_claims = { area = northern_greece_area }
			give_claims = { area = macedonia_area }
			give_claims = { area = morea_area }
			
			#because no mission + for roman empire
			give_claims = { area = carinthia_area }
			give_claims = { area = croatia_area }
			give_claims = { area = bosnia_area }
			give_claims = { area = slavonia_area }
			give_claims = { area = serbia_area }
			give_claims = { area = rascia_area }
			
			custom_tooltip = " "
			
			137 = {
				add_trade_modifier = {
					who = ROOT
					duration = -1
					power = 40
					key = ITA_littoral
				}
			}
		}
	}
	
	JHC_ITA_cross_the_pindus = {
		icon = cross_the_pindus
		position = 3
		required_missions = { JHC_ITA_take_the_littoral }
		
		provinces_to_highlight = {
			OR = {
				area = albania_area
				area = northern_greece_area
				area = macedonia_area
				area = morea_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = albania_area
					area = northern_greece_area
					area = macedonia_area
					area = morea_area
				}
				value = 14
			}
		}
		effect = {
			give_claims = { area = aegean_archipelago_area }
			give_claims = { area = thrace_area }
			give_claims = { area = bulgaria_area }
			give_claims = { area = silistria_area }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_conquest_of_east_1
				duration = -1
			}
			
			add_war_exhaustion = -1
			
			custom_tooltip = " "
			
			add_prestige_or_monarch_power = { amount = 20 }
		}
	}
	
	JHC_ITA_reclaim_our_latin_heritage = {
		icon = la_latinocrazia
		position = 4
		required_missions = { JHC_ITA_cross_the_pindus }
		
		provinces_to_highlight = {
			OR = {
				area = aegean_archipelago_area
				area = thrace_area
				area = bulgaria_area
				area = silistria_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = aegean_archipelago_area
					area = thrace_area
					area = bulgaria_area
					area = silistria_area
				}
				value = 13
			}
			151 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = {
			give_claims = { region = anatolia_region }
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_conquest_of_east_1_2
			hidden_effect = {
				remove_country_modifier = ITA_conquest_of_east_1
				add_country_modifier = {
					name = ITA_conquest_of_east_2
					duration = -1
				}
			}
			
			custom_tooltip = " "
			
			if = {
                limit = {
                    has_dlc = "Mandate of Heaven"
                }
                151 = {
                    add_province_modifier = {
                        name = ITA_constantinople_taken
                        duration = -1
                    }
                }
            }
            else = {
                151 = {
                    add_province_modifier = {
                        name = ITA_constantinople_taken_no_dlc
                        duration = -1
                    }
                }
            }


		}
	}
	
	ITA_holy_roman_delusions = {
		icon = lead_the_empire
		position = 5
		required_missions = { JHC_ITA_humiliate_austria }
		provinces_to_highlight = {
			is_part_of_hre = yes
		}
		trigger = {
			OR = {
				custom_trigger_tooltip = {
					tooltip = fra_dismantled_hre_tt
					NOT = { hre_size = 1 }
				}
				is_emperor = yes
			}
		}
		effect = {
			custom_tooltip = ITA_humiliation_of_holy_roman_empire_1_2
			hidden_effect = {
				remove_country_modifier = ITA_humiliation_of_holy_roman_empire_1
				add_country_modifier = {
					name = ITA_humiliation_of_holy_roman_empire_2
					duration = -1
				}
			}
			
			custom_tooltip = " "
			
			complex_dynamic_effect = {
				first_custom_tooltip = ITA_if_done_via_emperorship
				first_limit = "is_emperor = yes"
				first_effect = "
					add_country_modifier = {
						name = ITA_enhanced_emperorship
						duration = -1
					}
				"
				second_custom_tooltip = ITA_if_done_via_dismantlement
				second_limit = "
					NOT = { hre_size = 1 }
				"
				second_effect = "
					tooltip = {
						add_permanent_power_projection = {
							amount = 5
							type = ITA_no_more_holy_romans
						}
					}
					
					add_splendor = 400
				"
			}
			hidden_effect = {
				if = {
					limit = {
						NOT = { is_emperor = yes }
						NOT = { hre_size = 1 }
					}
					add_permanent_power_projection = { #would not work otherwise
						amount = 5
						type = ITA_no_more_holy_romans
					}
				}
			}
		}
	}
	
	JHC_ITA_a_real_roman_empire = {
		icon = a_real_roman_empire
		position = 7
		required_missions = { ITA_to_the_rhine ITA_holy_roman_delusions JHC_ITA_terra_santa }
		provinces_to_highlight = {
			BYZ_roman_empire_decision_trigger = yes
			NOT = { owned_by = ROOT }
		}
		trigger = {
			owns = 118 #not rome but fix to rome`
			tag = ROM
		}
		effect = {		
			country_event_with_effect_insight = {
				id = flavor_ita.5
				effect = "
					118 = {
						add_province_triggered_modifier = ITA_all_roads_lead_to_rome
					}
					
					custom_tooltip = \" \"
					
					custom_tooltip = ITA_final_modifier_tt
					
					custom_tooltip = \" \"
					
					add_permanent_power_projection = {
						amount = 10
						type = ITA_true_roman_empire
					}
				"
			}
		}
	}
}

JHC_ITA_unification_branch = {
	slot = 4
	generic = no
	ai = yes
	
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	
	has_country_shield = yes
	
	JHC_ITA_a_worthy_navy = {
		icon = a_worthy_navy
		position = 1
		
		trigger = {
			navy_size_percentage = 0.9
		}
		effect = {
			#Iberian Claims
			give_claims = { area = aragon_area } 
			give_claims = { area = catalonia_area } 
			give_claims = { area = valencia_area } 
			give_claims = { area = baleares_area } 
			#north african claims
			give_claims = { area = tunisia_area }
			give_claims = { area = djerba_area }
			give_claims = { area = tripolitania_area }
			
			custom_tooltip = " "
			
			if = {
                limit = {
                    has_dlc = "Mandate of Heaven"
                }
                add_country_modifier = {
                    name = ITA_best_form_of_defense_is_attack
                    duration = 7300
                }
            }
            else = {
                add_country_modifier = {
                    name = ITA_best_form_of_defense_is_attack_no_dlc
                    duration = 7300
                }
            }
			
			complex_dynamic_effect = {
				first_custom_tooltip = ITA_if_we_have_morale
				first_limit = "
					has_global_modifier_value = {
						which = naval_morale
						value = 0.15
					}
				"
				first_effect = "
					add_country_modifier = {
						name = ITA_unification_of_navies
						duration = 10950
					}
				"
			}
		}
	}
	
	JHC_ITA_africa_proconsulare = {
		icon = africa_proconsulare
		position = 3
		required_missions = { JHC_ITA_a_worthy_navy }
		
		provinces_to_highlight = {
			OR = {
				area = tunisia_area
				area = djerba_area
				area = tripolitania_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = tunisia_area
					area = djerba_area
					area = tripolitania_area
				}
				value = 10
			}
		}
		effect = {
			#egypt
			give_claims = { area = delta_area }
			give_claims = { area = vostani_area }
			give_claims = { area = bahari_area }
			give_claims = { area = cyrenaica_area }
			#rest of maghreb
			give_claims = { region = maghreb_region }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_conquest_of_africa_1 
				duration = -1
			}
			
			add_country_modifier = {
				name = ita_scipios_helmet
				duration = 7300
			}
			
			add_navy_tradition = 10
		}
	}
	
	ITA_african_coastline = {
		icon = mission_control_the_barbary_coast
		position = 4
		required_missions = { JHC_ITA_africa_proconsulare }
		provinces_to_highlight = {
			OR = {
				area = kabylia_area
				area = barbary_coast_area
				area = algiers_area
				area = northern_morocco_area
				province_id = 343
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = kabylia_area
					area = barbary_coast_area
					area = algiers_area
					area = northern_morocco_area
					province_id = 343
				}
				value = 10
			}
		}
		effect = {
			create_admiral = { tradition = 70 }
			
			custom_tooltip = " "
			
			add_years_of_income = 0.5
			
			custom_tooltip = " "
			
			define_advisor = {
				type = commandant
				skill = 3
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.5
			}
		}
	}
	
	JHC_ITA_anatolian_frontier = {
		icon = anatolian_frontier
		position = 5
		required_missions = { JHC_ITA_reclaim_our_latin_heritage }
		provinces_to_highlight = {
			region = anatolia_region
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				region = anatolia_region
				value = 30
			}
		}
		effect = {
			give_claims = { area = aleppo_area } 
			give_claims = { area = syria_area } 
			give_claims = { area = syrian_desert_area } 
			
			custom_tooltip = " "
			
			# add_country_modifier = {
				# name = ita_eastern_romans
				# duration = -1
			# }
			
			add_accepted_culture_or_dip_power = { culture = turkish value = 100 }
			
			custom_tooltip = " "
			
			add_country_modifier_for_age = {
				name = ITA_latin_tiara
				age = age_of_reformation
			}
		}
	}
}

JHC_ITA_overseas_branch = {
	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 = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	
	JHC_ITA_spagna_tarraconense = {
		icon = spagna_tarraconense
		position = 2
		required_missions = { JHC_ITA_a_worthy_navy }
		
		provinces_to_highlight = {
			OR = {
				area = aragon_area
				area = catalonia_area
				area = valencia_area
				area = baleares_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = aragon_area
					area = catalonia_area
					area = valencia_area
					area = baleares_area
				}
				value = 13
			}
			213 = { country_or_non_sovereign_subject_holds = ROOT }
			220 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = {
			give_claims = { region = iberia_region }
			
			custom_tooltip = " "
			
			add_years_of_trade_income = {
				years = 2
				custom_tooltip = BYZ_add_2_years_of_trade_income
			}
			
			custom_tooltip = " "
			
			add_mercantilism = 3
			
			custom_tooltip = " "
			
			213 = {
				set_center_level_2_center_of_trade = yes
			}
			220 = {
				set_center_level_2_center_of_trade = yes
			}
		}
	}
	
	JHC_ITA_hispaniae = {
		icon = hispaniae
		position = 3
		required_missions = { JHC_ITA_spagna_tarraconense }
		
		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 = {
				region = iberia_region
				value = 50
			}
		}
		effect = {
			add_dip_power = 75
			add_adm_power = 75
			add_mil_power = 75
			
			custom_tooltip = " "

			add_country_modifier_for_age = {
				name = ITA_triumph_for_hispaniae
				age = age_of_reformation
				else = "
					add_army_tradition_or_mil_power = { amount = 25 }
					
					custom_tooltip = \" \"
					
					add_mil_power = 100
				"
			}
		}
	}
	
	JHC_ITA_invade_egypt = {
		icon = invade_egypt
		position = 4
		required_missions = { JHC_ITA_africa_proconsulare }
		
		provinces_to_highlight = {
			OR = {
				area = delta_area
				area = vostani_area
				area = bahari_area
				area = cyrenaica_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = delta_area
					area = vostani_area
					area = bahari_area
					area = cyrenaica_area
				}
				value = 10
			}
		}
		effect = {
			give_claims = { area = palestine_area }
			give_claims = { area = trans_jordan_area }
			give_claims = { region = egypt_region }
			
			custom_tooltip = " "
			
			358 = {
				add_trade_modifier = {
					who = root
					duration = -1
					power = 50
					key = alexandria_ambition
				}
			}
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_conquest_of_africa_1_2
			hidden_effect = {
				remove_country_modifier = ITA_conquest_of_africa_1
				add_country_modifier = {
					name = ITA_conquest_of_africa_2
					duration = -1
				}
			}
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_distribute_dev_across_the_empire
			hidden_effect = {
				for = {
					amount = 12
					effect = "
						random_owned_province = {
							add_random_development = 1
						}
					"
				}
			}
			complex_dynamic_effect = {
				first_custom_tooltip = ITA_if_we_have_majority_of_trade_power
				first_limit = "
					358 = { has_most_province_trade_power = ROOT }
				"
				first_effect = "
					custom_tooltip = ITA_distribute_additional_dev_across_the_empire
					hidden_effect = {
						for = {
							amount = 8
							effect = \"
								random_owned_province = {
									add_random_development = 1
								}
							\"
						}
					}
				"
			}
		}
	}
	
	JHC_ITA_terra_santa = {
		icon = terra_santa
		position = 6
		required_missions = { JHC_ITA_invade_egypt JHC_ITA_anatolian_frontier }
		
		provinces_to_highlight = {
			OR = {
				area = palestine_area
				area = aleppo_area
				area = syria_area
				area = trans_jordan_area
				area = syrian_desert_area
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
				OR = {
					area = palestine_area
					area = aleppo_area
					area = syria_area
					area = trans_jordan_area
					area = syrian_desert_area
				}
				value = 15
			}
			
			379 = { country_or_non_sovereign_subject_holds = ROOT }
		}
		effect = {
			give_claims = { area = al_jazira_area }
			
			if = {
				limit = {
					379 = {
						NOT = { religion = ROOT }
					}
				}
				custom_tooltip = " "
				379 = {
					change_religion = ROOT
				}
			}
			
			custom_tooltip = " "
			
			379 = {
				add_province_triggered_modifier = ITA_crusader_kings
			}
			
			# custom_tooltip = " "
			
			add_prestige_or_monarch_power = { amount = 40 }
		}
	}
	
	JHC_ITA_befriend_ethiopia = {
		icon = befriend_ethiopia
		position = 8
		required_missions = { JHC_ITA_terra_santa }
		
		provinces_to_highlight = {
			if = {
				limit = { exists = ETH }
				owned_by = ETH
			}
			else_if = {
				limit = {
					any_known_country = {
						capital_scope = {
							region = horn_of_africa_region
						}
						religion_group = christian
					}
				}
				owner = {
					capital_scope = {
						region = horn_of_africa_region
					}
					religion_group = christian
					NOT = { alliance_with = ROOT }
				}
			}
			else = {
				OR = {
					area = central_ethiopia_area
					area = southern_ethiopia_area
					area = tigray_area
					area = damot_area
					area = hadiya_area
					area = shewa_area
				}
			}
		}
		trigger = {
			if = {
				limit = {
					OR = {
						any_known_country = {
							capital_scope = {
								region = horn_of_africa_region
							}
							religion_group = christian
						}
						exists = ETH
					}
				}
				OR = {
					if = {
						limit = {
							exists = ETH
						}
						alliance_with = ETH
					}
					else = {
						hidden_trigger = { always = no }
					}
					if = {
						limit = {
							any_known_country = {
								capital_scope = {
									region = horn_of_africa_region
								}
								religion_group = christian
							}
						}
						any_ally = {
							custom_trigger_tooltip = {
								tooltip = emp_ita_befriend_ethiopia_capital_tt
								capital_scope = {
									region = horn_of_africa_region
								}
							}
							religion_group = christian
						}
					}
					else = {
						hidden_trigger = { always = no }
					}
					AND = {
						central_ethiopia_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						southern_ethiopia_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						damot_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						tigray_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						shewa_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
						hadiya_area = {
							type = all
							country_or_non_sovereign_subject_holds = ROOT
						}
					}
				}
			}
			else = {
				central_ethiopia_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
				southern_ethiopia_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
				damot_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
				tigray_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
				shewa_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
				hadiya_area = {
					type = all
					country_or_non_sovereign_subject_holds = ROOT
				}
			}
		}
		effect = {
			add_dip_power = 100
		
			custom_tooltip = " "
			
			custom_tooltip = ITA_religious_diplomats
			set_country_flag = ITA_religious_diplomats_flag
			
			custom_tooltip = " "
			
			if = {
				limit = {
					alliance_with = ETH
				}
				ETH = {
					add_historical_friend = ROOT
				}
				add_historical_friend = ETH
			}
			else_if = {
				limit = {
					any_country = {
						capital_scope = {
							region = horn_of_africa_region
						}
						religion_group = christian
					}
				}
				random_ally = {
					limit = {
						capital_scope = {
							region = horn_of_africa_region
						}
						religion_group = christian
					}
					add_historical_friend = ROOT
					ROOT = {
						add_historical_friend = PREV
					}
				}
			}
			else = {
				add_army_tradition_or_mil_power = { amount = 15 }
			}
		}
	}
}

ITA_non_conquest_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	JHC_ITA_complete_the_risorgimento = {
		icon = complete_the_risorgimento
		position = 8
		required_missions = {  }
		
		provinces_to_highlight = {
			region = italy_region
			NOT = { owned_by = ROOT }
		}
		trigger = {
			italy_region = {
				type = all
				owned_by = ROOT
			}
			
			development_in_provinces = {
				region = italy_region
				value = 1000
			}
			
			stability = 2
		}
		effect = {
			add_country_modifier = {
				name = ita_from_po_to_toe
				duration = -1
			}
			
			if = {
                limit = {
                    has_dlc = "Mandate of Heaven"
                }
                italy_region = {
                    add_permanent_province_modifier = {
                        name = ITA_unity
                        duration = -1
                    }
                }
            }
            else = {
                italy_region = {
                    add_permanent_province_modifier = {
                        name = ITA_unity_no_dlc
                        duration = -1
                    }
                }
            }
		}
	}
	
	JHC_ITA_a_place_among_the_great_powers = {
		icon = a_place_among_the_great_powers
		position = 10
		required_missions = { JHC_ITA_answer_the_roman_question JHC_ITA_complete_the_risorgimento }
		
		provinces_to_highlight = {
			OR = {
				has_dlc = "Rights of Man"
				has_dlc = "Emperor"
			}
			NOT = { owned_by = ROOT }
			owner = {
				is_great_power = yes
			}
			is_capital = yes
		}
		
		trigger = {
			if = {
				limit = {
					OR = {
						has_dlc = "Rights of Man"
						has_dlc = "Emperor"
					}
				}
				is_great_power = yes
				NOT = { great_power_rank = 4 }
				OR = {
					any_ally = { is_great_power = yes }
					NOT = { great_power_rank = 2 }
				}
			}
			else = {
				OR = {
					total_development = 1500
					any_ally = { total_development = 500 }
				}
			}
			
			custom_trigger_tooltip = {
				tooltip = ITA_no_country_has_army_larger_than_us
				NOT = {
					any_country = {
						army_size = ROOT
					}
				}
			}
			custom_trigger_tooltip = {
				tooltip = ITA_no_country_has_navy_larger_than_us
				NOT = {
					any_country = {
						navy_size = ROOT
					}
				}
			}
		}
		effect = {
			add_power_projection_mission = { amount = 25 }
			
			custom_tooltip = " "
			
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				custom_tooltip = ITA_gain_100_splendor
				set_country_flag = ITA_gain_100_splendor_flag
				
				custom_tooltip = " "
			}
			
			add_country_modifier_for_age = {
				name = ITA_diplomatic_revolution
				age = age_of_reformation
				else = "
					add_country_modifier = {
						name = ITA_diplomatic_revolution_weaker
						duration = -1
					}
				"
			}
			if = {
				limit = {
					OR = {
						current_age = age_of_discovery
						current_age = age_of_reformation
					}
				}
				custom_tooltip = ITA_after_the_age_ends_weaken
			}
		}
	}
	
	ITA_the_trades_to_come = {
		icon = venture_captains #Probably cavour here as an icon
		position = 11
		required_missions = { }
		provinces_to_highlight = {
			OR = {
				AND = {
					NOT = { 
						ROOT = {
							num_of_centers_of_trade = 30
						}
					}
					province_has_center_of_trade_of_level = 1
					NOT = { owned_by = ROOT }
				}
				AND = {
					has_trader = ROOT
					NOT = {
						trade_share = {
							country = ROOT
							share = 80
						}
					}
				}
			}
		}
		trigger = {
			if = {
				limit = {
					trade_income_percentage = 0.01 #to prevent crashes
				}
				monthly_trade_income = 300
			}
			num_of_centers_of_trade = 30
			calc_true_if = {
				all_trade_node = {
					trade_share = {
						country = ROOT
						share = 80
					}
				}
				amount = 3
			}
		}
		effect = {
			add_years_of_trade_income = {
				years = 2
				custom_tooltip = BYZ_add_2_years_of_trade_income
			}
			
			custom_tooltip = " "
			
			enable_branching_mission_review = {
				key = ITA_TRADE
				ai_event_id = flavor_ita.8
			}
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_unlock_new_estate_privileges_that_will_be_decided
		}
	}
}

ITA_trade_branching_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		NOT = {
			OR = {
				has_country_flag = ITA_venice_missions
				has_country_flag = ITA_genoa_missions
			}
		}
	}
	has_country_shield = yes
	
	ITA_branch_1_12 = {
		icon = mission_unknown_mission
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
		}
		trigger = {
			ITA_branch_trigger = yes
		}
		effect = {
			ITA_branch_effect = yes
		}
	}
	
	ITA_branch_1_13 = {
		icon = mission_unknown_mission
		position = 13
		required_missions = { ITA_branch_1_12 ITA_branch_2_12 }
		provinces_to_highlight = {
		}
		trigger = {
			ITA_branch_trigger = yes
		}
		effect = {
			ITA_branch_effect = yes
		}
	}
}

ITA_genoa_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		has_country_flag = ITA_genoa_missions
	}
	has_country_shield = yes

	ITA_genoa_node = {
		icon = secure_the_republic
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
			province_id = 101
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			101 = {
				owned_by = ROOT
				highest_value_trade_node = yes
				trade_share = {
					country = ROOT
					share = 90
				}
				trade_node_value = 150
				if = {
					limit = {
						has_dlc = "Dharma"
					}
					province_has_center_of_trade_of_level = 3
				}
			}
		}
		effect = {
			add_mercantilism = 5
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_upgrade_privilege_genoa_version
			
			custom_tooltip = " "
			
			101 = {
				add_province_triggered_modifier = ITA_superior_trade_center
			}
			set_country_flag = ITA_node_flag
		}
	}
	
	ITA_italian_discovery = { #referring to columbus
		icon = mission_colonize_the_caribbean
		position = 13
		required_missions = { ITA_genoa_node ITA_plus_ultra }
		provinces_to_highlight = {
			if = {
				limit = {
					is_random_new_world = yes
				}
				continent = new_world
			}
			else = {
				OR = {
					continent = north_america
					continent = south_america
				}
			}
			NOT = { country_or_non_sovereign_subject_holds = ROOT }
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			colony = 3
			if = {
				limit = {
					is_random_new_world = yes
				}
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					continent = new_world
					value = 75
				}
			}
			else = {
				num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
					OR = {
						continent = north_america
						continent = south_america
					}
					value = 75
				}
			}
		}
		effect = {
			set_country_flag = ITA_trades_to_come_flag
			country_event_with_effect_insight = {
				id = flavor_ita.12
				effect = "
					custom_tooltip = ITA_double_certain_trade_goods_trading_in_bonus
					
					custom_tooltip = \" \"
					
					custom_tooltip = ITA_every_colonial_nation_will_get_goods_produced
				"
			}
		}
	}
}

ITA_venice_1 = {
	slot = 1
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		has_country_flag = ITA_venice_missions
	}
	has_country_shield = yes
	
	ITA_venice_node = {
		icon = new_pilings
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
			province_id = 112
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			112 = {
				owned_by = ROOT
				highest_value_trade_node = yes
				trade_share = {
					country = ROOT
					share = 90
				}
				trade_node_value = 150
				if = {
					limit = {
						has_dlc = "Dharma"
					}
					province_has_center_of_trade_of_level = 3
				}
			}
		}
		effect = {
			add_mercantilism = 5
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_upgrade_privilege_venice_version
			
			custom_tooltip = " "
			
			112 = {
				add_province_triggered_modifier = ITA_superior_trade_center
			}
			set_country_flag = ITA_node_flag
		}
	}
	
	ITA_journey_to_the_east = {
		icon = mission_rb_colonise_spice_islands
		position = 13
		required_missions = { ITA_venice_node ITA_explore_eastern_markets }
		provinces_to_highlight = {
			OR = {
				AND = {
					province_id = 4316
					NOT = {
						AND = {
							owned_by = ROOT
							province_trade_power = 50
							has_great_project = {
								type = suez_canal
								tier = 2
							}
						}
					}
				}
				AND = {
					superregion = india_superregion
					NOT = {
						is_owned_by_trade_company = yes
					}
					NOT = {
						ROOT = {
							num_of_owned_provinces_with = {
								superregion = india_superregion
								is_owned_by_trade_company = yes
								value = 7 
							}
						}
					}
				}
				AND = {
					OR = {
						province_id = 4346
						province_id = 1340
						province_id = 504
					}
					NOT = {
						trade_share = {
							country = ROOT
							share = 60
						}
					}
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			4316 = {
				owned_by = ROOT
				province_trade_power = 50
				has_great_project = {
					type = suez_canal
					tier = 2
				}
			}
			num_of_owned_provinces_with = {
				superregion = india_superregion
				if = {
					limit = {
						OR = {
							has_dlc = "Wealth of Nations"
							has_dlc = "Dharma"
						}
					}
					is_owned_by_trade_company = yes
				}
				value = 7 
			}
			4346 = {
				trade_share = {
					country = ROOT
					share = 60
				}
			}
			1340 = {
				trade_share = {
					country = ROOT
					share = 60
				}
			}
			504 = {
				trade_share = {
					country = ROOT
					share = 60
				}
			}
		}
		effect = {
			country_event_with_effect_insight = {
				id = flavor_ita.10
				effect = "
					custom_tooltip = ITA_upgrade_suez
					
					custom_tooltip = \" \"
					
					custom_tooltip = ITA_upgrade_privilege_with_spices
				"
			}
		}
	}
}

ITA_non_conquest_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	JHC_ITA_answer_the_roman_question = {
		icon = answer_the_roman_question
		position = 9
		required_missions = { JHC_ITA_complete_the_risorgimento }
		
		trigger = {
			religious_unity = 0.85
			if = {
				limit = {
					has_estate = estate_church
				}
				estate_loyalty = {
					estate = estate_church
					loyalty = 60
				}
			}
			118 = {
				owned_by = ROOT
			}
			if = {
				limit = {
					religion = catholic
				}
				OR = {
					is_papal_controller = yes
					invested_papal_influence = 40
					calc_true_if = {
						AND = {
							has_country_modifier = papal_sanction_for_church_taxes
							has_country_modifier = papal_blessing
							has_country_modifier = papal_indulgence
							has_country_modifier = usury_forgiven
							has_country_modifier = papal_sanction_for_holy_war
							has_country_modifier = papal_legate
						}
						amount = 4
					}
				}
			}
			else_if = {
				limit = {
					religion_group = christian
				}
				custom_trigger_tooltip = {
					tooltip = YEM_win_10_wars_against_heretics
					check_variable = {
						which = num_of_wars_won_against_heretics
						value = 10
					}
				}
				118 = {
					num_of_times_improved = 5
				}
			}
			else = {
				custom_trigger_tooltip = {
					tooltip = YEM_win_20_wars_against_non_believers
					check_variable = {
						which = num_of_wars_won_against_non_believers
						value = 20
					}
				}
				118 = {
					num_of_times_improved = 5
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = ita_the_roman_answer
				duration = 14600
			}
			
			if = {
				limit = {
					religion = catholic
					exists = PAP
				}
				add_historical_friend = PAP
				PAP = { add_historical_friend = ROOT }
			}
			else = {
				118 = {
					remove_province_triggered_modifier = religious_center
				}
			}
			
			if = {
				limit = {
					religion = catholic
				}
				custom_tooltip = " "
				add_papal_influence = 50
			}
			else_if = {
				limit = {
					religion = orthodox
				}
				custom_tooltip = " "
				add_patriarch_authority = 0.25
			}
			else_if = {
				limit = {
					religion = reformed
					has_dlc = "Wealth of Nations"
				}
				custom_tooltip = " "
				add_fervor = 50
			}
			else_if = {
				limit = {
					religion = protestant
					has_dlc = "Common Sense"
				}
				custom_tooltip = " "
				add_church_power = 50
			}
			else_if = {
				limit = {
					religion = hussite
					has_dlc = "Winds of Change"
				}
				custom_tooltip = " "
				add_church_power = 50
			}
			else_if = {
				limit = {
					religion = anglican
					has_dlc = "Rule Britannia"
				}
				custom_tooltip = " "
				add_church_power = 50
			}
			else = {
				custom_tooltip = " "
				add_stability_or_adm_power = yes
			}
		}
	}
	
	ITA_economic_liberalism = {
		icon = mission_camillo_cavour
		position = 11
		required_missions = { ITA_unify_regional_economies }
		provinces_to_highlight = {
		}
		trigger = {
			home_trade_node = {
				highest_value_trade_node = yes
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			if = {
				limit = {
					trade_income_percentage = 0.01 #to prevent crashes
				}
				custom_trigger_tooltip = {
					tooltip = ITA_at_least_100_trade_income
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = current_trade_income
							value = monthly_income
						}
						export_to_variable = {
							which = trade_income_share
							value = trigger_value:trade_income_percentage
						}
						multiply_variable = { which = current_trade_income which = trade_income_share }
						check_variable = { which = current_trade_income value = 100 }
					}
				}
			}
			trade_efficiency = 0.5
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_ita.2
				option_1 = "
					hire_advisor = {
						type = statesman
						religion = root
						culture = root
						min_age = 25
						max_age = 25
						skill = 3
						name = \"Camillo Benso di Cavour\"
						cost_multiplier = 1
					}
					set_country_flag = ITA_camillo_is_alive
					
					custom_tooltip = \" \"
					
					custom_tooltip = ITA_while_cavour_is_active
					
					custom_tooltip = \" \"
					
					add_mercantilism = -5
				"
				option_2 = "
					add_country_modifier = {
						name = ITA_protectionism
						duration = 10950
					}
					
					add_mercantilism = 5
				"
			}
		}
	}
}

ITA_trade_branching_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		NOT = {
			OR = {
				has_country_flag = ITA_venice_missions
				has_country_flag = ITA_genoa_missions
			}
		}
	}
	has_country_shield = yes
	
	ITA_branch_2_12 = {
		icon = mission_unknown_mission
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
		}
		trigger = {
			ITA_branch_trigger = yes
		}
		effect = {
			ITA_branch_effect = yes
		}
	}
}

ITA_genoa_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		has_country_flag = ITA_genoa_missions
	}
	has_country_shield = yes
	
	ITA_plus_ultra = {
		icon = mission_plus_ultra
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
			OR = {
				province_id = 1295
				province_id = 1293
				province_id = 341
			}
			NOT = { 
				trade_share = {
					country = ROOT
					share = 80
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			1295 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			1293 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			341 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
		}
		effect = {
			country_event_with_option_insight = {
				id = flavor_ita.11
				option_1 = "
					custom_tooltip = ITA_estate_privilege_for_colonization
					set_country_flag = ITA_estate_privilege_for_colonization_flag
					
					custom_tooltip = \" \"
					
					create_explorer = { tradition = 80 culture = ligurian }
				"
				option_2 = "
					custom_tooltip = ITA_cb_for_america
					set_country_flag = ITA_cb_for_america_flag
					
					custom_tooltip = \" \"
					
					create_conquistador = { tradition = 80 }
				"
			}
		}
	}
}

ITA_venice_2 = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
		has_country_flag = ITA_venice_missions
	}
	has_country_shield = yes
	
	ITA_explore_eastern_markets = {
		icon = control_the_means_of_transaction
		position = 12
		required_missions = { ITA_the_trades_to_come }
		provinces_to_highlight = {
			OR = {
				province_id = 358
				province_id = 1320
				province_id = 377
			}
			NOT = { 
				trade_share = {
					country = ROOT
					share = 80
				}
			}
		}
		trigger = {
			not_in_mission_preview_mode = { key = ITA_TRADE }
			358 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			1320 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
			377 = {
				trade_share = {
					country = ROOT
					share = 80
				}
			}
		}
		effect = {
			custom_tooltip = ITA_early_suez_canal
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_permanent_claim_on_india
			hidden_effect = {
				4346 = {
					every_trade_node_member_province = {
						limit = {
							has_port = yes
							province_has_center_of_trade_of_level = 1
							NOT = { is_core = ROOT }
							NOT = { is_permanent_claim = ROOT }
						}
						add_permanent_claim = ROOT
					}
				}
				504 = {
					every_trade_node_member_province = {
						limit = {
							has_port = yes
							province_has_center_of_trade_of_level = 1
							NOT = { is_core = ROOT }
							NOT = { is_permanent_claim = ROOT }
						}
						add_permanent_claim = ROOT
					}
				}
				1340 = {
					every_trade_node_member_province = {
						limit = {
							has_port = yes
							province_has_center_of_trade_of_level = 1
							NOT = { is_core = ROOT }
							NOT = { is_permanent_claim = ROOT }
						}
						add_permanent_claim = ROOT
					}
				}
			}
		}
	}
}

ITA_non_conquest_2_cont = {
	slot = 2
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	ITA_glass = {
		icon = bohemian_crystal
		position = 13
		required_missions = { JHC_ITA_prosperity_for_all }
		provinces_to_highlight = {
			OR = {
				province_id = 112
				province_id = 117
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { has_manufactory_trigger = yes }
				NOT = { has_production_building_trigger = yes }
				NOT = { development = 25 }
			}
		}
		trigger = {
			112 = { #venice
				owned_by = ROOT
				has_manufactory_trigger = yes
				has_production_building_trigger = yes
				development = 25
			}
			117 = {
				owned_by = ROOT
				has_manufactory_trigger = yes
				has_production_building_trigger = yes
				development = 25
			}
		}
		effect = {
			112 = {
				add_or_upgrade_production_building = yes
				
				custom_tooltip = " "
				
				add_province_modifier = {
					name = ITA_murano_glass
					duration = -1
				}
			}
			
			117 = {
				add_or_upgrade_production_building = yes
			}
			
			custom_tooltip = " "
			
			add_years_of_owned_provinces_production_income = {
				years = 10
				trigger = {
					trade_goods = glass
				}
				custom_tooltip = ITA_ten_years_of_glass_income
			}
			
			if = {
				limit = {
					has_saved_global_event_target = diamond_city_global
				}
				custom_tooltip = " "
				complex_dynamic_effect = {
					first_custom_tooltip = ITA_if_we_own_faceting
					first_limit = "
						event_target:diamond_city_global = {
							country_or_non_sovereign_subject_holds = ROOT
						}
					"
					first_effect = "
						event_target:diamond_city_global = {
							add_base_tax = 2
							add_base_production = 2
							add_base_manpower = 2
						}
						
						add_prestige_or_monarch_power = { amount = 20 }
					"
				}
			}
		}
	}
}

ITA_non_conquest_3 = {
	slot = 3
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	ITA_galleasses = {
		icon = mission_galleass
		position = 9
		required_missions = { ITA_reform_the_military }
		provinces_to_highlight = {
		}
		trigger = {
			navy_size = 50 # modified
			OR = {
				galley_fraction = 0.5
				num_of_galley = 80
			}
			navy_tradition = 40
			if = { 
				limit = { has_dlc = "Rule Britannia" } 
				has_naval_doctrine = any 
			}
			else = {
				OR = {
					naval_reformer = 2
					has_dip_advisor_3 = yes
				}
			}
		}
		effect = {
			if = {
				limit = { has_dlc = "Domination" }
				add_country_modifier = {
					name = ITA_allow_galleasses
					duration = -1
				}
				custom_tooltip = ITA_sources_of_galleasses
				
				custom_tooltip = " "
				
				country_event_with_option_insight = {
					id = flavor_ita.3
					option_1 = "
						add_country_modifier = {
							name = ITA_galleass_transport
							duration = -1
						}
						
						add_dip_power = 50
					"
					option_2 = "
						#add_country_modifier = {
						#	name = ITA_galleass_amount
						#	duration = -1
						#}
						custom_tooltip = ITA_galleass_amount_tt
						
						add_years_of_income = 0.1
					"
					option_3 = "
						add_country_modifier = {
							name = ITA_galleass_durability
							duration = -1
						}
						
						add_navy_tradition = 20
					"
				}
			}
			else = {
				add_country_modifier = {
					name = ITA_galleass_galleys
					duration = -1
				}
			}
		}
	}
	
	ITA_unify_regional_economies = {
		icon = dominant_economy
		position = 10
		required_missions = { }
		provinces_to_highlight = {
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = ITA_developed_provinces_at_least_50_times
				check_variable = {
					which = num_of_times_developed
					value = 50
				}
			}
			monthly_income = 75
		}
		effect = {
			custom_tooltip = ITA_selling_crownland_will_give_25_administrative_power
			set_country_flag = ITA_selling_crownland_will_give_25_administrative_power_flag
			
			custom_tooltip = " "
			
			custom_tooltip = ITA_every_province_loses_15_autonomy
			hidden_effect = {
				every_owned_province = {
					add_local_autonomy = -15
				}
			}
		}
	}
	
	JHC_ITA_prosperity_for_all = {
		icon = prosperity_for_all
		position = 12
		required_missions = { ITA_unify_regional_economies JHC_ITA_develop_the_south }
		
		trigger = {
			reform_level = 3
			OR = {
				has_adm_advisor_3 = yes
				has_dip_advisor_3 = yes
			}
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				custom_trigger_tooltip = {
					tooltip = emp_ita_prosperity_for_all_tt
					num_of_provinces_owned_or_owned_by_non_sovereign_subjects_with = {
						is_prosperous = yes
						value = 8
					}
				}
			}
			else = {
				all_owned_province = {
					NOT = { devastation = 1 }
				}
			}
		}
		effect = {
			add_country_modifier = {
				name = ita_italian_prosperity
				duration = 10950
			}
			
			custom_tooltip = ITA_spread_base_tax_and_base_production
			hidden_effect = {
				for = {
					amount = 10
					effect = "
						random_owned_province = {
							add_base_tax = 1
						}
					"
				}
				for = {
					amount = 10
					effect = "
						random_owned_province = {
							add_base_production = 1
						}
					"
				}
			}
		}
	}
	
	ITA_wine = {
		icon = mission_wine_monopolies
		position = 13
		required_missions = { JHC_ITA_prosperity_for_all }
		provinces_to_highlight = {
			owned_by = ROOT
			trade_goods = wine
		}
		trigger = {
			num_of_owned_provinces_with = {
				trade_goods = wine
				has_production_building_trigger = yes
				has_manufactory_trigger = yes
				value = 5
			}
			trading_part = {
				trade_goods = wine
				value = 0.67
			}
			production_leader = {
				trade_goods = wine
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Emperor"
				}
				custom_tooltip = ITA_wine_monopolies
				set_country_flag = ITA_wine_monopolies_flag
			}
			else = {
				add_years_of_income = 1
			}
			
			custom_tooltip = " "
			
			add_mercantilism = 3
			
			custom_tooltip = " "
			
			country_event_with_effect_insight = {
				id = flavor_ita.9
				effect = "
					change_price = {
						trade_goods = wine
						key = ITA_wine_upgrade
						value = 0.4
						duration = 10950
					}
				"
			}
		}
	}
	
	ITA_industrial_triangle = {
		icon = industrialized_rhineland
		position = 14
		required_missions = { ITA_wine ITA_silk ITA_glass }
		provinces_to_highlight = {
			OR = {
				AND = {
					OR = {
						province_id = 101
						province_id = 103
						province_id = 104
					}
					NOT = {
						AND = {
							owned_by = ROOT
							development = 35
							has_production_building_trigger = yes
							num_of_buildings_in_province = 8
						}
					}
				}
				AND = {
					OR = {
						area = piedmont_area
						area = lombardy_area
						area = liguria_area
					}
					NOT = { owned_by = ROOT }
				}
			}
		}
		trigger = {
			reform_level = 8
			num_of_owned_provinces_with = {
				has_manufactory_trigger = yes
				value = 30
			}
			
			101 = { #genoa
				owned_by = ROOT
				development = 35
				has_production_building_trigger = yes
				num_of_buildings_in_province = 8
			}
			103 = { #torino 
				owned_by = ROOT
				development = 35
				has_production_building_trigger = yes
				num_of_buildings_in_province = 8
			}
			104 = { #milano
				owned_by = ROOT
				development = 35
				has_production_building_trigger = yes
				num_of_buildings_in_province = 8
			}
			piedmont_area = {
				type = all
				owned_by = ROOT
			}
			lombardy_area = {
				type = all
				owned_by = ROOT
			}
			liguria_area = {
				type = all
				owned_by = ROOT
			}
		}
		effect = {
			piedmont_area = {
				add_permanent_province_modifier = {
					name = ITA_industrial_triangle_modifier
					duration = -1
				}
			}
			lombardy_area = {
				add_permanent_province_modifier = {
					name = ITA_industrial_triangle_modifier
					duration = -1
				}
			}
			liguria_area = {
				add_permanent_province_modifier = {
					name = ITA_industrial_triangle_modifier
					duration = -1
				}
			}
			
			custom_tooltip = " "
			
			if = {
				limit = {
					has_dlc = "Domination"
				}
				custom_tooltip = ITA_upgrade_city_expansion_privileges	
				set_country_flag = ITA_upgrade_city_expansion_privileges_flag
			}
			else = {
				add_stability_or_adm_power = yes 
			}
		}
	}
}

ITA_non_conquest_4 = {
	slot = 4
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	ITA_reform_the_military = {
		icon = mission_italian_condottiere
		position = 8
		required_missions = {  }
		provinces_to_highlight = {
		}
		trigger = {
			army_size = 40 # modified
			OR = {
				army_size_percentage = 0.9 
				army_size = 70 # modified
			}
			num_of_generals = 1
			reform_level = 5
			num_of_battles = { amount = 40 }
		}
		effect = {
			add_mil_power = 100 
			
			custom_tooltip = " "
		
			country_event_with_option_insight = {
				id = flavor_ita.6
				#adapt the condotierri
				option_1 = "
					add_country_modifier = {
						name = ITA_adapt_the_condotierri
						duration = -1 
					}
					
					custom_tooltip = ITA_cruelty_of_mercenaries_event_will_no_longer_happen
				"
				#dont adapt the condotierri
				option_2 = "
					add_country_modifier = {
						name = ITA_modern_military
						duration = -1
					}
				"
			}
		}
	}
	
	JHC_ITA_alpine_defenses = {
		icon = alpine_defenses
		position = 9
		required_missions = { ITA_reform_the_military }
		
		provinces_to_highlight = {
			OR = {
				area = liguria_area
				area = piedmont_area
				area = lombardy_area
				area = po_valley_area
				area = venetia_area
			}
			owned_by = root

			if = {
				limit = {
					ROOT = {
						num_of_owned_provinces_with = {
							value = 5
							OR = {
								area = liguria_area
								area = piedmont_area
								area = lombardy_area
								area = po_valley_area
								area = venetia_area
							}
							fort_level = 1
						}
					}
				}
				fort_level = 1
				NOT = {
					AND = {
						if = {
							limit = {
								ROOT = {
									NOT = { mil_tech = 14 }
								}
							}
							OR = {
								has_building = fort_15th
								has_building = fort_16th
								has_building = fort_17th
								has_building = fort_18th
							}
						}
						else_if = {
							limit = {
								ROOT = {
									AND = {
										mil_tech = 14
										NOT = { mil_tech = 19 }
									}
								}
							}
							OR = {
								has_building = fort_16th
								has_building = fort_17th
								has_building = fort_18th
							}
						}
						else_if = {
							limit = {
								ROOT = {
									AND = {
										mil_tech = 19
										NOT = { mil_tech = 24 }
									}
								}
							}
							OR= { 
								has_building = fort_17th
								has_building = fort_18th
							}
						}
						else_if = {
							limit = {
								ROOT = {
									mil_tech = 24
								}
							}
							has_building = fort_18th
						}
					}
				}
			}
			else = {
				NOT = {
					AND = {
						if = {
							limit = {
								ROOT = {
									NOT = { mil_tech = 14 }
								}
							}
							has_building = fort_15th
						}
						else_if = {
							limit = {
								ROOT = {
									AND = {
										mil_tech = 14
										NOT = { mil_tech = 19 }
									}
								}
							}
							OR = {
								has_building = fort_16th
								has_building = fort_17th
								has_building = fort_18th
							}

						}
						else_if = {
							limit = {
								ROOT = {
									AND = {
										mil_tech = 19
										NOT = { mil_tech = 24 }
									}
								}
							}
							OR = {
								has_building = fort_17th
								has_building = fort_18th
							}

						}
						else_if = {
							limit = {
								ROOT = {
									mil_tech = 24
								}
							}
							has_building = fort_18th
						}
					}
				}
			}
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = emp_ita_alpine_defenses_tooltip
			}
			num_of_owned_provinces_with = {
				value = 5
				OR = {
					area = liguria_area
					area = piedmont_area
					area = lombardy_area
					area = po_valley_area
					area = venetia_area
				}
				if = {
					limit = {
						ROOT = {
							NOT = { mil_tech = 14 }
						}
					}
					OR = {
						has_building = fort_15th
						has_building = fort_16th
						has_building = fort_17th
						has_building = fort_18th
					}
				}
				else_if = {
					limit = {
						ROOT = {
							AND = {
								mil_tech = 14
								NOT = { mil_tech = 19 }
							}
						}
					}
					OR = {
						has_building = fort_16th
						has_building = fort_17th
						has_building = fort_18th
					}
				}
				else_if = {
					limit = {
						ROOT = {
							AND = {
								mil_tech = 19
								NOT = { mil_tech = 24 }
							}
						}
					}
					OR = {
						has_building = fort_17th
						has_building = fort_18th
					}
				}
				else_if = {
					limit = {
						ROOT = {
							mil_tech = 24
						}
					}
					has_building = fort_18th
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_dlc = "Domination"
				}
				custom_tooltip = ITA_upgrade_the_expand_the_fortifications_privilege
				set_country_flag = ITA_upgrade_the_expand_the_fortifications_privilege_flag
			}
			else = {
				add_mil_power = 150
			}
			
			custom_tooltip = " "
			
			define_advisor = {
				type = fortification_expert
				skill = 3
				culture = ROOT
				religion = ROOT
				cost_multiplier = 0.33
			}
			
			custom_tooltip = " "
			
			add_army_tradition_or_mil_power = { amount = 10 }
		}
	}
	
	JHC_ITA_develop_the_south = {
		icon = develop_the_south
		position = 11
		required_missions = { ITA_unify_regional_economies }
		
		provinces_to_highlight = {
			OR = {
				area = naples_area
				area = sicily_area
				area = western_sicily_area
				area = calabria_area
				area = apulia_area
			}
			NOT = { development = 25 }
		}
		trigger = {
			custom_trigger_tooltip = {
				tooltip = emp_ita_develop_the_south_tt
				num_of_owned_provinces_with = {
					OR = {
						area = naples_area
						area = sicily_area
						area = western_sicily_area
						area = calabria_area
						area = apulia_area
					}
					development = 25
					value = 5
				}
			}
		}
		effect = {
			add_stability_or_adm_power = yes
			
			custom_tooltip = " "
			
			if = {
				limit = {
					has_estate = estate_burghers
				}
				add_estate_loyalty = {
					estate = estate_burghers 
					loyalty = 10
				}
			}
			else = {
				add_dip_power = 100
			}
			
			custom_tooltip = " "
		
			custom_tooltip = emp_ita_develop_the_south_tt2
            tooltip = {
                if = {
                    limit = {
                        has_dlc = "Mandate of Heaven"
                    }
                    add_province_modifier = {
                        name = ita_southern_focus
                        duration = 7300
                    }
                }
                else = {
                    add_province_modifier = {
                        name = ita_southern_focus_no_dlc
                        duration = 7300
                    }
                }
            }
            hidden_effect = {
                if = {
                    limit = {
                        has_dlc = "Mandate of Heaven"
                    }
                    every_owned_province = {
                        limit = {
                            OR = {
                                area = naples_area
                                area = sicily_area
                                area = western_sicily_area
                                area = calabria_area
                                area = apulia_area
                            }
                        }
                        add_province_modifier = {
                            name = ita_southern_focus
                            duration = 7300
                        }
                    }
                }
                else = {
                    every_owned_province = {
                        limit = {
                            OR = {
                                area = naples_area
                                area = sicily_area
                                area = western_sicily_area
                                area = calabria_area
                                area = apulia_area
                            }
                        }
                        add_province_modifier = {
                            name = ita_southern_focus_no_dlc
                            duration = 7300
                        }
                    }
                }
            }
		}
	}
	
	ITA_silk = {
		icon = purely_for_commerce
		position = 13
		required_missions = { JHC_ITA_prosperity_for_all }
		provinces_to_highlight = {
			OR = {
				province_id = 123
				province_id = 2980
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { has_production_building_trigger = yes }
				NOT = { development = 25 }
			}
		}
		trigger = {
			123 = {
				owned_by = ROOT
				has_production_building_trigger = yes
				development = 25
			}
			2980 = {
				owned_by = ROOT
				has_production_building_trigger = yes
				development = 25
			}
		}
		effect = {
			123 = {
				add_or_upgrade_production_building = yes 
				
				custom_tooltip = " "
				
				add_permanent_province_modifier = {
					name = ITA_center_of_silk_production
					duration = -1
				}
				
				set_province_flag = BYZ_may_convert_to_silk
				province_event = { id = MEE_Byzantine_Events.23 }
			}
			
			2980 = {
				add_or_upgrade_production_building = yes 
				
				custom_tooltip = " "
				
				add_permanent_province_modifier = {
					name = ITA_center_of_silk_weaving
					duration = -1
				}
				
				set_province_flag = BYZ_may_convert_to_silk
				province_event = { id = MEE_Byzantine_Events.23 days = 180 } #the events cannot be fired at the same time
			}
			
			custom_tooltip = " "
			
			add_years_of_trade_income = {
				years = 2
				custom_tooltip = BYZ_add_2_years_of_trade_income
			}
			
			custom_tooltip = " "
			
			add_mercantilism = 3 
		}
	}
}

ITA_non_conquest_5 = {
	slot = 5
	generic = no
	ai = yes
	potential_on_load = {
		has_dlc = "Winds of Change"
	}
	potential = {
		has_dlc = "Winds of Change"
		OR = {
			tag = ITA
			AND = {
				tag = ROM
				was_tag = ITA
			}
		}
		NOT = { map_setup = map_setup_random }
	}
	has_country_shield = yes
	
	JHC_ITA_continue_the_renaissance = {
		icon = continue_the_renaissance
		position = 9
		required_missions = { }
		provinces_to_highlight = {
			if = {
				limit = {
					has_saved_global_event_target = birthplace_of_the_renaissance
				}
				province_id = event_target:birthplace_of_the_renaissance
			}
			else = {
				province_id = 116
			}
		}
		trigger = {
			if = {
				limit = {
					has_saved_global_event_target = birthplace_of_the_renaissance
				}
				event_target:birthplace_of_the_renaissance = {
					has_province_modifier = birthplace_of_the_renaissance #this is always true
					owned_by = ROOT
					num_of_times_improved = 10
				}
			}
			else = { #fallback
				116 = {
					owned_by = ROOT
					num_of_times_improved = 10
				}
			}
			is_ahead_of_time_in_technology = { tech = adm }
			is_ahead_of_time_in_technology = { tech = dip }
			is_ahead_of_time_in_technology = { tech = mil }
		}
		effect = {
			set_country_flag = ITA_flowering_of_renaissance_flag
			if = {
                limit = {
                    has_saved_global_event_target = birthplace_of_the_renaissance
                }
                if = {
                    limit = {
                        has_dlc = "Mandate of Heaven"
                    }
                    event_target:birthplace_of_the_renaissance = {
                        add_province_triggered_modifier = ITA_flowering_of_renaissance
                    }
                }
                else = {
                    event_target:birthplace_of_the_renaissance = {
                        add_province_triggered_modifier = ITA_flowering_of_renaissance_no_dlc
                    }
                }
            }
            else = {
                if = {
                    limit = {
                        has_dlc = "Mandate of Heaven"
                    }
                    116 = {
                        add_province_triggered_modifier = ITA_flowering_of_renaissance
                    }
                }
                else = {
                    116 = {
                        add_province_triggered_modifier = ITA_flowering_of_renaissance_no_dlc
                    }
                }
            }
			
			custom_tooltip = " "
			
			add_country_modifier = {
				name = ITA_renaissance
				duration = 10950
			}
			
			add_adm_power = 50
			add_dip_power = 50
			add_mil_power = 50
		}
	}
	
	ITA_train_of_thought = {
		icon = commission_the_mona_lisa
		position = 11
		required_missions = { JHC_ITA_continue_the_renaissance }
		provinces_to_highlight = {
			# owned_by = ROOT
			# NOT = { has_building = university }
		}
		trigger = {
			if = {
				limit = {
					has_dlc = "Rule Britannia"
				}
				innovativeness = 80
			}
			variable_arithmetic_trigger = {
				custom_tooltip = more_than_33_mana_gain
				
				export_to_variable = {
					variable_name = adm_gain
					value = trigger_value:monthly_adm
				}
				export_to_variable = {
					variable_name = dip_gain
					value = trigger_value:monthly_dip
				}
				export_to_variable = {
					variable_name = mil_gain
					value = trigger_value:monthly_mil
				}
				change_variable = {
					which = adm_gain
					which = dip_gain
				}
				
				change_variable = {
					which = adm_gain
					which = mil_gain
				}
				
				check_variable = {
					which = adm_gain
					value = 33
				}
			}
			if = {
				limit = {
					has_dlc = "Mandate of Heaven"
				}
				num_of_age_rewards_taken = {
					amount = 4
				}
			}
			reform_level = 7
		}
		effect = {
			set_country_flag = ITA_train_of_thought_flag
			if = {
                limit = {
                    OR = {
                        has_dlc = "Res Publica"
                        has_dlc = "Common Sense"
                    }
                }
                add_country_modifier_for_age = {
                    name = ITA_new_renaissance
                    age = age_of_reformation
                    else = "
                        add_splendor = 400
                    "
                }
            }
            else = {
                add_country_modifier_for_age = {
                    name = ITA_new_renaissance_non_dlc
                    age = age_of_reformation
                    else = "
                        add_splendor = 400
                    "
                }
            }
			
			custom_tooltip = ITA_maintaining_the_ptm_will_be_easier
		}
	}
}