# Scripted triggers should have _trigger suffix

# Romance cultures have the ability to re-create, vassalize Roman legions and use the Imperial Reconquest CB
# trigger has character scope
has_romance_culture_trigger = {
	OR = {
		culture = roman
		culture = dalmatian
		culture = romano_gallic
		culture = romano_frank
		culture = african_romance
		culture = romano_british
		culture = romano_persian
		culture = romano_aramean
		culture = romano_vandalic
		culture = thraco_roman
		culture = illyro_roman
		culture = pannonian
		culture = raetoroman
		culture = noricroman
		culture = romano_hispanic
		culture = romano_gothic
		culture = helleno_aramean
		culture = greek
		culture = greek_gothic
		culture = greek_persian
		culture = pontic
		culture = helleno_thracian
		culture = massalian
		culture = romano_dacian
		culture = tsakonian
	}
}

# Germanic cultures have melting-pots
# trigger has character scope
has_germanic_culture_trigger = {
	OR = {
		culture_group = north_germanic
		culture_group = central_germanic
		culture_group = east_germanic
		culture_group = west_germanic
	}
}

# Celtic cultures are used for some melting-pots
# trigger has character scope
has_celtic_culture_trigger = {
	OR = {
		culture_group = celtic
		culture_group = continental_celtic
		culture_group = east_celtic
	}
}

# Slavic cultures are used for some melting-pots
# trigger has character scope
has_slavic_culture_trigger = {
	OR = {
		culture_group = east_slavic
		culture_group = west_slavic
		culture_group = south_slavic
	}
}

# Arabian cultures are used for some melting-pots
# trigger has character scope
has_arabic_culture_trigger = {
	OR = {
		culture_group = south_semitic
		culture_group = central_semitic
	}
}

# The Bureaucratic government type is used for the WRE and ERE
# trigger has title scope
bureaucratic_government_trigger = {
	OR = {
		title = e_wre
		title = e_byzantium
		title = e_roman_empire
		AND = { # Flag for Bureaucratic Italy set during Odoacer's rule between 476-493
			title = k_italy
			has_global_flag = italy_bureaucratic
		}
		AND = {
			title = k_dalmatia
			has_global_flag = bureaucratic_dalmatia
		}
		AND = {
			higher_tier_than = duke
			has_title_flag = adopted_bureaucratic
		}
		has_title_flag = alternate_wre
	}
	NOT = {
		has_title_flag = wre_restored
		has_title_flag = ere_restored
	}
}

# The Sassanid government type is used for Persia
# trigger has title scope
sassanid_government_trigger = {
	OR = {
		top_liege = {
			title = e_persia
		}
		title = e_persia
		holder_scope = {
			OR = {
				culture = persian
				culture = parthian
				religion = zoroastrian
			}
		}
	}
}

# The Legion government type is used for the Roman legions
# trigger has title scope
roman_legion_title_trigger = {
	OR = {
		title = c_legio_ii_britannica
		title = c_legio_i_flavia_constantia_gallicana
		title = c_legio_i_mesopotamia
		title = c_legio_i_dacia
		title = c_legio_iii_augusta
		title = c_legio_i_germania_inferior
		title = c_legio_i_belgica
		title = c_legio_i_septem_provincae
		title = c_legio_vi_ferrata
		title = c_legio_ii_augusta
		title = c_legio_vii_gemina
		title = c_legio_iii_gallica
		title = c_legio_x_fretensis
		title = c_legio_i_sicilia
		title = c_legio_i_raetia_noricum
		title = c_legio_i_suburbicaria
		title = c_legio_viii_augusta
		title = c_legio_i_noricorum
		title = c_legio_ii_italica
		title = c_legio_i_italica
		title = c_legio_x_gemina
		title = c_legio_xii_fulminata
		title = c_legio_i_flavia_constantia
		title = c_legio_ii_flavia_constantia
		title = c_legio_i_isaura_sagittaria
		title = c_legio_i_iovia
		title = c_legio_ii_herculia
		title = c_legio_ii_isaura
		title = c_legio_iii_diocletiana
		title = c_legio_iv_parthica
		title = c_legio_iv_italica
		title = c_legio_ii_iulia_alpina
		title = c_legio_iii_herculea
		title = c_legio_iv_martia
		title = c_legio_ii_felix_valentis_thebaeorum
		title = c_legio_i_flavia_theodosiana
		title = c_legio_i_maximiana_thaebanorum
		title = c_legio_xv_apollinaris
		title = c_legio_i_illyricorum
		title = c_legio_xiii_gemina
		title = c_legio_i_pontica
		title = c_legio_iii_cyrenaica
		title = c_legio_iv_scythia
		title = c_legio_i_armeniaca
		title = c_legio_ii_traiana_fortis
		title = c_legio_v_macedonica
		title = c_legio_iv_flavia_felix
		title = c_legio_v_iovia
		title = c_legio_xx_valeria_victrix
		title = c_legio_vi_victrix
		title = c_legio_i_iulia_alpina
		title = c_legio_iii_iulia_alpina
		title = c_legio_i_minervia
		title = c_legio_xxx_ulpia_victrix
		title = c_legio_i_flavia_martis
		title = c_legio_xxii_primigenia
		title = c_legio_i_flavia_pacis
		title = c_legio_ii_flavia_virtuis
		title = c_legio_iii_flavia_salutis
		title = c_legio_iii_italica
		title = c_legio_xiv_gemina
		title = c_legio_i_adiutrix
		title = c_legio_ii_adiutrix
		title = c_legio_vi_herculia
		title = c_legio_xi_claudia
		title = c_legio_iii_isaura
		title = c_legio_xvi_flavia_firma
		title = c_legio_i_parthica
		title = c_legio_iii_parthica
		title = c_legio_ii_armeniaca
		title = c_legio_ii_parthica
		title = c_legio_vi_parthica
		title = d_imperial_fleet_wre
		title = d_imperial_fleet_ere
	}
}

