# Terra Nova
# SRI_AI_Behaviour.txt
#
## 29.50.xx  Individual AI setup events, context-dependent (mostly colonial & conquest)
#	 50 PORTUGAL
#	 51 SPAIN/CASTILLE
#	 52 ENGLAND
#	 53 FRANCE
#	 54 LOW COUNTRY
#	 55 RUSSIA
#	 56 AUSTRIA
# 	 57 OTTOMANS
#	 60-89 RESERVED FOR OTHER COUNTRIES
## 29.50.90  Confrontation over spheres of influence (apply by context)
## 29.50.95  Checking the player
## 29.50.99  Big Initial AI setup event (triggered from initialization events)

#########################################################################
#
#			AI evaluates player as a threat
#
#########################################################################

# frontline countries / set

country_event = {

  	id = 295000

	trigger = {
		any_neighbor_country = {
			ai = no
			is_threat = THIS
			badboy = 0.1
		}
		NOT = { has_country_flag = we_are_scared }
		NOT = { overlord = { num_of_cities = 1 ai = no } }
		NOT = { has_global_flag = ai_vs_player_war }
		ai = yes
 	}

	mean_time_to_happen = { years = 1 }

	title = "EVTNAME295000"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = we_are_scared
	}
}

# secondary countries / set

country_event = {

  	id = 295001

	trigger = {
		any_known_country = {
			ai = no
			is_threat = THIS
			badboy = 0.2
		}
		NOT = { has_country_flag = we_are_scared }
		NOT = { has_country_flag = we_are_concerned }
		NOT = { overlord = { num_of_cities = 1 ai = no } }
		NOT = { has_global_flag = ai_vs_player_war }
		ai = yes
 	}

	mean_time_to_happen = { years = 4 }

	title = "EVTNAME295000"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = we_are_concerned
	}
}

# rival countries / set

country_event = {

  	id = 295002

	trigger = {
		any_known_country = {
			ai = no
			is_rival = THIS
			badboy = 0.3
			OR = {
				num_of_cities = THIS
				navy = THIS
				army = THIS
			}
		}
		NOT = { has_country_flag = we_are_alarmed }
		NOT = { overlord = { num_of_cities = 1 ai = no } }
		NOT = { has_global_flag = ai_vs_player_war }
		ai = yes
 	}

	mean_time_to_happen = { years = 2 }

	title = "EVTNAME295000"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = we_are_alarmed
	}
}

# unset

country_event = {

  	id = 295003

	trigger = {
		has_country_flag = we_are_concerned
		OR = {
			overlord = { num_of_cities = 1 ai = no }
			NOT = {
				any_known_country = {
					ai = no
					is_threat = THIS
				}
			}
		}
		ai = yes
 	}

	mean_time_to_happen = { years = 8 }

	title = "EVTNAME295002"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		clr_country_flag = we_are_concerned
		clr_country_flag = we_are_scared
	}
}

# rival countries / unset

country_event = {

  	id = 295004

	trigger = {
		has_country_flag = we_are_alarmed
		OR = {
			overlord = { num_of_cities = 1 ai = no }
			NOT = {
				any_known_country = {
					ai = no
					is_rival = THIS
				}
			}
		}
		ai = yes
		NOT = { has_global_flag = ai_vs_player_war }
 	}

	mean_time_to_happen = { years = 4 }

	title = "EVTNAME295000"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		clr_country_flag = we_are_alarmed
	}
}

### 29.50.50  Individual AI setup events, context-dependent ###