# The Sub-Roman government type is used for the successor states to the Roman Empire
# trigger has title scope
sub_roman_government_trigger = {
	OR = {
		top_liege = {
			primary_title = {
				OR = {
					bureaucratic_government_trigger = yes
					holder_scope = {
						OR = {
							has_romance_culture_trigger = yes
							any_realm_title = {
								region = custom_imperium_romanum
							}
						}
					}
				}
			}
		}
		holder_scope = {
			OR = {
				has_romance_culture_trigger = yes
				any_realm_title = {
					region = custom_imperium_romanum
				}
			}
		}
		title = d_odoacer
	}
}

# The High tribal government type is mostly used for the small-scale government on the British Isles
# trigger has title scope
high_tribal_government_trigger = {
	OR = {
		# Global flags set in history
		AND = { 
			title = d_atrebatia
			has_global_flag = atrebatia_high_tribal
		}
		AND = { 
			title = d_cornwall
			has_global_flag = cornwall_high_tribal
		}
		AND = { 
			title = d_deheubarth
			has_global_flag = deheubarth_high_tribal
		}
		AND = { 
			title = d_guent
			has_global_flag = guent_high_tribal
		}
		AND = { 
			title = d_brycheiniog
			has_global_flag = brycheiniog_high_tribal
		}
		AND = { 
			title = d_guenet
			has_global_flag = guenet_high_tribal
		}
		AND = { 
			title = d_powys
			has_global_flag = powys_high_tribal
		}
		AND = { 
			title = d_elmet
			has_global_flag = elmet_high_tribal
		}
		AND = { 
			title = d_galloway
			has_global_flag = galloway_high_tribal
		}
		AND = { 
			title = d_gwynedd
			has_global_flag = gwynedd_high_tribal
		}
		AND = { 
			title = d_oxford
			has_global_flag = oxford_high_tribal
		}
		AND = { 
			title = d_somerset
			has_global_flag = somerset_high_tribal
		}
		AND = { 
			title = k_rheged
			has_global_flag = rheged_high_tribal
		}
		AND = {
			title = d_vasconia
			has_global_flag = vasconia_high_tribal
		}
		AND = {
			title = d_astures
			has_global_flag = astures_high_tribal
		}
		AND = {
			title = d_cantabria
			has_global_flag = cantabria_high_tribal
		}
		holder_scope = {
			top_liege = {
				primary_title = {
					OR = {
						AND = { 
							title = d_atrebatia
							has_global_flag = atrebatia_high_tribal
						}
						AND = { 
							title = d_cornwall
							has_global_flag = cornwall_high_tribal
						}
						AND = { 
							title = d_deheubarth
							has_global_flag = deheubarth_high_tribal
						}
						AND = { 
							title = d_guent
							has_global_flag = guent_high_tribal
						}
						AND = { 
							title = d_brycheiniog
							has_global_flag = brycheiniog_high_tribal
						}
						AND = { 
							title = d_guenet
							has_global_flag = guenet_high_tribal
						}
						AND = { 
							title = d_powys
							has_global_flag = powys_high_tribal
						}
						AND = { 
							title = d_elmet
							has_global_flag = elmet_high_tribal
						}
						AND = { 
							title = d_galloway
							has_global_flag = galloway_high_tribal
						}
						AND = { 
							title = d_gwynedd
							has_global_flag = gwynedd_high_tribal
						}
						AND = { 
							title = d_oxford
							has_global_flag = oxford_high_tribal
						}
						AND = { 
							title = d_somerset
							has_global_flag = somerset_high_tribal
						}
						AND = { 
							title = k_rheged
							has_global_flag = rheged_high_tribal
						}
						AND = { 
							title = d_vasconia
							has_global_flag = vasconia_high_tribal
						}
						AND = {
							title = d_astures
							has_global_flag = astures_high_tribal
						}
						AND = {
							title = d_cantabria
							has_global_flag = cantabria_high_tribal
						}
						has_title_flag = high_tribal_government_flag
					}
				}
			}
		}
	}
}

# Foederati barbarians can use the foederati diplo-action
# trigger has character scope
foederati_barbarian_trigger = {
	independent = yes
	mercenary = no
	holy_order = no
	is_landed = yes
	is_tributary = no			
	OR = {
		is_tribal = yes
		is_nomadic = yes
		primary_title = { title = k_arabia_petraea }
		primary_title = { title = k_ostrogoths } 
	}
	OR = {
		has_romance_culture_trigger = no
		primary_title = { title = k_ostrogoths } 
	}
	NOR = {
		primary_title = { 
			higher_tier_than = KING
			bureaucratic_government_trigger = yes
			sassanid_government_trigger = yes
		}
	}
}

# Foederati Romans can use the foederati diplo-action
# trigger has character scope
foederati_roman_trigger = {
	independent = yes
	mercenary = no
	holy_order = no
	is_landed = yes
	primary_title = { higher_tier_than = DUKE }
	OR = { 
		has_romance_culture_trigger = yes
		has_landed_title = e_wre
		has_landed_title = e_byzantium 
		has_landed_title = e_roman_empire
	}
	num_of_count_titles_in_realm = 2 # Needs to be able to grant a county without game-over 
}

# Mystic religions get some particular events and can access the Mystic trait
# trigger has character scope
mystic_religion_trigger = {
	OR = {
		religion = tzadikite
		religion = melchisedechianism
	}
}

amber_route_trade_post_trigger = {
	custom_tooltip = {
		text = amber_route_province_desc
		hidden_tooltip = {
			OR = {
				province_id = 333
				province_id = 357
				province_id = 368
				province_id = 372
				province_id = 411
			}
		}
	}
}

would_be_in_wre_trigger = {
	OR = {
		region = custom_pars_occidentalis
		region = custom_diocese_pannoniae
		region = world_europe_west
		region = world_europe_north
		AND = {
			region = world_africa_north
			NOT = { region = custom_diocese_aegyptus }
		}
		region = world_africa_west
	}
}
would_be_in_byzantium_trigger = {
	OR = {
		region = custom_praetorian_prefecture_orientis
		region = custom_diocese_moesiae
		region = world_europe_east
		region = world_steppe
		region = world_persia
		region = world_asia_minor
		region = world_india
		region = world_middle_east
		region = world_africa_east
	}
}

religion_openly_scythian_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_scythian_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = scythian_pagan
				religion = scythian_pagan_reformed
			}
		}
	}
}

religion_openly_germanic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_germanic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = germanic_pagan
				religion = germanic_pagan_reformed
			}
		}
	}
}

religion_openly_berber_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_berber_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = central_african_pagan
				religion = central_african_pagan_reformed
				religion = gurzil_pagan
				religion = msoura_pagan
				religion = african_solar_pagan
				religion = african_solar_pagan_reformed
				religion = mandulis_pagan
				religion = mandulis_pagan_reformed
			}
		}
	}
}

religion_openly_semitic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_semitic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = semitic_pagan
				religion = semitic_pagan_reformed
			}
		}
	}
}

religion_openly_balkan_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_balkan_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = dacian_pagan
				religion = dacian_pagan_reformed
				religion = illyran_pagan
				religion = illyran_pagan_reformed
			}
		}
	}
}

religion_openly_vasconic_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_vasconic_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = vasconic_pagan
				religion = vasconic_pagan_reformed
			}
		}
	}
}

religion_openly_root_west_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_root_west_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = root_west_pagan
				religion = root_west_pagan_reformed
			}
		}
	}
}

religion_openly_sanamahi_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_sanamahi_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = sanamahi
				religion = sanamahi_reformed
			}
		}
	}
}

religion_openly_georgian_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_georgian_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = georgian_pagan
				religion = georgian_pagan_reformed
			}
		}
	}
}

religion_openly_east_african_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_east_african_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = east_african_pagan
				religion = east_african_pagan_reformed
			}
		}
	}
}

religion_openly_assyrian_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_assyrian_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = assyrian_pagan
			}
		}
	}
}

religion_openly_dravidian_or_reformed_trigger = {
	custom_tooltip = {
		text = religion_openly_dravidian_or_reformed_tooltip
		hidden_trigger = {
			OR = {
				religion = dravidian_pagan
				religion = dravidian_pagan_reformed
			}
		}
	}
}