# 50 PORTUGAL
country_event = { # West Africa

  	id = 2950500

	trigger = {
		tag = POR
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		west_african_coast = { empty = yes range = yes }
		NOT = { west_african_coast = { owned_by = THIS } }
		NOT = {
			west_african_coast = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		west_african_coast = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				NOT = { capital_scope = { owned_by = THIS } }
				any_owned_province = { region = west_african_coast }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = west_african_coast }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = west_african_coast } }
			any_owned = {
				limit = {
					region = west_african_coast
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = antagonize
		set_global_flag = conquer_prov
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # South Africa

  	id = 29505000

	trigger = {
		tag = POR
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 16
		transport = 3
		south_africa = { empty = yes range = yes }
		NOT = { south_africa = { owned_by = THIS } }
		west_african_coast = { owned_by = THIS citysize = 3000 }
		NOT = {
			south_africa = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_01a }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 12
		modifier = {
			factor = 0.2
			NOT = { west_african_coast = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			south_africa = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01a
		south_africa = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		cape = { clr_province_flag = colonize_prov }
		any_country = {
			limit = {
				NOT = { capital_scope = { owned_by = THIS } }
				capital_scope = { continent = africa }
				any_owned_province = { region = south_africa }
			}
			set_country_flag = vassal
			set_country_flag = military_access
			any_owned = {
				limit = { region = south_africa }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = south_africa } }
			any_owned = {
				limit = {
					region = south_africa
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
		set_global_flag = military_access
		set_global_flag = vassal
  		country_event = 296000
	}
}
country_event = { # Discover India

  	id = 2950501

	trigger = {
		tag = POR
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 20
		transport = 3
		south_africa = { owned_by = THIS }
		indian_coast = { NOT = { has_discovered = THIS } range = yes }
		NOT = { has_country_flag = ai_colonial_02 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			indian_ocean_islands = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { owned_by = THIS }
		}
		modifier = {
			factor = 0.2
			NOT = { south_africa = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			indian_coast = { has_discovered = THIS }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		indian_coast = { set_province_flag = explore_prov }
		random_country = {
			limit = {
				NOT = { capital_scope = { owned_by = THIS } }
				any_owned_province = { region = indian_coast }
			}
			set_country_flag = befriend
			set_country_flag = military_access
		}
		any_country = {
			limit = { any_owned_province = { region = indian_coast } }
			any_owned = {
				limit = {
					region = indian_coast
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = explore_prov
		set_global_flag = befriend
		set_global_flag = military_access
  		country_event = 296000
	}
}
country_event = { # Discover China & Japan

  	id = 2950502

	trigger = {
		tag = POR
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		OR = {
			west_african_coast = { owned_by = THIS citysize = 3000 }
			south_africa = { owned_by = THIS citysize = 3000 }
		}
		NOT = { indian_coast = { NOT = { has_discovered = THIS } } }
		east_asian_cot = { NOT = { has_discovered = THIS } range = yes }
		NOT = { has_country_flag = ai_colonial_03 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 36
		modifier = {
			factor = 0.05
			east_asian_cot = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			chinese_coast = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			japanese_region = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_03
		east_asian_cot = { set_province_flag = explore_prov }
		any_country = {
			limit = {
				any_owned_province = { region = east_asian_cot }
				NOT = { owns = 668 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = befriend
			set_country_flag = military_access
		}
		random_country = {
			limit = {
				owns = 668
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
		}
		set_global_flag = explore_prov
		set_global_flag = antagonize
		set_global_flag = befriend
		set_global_flag = military_access
		any_country = {
			limit = { any_owned_province = { region = east_asian_cot } }
			any_owned = {
				limit = {
					region = east_asian_cot
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
  		country_event = 296000
		add_ai_strategy = {
			explore_prov = {
				id = 668	# Macao
				value = 240
			}
			conquer_prov = {
				id = 668	# Macao
				value = 160
			}
		}
	}
}
#id = 2950504 NOT IN USE ai_colonial_04 (POR)
country_event = { # Colonize Brazil

  	id = 2950504

	trigger = {
		tag = POR
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		transport = 3
		OR = {
			west_african_coast = { owned_by = THIS citysize = 2000 }
			south_africa = { owned_by = THIS citysize = 2000 }
		}
		amazonas = { empty = yes range = yes }
		NOT = { has_country_flag = ai_colonial_05 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			NOT = { south_africa = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			NOT = { west_african_coast = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			south_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.02
			central_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.01
			north_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.01
			amazonas = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_05
		amazonas = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = amazonas }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = amazonas }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = amazonas } }
			any_owned = {
				limit = {
					region = amazonas
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}

# 51 SPAIN/CASTILLE
country_event = { # carribbean

  	id = 2950510

	trigger = {
		OR = {
			tag = CAS 
			tag = SPA
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		OR = {
			the_carribean = { empty = yes range = yes NOT = { has_discovered = THIS } }
			AND = {
				number_of_colonies = 1
				NOT = { the_carribean = { owned_by = THIS } }
				the_carribean = { empty = yes }
			}
		}
		the_carribean = { empty = yes }
		NOT = { has_country_flag = ai_colonial_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		the_carribean = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = the_carribean }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = the_carribean }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_carribean } }
			any_owned = {
				limit = {
					region = the_carribean
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}
country_event = { # spanish main

  	id = 2950511

	trigger = {
		OR = {
			tag = CAS 
			tag = SPA
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 16
		transport = 3
		the_spanish_main = { NOT = { owned_by = THIS } }
		the_spanish_main = { empty = yes range = yes }
		the_carribean = { owned_by = THIS citysize = 1000 }
		NOT = { has_country_flag = ai_colonial_02 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			south_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.1
			north_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			the_spanish_main = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		the_spanish_main = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = the_spanish_main }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = the_spanish_main }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_spanish_main } }
			any_owned = {
				limit = {
					region = the_spanish_main
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}
country_event = { # mexico

  	id = 2950512

	trigger = {
		OR = {
			tag = CAS 
			tag = SPA
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 18
		transport = 3
		the_carribean = { owned_by = THIS citysize = 2000 }
		the_spanish_main = { owned_by = THIS citysize = 1200 }
		NOT = {
			central_american_region = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_03 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			south_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.1
			north_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			central_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.01
			central_american_region = { NOT = { owned_by = THIS } has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_03
		central_american_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = central_american_region }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = central_american_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = central_american_region } }
			any_owned = {
				limit = {
					region = central_american_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}
country_event = { # la_plata_region

  	id = 2950513

	trigger = {
		OR = {
			tag = CAS 
			tag = SPA
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		tariff_efficiency = 0.9
		la_plata_region = { empty = yes range = yes }
		the_carribean = { owned_by = THIS citysize = 4000 }
		the_spanish_main = { owned_by = THIS citysize = 3000 }
		central_american_region = { owned_by = THIS citysize = 2000 }
		NOT = { has_country_flag = ai_colonial_04 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 48
		modifier = {
			factor = 0.5
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.3
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			la_plata_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			central_american_region = { owned_by = THIS has_owner_culture = no }
		}
		modifier = {
			factor = 0.05
			the_andes = { owned_by = THIS has_owner_culture = no }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_04
		la_plata_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = la_plata_region }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			any_owned = { clr_province_flag = colonize_prov }
		}
		any_country = {
			limit = { any_owned_province = { region = la_plata_region } }
			any_owned = {
				limit = {
					region = la_plata_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
		set_global_flag = rival
  		country_event = 296000
	}
}
country_event = { # the_andes

  	id = 2950514

	trigger = {
		OR = {
			tag = CAS 
			tag = SPA
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		the_andes = { empty = yes range = yes }
		the_carribean = { owned_by = THIS citysize = 3000 }
		the_spanish_main = { owned_by = THIS citysize = 2000 }
		central_american_region = { owned_by = THIS citysize = 1000 }
		tariff_efficiency = 0.9
		NOT = {
			the_andes = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_05 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			central_american_region = { owned_by = THIS has_owner_culture = no }
		}
		modifier = {
			factor = 0.05
			the_andes = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.01
			the_andes = { NOT = { owned_by = THIS } has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_05
		the_andes = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = the_andes }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = the_andes }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_andes } }
			any_owned = {
				limit = {
					region = the_andes
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}

# 52 ENGLAND
country_event = { # 13 colonies

  	id = 2950520

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		the_carribean = { citysize = 2000 owner = { capital_scope = { continent = europe } } }
		OR = {
			the_thirteen_colonies = { empty = yes range = yes NOT = { has_discovered = THIS } }
			AND = {
				number_of_colonies = 1
				NOT = { the_thirteen_colonies = { owned_by = THIS } }
				the_thirteen_colonies = { empty = yes }
			}
		}
		NOT = { has_country_flag = ai_colonial_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 100
		modifier = {
			factor = 0.2
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { central_american_region = { empty = yes } }
		}
		modifier = {
			factor = 0.02
			central_american_region = { has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 0.04
			the_andes = { has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 0.1
			north_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.1
			northern_america = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.1
			north_american_region = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.05
			central_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.025
			south_american_region = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		the_thirteen_colonies = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				NOT = { capital_scope = { owned_by = THIS } }
				any_owned_province = { region = the_thirteen_colonies }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = the_thirteen_colonies }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_thirteen_colonies } }
			any_owned = {
				limit = {
					region = the_thirteen_colonies
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}
country_event = { # Carribbean

  	id = 2950521

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 16
		transport = 3
		the_thirteen_colonies = { citysize = 3000 owned_by = THIS }
		the_carribean = { range = yes citysize = 3000 owner = { capital_scope = { continent = europe } } }
		NOT = { has_country_flag = ai_colonial_02 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 48
		modifier = {
			factor = 0.2
			NOT = { the_thirteen_colonies = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			the_carribean = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.1
			the_carribean = { has_discovered = THIS }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		the_carribean = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = the_carribean }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			any_owned = {
				limit = { region = the_carribean }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_carribean } }
			any_owned = {
				limit = {
					region = the_carribean
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
		set_global_flag = explore_prov
		set_global_flag = antagonize
  		country_event = 296000
	}
}
country_event = { # South Africa / access

  	id = 2950522

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 20
		transport = 5
		NOT = { cape = { owned_by = THIS } }
		cape = { range = yes has_discovered = THIS owner = { capital_scope = { continent = europe } } }
		NOT = { has_country_flag = ai_colonial_03 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			NOT = { cape = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			cape = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.1
			cape = { has_discovered = THIS }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_03
		cape = { set_province_flag = explore_prov }
		random_country = {
			limit = {
				any_owned_province = { region = cape }
				capital_scope = { continent = europe }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = military_access
			set_global_flag = military_access
		}
		random_country = {
			limit = {
				any_owned_province = { region = cape }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { has_global_flag = military_access }
			}
			set_country_flag = military_access
			set_global_flag = military_access
		}
		any_country = {
			limit = { any_owned_province = { region = cape } }
			any_owned = {
				limit = {
					region = cape
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # India

  	id = 2950523

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		cape = { range = yes has_discovered = THIS }
		indian_region = { range = yes }
		indian_region = {
			port = yes
			owner = {
				capital_scope = { region = indian_region }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { prestige = THIS }
				NOT = { num_of_cities = THIS }
				NOT = { army = THIS }
				is_subject = no
			}
		}
		NOT = { has_country_flag = ai_colonial_04 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 4
			NOT = { the_thirteen_colonies = { owned_by = THIS } }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { owned_by = THIS }
		}
		modifier = {
			factor = 0.2
			NOT = { indian_ocean_islands = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			cape = { owned_by = THIS }
		}
		modifier = {
			factor = 0.2
			NOT = { cape = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			indian_coast = { has_discovered = THIS }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_04
		indian_region = { set_province_flag = explore_prov }
		random_country = {
			limit = {
				capital_scope = { region = indian_region }
				num_of_ports = 1
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { prestige = THIS }
				NOT = { num_of_cities = THIS }
				NOT = { army = THIS }
				is_subject = no
			}
			set_country_flag = vassal
			set_global_flag = vassal
		}
		random_country = {
			limit = {
				capital_scope = { region = indian_region }
				num_of_ports = 1
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { has_country_flag = vassal }
				any_neighbor_country = { has_country_flag = vassal }
			}
			set_country_flag = befriend
			set_country_flag = military_access
			set_global_flag = befriend
			set_global_flag = military_access
		}
		any_country = {
			limit = {
				capital_scope = { continent = europe }
				any_owned_province = { region = indian_region }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { relation = { who = THIS value = 100} }
			}
			set_country_flag = antagonize
			set_country_flag = rival
			set_global_flag = antagonize
			set_global_flag = rival
			any_owned = {
				limit = { region = indian_region }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = indian_region } }
			any_owned = {
				limit = {
					region = indian_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # South Africa / conquest

  	id = 2950524

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		tariff_efficiency = 0.9
		indian_region = { is_capital = yes owner = { vassal_of = THIS } }
		NOT = {
			cape = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_05 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 2
			cape = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			cape = { empty = yes }
		}
		modifier = {
			factor = 2
			indian_coast = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 1.5
			indian_region = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_05
		cape = { set_province_flag = conquer_prov set_province_flag = colonize_prov }
		any_country = { # friends
			limit = {
				any_owned_province = { region = cape }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = cape }
				clr_province_flag = conquer_prov
				clr_province_flag = colonize_prov
			}
		}
		any_country = { # not friends, european
			limit = {
				any_owned_province = { region = cape }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = cape }
				clr_province_flag = colonize_prov
			}
		}
		any_country = { # not friends, not european
			limit = {
				any_owned_province = { region = cape }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = cape }
				clr_province_flag = colonize_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = conquer_prov
  		country_event = 296000
	}
}
country_event = { # Australia / New Zealand

  	id = 2950525

	trigger = {
		OR = {
			tag = ENG
			tag = GBR
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 30
		transport = 6
		tariff_efficiency = 0.9
		indian_region = { is_capital = yes owner = { vassal_of = THIS } }
		NOT = { has_country_flag = ai_colonial_06 }
		ai = yes
		is_subject = no
		OR = {
			australian_coast = { empty = yes range = yes NOT = { has_discovered = THIS } }
			new_zealand_region = { empty = yes range = yes NOT = { has_discovered = THIS } }
		}
	}

	mean_time_to_happen = {
		years = 100
		modifier = {
			factor = 2
			indian_coast = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 1.5
			indian_region = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 0.6
			cape = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			cape = { empty = yes }
		}
		modifier = {
			factor = 2
			indian_ocean_islands = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 0.05
			australian_coast = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			australian_coast = { owner = { rival_of = THIS } }
		}
		modifier = {
			factor = 0.05
			new_zealand_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			new_zealand_region = { owner = { rival_of = THIS } }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_06
		australian_coast = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = australian_coast }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = australian_coast }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = australian_coast }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = australian_coast }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = australian_coast } }
			any_owned = {
				limit = {
					region = australian_coast
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		new_zealand_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = new_zealand_region }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = new_zealand_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = new_zealand_region }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = new_zealand_region }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = new_zealand_region } }
			any_owned = {
				limit = {
					region = new_zealand_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}

# 53 FRANCE
country_event = { # Canada

  	id = 2950530

	trigger = {
		tag = FRA
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		the_carribean = { citysize = 2000 owner = { capital_scope = { continent = europe } } }
		OR = {
			northern_america = { empty = yes range = yes NOT = { has_discovered = THIS } }
			AND = {
				number_of_colonies = 1
				NOT = { northern_america = { owned_by = THIS } }
				northern_america = { empty = yes }
			}
		}
		NOT = { has_country_flag = ai_colonial_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 100
		modifier = {
			factor = 0.2
			NOT = { the_carribean = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { central_american_region = { empty = yes } }
		}
		modifier = {
			factor = 0.02
			central_american_region = { has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 0.04
			the_andes = { has_discovered = THIS trade_goods = gold }
		}
		modifier = {
			factor = 0.2
			northern_america = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.1
			the_thirteen_colonies = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.1
			north_american_region = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.1
			north_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			central_american_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.025
			south_american_region = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		northern_america = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = northern_america }
				NOT = { relation = { who = THIS value = 100 } }
				capital_scope = { continent = europe }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = northern_america }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = northern_america }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { continent = europe } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = northern_america }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = northern_america }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = northern_america }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = northern_america } }
			any_owned = {
				limit = {
					region = northern_america
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Mississippi

  	id = 2950531

	trigger = {
		tag = FRA
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		tariff_efficiency = 0.9
		navy = 16
		transport = 3
		northern_america = { citysize = 4000 owned_by = THIS }
		the_mississippi_region = { empty = yes range = yes }
		NOT = { has_country_flag = ai_colonial_02 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 72
		modifier = {
			factor = 0.1
			NOT = { northern_america = { empty = yes } }
		}
		modifier = {
			factor = 0.1
			NOT = { the_thirteen_colonies = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { the_spanish_main = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			NOT = { central_american_region = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			the_mississippi_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			the_mississippi_region = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 0.12
			north_american_region = { owner = { is_rival = THIS } }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		the_mississippi_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = the_mississippi_region }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = the_mississippi_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = the_mississippi_region }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = the_mississippi_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = the_mississippi_region }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = the_mississippi_region }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_mississippi_region } }
			any_owned = {
				limit = {
					region = the_mississippi_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}

# 54 LOW COUNTRY
country_event = { # South Africa

  	id = 2950540

	trigger = {
		OR = {
			primary_culture = dutch
			primary_culture = flemish
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 12
		num_of_cities = 4
		num_of_ports = 1
		the_carribean = { range = yes citysize = 3000 owner = { capital_scope = { continent = europe } } }
		OR = {
			cape = { empty = yes range = yes NOT = { has_discovered = THIS } }
			AND = {
				number_of_colonies = 3
				NOT = { cape = { owned_by = THIS } }
				cape = { empty = yes }
			}
		}
		NOT = {
			lowlands_region = {
				port = yes
				NOT = { owned_by = THIS }
				owner = {
					OR = {
						primary_culture = dutch
						primary_culture = flemish
					}
					num_of_ports = 2
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_colonial_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		cape = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = cape }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = cape }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = cape }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = cape }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = cape }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			any_owned = {
				limit = { region = cape }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = cape } }
			any_owned = {
				limit = {
					region = cape
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		add_ai_strategy = { personality = colonial }
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Asian Trade

  	id = 2950541

	trigger = {
		OR = {
			primary_culture = dutch
			primary_culture = flemish
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 16
		transport = 3
		num_of_cities = 4
		num_of_ports = 1
		south_africa = { citysize = 2000 owned_by = THIS }
		NOT = { has_country_flag = ai_colonial_02 }
		ai = yes
		is_subject = no
		OR = {
			eastasian_trade_ports = { range = yes }
			AND = {
				total_merchants = 20
				eastasian_trade_ports = { has_discovered = THIS }
			}
		}
		NOT = {
			lowlands_region = {
				port = yes
				NOT = { owned_by = THIS }
				owner = {
					OR = {
						primary_culture = dutch
						primary_culture = flemish
					}
					num_of_ports = 2
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
	}

	mean_time_to_happen = {
		years = 18
		modifier = {
			factor = 0.05
			eastasian_trade_ports = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			eastasian_trade_ports = { cot = yes cot_value = 700 }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { owned_by = THIS }
		}
		modifier = {
			factor = 0.1
			NOT = { cape = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			indian_coast = { has_discovered = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		eastasian_trade_ports = { set_province_flag = explore_prov }
		any_country = {
			limit = {
				any_owned_province = { cot = yes region = eastasian_trade_ports }
				NOT = { capital_scope = { continent = europe } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = befriend
			set_country_flag = military_access
			set_global_flag = befriend
			set_global_flag = military_access
		}
		any_country = {
			limit = {
				any_owned_province = { region = eastasian_trade_ports }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = eastasian_trade_ports }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = eastasian_trade_ports } }
			any_owned = {
				limit = {
					region = eastasian_trade_ports
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Indonesia

  	id = 2950542

	trigger = {
		OR = {
			primary_culture = dutch
			primary_culture = flemish
		}
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 20
		transport = 5
		indonesian_region = { empty = yes range = yes }
		num_of_cities = 4
		num_of_ports = 1
		NOT = { has_country_flag = ai_colonial_03 }
		ai = yes
		OR = {
			east_asian_cot = { placed_merchants = 3 }
			eastasian_trade_ports = { placed_merchants = 3 }
			south_africa = { citysize = 4000 owned_by = THIS }
		}
		is_subject = no
		NOT = {
			lowlands_region = {
				port = yes
				NOT = { owned_by = THIS }
				owner = {
					OR = {
						primary_culture = dutch
						primary_culture = flemish
					}
					num_of_ports = 2
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = {
			indonesian_region = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
	}

	mean_time_to_happen = {
		years = 36
		modifier = {
			factor = 0.2
			east_asian_cot = { placed_merchants = 5 }
		}
		modifier = {
			factor = 0.2
			eastasian_trade_ports = { placed_merchants = 5 }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { owned_by = THIS }
		}
		modifier = {
			factor = 0.1
			NOT = { cape = { empty = yes } }
		}
		modifier = {
			factor = 0.05
			indonesian_region = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.05
			indonesian_region = { has_discovered = THIS NOT = { owned_by = THIS } owner = { capital_scope = { continent = europe } } }
		}
		modifier = {
			factor = 0.01
			indonesian_region = { owned_by = THIS }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_03
		indonesian_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = indonesian_region }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = indonesian_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = indonesian_region }
				NOT = { capital_scope = { continent = europe } }
				NOT = { trade_agreement_with = THIS }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = indonesian_region }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = indonesian_region }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = {
				limit = { region = indonesian_region }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = indonesian_region } }
			any_owned = {
				limit = {
					region = indonesian_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Unifying Netherlands

  	id = 2950543

	trigger = {
		tag = NED
		lowlands_region = {
			is_core = THIS
			NOT = { owned_by = THIS }
		}
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_diplomatic_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 6 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_01
		any_country = {
			limit = { capital_scope = { region = lowlands_region NOT = { owned_by = THIS } } }
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = { set_province_flag = conquer_prov }
			set_global_flag = conquer_prov
		}
		any_country = {
			limit = {
				capital_scope = { region = lowlands_region NOT = { owned_by = THIS } }
				OR = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
					navy = THIS
				}
			}
			set_country_flag = rival
			set_global_flag = rival
		}
		any_country = {
			limit = {
				any_owned_province = { region = lowlands_region }
				NOT = { capital_scope = { region = lowlands_region } }
			}
			set_country_flag = threat
			set_global_flag = threat
			any_owned = {
				limit = { region = lowlands_region }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
  		country_event = 296000
	}
}

# 55 RUSSIA
country_event = { # Western Siberia

  	id = 2950550

	trigger = {
		tag = RUS
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_colonial_01 }
		western_siberia = { empty = yes }
		NOT = {
			western_siberia = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 12
		modifier = {
			factor = 0.5
			western_siberia = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			war = yes
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_01
		western_siberia = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = western_siberia }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = western_siberia }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = western_siberia }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = western_siberia }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = western_siberia }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = {
				limit = { region = western_siberia }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = western_siberia } }
			any_owned = {
				limit = {
					region = western_siberia
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Eastern Siberia

  	id = 2950551

	trigger = {
		tag = RUS
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_colonial_02 }
		eastern_siberia = { empty = yes }
		western_siberia = { owned_by = THIS citysize = 2000 any_neighbor_province = { region = eastern_siberia } }
		NOT = {
			eastern_siberia = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.1
			NOT = { western_siberia = { empty = yes } }
		}
		modifier = {
			factor = 0.2
			eastern_siberia = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			war = yes
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_02
		eastern_siberia = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = eastern_siberia }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = eastern_siberia }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = eastern_siberia }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = eastern_siberia }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = eastern_siberia }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = {
				limit = { region = eastern_siberia }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = eastern_siberia } }
			any_owned = {
				limit = {
					region = eastern_siberia
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Beyond Siberia

  	id = 2950552

	trigger = {
		tag = RUS
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_colonial_03 }
		NOT = { western_siberia = { empty = yes } }
		eastern_siberia = { owned_by = THIS citysize = 6000 any_neighbor_province = { region = manchuria } }
		ai = yes
		is_subject = no
		OR = {
			northwest_america = { empty = yes }
			manchuria = { NOT = { owned_by = THIS } }
		}
		NOT = {
			manchuria = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
	}

	mean_time_to_happen = {
		years = 100
		modifier = {
			factor = 0.75
			NOT = { eastern_siberia = { empty = yes } }
		}
		modifier = {
			factor = 0.75
			manchuria = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			war = yes
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_03
		manchuria = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = manchuria }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = manchuria }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = manchuria }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = manchuria }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = manchuria }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = {
				limit = { region = manchuria }
				clr_province_flag = colonize_prov
			}
		}
		northwest_america = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = {
				any_owned_province = { region = northwest_america }
				capital_scope = { continent = europe }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = northwest_america }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = northwest_america }
				NOT = { capital_scope = { continent = europe } }
				NOT = { relation = { who = THIS value = 100 } }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = northwest_america }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = {
				any_owned_province = { region = northwest_america }
				relation = { who = THIS value = 100 }
				NOT = { capital_scope = { owned_by = THIS } }
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = {
				limit = { region = northwest_america }
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { has_province_flag = explore_prov has_discovered = THIS } }
			any_owned = {
				limit = {
					has_province_flag = explore_prov
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # Forming Russia

  	id = 2950553

	trigger = {
		OR = {
			tag = MOS
			tag = NOV
			tag = RUS
		}
		NOT = {
			russian_region = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_diplomatic_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 6 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_01
		russian_region = { set_province_flag = conquer_prov }
		any_country = {
			limit = { any_owned_province = { region = russian_region } religion_group = THIS }
			set_country_flag = protect
			set_country_flag = rival
			set_global_flag = protect_country
			set_global_flag = rival
		}
		any_country = {
			limit = { capital_scope = { region = russian_region } NOT = { religion_group = THIS } }
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = {
				any_owned_province = { region = russian_region }
				NOT = { capital_scope = { region = russian_region } }
			}
			set_country_flag = threat
			set_global_flag = threat
		}
		set_global_flag = conquer_prov
  		country_event = 296000
	}
}

# 56 AUSTRIA
country_event = { # Unify HAB

  	id = 2950560

	trigger = {
		primary_culture = austrian
		has_global_flag = ai_may_strategize
		num_of_cities = 3
		NOT = { exists = HAB }
		NOT = { has_country_flag = ai_diplomatic_01 }
		ai = yes
		is_subject = no
		NOT = {
			circuit_austrian = {
				NOT = { owned_by = THIS }
				owner = {
					primary_culture = austrian
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_01
		circuit_austrian = { set_province_flag = conquer_prov }
		any_country = {
			limit = { capital_scope = { region = circuit_austrian NOT = { owned_to = THIS } } }
			set_country_flag = vassal
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				any_owned_province = { region = circuit_austrian }
				NOT = { capital_scope = { region = circuit_austrian } }
			}
			set_country_flag = threat
			set_global_flag = threat
		}
		set_global_flag = conquer_prov
  		country_event = 296000
	}
}

# 57 OTTOMANS
country_event = { # Eastern Balkans and Asia Minor

  	id = 2950570

	trigger = {
		tag = TUR
		has_global_flag = ai_may_strategize
		NOT = { owns = 151 }
		NOT = {
			asia_minor = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_diplomatic_01 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_01
		asia_minor = { set_province_flag = conquer_prov }
		any_country = {
			limit = { any_owned_province = { region = asia_minor } religion_group = christian }
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = { capital_scope = { region = asia_minor } religion_group = muslim }
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = vassal
			set_global_flag = protect_country
		}
		any_country = {
			limit = { any_owned_province = { region = asia_minor } NOT = { capital_scope = { region = asia_minor } } religion_group = muslim }
			set_country_flag = rival
			set_global_flag = rival
		}
		eastern_balkans = { set_province_flag = conquer_prov }
		any_country = {
			limit = { any_owned_province = { region = eastern_balkans } religion_group = christian }
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = vassal
			set_global_flag = protect_country
		}
		any_country = {
			limit = { capital_scope = { region = eastern_balkans } religion_group = muslim }
			set_country_flag = vassal
			set_country_flag = protect
		}
		any_country = {
			limit = { any_owned_province = { region = eastern_balkans } NOT = { capital_scope = { region = eastern_balkans } } religion_group = muslim }
			set_country_flag = rival
			set_global_flag = rival
		}
		set_global_flag = conquer_prov
  		country_event = 296000
	}
}
country_event = { # Western Balkans and Anatolia

  	id = 2950571

	trigger = {
		tag = TUR
		has_global_flag = ai_may_strategize
		owns = 151
		NOT = {
			western_balkans = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = {
			anatolia = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		NOT = { has_country_flag = ai_diplomatic_02 }
		ai = yes
		is_subject = no
		OR = {
			western_balkans = { NOT = { owned_by = THIS } }
			anatolia = { NOT = { owned_by = THIS } }
		}
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_02
		western_balkans = { set_province_flag = conquer_prov }
		set_global_flag = conquer_prov
		any_country = {
			limit = { any_owned_province = { region = western_balkans } religion_group = christian NOT = { army = THIS } }
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = { any_owned_province = { region = western_balkans } religion_group = christian army = THIS }
			set_country_flag = rival
			set_global_flag = rival
		}
		any_country = {
			limit = { capital_scope = { region = western_balkans } religion_group = muslim }
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = vassal
			set_global_flag = protect_country
		}
		any_country = {
			limit = { any_owned_province = { region = western_balkans } NOT = { capital_scope = { region = western_balkans } } religion_group = muslim }
			set_country_flag = rival
			set_global_flag = rival
		}
		anatolia = { set_province_flag = conquer_prov }
		any_country = {
			limit = { any_owned_province = { region = anatolia } religion_group = christian NOT = { army = THIS } }
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = { any_owned_province = { region = anatolia } religion_group = christian army = THIS }
			set_country_flag = rival
			set_global_flag = rival
		}
		any_country = {
			limit = { capital_scope = { region = anatolia } religion_group = muslim }
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = vassal
			set_global_flag = protect_country
		}
		any_country = {
			limit = { any_owned_province = { region = anatolia } NOT = { capital_scope = { region = anatolia } } religion_group = muslim }
			set_country_flag = rival
			set_global_flag = rival
		}
  		country_event = 296000
	}
}
country_event = { # Mameluks

  	id = 2950572

	trigger = {
		tag = TUR
		has_global_flag = ai_may_strategize
		owns = 151
		exists = MAM
		MAM = {
			NOT = { prestige = THIS }
			NOT = { num_of_cities = THIS }
			NOT = { army = THIS }
		}
		NOT = { has_country_flag = ai_diplomatic_03 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_03
		MAM = {
			set_country_flag = befriend
			set_country_flag = protect
			set_country_flag = vassal
		}
		set_global_flag = befriend
		set_global_flag = protect_country
		set_global_flag = vassal
  		country_event = 296000
	}
}
country_event = { # North Africa

  	id = 2950573

	trigger = {
		tag = TUR
		has_global_flag = ai_may_strategize
		owns = 151
		NOT = {
			north_africa = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		OR = {
			owns = 368
			owns = 379
			MAM = { vassal_of = TUR }
		}
		NOT = { has_country_flag = ai_diplomatic_04 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_04
		any_country = {
			limit = { any_owned_province = { region = north_africa } religion_group = christian }
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = north_africa }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { capital_scope = { region = north_africa } religion_group = muslim }
			set_country_flag = befriend
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = befriend
			set_global_flag = protect_country
			set_global_flag = vassal
		}
		any_country = {
			limit = { any_owned_province = { region = north_africa } NOT = { capital_scope = { region = north_africa } } religion_group = muslim NOT = { vassal_of = TUR } }
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = north_africa }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
  		country_event = 296000
	}
}
country_event = { # Arabia

  	id = 2950574

	trigger = {
		tag = TUR
		NOT = { exists = MAM }
		has_global_flag = ai_may_strategize
		owns = 151
		NOT = {
			arabia = {
				owner = {
					prestige = THIS
					num_of_cities = THIS
					army = THIS
				}
			}
		}
		OR = {
			owns = 368
			owns = 379
		}
		NOT = { has_country_flag = ai_diplomatic_05 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_diplomatic_05
		arabia = { set_province_flag = conquer_prov }
		set_global_flag = conquer_prov
		any_country = {
			limit = { any_owned_province = { region = arabia } religion_group = christian NOT = { army = THIS } }
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = { any_owned_province = { region = arabia } religion_group = christian army = THIS }
			set_country_flag = rival
			set_global_flag = rival
		}
		any_country = {
			limit = { capital_scope = { region = arabia } religion_group = muslim }
			set_country_flag = vassal
			set_country_flag = protect
			set_global_flag = vassal
			set_global_flag = protect_country
		}
		any_country = {
			limit = { any_owned_province = { region = arabia } NOT = { capital_scope = { region = arabia } } religion_group = muslim }
			set_country_flag = rival
			set_global_flag = rival
		}
  		country_event = 296000
	}
}

### Confrontation over spheres of influence (apply by context) ###
# 295090.0

province_event = { # Northern Italy

  	id = 2950900

	trigger = {
		OR = {
			region = lombardia
			any_neighbor_province = { region = lombardia }
		}
		has_global_flag = ai_may_strategize
		NOT = {
			italian_region = {
				is_capital = yes
				owner = {
					OR = {
						army = THIS
						num_of_cities = THIS
						prestige = THIS
					}
				}
			}
		}
		owner = {
			NOT = { capital_scope = { region = lombardia } }
			NOT = { has_country_flag = ai_competitive_01 }
			ai = yes
			is_subject = no
		}		
	}

	mean_time_to_happen = { months = 24 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_01 }
		lombardia = { set_province_flag = conquer_prov }
		set_global_flag = conquer_prov
		any_country = {
			limit = {
				capital_scope = { region = lombardia }
				NOT = { vassal_of = THIS }
				NOT = { junior_union_with = THIS }
			}
			set_country_flag = protect
			set_country_flag = vassal
			set_global_flag = protect_country
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				capital_scope = { region = lombardia }
				OR = {
					vassal_of = THIS
					junior_union_with = THIS
				}
			}
			set_country_flag = protect
			set_global_flag = protect_country
			any_owned = { clr_province_flag = conquer_prov }
		}
		any_country = {
			limit = {
				any_owned_province = { region = lombardia }
				NOT = { capital_scope = { region = lombardia } }
				NOT = { army = THIS }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = {
				any_owned_province = { region = lombardia }
				NOT = { capital_scope = { region = lombardia } }
				army = THIS
			}
			set_country_flag = rival
			set_global_flag = rival
		}
  		owner = { country_event = 296000 }
	}
}
province_event = { # Crimea, Caucasus, Caspian

  	id = 2950901

	trigger = {
		OR = {
			region = caucasus_caspian
			any_neighbor_province = { region = caucasus_caspian }
		}
		has_global_flag = ai_may_strategize
		caucasus_caspian = {
			owner = {
				is_rival = THIS
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		NOT = {
			caucasus_caspian = {
				is_capital = yes
				owner = {
					OR = {
						army = THIS
						num_of_cities = THIS
						prestige = THIS
					}
				}
			}
		}
		owner = {
			NOT = { capital_scope = { region = caucasus_caspian } }
			NOT = { has_country_flag = ai_competitive_02 }
			ai = yes
			is_subject = no
			num_of_cities = 16
		}		
	}

	mean_time_to_happen = { months = 24 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_02 }
		caucasus_caspian = { set_province_flag = conquer_prov }
		set_global_flag = conquer_prov
		any_country = {
			limit = {
				capital_scope = { region = caucasus_caspian }
				NOT = { vassal_of = THIS }
				NOT = { junior_union_with = THIS }
			}
			set_country_flag = vassal
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				capital_scope = { region = caucasus_caspian }
				OR = {
					vassal_of = THIS
					alliance_with = THIS
					marriage_with = THIS
					junior_union_with = THIS
				}
			}
			set_country_flag = protect
			set_global_flag = protect_country
		}
		any_country = {
			limit = {
				any_owned_province = { region = caucasus_caspian }
				NOT = { capital_scope = { region = caucasus_caspian } }
				NOT = { num_of_cities = THIS }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = {
				any_owned_province = { region = caucasus_caspian }
				NOT = { capital_scope = { region = caucasus_caspian } }
				num_of_cities = THIS
			}
			set_country_flag = rival
			set_global_flag = rival
		}
  		owner = { country_event = 296000 }
	}
}
province_event = { # mississippi

  	id = 2950902

	trigger = {
		is_colony = no
		OR = {
			region = the_mississippi_region
			any_neighbor_province = { region = the_mississippi_region }
		}
		has_global_flag = ai_may_strategize
		the_mississippi_region = { empty = yes range = yes }
		the_mississippi_region = {
			NOT = { owned_by = THIS }
			owner = {
				capital_scope = { continent = europe }
				OR = {
					army = THIS
					num_of_cities = THIS
					prestige = THIS
				}
			}
		}
		owner = {
			any_owned_province = { port = yes is_core = THIS }
			tariff_efficiency = 0.9
			navy = 18
			transport = 4
			capital_scope = { continent = europe }
			NOT = { has_country_flag = ai_competitive_03 }
			ai = yes
			is_subject = no
		}		
	}

	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			owner = { NOT = { transport = 10 } }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_03 }
		the_mississippi_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
		any_country = {
			limit = { any_owned_province = { region = the_mississippi_region } }
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = the_mississippi_region }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_mississippi_region } }
			any_owned = {
				limit = {
					region = the_mississippi_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
  		owner = { country_event = 296000 }
	}
}
province_event = { # great_plains

  	id = 2950903

	trigger = {
		is_colony = no
		OR = {
			region = great_plains
			any_neighbor_province = { region = great_plains }
		}
		has_global_flag = ai_may_strategize
		great_plains = { empty = yes range = yes }
		great_plains = {
			NOT = { owned_by = THIS }
			owner = {
				capital_scope = { continent = europe }
				OR = {
					army = THIS
					num_of_cities = THIS
					prestige = THIS
				}
			}
		}
		owner = {
			capital_scope = { continent = europe }
			tariff_efficiency = 0.9
			any_owned_province = { port = yes is_core = THIS }
			navy = 18
			transport = 4
			NOT = { has_country_flag = ai_competitive_04 }
			ai = yes
			is_subject = no
		}		
	}

	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			owner = { NOT = { transport = 10 } }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_04 }
		great_plains = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = great_plains } }
			set_country_flag = rival
			set_global_flag = rival
			any_owned = {
				limit = { region = great_plains }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = great_plains } }
			any_owned = {
				limit = {
					region = great_plains
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		owner = { country_event = 296000 }
	}
}
country_event = { # eastern_america

  	id = 2950904

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 18
		transport = 4
		eastern_america = { empty = yes range = yes }
		eastern_america = {
			citysize = 3000
			NOT = { owned_by = THIS }
			owner = {
				is_rival = THIS
				capital_scope = { continent = europe }
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		capital_scope = { continent = europe }
		NOT = { has_country_flag = ai_competitive_05 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 10
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_05
		eastern_america = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = eastern_america } }
			any_owned = {
				limit = {
					region = eastern_america
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # northwest_america

  	id = 2950905

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 20
		transport = 5
		northwest_america = { empty = yes range = yes }
		northwest_america = {
			citysize = 3000
			NOT = { owned_by = THIS }
			owner = {
				is_rival = THIS
				capital_scope = { continent = europe }
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		capital_scope = { continent = europe }
		NOT = { has_country_flag = ai_competitive_06 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_06
		northwest_america = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = northwest_america } }
			any_owned = {
				limit = {
					region = northwest_america
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
province_event = { # western_america

  	id = 2950906

	trigger = {
		is_colony = no
		any_neighbor_province = { region = western_america }
		western_america = { empty = yes range = yes }
		has_global_flag = ai_may_strategize
		owner = {
			capital_scope = { continent = europe }
			any_owned_province = { port = yes is_core = THIS }
			tariff_efficiency = 0.9
			navy = 20
			transport = 5
			NOT = { has_country_flag = ai_competitive_07 }
			ai = yes
			is_subject = no
		}		
	}

	mean_time_to_happen = {
		months = 24
		modifier = {
			factor = 10
			owner = { NOT = { transport = 10 } }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_07 }
		western_america = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = western_america } }
			any_owned = {
				limit = {
					region = western_america
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		owner = { country_event = 296000 }
	}
}
country_event = { # the_carribean

  	id = 2950907

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		capital_scope = { continent = europe }
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 20
		transport = 5
		NOT = { has_country_flag = ai_competitive_08 }
		the_carribean = { has_discovered = THIS range = yes }
		the_carribean = {
			citysize = 3000
			NOT = { owned_by = THIS }
			owner = {
				is_rival = THIS
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 10
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_08
		the_carribean = { set_province_flag = colonize_prov set_province_flag = explore_prov }
		any_owned = {
			limit = { region = the_carribean }
			clr_province_flag = colonize_prov
			clr_province_flag = explore_prov
			set_province_flag = protect
			set_global_flag = protect_province
		}
		rival_countries = {
			any_owned = {
				limit = { region = the_carribean }
				clr_province_flag = colonize_prov
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = the_carribean } }
			any_owned = {
				limit = {
					region = the_carribean
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # pacific_ocean_islands

  	id = 2950908

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 25
		transport = 5
		pacific_ocean_islands = { empty = yes range = yes }
		pacific_ocean_islands = { has_discovered = THIS }
		pacific_ocean_islands = {
			owner = {
				is_rival = THIS
				capital_scope = { continent = europe }
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		capital_scope = { continent = europe }
		NOT = { has_country_flag = ai_competitive_09 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 10
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_09
		pacific_ocean_islands = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = pacific_ocean_islands } }
			any_owned = {
				limit = {
					region = pacific_ocean_islands
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # India - built around GB example, then add another event for added vassals

  	id = 2950909

	trigger = {
		number_of_colonies = 1
		overseas_provinces_percentage = 0.1
		tariff_efficiency = 0.9
		capital_scope = { continent = europe }
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 25
		transport = 5
		indian_region = {
			has_discovered = THIS
			range = yes
			owner = {
				is_subject = yes
				capital_scope = { region = indian_region }
				overlord = {
					capital_scope = { continent = europe }
					is_rival = THIS
					OR = {
						NOT = { prestige = THIS }
						NOT = { num_of_cities = THIS }
					}
					OR = {
						NOT = { army = THIS }
						NOT = { navy = THIS }
					}
				}
			}
		}
		indian_region = {
			port = yes
			owner = {
				capital_scope = { region = indian_region }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { prestige = THIS }
				NOT = { num_of_cities = THIS }
				NOT = { army = THIS }
				is_subject = no
			}
		}
		NOT = { has_country_flag = ai_competitive_10 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 0.2
			indian_ocean_islands = { has_discovered = THIS }
		}
		modifier = {
			factor = 0.2
			indian_ocean_islands = { owned_by = THIS }
		}
		modifier = {
			factor = 2
			indian_ocean_islands = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			indian_coast = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			indian_region = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			NOT = { overseas_provinces_percentage = 0.1 }
		}
		modifier = {
			factor = 2
			NOT = { overseas_provinces_percentage = 0.2 }
		}
		modifier = {
			factor = 2
			NOT = { navy = 24 }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_10
		indian_region = { set_province_flag = explore_prov }
		random_country = {
			limit = {
				capital_scope = { region = indian_region }
				num_of_ports = 1
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { prestige = THIS }
				NOT = { num_of_cities = THIS }
				NOT = { army = THIS }
				is_subject = no
			}
			set_country_flag = vassal
			set_global_flag = vassal
		}
		random_country = {
			limit = {
				capital_scope = { region = indian_region }
				num_of_ports = 1
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { has_country_flag = vassal }
				any_neighbor_country = { has_country_flag = vassal }
			}
			set_country_flag = befriend
			set_country_flag = military_access
			set_global_flag = befriend
			set_global_flag = military_access
		}
		any_country = {
			limit = {
				capital_scope = { continent = europe }
				any_owned_province = { region = indian_region }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { relation = { who = THIS value = 100} }
			}
			set_country_flag = antagonize
			set_country_flag = rival
			set_global_flag = antagonize
			set_global_flag = rival
			any_owned = {
				limit = { region = indian_region }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = indian_region } }
			any_owned = {
				limit = {
					region = indian_region
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
province_event = { # western_balkans

  	id = 2950910

	trigger = {
		OR = {
			region = western_balkans
			any_neighbor_province = { region = western_balkans }
		}
		western_balkans = {
			owner = {
				is_rival = THIS
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		has_global_flag = ai_may_strategize
		NOT = {
			western_balkans = {
				is_capital = yes
				owner = {
					OR = {
						army = THIS
						num_of_cities = THIS
						prestige = THIS
					}
				}
			}
		}
		owner = {
			NOT = { capital_scope = { region = western_balkans } }
			NOT = { has_country_flag = ai_competitive_11 }
			ai = yes
			is_subject = no
			num_of_cities = 16
		}		
	}

	mean_time_to_happen = { months = 24 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_11 }
		western_balkans = { set_province_flag = conquer_prov }
		any_country = {
			limit = {
				capital_scope = { region = western_balkans }
				NOT = { vassal_of = THIS }
				NOT = { junior_union_with = THIS }
			}
			set_country_flag = protect
			set_country_flag = vassal
			set_global_flag = protect_country
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				capital_scope = { region = western_balkans }
				OR = {
					vassal_of = THIS
					alliance_with = THIS
					marriage_with = THIS
					junior_union_with = THIS
				}
			}
			set_country_flag = protect
			set_global_flag = protect_country
		}
		any_country = {
			limit = {
				any_owned_province = { region = western_balkans }
				NOT = { capital_scope = { region = western_balkans } }
				NOT = { num_of_cities = THIS }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = {
				any_owned_province = { region = western_balkans }
				NOT = { capital_scope = { region = western_balkans } }
				num_of_cities = THIS
			}
			set_country_flag = rival
			set_global_flag = rival
		}
		set_global_flag = conquer_prov
  		owner = { country_event = 296000 }
	}
}
province_event = { # region hungary

  	id = 2950911

	trigger = {
		OR = {
			region = hungary
			any_neighbor_province = { region = hungary }
		}
		hungary = {
			owner = {
				is_rival = THIS
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
					NOT = { army = THIS }
				}
			}
		}
		has_global_flag = ai_may_strategize
		NOT = {
			hungary = {
				is_capital = yes
				owner = {
					OR = {
						army = THIS
						num_of_cities = THIS
						prestige = THIS
					}
				}
			}
		}
		owner = {
			NOT = { capital_scope = { region = hungary } }
			NOT = { has_country_flag = ai_competitive_12 }
			ai = yes
			is_subject = no
			num_of_cities = 16
		}		
	}

	mean_time_to_happen = { months = 24 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		owner = { set_country_flag = ai_competitive_12 }
		hungary = { set_province_flag = conquer_prov }
		any_country = {
			limit = {
				capital_scope = { region = hungary }
				NOT = { vassal_of = THIS }
				NOT = { junior_union_with = THIS }
			}
			set_country_flag = protect
			set_country_flag = vassal
			set_global_flag = protect_country
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				capital_scope = { region = hungary }
				OR = {
					vassal_of = THIS
					alliance_with = THIS
					marriage_with = THIS
					junior_union_with = THIS
				}
			}
			set_country_flag = protect
			set_global_flag = protect_country
		}
		any_country = {
			limit = {
				any_owned_province = { region = hungary }
				NOT = { capital_scope = { region = hungary } }
				NOT = { num_of_cities = THIS }
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
		}
		any_country = {
			limit = {
				any_owned_province = { region = hungary }
				NOT = { capital_scope = { region = hungary } }
				num_of_cities = THIS
			}
			set_country_flag = rival
			set_global_flag = rival
		}
		set_global_flag = conquer_prov
  		owner = { country_event = 296000 }
	}
}
country_event = { # India - add more vassals

  	id = 2950912

	trigger = {
		indian_region = { owner = { vassal_of = THIS } }
		capital_scope = { continent = europe }
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 30
		transport = 5
		indian_region = {
			is_capital = yes
			has_discovered = THIS
			owner = {
				is_vassal = yes
				NOT = { army = THIS }
				NOT = { navy = THIS }
				overlord = {
					is_rival = THIS
					capital_scope = { continent = europe }
					NOT = { capital_scope = { owned_by = THIS } }
					OR = {
						NOT = { prestige = THIS }
						NOT = { num_of_cities = THIS }
					}
					OR = {
						NOT = { army = THIS }
						NOT = { navy = THIS }
					}
					OR = {
						prestige = THIS
						num_of_cities = THIS
						army = THIS
						navy = THIS
					}
				}
			}
		}
		NOT = { has_country_flag = ai_competitive_13 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		years = 12
		modifier = {
			factor = 2
			indian_ocean_islands = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			indian_coast = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			indian_region = { NOT = { has_discovered = THIS } }
		}
		modifier = {
			factor = 2
			NOT = { overseas_provinces_percentage = 0.1 }
		}
		modifier = {
			factor = 2
			NOT = { overseas_provinces_percentage = 0.2 }
		}
		modifier = {
			factor = 2
			NOT = { navy = 24 }
		}
		modifier = {
			factor = 2
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_13
		random_country = {
			limit = {
				capital_scope = { region = indian_region has_discovered = THIS }
				is_vassal = yes
				NOT = { army = THIS }
				NOT = { navy = THIS }
				overlord = {
					is_rival = THIS
					capital_scope = { continent = europe }
					NOT = { capital_scope = { owned_by = THIS } }
					OR = {
						NOT = { prestige = THIS }
						NOT = { num_of_cities = THIS }
					}
					OR = {
						NOT = { army = THIS }
						NOT = { navy = THIS }
					}
					OR = {
						prestige = THIS
						num_of_cities = THIS
						army = THIS
						navy = THIS
					}
				}
			}
			set_country_flag = antagonize
			set_global_flag = antagonize
			any_owned = {
				limit = { region = indian_region }
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
			overlord = {
				set_country_flag = antagonize
				set_country_flag = rival
				set_global_flag = antagonize
				set_global_flag = rival
				any_owned = {
					limit = { region = indian_region }
					set_province_flag = conquer_prov
					set_global_flag = conquer_prov
				}
			}
		}
		random_country = {
			limit = {
				capital_scope = { region = indian_region }
				NOT = { capital_scope = { owned_by = THIS } }
				NOT = { prestige = THIS }
				NOT = { num_of_cities = THIS }
				NOT = { army = THIS }
				is_subject = no
				is_vassal = no
			}
			set_country_flag = vassal
			set_global_flag = vassal
		}
		any_country = {
			limit = {
				capital_scope = { region = indian_region }
				vassal_of = THIS
			}
			set_country_flag = befriend
			set_country_flag = protect
			set_global_flag = befriend
			set_global_flag = protect_country
		}
		any_country = {
			limit = { any_owned_province = { region = indian_region NOT = { has_discovered = THIS } } }
			any_owned = {
				limit = {
					region = indian_region
					NOT = { has_discovered = THIS }
				}
				set_province_flag = explore_prov
				set_global_flag = explore_prov
			}
		}
  		country_event = 296000
	}
}
country_event = { # atlantic_ocean_islands

  	id = 2950913

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		atlantic_ocean_islands = { empty = yes range = yes }
		atlantic_ocean_islands = { has_discovered = THIS }
		atlantic_ocean_islands = {
			owner = {
				is_rival = THIS
				capital_scope = { continent = europe }
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
				}
				OR = {
					NOT = { navy = THIS }
					NOT = { army = THIS }
				}
			}
		}
		capital_scope = { continent = europe }
		NOT = { has_country_flag = ai_competitive_14 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 10
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_14
		atlantic_ocean_islands = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = atlantic_ocean_islands } }
			any_owned = {
				limit = {
					region = atlantic_ocean_islands
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = atlantic_ocean_islands } }
			any_owned = {
				limit = {
					region = atlantic_ocean_islands
					citysize = 1000
				}
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { is_rival = THIS any_owned_province = { region = atlantic_ocean_islands } }
			any_owned = {
				limit = {
					region = atlantic_ocean_islands
				}
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}
country_event = { # indian_ocean_islands

  	id = 2950914

	trigger = {
		overseas_provinces_percentage = 0.1
		number_of_colonies = 1
		tariff_efficiency = 0.9
		has_global_flag = ai_may_strategize
		any_owned_province = { port = yes is_core = THIS }
		navy = 24
		transport = 6
		indian_ocean_islands = { empty = yes range = yes }
		indian_ocean_islands = { has_discovered = THIS }
		indian_ocean_islands = {
			owner = {
				is_rival = THIS
				capital_scope = { continent = europe }
				OR = {
					NOT = { prestige = THIS }
					NOT = { num_of_cities = THIS }
				}
				OR = {
					NOT = { navy = THIS }
					NOT = { army = THIS }
				}
			}
		}
		capital_scope = { continent = europe }
		NOT = { has_country_flag = ai_competitive_15 }
		ai = yes
		is_subject = no
	}

	mean_time_to_happen = {
		months = 12
		modifier = {
			factor = 10
			NOT = { transport = 10 }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_competitive_15
		indian_ocean_islands = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		any_country = {
			limit = { any_owned_province = { region = indian_ocean_islands } }
			any_owned = {
				limit = {
					region = indian_ocean_islands
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { region = indian_ocean_islands } }
			any_owned = {
				limit = {
					region = indian_ocean_islands
					citysize = 1000
				}
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { is_rival = THIS any_owned_province = { region = indian_ocean_islands } }
			any_owned = {
				limit = {
					region = indian_ocean_islands
				}
				set_province_flag = conquer_prov
				set_global_flag = conquer_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}

# Economic
country_event = { # aiming at a valuable market

  	id = 2950930

	trigger = {
		OR = {
			NOT = { num_of_cots = 1 }
			trade_income_percentage = 0.8
		}
		OR = {
			total_merchants = 20
			check_variable = { which = trade_acumen value = 2 }
		}
		any_known_country = {
			num_of_cots = 1
			NOT = { open_market = THIS }
			NOT = { is_rival = THIS }
			NOT = { is_threat = THIS }
			any_owned_province = {
				cot = yes
				has_discovered = THIS
				cot_value = 700
				OR = {
					THIS = { any_owned_province = { port = yes is_core = THIS } }
					AND = {
						continent = europe
						THIS = { capital_scope = { continent = europe } }
					}
					AND = {
						continent = asia
						THIS = { capital_scope = { continent = asia } }
					}
					AND = {
						continent = africa
						THIS = { capital_scope = { continent = africa } }
					}
					AND = {
						continent = north_america
						THIS = { capital_scope = { continent = north_america } }
					}
					AND = {
						continent = south_america
						THIS = { capital_scope = { continent = south_america } }
					}
				}
			}
		}
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_economic_01 }
		ai = yes
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 4
			war = yes
		}
		modifier = {
			factor = 0.8
			total_merchants = 30
		}
		modifier = {
			factor = 0.8
			total_merchants = 40
		}
		modifier = {
			factor = 0.8
			total_merchants = 50
		}
		modifier = {
			factor = 0.8
			check_variable = { which = trade_acumen value = 3 }
		}
		modifier = {
			factor = 0.8
			check_variable = { which = trade_acumen value = 4 }
		}
		modifier = {
			factor = 0.8
			check_variable = { which = trade_acumen value = 5 }
		}
		modifier = {
			factor = 0.8
			check_variable = { which = trade_acumen value = 6 }
		}
	}

	title = "AI_ECONOMIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_economic_01
		random_country = {
			limit = {
				num_of_cots = 1
				NOT = { open_market = THIS }
				NOT = { is_rival = THIS }
				NOT = { is_threat = THIS }
				any_owned_province = {
					cot = yes
					has_discovered = THIS
					cot_value = 700
					OR = {
						THIS = { any_owned_province = { port = yes is_core = THIS } }
						AND = {
							continent = europe
							THIS = { capital_scope = { continent = europe } }
						}
						AND = {
							continent = asia
							THIS = { capital_scope = { continent = asia } }
						}
						AND = {
							continent = africa
							THIS = { capital_scope = { continent = africa } }
						}
						AND = {
							continent = north_america
							THIS = { capital_scope = { continent = north_america } }
						}
						AND = {
							continent = south_america
							THIS = { capital_scope = { continent = south_america } }
						}
					}
				}
			}
			set_country_flag = befriend
		}
		set_global_flag = befriend
  		country_event = 296000
	}
}

# Colonial Latecomers
country_event = { # America

  	id = 2950940

	trigger = {
		NOT = { overseas_provinces_percentage = 0.01 }
		any_owned_province = { port = yes is_core = THIS }
		num_of_ports = 4
		colonists = 5
		navy = 18
		transport = 3
		any_known_country = {
			is_rival = THIS
			overseas_provinces_percentage = 0.3
		}
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = ai_colonial_99 }
		ai = yes
		is_subject = no
		OR = {
			AND = {
				south_american_region = { range = yes empty = yes has_discovered = THIS }
				south_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
			AND = {
				central_american_region = { range = yes empty = yes has_discovered = THIS }
				central_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
			AND = {
				north_american_region = { range = yes empty = yes has_discovered = THIS }
				north_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
		}
	}

	mean_time_to_happen = {
		years = 24
		modifier = {
			factor = 4
			war = yes
		}
		modifier = {
			factor = 0.8
			num_of_ports = 8
		}
		modifier = {
			factor = 0.8
			num_of_ports = 12
		}
		modifier = {
			factor = 0.8
			num_of_ports = 16
		}
		modifier = {
			factor = 0.8
			num_of_ports = 20
		}
		modifier = {
			factor = 0.8
			navy = 24
		}
		modifier = {
			factor = 0.8
			navy = 36
		}
		modifier = {
			factor = 0.8
			navy = 48
		}
	}

	title = "AI_COLONIAL"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_colonial_99
		random_country = {
			limit = {
				south_american_region = { range = yes empty = yes has_discovered = THIS }
				south_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
			south_american_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		}
		random_country = {
			limit = {
				central_american_region = { range = yes empty = yes has_discovered = THIS }
				central_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
			central_american_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		}
		random_country = {
			limit = {
				north_american_region = { range = yes empty = yes has_discovered = THIS }
				north_american_region = { citysize = 3000 has_province_flag = colonial_province has_owner_culture = yes }
			}
			north_american_region = { set_province_flag = explore_prov set_province_flag = colonize_prov }
		}
		any_country = {
			any_owned = {
				limit = {
					OR = {
						has_province_flag = explore_prov
						has_province_flag = colonize_prov
					}
					OR = {
						region = south_american_region
						region = central_american_region
						region = north_american_region
					}
				}
				clr_province_flag = explore_prov
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			any_owned = {
				limit = {
					OR = {
						has_province_flag = explore_prov
						has_province_flag = colonize_prov
					}
					range = no
				}
				clr_province_flag = explore_prov
				clr_province_flag = colonize_prov
			}
		}
		any_country = {
			limit = { any_owned_province = { has_province_flag = explore_prov has_discovered = THIS } }
			any_owned = {
				limit = {
					has_province_flag = explore_prov
					has_discovered = THIS
				}
				clr_province_flag = explore_prov
			}
		}
		set_global_flag = colonize_prov
		set_global_flag = explore_prov
  		country_event = 296000
	}
}

### Checking the player ###

# 29.50.95

country_event = { # looking at player as a threat and rival

  	id = 2950950

	trigger = {
		any_known_country = {
			ai = no
			badboy = 0.4
			is_rival = THIS
			OR = {
				num_of_cities = THIS
				navy = THIS
				army = THIS
			}
			OR = {
				NOT = { num_of_cities = THIS }
				NOT = { navy = THIS }
				NOT = { army = THIS }
				NOT = { prestige = THIS }
			}
		}
		has_global_flag = ai_may_strategize
		NOT = { has_country_flag = we_are_scared }
		any_known_country = { has_country_flag = we_are_scared }
		NOT = { has_country_flag = ai_vs_player_01 }
		ai = yes
		is_subject = no
		NOT = { has_global_flag = ai_vs_player_war }
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_vs_player_01
		random_country = {
			limit = {
				ai = no
				badboy = 0.4
				is_rival = THIS
			}
			set_country_flag = rival
			set_country_flag = threat
		}
		any_country = {
			limit = { has_country_flag = we_are_scared }
			set_country_flag = protect
			set_global_flag = protect_country
		}
		any_country = {
			limit = {
				ai = yes
				OR = {
					has_country_flag = ai_vs_player_01
					has_country_flag = ai_vs_player_02
					has_country_flag = ai_vs_player_03
				}
			}
			relation = { who = THIS value = 100 }
#			set_country_flag = befriend
		}
		set_global_flag = rival
		set_global_flag = threat
  		country_event = 296000
	}
}
country_event = { # upping it one notch

  	id = 2950951

	trigger = {
		any_known_country = {
			ai = no
			badboy = 0.5
			is_rival = THIS
			OR = {
				num_of_cities = THIS
				navy = THIS
				army = THIS
			}
			OR = {
				NOT = { num_of_cities = THIS }
				NOT = { navy = THIS }
				NOT = { army = THIS }
				NOT = { prestige = THIS }
			}
		}
		has_global_flag = ai_may_strategize
		any_known_country = {
			OR = {
				has_country_flag = we_are_concerned
				has_country_flag = we_are_scared
			}
		}
		NOT = { has_country_flag = we_are_concerned }
		NOT = { has_country_flag = we_are_scared }
		NOT = { has_country_flag = ai_vs_player_02 }
		ai = yes
		is_subject = no
		NOT = { has_global_flag = ai_vs_player_war }
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_vs_player_02
		random_country = {
			limit = {
				ai = no
				badboy = 0.5
				is_rival = THIS
			}
			set_country_flag = rival
			set_country_flag = threat
			set_country_flag = antagonize
			rival_countries = { set_country_flag = enemy_of_enemy }
			threat_countries = { set_country_flag = enemy_of_enemy }
			any_neighbor_country = { set_country_flag = enemy_of_enemy }
		}
		any_country = {
			limit = {
				ai = yes
				OR = {
					has_country_flag = we_are_concerned
					has_country_flag = we_are_scared
					has_country_flag = enemy_of_enemy
					has_country_flag = we_are_alarmed
				}
			}
			clr_country_flag = enemy_of_enemy
			set_country_flag = befriend
			set_country_flag = protect
			set_country_flag = military_access
			set_global_flag = befriend
			set_global_flag = protect_country
			set_global_flag = military_access
		}
		any_country = {
			limit = {
				ai = yes
				OR = {
					has_country_flag = ai_vs_player_01
					has_country_flag = ai_vs_player_02
					has_country_flag = ai_vs_player_03
				}
			}
			relation = { who = THIS value = 200 }
			set_country_flag = befriend
			set_global_flag = befriend
		}
		set_global_flag = antagonize
		set_global_flag = rival
		set_global_flag = threat
  		country_event = 296000
	}
}
country_event = { # escalation
  	id = 2950952

	trigger = {
		any_known_country = {
			ai = no
			badboy = 0.6
			is_rival = THIS
			OR = {
				num_of_cities = THIS
				navy = THIS
				army = THIS
			}
			OR = {
				NOT = { num_of_cities = THIS }
				NOT = { navy = THIS }
				NOT = { army = THIS }
				NOT = { prestige = THIS }
			}
		}
		has_global_flag = ai_may_strategize
		any_known_country = {
			OR = {
				has_country_flag = we_are_concerned
				has_country_flag = we_are_scared
				has_country_flag = we_are_alarmed
			}
		}
		NOT = { has_country_flag = we_are_concerned }
		NOT = { has_country_flag = we_are_scared }
		NOT = { has_country_flag = ai_vs_player_03 }
		ai = yes
		is_subject = no
		NOT = { has_global_flag = ai_vs_player_war }
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_DIPLOMATIC"
	desc = "ai"

	immediate = { clr_global_flag = ai_may_strategize }
	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = ai_vs_player_03
		random_country = {
			limit = {
				ai = no
				badboy = 0.6
				is_rival = THIS
			}
			set_country_flag = rival
			set_country_flag = threat
			set_country_flag = antagonize
			rival_countries = { set_country_flag = enemy_of_enemy }
			threat_countries = { set_country_flag = enemy_of_enemy }
			any_neighbor_country = { set_country_flag = enemy_of_enemy }
		}
		any_country = {
			limit = {
				ai = yes
				OR = {
					has_country_flag = we_are_concerned
					has_country_flag = we_are_scared
					has_country_flag = enemy_of_enemy
					has_country_flag = we_are_alarmed
				}
			}
			clr_country_flag = enemy_of_enemy
			set_country_flag = befriend
			set_country_flag = protect
			set_country_flag = military_access
			set_global_flag = befriend
			set_global_flag = military_access
			set_global_flag = protect_country
		}
		any_country = {
			limit = {
				ai = yes
				OR = {
					has_country_flag = ai_vs_player_01
					has_country_flag = ai_vs_player_02
					has_country_flag = ai_vs_player_03
				}
			}
			relation = { who = THIS value = 200 }
			set_country_flag = befriend
			set_global_flag = befriend
		}
		set_global_flag = antagonize
		set_global_flag = rival
		set_global_flag = threat
  		country_event = 296000
	}
}

country_event = { # Seeweg nach Indien

  	id = 295097

	trigger = {
		OR = {
			number_of_colonies = 1
			overseas_provinces_percentage = 0.01
		}
		navy = 12
		NOT = { has_country_flag = discovered_indian_sea_route }
		any_owned_province = { port = yes is_core = THIS }
		capital_scope = { continent = europe }
		cape = { range = yes has_discovered = THIS }
		indian_region = { range = yes has_discovered = THIS }
		ai = yes
		OR = {
			1331 = { NOT = { has_discovered = THIS } }
			1332 = { NOT = { has_discovered = THIS } }
			1333 = { NOT = { has_discovered = THIS } }
			1336 = { NOT = { has_discovered = THIS } }
			1337 = { NOT = { has_discovered = THIS } }
			1338 = { NOT = { has_discovered = THIS } }
			1339 = { NOT = { has_discovered = THIS } }
			1340 = { NOT = { has_discovered = THIS } }
			1446 = { NOT = { has_discovered = THIS } }
			1447 = { NOT = { has_discovered = THIS } }
			1448 = { NOT = { has_discovered = THIS } }
			1449 = { NOT = { has_discovered = THIS } }
			1450 = { NOT = { has_discovered = THIS } }
			1451 = { NOT = { has_discovered = THIS } }
			1452 = { NOT = { has_discovered = THIS } }
			1453 = { NOT = { has_discovered = THIS } }
			1454 = { NOT = { has_discovered = THIS } }
			1455 = { NOT = { has_discovered = THIS } }
			1456 = { NOT = { has_discovered = THIS } }
			1457 = { NOT = { has_discovered = THIS } }
			1458 = { NOT = { has_discovered = THIS } }
			1459 = { NOT = { has_discovered = THIS } }
			1460 = { NOT = { has_discovered = THIS } }
			1615 = { NOT = { has_discovered = THIS } }
			1616 = { NOT = { has_discovered = THIS } }
			1617 = { NOT = { has_discovered = THIS } }
			1618 = { NOT = { has_discovered = THIS } }
			1627 = { NOT = { has_discovered = THIS } }
		}
	}

	mean_time_to_happen = { months = 12 }

	title = "AI_COLONIAL"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_country_flag = discovered_indian_sea_route
		random_country = {
			limit = { 1331 = { NOT = { has_discovered = THIS } } }
			THIS = { 1331 = { discover = yes } }
		}
		random_country = {
			limit = { 1332 = { NOT = { has_discovered = THIS } } }
			THIS = { 1332 = { discover = yes } }
		}
		random_country = {
			limit = { 1333 = { NOT = { has_discovered = THIS } } }
			THIS = { 1333 = { discover = yes } }
		}
		random_country = {
			limit = { 1336 = { NOT = { has_discovered = THIS } } }
			THIS = { 1336 = { discover = yes } }
		}
		random_country = {
			limit = { 1337 = { NOT = { has_discovered = THIS } } }
			THIS = { 1337 = { discover = yes } }
		}
		random_country = {
			limit = { 1338 = { NOT = { has_discovered = THIS } } }
			THIS = { 1338 = { discover = yes } }
		}
		random_country = {
			limit = { 1339 = { NOT = { has_discovered = THIS } } }
			THIS = { 1339 = { discover = yes } }
		}
		random_country = {
			limit = { 1340 = { NOT = { has_discovered = THIS } } }
			THIS = { 1340 = { discover = yes } }
		}
		random_country = {
			limit = { 1446 = { NOT = { has_discovered = THIS } } }
			THIS = { 1446 = { discover = yes } }
		}
		random_country = {
			limit = { 1447 = { NOT = { has_discovered = THIS } } }
			THIS = { 1447 = { discover = yes } }
		}
		random_country = {
			limit = { 1448 = { NOT = { has_discovered = THIS } } }
			THIS = { 1448 = { discover = yes } }
		}
		random_country = {
			limit = { 1449 = { NOT = { has_discovered = THIS } } }
			THIS = { 1449 = { discover = yes } }
		}
		random_country = {
			limit = { 1450 = { NOT = { has_discovered = THIS } } }
			THIS = { 1450 = { discover = yes } }
		}
		random_country = {
			limit = { 1451 = { NOT = { has_discovered = THIS } } }
			THIS = { 1451 = { discover = yes } }
		}
		random_country = {
			limit = { 1452 = { NOT = { has_discovered = THIS } } }
			THIS = { 1452 = { discover = yes } }
		}
		random_country = {
			limit = { 1453 = { NOT = { has_discovered = THIS } } }
			THIS = { 1453 = { discover = yes } }
		}
		random_country = {
			limit = { 1454 = { NOT = { has_discovered = THIS } } }
			THIS = { 1454 = { discover = yes } }
		}
		random_country = {
			limit = { 1455 = { NOT = { has_discovered = THIS } } }
			THIS = { 1455 = { discover = yes } }
		}
		random_country = {
			limit = { 1456 = { NOT = { has_discovered = THIS } } }
			THIS = { 1456 = { discover = yes } }
		}
		random_country = {
			limit = { 1457 = { NOT = { has_discovered = THIS } } }
			THIS = { 1457 = { discover = yes } }
		}
		random_country = {
			limit = { 1458 = { NOT = { has_discovered = THIS } } }
			THIS = { 1458 = { discover = yes } }
		}
		random_country = {
			limit = { 1459 = { NOT = { has_discovered = THIS } } }
			THIS = { 1459 = { discover = yes } }
		}
		random_country = {
			limit = { 1460 = { NOT = { has_discovered = THIS } } }
			THIS = { 1460 = { discover = yes } }
		}
		random_country = {
			limit = { 1615 = { NOT = { has_discovered = THIS } } }
			THIS = { 1615 = { discover = yes } }
		}
		random_country = {
			limit = { 1616 = { NOT = { has_discovered = THIS } } }
			THIS = { 1616 = { discover = yes } }
		}
		random_country = {
			limit = { 1617 = { NOT = { has_discovered = THIS } } }
			THIS = { 1617 = { discover = yes } }
		}
		random_country = {
			limit = { 1618 = { NOT = { has_discovered = THIS } } }
			THIS = { 1618 = { discover = yes } }
		}
		random_country = {
			limit = { 1627 = { NOT = { has_discovered = THIS } } }
			THIS = { 1627 = { discover = yes } }
		}
	}
}

### big AI setup event ###

# intitialize, if not used as part of SRI or MMP mods
# also serves as maintenance event for flags, needed in the absence of both of these mods

country_event = {

  	id = 295098

	trigger = {
		ai = yes
		num_of_cots = 1
		NOT = { has_global_flag = magna_mundi }
		NOT = { has_global_flag = sacra_romanum_imperium }
		OR = {
			NOT = { has_global_flag = initialized_ai_strategy }
			has_global_flag = ai_vs_player_war
		}
	}

	mean_time_to_happen = {
		years = 12
		modifier = {
			factor = 0.1
			NOT = { has_global_flag = initialized_ai_strategy }
		}
	}

	title = "AI_DIPLOMATIC"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
# ai_vs_player cleanup
		any_country = {
			limit = {
				ai = no
				war = no
				has_global_flag = ai_vs_player_war
			}
			set_global_flag = some_peaceful_human
		}
		any_country = {
			limit = {
				ai = no
				war = yes
				has_global_flag = ai_vs_player_war
			}
			clr_global_flag = some_peaceful_human
		}
		random_owned = {
			limit = {
				has_global_flag = ai_vs_player_war
				has_global_flag = some_peaceful_human
			}
			clr_global_flag = ai_vs_player_war
			clr_global_flag = some_peaceful_human
		}
# initializing
		random_owned = {
			limit = { NOT = { has_global_flag = initialized_ai_strategy } }
			set_global_flag = initialized_ai_strategy
			BLI = { country_event = 295099 }
		}
	}
}

country_event = {

  	id = 295099

	is_triggered_only = yes

	title = "AI_DIPLOMATIC"
	desc = "ai"

	option = {
		name = "BAD2"
		ai_chance = { factor = 100 }
		set_global_flag = ai_may_strategize	# will (hopefully) prevent a dual triggering
# France & Burgundy
		FRA = { add_ai_strategy = { papacy_interest = yes } }
		random_country = {
			limit = { tag = FRA exists = BUR exists = yes }
			add_ai_strategy = {
				befriend = {
					id = BUR
					value = 100
				}
				protect = {
					id = BUR
					value = 200
				}
				military_access = {
					id = BUR
					value = 200
				}
			}
		}
		random_country = {
			limit = { tag = BUR exists = yes }
			add_ai_strategy = {
				befriend = {
					id = FRA
					value = 200
				}
				military_access = {
					id = FRA
					value = 200
				}
			}
		}
# Iberia
		random_country = {
			limit = { tag = CAS exists = GRA exists = yes }
			add_ai_strategy = {
				personality = military
				papacy_interest = yes
				antagonize = {
					id = GRA
					value = 200
				}
				befriend = {
					id = POR
					value = 100
				}
				protect = {
					id = POR
					value = 200
				}
				conquer_prov = {
					id = 222
					value = 200
				}
				conquer_prov = {
					id = 223
					value = 200
				}
				conquer_prov = {
					id = 226
					value = 200
				}
			}
		}
		any_country = {
			limit = { OR = { tag = CAS tag = SPA } exists = yes exists = ARA }
			add_ai_strategy = {
				befriend = {
					id = ARA
					value = 100
				}
				protect = {
					id = ARA
					value = 200
				}
			}
		}
		any_country = {
			limit = { OR = { tag = CAS tag = SPA } exists = yes NOT = { exists = GRA } }
			add_ai_strategy = {
				personality = colonial
				papacy_interest = yes
				befriend = {
					id = POR
					value = 100
				}
				protect = {
					id = POR
					value = 200
				}
			}
		}
		random_country = {
			limit = { tag = ARA exists = yes }
			add_ai_strategy = { personality = capital }
		}
		POR = { add_ai_strategy = { personality = colonial } }
		any_country = {
			limit = { OR = { tag = ARA tag = POR } exists = CAS exists = yes }
			add_ai_strategy = {
				befriend = {
					id = CAS
					value = 100
				}
				protect = {
					id = CAS
					value = 200
				}
			}
		}
		any_country = {
			limit = { OR = { tag = ARA tag = POR } exists = SPA exists = yes }
			add_ai_strategy = {
				befriend = {
					id = SPA
					value = 100
				}
				protect = {
					id = SPA
					value = 200
				}
			}
		}
		random_country = {
			limit = { tag = POR exists = NED }
			add_ai_strategy = {
				rival = {
					id = NED
					value = 200
				}
				antagonize = {
					id = NED
					value = 60
				}
			}
		}
# Low Country
		random_country = {
			limit = { tag = NED exists = yes }
			add_ai_strategy = {
				befriend = {
					id = ENG
					value = 70
				}
				rival = {
					id = ENG
					value = 100
				}
				rival = {
					id = POR
					value = 120
				}
				antagonize = {
					id = POR
					value = 100
				}
				protect = {
					id = ENG
					value = 60
				}
			}
		}
# Britain
		random_country = {
			limit = { OR = { tag = ENG tag = GBR } exists = SCO exists = yes }
			add_ai_strategy = {
				vassal = {
					id = SCO
					value = 100
				}
			}
		}
		random_country = {
			limit = { OR = { tag = ENG tag = GBR } exists = NED exists = yes }
			add_ai_strategy = {
				rival = {
					id = NED
					value = 70
				}
				befriend = {
					id = NED
					value = 80
				}
				protect = {
					id = NED
					value = 180
				}
			}
		}
# Sweden
		random_country = {
			limit = { tag = SWE exists = DAN exists = yes }
			random_list = {
				33 = {
					SWE = {
						add_ai_strategy = {
							befriend = {
								id = DAN
								value = 100
							}
						}
					}
				}
				33 = {
					SWE = {
						add_ai_strategy = {
							befriend = {
								id = DAN
								value = 400
							}
						}
					}
				}
				34 = {  }
			}
		}
# Germany
		random_country = {
			limit = { tag = BOH exists = yes }
			BOH = { add_ai_strategy = { hre_interest = yes } }
		}
		BAV = { add_ai_strategy = { hre_interest = yes } }
		random_country = {
			limit = { tag = BRA exists = yes }
			BRA = { add_ai_strategy = { hre_interest = yes } }
		}
		random_country = {
			limit = { tag = PRU exists = yes }
			PRU = { add_ai_strategy = { hre_interest = yes } }
		}
		random_country = {
			limit = { tag = PAL exists = yes emperor = { tag = BOH } }
			PAL = { add_ai_strategy = { hre_interest = yes } }
		}
		HAB = {
			add_ai_strategy = {
				personality = diplomacy
				papacy_interest = yes
				hre_interest = yes
			}
		}
		random_country = {
			limit = { tag = HAB exists = VEN }
			add_ai_strategy = {
				antagonize = {
					id = VEN
					value = 80
				}
			}
		}
		random_country = {
			limit = { tag = HAB exists = HUN }
			add_ai_strategy = {
				protect = {
					id = HUN
					value = 180
				}
				vassal = {
					id = HUN
					value = 80
				}
			}
		}
		random_country = {
			limit = { tag = HAB exists = BOH }
			add_ai_strategy = {
				protect = {
					id = BOH
					value = 40
				}
				vassal = {
					id = BOH
					value = 120
				}
			}
		}
# Emperor
		any_country = {
			limit = {
				emperor = { ai = yes }
#				capital_scope = { hre = yes }
#				exists = yes
				NOT = { is_emperor = yes }
				elector = yes
#				OR = {
#					any_neighbor_country = { capital_scope = { hre = no } }
#					elector = yes
#				}
			}
			set_country_flag = military_access
			set_country_flag = protect
		}
		set_global_flag = protect_country
		set_global_flag = military_access
		random_country = {
			limit = { emperor = { ai = yes } }
			emperor = { country_event = 296000 }
		}
# Poland
		random_country = {
			limit = { tag = POL exists = LIT exists = yes }
			POL = {
				add_ai_strategy = {
					befriend = {
						id = LIT
						value = 400
					}
					protect = {
						id = LIT
						value = 200
					}
				}
			}
			LIT = {
				add_ai_strategy = {
					befriend = {
						id = POL
						value = 400
					}
					protect = {
						id = POL
						value = 200
					}
				}
			}
		}
		random_country = {
			limit = { tag = POL exists = TEU exists = yes }
			POL = {
				add_ai_strategy = {
					antagonize = {
						id = TEU
						value = 100
					}
					vassal = {
						id = TEU
						value = 100
					}
					conquer_prov = {		
						id = 43
						value = 200	
					}		
				}
			}
		}
		random_country = {
			limit = { tag = POL exists = LIV exists = yes }
			POL = {
				add_ai_strategy = {
					antagonize = {
						id = LIV
						value = 100
					}
					vassal = {
						id = LIV
						value = 100
					}
				}
			}
		}
		random_country = {
			limit = { tag = POL exists = MAZ exists = yes }
			POL = {
				add_ai_strategy = {
					antagonize = {
						id = MAZ
						value = 100
					}
					conquer_prov = {		
						id = 257
						value = 100	
					}		
				}
			}
		}
		random_country = {
			limit = { tag = POL exists = RIG exists = yes }
			POL = {
				add_ai_strategy = {
					antagonize = {
						id = RIG
						value = 100
					}
					vassal = {
						id = RIG
						value = 100
					}
					conquer_prov = {		
						id = 38
						value = 100	
					}		
				}
			}
		}
		random_country = {
			limit = { tag = POL exists = KUR exists = yes }
			POL = {
				add_ai_strategy = {
					antagonize = {
						id = KUR
						value = 100
					}
					vassal = {		
						id = KUR
						value = 100	
					}		
				}
			}
		}
# Italy
		random_country = {
			limit = { tag = MLO exists = yes religion = catholic }
			MLO = { add_ai_strategy = { papacy_interest = yes } }
		}
		random_country = {
			limit = { tag = NAP exists = yes religion = catholic }
			add_ai_strategy = {
				papacy_interest = yes
				hre_interest = yes
			}
		}
		random_country = {
			limit = { tag = TUS exists = yes religion = catholic }
			add_ai_strategy = { papacy_interest = yes }
		}
		random_country = {
			limit = { tag = TUS exists = yes government = monarchy }
			add_ai_strategy = { hre_interest = yes }
		}
# Ottomans
		random_country = {
			limit = { tag = TUR NOT = { owns = 151 } }
			TUR = {
				add_ai_strategy = {
					conquer_prov = {		
						id = 151
						value = 100	
					}		
				}
			}
		}
	}
}
