country_decisions = {
	create_dominion_in_india = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DI1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DI2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DI3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DI4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DI5 }
				}
				AND = {
					religion_group = muslim
					NOT = { exists = DI6 }
				}
				NOT = { exists = DI7 }
				NOT = { exists = DI8 }
				NOT = { exists = DI9 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_india = yes
				}
			}
			india_superregion = {
				has_discovered = ROOT
				owned_by = ROOT
			}
			india_superregion = {
				type = all
				OR = {
					is_node_in_trade_company_region = no
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			superregion = india_superregion
			is_node_in_trade_company_region = yes
			has_discovered = ROOT
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			india_superregion = {
				owned_by = ROOT
				is_city = yes
				is_node_in_trade_company_region = yes
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_INDIAN_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British India:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DI1 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI1
						}
						cede_province = DI1
					}
					create_subject = {
						subject = DI1
						subject_type = dominion
					}
					create_subject = {
						subject = DI1
						subject_type = dominion_tc
					}
					DI1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic India:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DI2 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI2
						}
						cede_province = DI2
					}
					create_subject = {
						subject = DI2
						subject_type = dominion
					}
					create_subject = {
						subject = DI2
						subject_type = dominion_tc
					}
					DI2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian India:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DI3 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI3
						}
						cede_province = DI3
					}
					create_subject = {
						subject = DI3
						subject_type = dominion
					}
					create_subject = {
						subject = DI3
						subject_type = dominion_tc
					}
					DI3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French India:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DI4 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI4
						}
						cede_province = DI4
					}
					create_subject = {
						subject = DI4
						subject_type = dominion
					}
					create_subject = {
						subject = DI4
						subject_type = dominion_tc
					}
					DI4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian India:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DI5 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI5
						}
						cede_province = DI5
					}
					create_subject = {
						subject = DI5
						subject_type = dominion
					}
					create_subject = {
						subject = DI5
						subject_type = dominion_tc
					}
					DI5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim India:
			else_if = {
				limit = {
					religion_group = muslim
					NOT = { exists = DI6 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI6
						}
						cede_province = DI6
					}
					create_subject = {
						subject = DI6
						subject_type = dominion
					}
					create_subject = {
						subject = DI6
						subject_type = dominion_tc
					}
					DI6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# First Dominion of India:
			else_if = {
				limit = {
					NOT = { exists = DI7 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI7
						}
						cede_province = DI7
					}
					create_subject = {
						subject = DI7
						subject_type = dominion
					}
					create_subject = {
						subject = DI7
						subject_type = dominion_tc
					}
					DI7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Second Dominion of India:
			else_if = {
				limit = {
					NOT = { exists = DI8 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI8
						}
						cede_province = DI8
					}
					create_subject = {
						subject = DI8
						subject_type = dominion
					}
					create_subject = {
						subject = DI8
						subject_type = dominion_tc
					}
					DI8 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Third Dominion of India:
			else_if = {
				limit = {
					NOT = { exists = DI9 }
				}
				hidden_effect = {
					india_superregion = {
						limit = {
							owned_by = ROOT
							is_city = yes
							is_node_in_trade_company_region = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DI9
						}
						cede_province = DI9
					}
					create_subject = {
						subject = DI9
						subject_type = dominion
					}
					create_subject = {
						subject = DI9
						subject_type = dominion_tc
					}
					DI9 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDIA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 521
							}
							set_capital = 521
						}
						else_if = {
							limit = {
								owns = 524
							}
							set_capital = 524
						}
						else_if = {
							limit = {
								owns = 569
							}
							set_capital = 569
						}
						else_if = {
							limit = {
								owns = 538
							}
							set_capital = 538
						}
						else_if = {
							limit = {
								owns = 561
							}
							set_capital = 561
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = GBR
			}
			modifier = {
				factor = 0
				capital_scope = {
					OR = {
						continent = asia
						continent = oceania
						superregion = east_indies_superregion
					}
				}
			}
			modifier = {
				factor = 0.1
				NOT = { has_country_flag = trade_company }
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						superregion = india_superregion
						is_node_in_trade_company_region = yes
					}
				}
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }
						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				num_of_owned_provinces_with = {
					value = 20
					superregion = india_superregion
					is_city = yes
					is_state = yes
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_east_indies = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DE1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DE3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DE4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE5 }
				}
				AND = {
					religion_group = muslim
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE6 }
				}
				AND = {
					OR = {
						tag = NED
						tag = HOL
						primary_culture = dutch
					}
					NOT = { exists = DE7 }
				}
				NOT = { exists = DE8 }
				NOT = { exists = DE9 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_east_indies = yes
				}
			}
			OR = {
				trade_company_indonesia = {
					has_discovered = ROOT
				}
				trade_company_moluccas = {
					has_discovered = ROOT
				}
			}
			OR = {
				trade_company_indonesia = {
					owned_by = ROOT
				}
				trade_company_moluccas = {
					owned_by = ROOT
				}
			}
			trade_company_indonesia = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_moluccas = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				trade_company_region = trade_company_indonesia
				trade_company_region = trade_company_moluccas
			}
			has_discovered = ROOT
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			OR = {
				trade_company_indonesia = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_moluccas = {
					owned_by = ROOT
					is_city = yes
				}
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_EAST_INDIES_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British East Indies:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DE1 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE1
						}
						cede_province = DE1
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE1
						}
						cede_province = DE1
					}
					create_subject = {
						subject = DE1
						subject_type = dominion
					}
					create_subject = {
						subject = DE1
						subject_type = dominion_tc
					}
					DE1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic East Indies:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE2 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE2
						}
						cede_province = DE2
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE2
						}
						cede_province = DE2
					}
					create_subject = {
						subject = DE2
						subject_type = dominion
					}
					create_subject = {
						subject = DE2
						subject_type = dominion_tc
					}
					DE2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian East Indies:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DE3 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE3
						}
						cede_province = DE3
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE3
						}
						cede_province = DE3
					}
					create_subject = {
						subject = DE3
						subject_type = dominion
					}
					create_subject = {
						subject = DE3
						subject_type = dominion_tc
					}
					DE3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French East Indies:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DE4 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE4
						}
						cede_province = DE4
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE4
						}
						cede_province = DE4
					}
					create_subject = {
						subject = DE4
						subject_type = dominion
					}
					create_subject = {
						subject = DE4
						subject_type = dominion_tc
					}
					DE4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian East Indies:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE5 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE5
						}
						cede_province = DE5
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE5
						}
						cede_province = DE5
					}
					create_subject = {
						subject = DE5
						subject_type = dominion
					}
					create_subject = {
						subject = DE5
						subject_type = dominion_tc
					}
					DE5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim East Indies:
			else_if = {
				limit = {
					religion_group = muslim
					OR = {
						AND = {
							NOT = { tag = NED }
							NOT = { tag = HOL }
							NOT = { primary_culture = dutch }
						}
						exists = DE7
					}
					NOT = { exists = DE6 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE6
						}
						cede_province = DE6
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE6
						}
						cede_province = DE6
					}
					create_subject = {
						subject = DE6
						subject_type = dominion
					}
					create_subject = {
						subject = DE6
						subject_type = dominion_tc
					}
					DE6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Dutch East Indies:
			else_if = {
				limit = {
					OR = {
						tag = NED
						tag = HOL
						primary_culture = dutch
					}
					NOT = { exists = DE7 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE7
						}
						cede_province = DE7
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE7
						}
						cede_province = DE7
					}
					create_subject = {
						subject = DE7
						subject_type = dominion
					}
					create_subject = {
						subject = DE7
						subject_type = dominion_tc
					}
					DE7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# First Dominion of Indonesia:
			else_if = {
				limit = {
					NOT = { exists = DE8 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE8
						}
						cede_province = DE8
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE8
						}
						cede_province = DE8
					}
					create_subject = {
						subject = DE8
						subject_type = dominion
					}
					create_subject = {
						subject = DE8
						subject_type = dominion_tc
					}
					DE8 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Second Dominion of Indonesia:
			else_if = {
				limit = {
					NOT = { exists = DE9 }
				}
				hidden_effect = {
					trade_company_indonesia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE9
						}
						cede_province = DE9
					}
					trade_company_moluccas = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DE9
						}
						cede_province = DE9
					}
					create_subject = {
						subject = DE9
						subject_type = dominion
					}
					create_subject = {
						subject = DE9
						subject_type = dominion_tc
					}
					DE9 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_INDIES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 2407
							}
							set_capital = 2407
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = NED
			}
			modifier = {
				factor = 0
				capital_scope = {
					OR = {
						continent = asia
						continent = oceania
						superregion = east_indies_superregion
					}
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						OR = {
							region = indonesia_region
							region = moluccas_region
							region = malaya_region
						}
					}
				}
			}
			modifier = {
				factor = 0.1
				NOT = { has_country_flag = trade_company }
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					trade_company_indonesia = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_moluccas = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_indochina = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DC1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DC2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DC3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DC4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DC5 }
				}
				AND = {
					religion_group = muslim
					NOT = { exists = DC6 }
				}
				NOT = { exists = DC7 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_indochina = yes
				}
			}
			OR = {
				trade_company_indochina = {
					has_discovered = ROOT
				}
				trade_company_burma = {
					has_discovered = ROOT
					NOT = { superregion = india_superregion }
				}
				trade_company_east_india = {
					has_discovered = ROOT
					NOT = { superregion = india_superregion }
				}
			}
			OR = {
				trade_company_indochina = {
					owned_by = ROOT
				}
				trade_company_burma = {
					owned_by = ROOT
					NOT = { superregion = india_superregion }
				}
				trade_company_east_india = {
					owned_by = ROOT
					NOT = { superregion = india_superregion }
				}
			}
			trade_company_indochina = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_burma = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
					superregion = india_superregion
				}
			}
			trade_company_east_india = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
					superregion = india_superregion
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				trade_company_region = trade_company_indochina
				trade_company_region = trade_company_burma
				trade_company_region = trade_company_east_india
			}
			has_discovered = ROOT
			NOT = { superregion = india_superregion }
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			OR = {
				trade_company_indochina = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_burma = {
					owned_by = ROOT
					is_city = yes
					NOT = { superregion = india_superregion }
				}
				trade_company_east_india = {
					owned_by = ROOT
					is_city = yes
					NOT = { superregion = india_superregion }
				}
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_INDOCHINA_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British Indochina:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DC1 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC1
						}
						cede_province = DC1
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC1
						}
						cede_province = DC1
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC1
						}
						cede_province = DC1
					}
					create_subject = {
						subject = DC1
						subject_type = dominion
					}
					create_subject = {
						subject = DC1
						subject_type = dominion_tc
					}
					DC1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic Indochina:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DC2 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC2
						}
						cede_province = DC2
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC2
						}
						cede_province = DC2
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC2
						}
						cede_province = DC2
					}
					create_subject = {
						subject = DC2
						subject_type = dominion
					}
					create_subject = {
						subject = DC2
						subject_type = dominion_tc
					}
					DC2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian Indochina:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DC3 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC3
						}
						cede_province = DC3
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC3
						}
						cede_province = DC3
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC3
						}
						cede_province = DC3
					}
					create_subject = {
						subject = DC3
						subject_type = dominion
					}
					create_subject = {
						subject = DC3
						subject_type = dominion_tc
					}
					DC3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French Indochina:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DC4 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC4
						}
						cede_province = DC4
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC4
						}
						cede_province = DC4
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC4
						}
						cede_province = DC4
					}
					create_subject = {
						subject = DC4
						subject_type = dominion
					}
					create_subject = {
						subject = DC4
						subject_type = dominion_tc
					}
					DC4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian Indochina:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DC5 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC5
						}
						cede_province = DC5
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC5
						}
						cede_province = DC5
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC5
						}
						cede_province = DC5
					}
					create_subject = {
						subject = DC5
						subject_type = dominion
					}
					create_subject = {
						subject = DC5
						subject_type = dominion_tc
					}
					DC5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim Indochina:
			else_if = {
				limit = {
					religion_group = muslim
					NOT = { exists = DC6 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC6
						}
						cede_province = DC6
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC6
						}
						cede_province = DC6
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC6
						}
						cede_province = DC6
					}
					create_subject = {
						subject = DC6
						subject_type = dominion
					}
					create_subject = {
						subject = DC6
						subject_type = dominion_tc
					}
					DC6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Dominion of Indochina:
			else_if = {
				limit = {
					NOT = { exists = DC7 }
				}
				hidden_effect = {
					trade_company_indochina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC7
						}
						cede_province = DC7
					}
					trade_company_burma = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC7
						}
						cede_province = DC7
					}
					trade_company_east_india = {
						limit = {
							owned_by = ROOT
							is_city = yes
							NOT = { superregion = india_superregion }
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DC7
						}
						cede_province = DC7
					}
					create_subject = {
						subject = DC7
						subject_type = dominion
					}
					create_subject = {
						subject = DC7
						subject_type = dominion_tc
					}
					DC7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = INDOCHINA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = FRA
			}
			modifier = {
				factor = 0
				capital_scope = {
					OR = {
						continent = asia
						continent = oceania
						superregion = east_indies_superregion
					}
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						region = indo_china_region
					}
				}
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					trade_company_indochina = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_burma = {
						type = all
						OR = {
							AND = {
								owned_by = ROOT
								is_city = yes
								is_state = yes
							}
							superregion = india_superregion
						}
					}
					trade_company_east_india = {
						type = all
						OR = {
							AND = {
								owned_by = ROOT
								is_city = yes
								is_state = yes
							}
							superregion = india_superregion
						}
					}
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_philippines = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DP1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DP2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DP4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP5 }
				}
				AND = {
					religion_group = muslim
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP6 }
				}
				AND = {
					OR = {
						tag = SPA
						tag = CAS
						primary_culture = castillian
					}
					NOT = { exists = DP7 }
				}
				NOT = { exists = DP8 }
				NOT = { exists = DP9 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_philippines = yes
				}
			}
			trade_company_philippines = {
				has_discovered = ROOT
			}
			trade_company_philippines = {
				owned_by = ROOT
			}
			trade_company_philippines = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			trade_company_region = trade_company_philippines
			has_discovered = ROOT
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			trade_company_philippines = {
				owned_by = ROOT
				is_city = yes
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_PHILIPPINES_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British Philippines:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DP1 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP1
						}
						cede_province = DP1
					}
					create_subject = {
						subject = DP1
						subject_type = dominion
					}
					create_subject = {
						subject = DP1
						subject_type = dominion_tc
					}
					DP1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic Philippines:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DP2 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP2
						}
						cede_province = DP2
					}
					create_subject = {
						subject = DP2
						subject_type = dominion
					}
					create_subject = {
						subject = DP2
						subject_type = dominion_tc
					}
					DP2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian Philippines:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP3 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP3
						}
						cede_province = DP3
					}
					create_subject = {
						subject = DP3
						subject_type = dominion
					}
					create_subject = {
						subject = DP3
						subject_type = dominion_tc
					}
					DP3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French Philippines:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DP4 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP4
						}
						cede_province = DP4
					}
					create_subject = {
						subject = DP4
						subject_type = dominion
					}
					create_subject = {
						subject = DP4
						subject_type = dominion_tc
					}
					DP4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian Philippines:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP5 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP5
						}
						cede_province = DP5
					}
					create_subject = {
						subject = DP5
						subject_type = dominion
					}
					create_subject = {
						subject = DP5
						subject_type = dominion_tc
					}
					DP5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						else_if = {
							limit = {
								owns = 2413
							}
							set_capital = 2413
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim Philippines:
			else_if = {
				limit = {
					religion_group = muslim
					OR = {
						AND = {
							NOT = { tag = SPA }
							NOT = { tag = CAS }
							NOT = { primary_culture = castillian }
						}
						exists = DP7
					}
					NOT = { exists = DP6 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP6
						}
						cede_province = DP6
					}
					create_subject = {
						subject = DP6
						subject_type = dominion
					}
					create_subject = {
						subject = DP6
						subject_type = dominion_tc
					}
					DP6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Spanish Philippines:
			else_if = {
				limit = {
					OR = {
						tag = SPA
						tag = CAS
						primary_culture = castillian
					}
					NOT = { exists = DP7 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP7
						}
						cede_province = DP7
					}
					create_subject = {
						subject = DP7
						subject_type = dominion
					}
					create_subject = {
						subject = DP7
						subject_type = dominion_tc
					}
					DP7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# First Dominion of the Philippines:
			else_if = {
				limit = {
					NOT = { exists = DP8 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP8
						}
						cede_province = DP8
					}
					create_subject = {
						subject = DP8
						subject_type = dominion
					}
					create_subject = {
						subject = DP8
						subject_type = dominion_tc
					}
					DP8 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Second Dominion of Indonesia:
			else_if = {
				limit = {
					NOT = { exists = DP9 }
				}
				hidden_effect = {
					trade_company_philippines = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DP9
						}
						cede_province = DP9
					}
					create_subject = {
						subject = DP9
						subject_type = dominion
					}
					create_subject = {
						subject = DP9
						subject_type = dominion_tc
					}
					DP9 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = PHILIPPINES }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								owns = 656
							}
							set_capital = 656
						}
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = SPA
			}
			modifier = {
				factor = 0
				capital_scope = {
					OR = {
						continent = asia
						continent = oceania
						superregion = east_indies_superregion
					}
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						region = moluccas_region
					}
				}
			}
			modifier = {
				factor = 0.1
				NOT = { has_country_flag = trade_company }
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				trade_company_philippines = {
					type = all
					owned_by = ROOT
					is_city = yes
					is_state = yes
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_west_africa = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			NOT = { has_global_flag = extended_timeline_mod }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DW1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DW2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DW3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DW4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DW5 }
				}
				AND = {
					religion_group = muslim
					NOT = { exists = DW6 }
				}
				NOT = { exists = DW7 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_west_africa = yes
				}
			}
			OR = {
				trade_company_west_africa = {
					has_discovered = ROOT
				}
				trade_company_timbuktu = {
					has_discovered = ROOT
				}
				trade_company_katsina = {
					has_discovered = ROOT
				}
				trade_company_kongo = {
					has_discovered = ROOT
				}
			}
			OR = {
				trade_company_west_africa = {
					owned_by = ROOT
				}
				trade_company_timbuktu = {
					owned_by = ROOT
				}
				trade_company_katsina = {
					owned_by = ROOT
				}
				trade_company_kongo = {
					owned_by = ROOT
				}
			}
			trade_company_west_africa = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_timbuktu = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_katsina = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_kongo = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				trade_company_region = trade_company_west_africa
				trade_company_region = trade_company_timbuktu
				trade_company_region = trade_company_katsina
				trade_company_region = trade_company_kongo
			}
			has_discovered = ROOT
			is_sea = no
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			OR = {
				trade_company_west_africa = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_timbuktu = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_katsina = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_kongo = {
					owned_by = ROOT
					is_city = yes
				}
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_WEST_AFRICA_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British West Africa:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DW1 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW1
						}
						cede_province = DW1
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW1
						}
						cede_province = DW1
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW1
						}
						cede_province = DW1
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW1
						}
						cede_province = DW1
					}
					create_subject = {
						subject = DW1
						subject_type = dominion
					}
					create_subject = {
						subject = DW1
						subject_type = dominion_tc
					}
					DW1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic West Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DW2 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW2
						}
						cede_province = DW2
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW2
						}
						cede_province = DW2
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW2
						}
						cede_province = DW2
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW2
						}
						cede_province = DW2
					}
					create_subject = {
						subject = DW2
						subject_type = dominion
					}
					create_subject = {
						subject = DW2
						subject_type = dominion_tc
					}
					DW2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian West Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DW3 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW3
						}
						cede_province = DW3
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW3
						}
						cede_province = DW3
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW3
						}
						cede_province = DW3
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW3
						}
						cede_province = DW3
					}
					create_subject = {
						subject = DW3
						subject_type = dominion
					}
					create_subject = {
						subject = DW3
						subject_type = dominion_tc
					}
					DW3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French West Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DW4 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW4
						}
						cede_province = DW4
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW4
						}
						cede_province = DW4
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW4
						}
						cede_province = DW4
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW4
						}
						cede_province = DW4
					}
					create_subject = {
						subject = DW4
						subject_type = dominion
					}
					create_subject = {
						subject = DW4
						subject_type = dominion_tc
					}
					DW4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian West Africa:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DW5 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW5
						}
						cede_province = DW5
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW5
						}
						cede_province = DW5
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW5
						}
						cede_province = DW5
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW5
						}
						cede_province = DW5
					}
					create_subject = {
						subject = DW5
						subject_type = dominion
					}
					create_subject = {
						subject = DW5
						subject_type = dominion_tc
					}
					DW5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim West Africa:
			else_if = {
				limit = {
					religion_group = muslim
					NOT = { exists = DW6 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW6
						}
						cede_province = DW6
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW6
						}
						cede_province = DW6
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW6
						}
						cede_province = DW6
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW6
						}
						cede_province = DW6
					}
					create_subject = {
						subject = DW6
						subject_type = dominion
					}
					create_subject = {
						subject = DW6
						subject_type = dominion_tc
					}
					DW6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Dominion of West Africa:
			else_if = {
				limit = {
					NOT = { exists = DW7 }
				}
				hidden_effect = {
					trade_company_west_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW7
						}
						cede_province = DW7
					}
					trade_company_timbuktu = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW7
						}
						cede_province = DW7
					}
					trade_company_katsina = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW7
						}
						cede_province = DW7
					}
					trade_company_kongo = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DW7
						}
						cede_province = DW7
					}
					create_subject = {
						subject = DW7
						subject_type = dominion
					}
					create_subject = {
						subject = DW7
						subject_type = dominion_tc
					}
					DW7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = WEST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = FRA
			}
			modifier = {
				factor = 0
				capital_scope = {
					continent = africa
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						OR = {
							region = niger_region
							region = kongo_region
							region = guinea_region
						}
					}
				}
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					trade_company_west_africa = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_timbuktu = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_katsina = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_kongo = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_south_africa = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			NOT = { has_global_flag = extended_timeline_mod }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DS1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DS2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DS3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DS4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DS5 }
				}
				AND = {
					religion_group = muslim
					NOT = { exists = DS6 }
				}
				NOT = { exists = DS7 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_south_africa = yes
				}
			}
			trade_company_south_africa = {
				has_discovered = ROOT
			}
			trade_company_south_africa = {
				owned_by = ROOT
			}
			trade_company_south_africa = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			trade_company_region = trade_company_south_africa
			has_discovered = ROOT
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			trade_company_south_africa = {
				owned_by = ROOT
				is_city = yes
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_SOUTH_AFRICA_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British South Africa:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DS1 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS1
						}
						cede_province = DS1
					}
					create_subject = {
						subject = DS1
						subject_type = dominion
					}
					create_subject = {
						subject = DS1
						subject_type = dominion_tc
					}
					DS1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic South Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DS2 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS2
						}
						cede_province = DS2
					}
					create_subject = {
						subject = DS2
						subject_type = dominion
					}
					create_subject = {
						subject = DS2
						subject_type = dominion_tc
					}
					DS2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian South Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DS3 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS3
						}
						cede_province = DS3
					}
					create_subject = {
						subject = DS3
						subject_type = dominion
					}
					create_subject = {
						subject = DS3
						subject_type = dominion_tc
					}
					DS3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French South Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DS4 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS4
						}
						cede_province = DS4
					}
					create_subject = {
						subject = DS4
						subject_type = dominion
					}
					create_subject = {
						subject = DS4
						subject_type = dominion_tc
					}
					DS4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian South Africa:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DS5 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS5
						}
						cede_province = DS5
					}
					create_subject = {
						subject = DS5
						subject_type = dominion
					}
					create_subject = {
						subject = DS5
						subject_type = dominion_tc
					}
					DS5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim South Africa:
			else_if = {
				limit = {
					religion_group = muslim
					NOT = { exists = DS6 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS6
						}
						cede_province = DS6
					}
					create_subject = {
						subject = DS6
						subject_type = dominion
					}
					create_subject = {
						subject = DS6
						subject_type = dominion_tc
					}
					DS6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Dominion of South Africa:
			else_if = {
				limit = {
					NOT = { exists = DS7 }
				}
				hidden_effect = {
					trade_company_south_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DS7
						}
						cede_province = DS7
					}
					create_subject = {
						subject = DS7
						subject_type = dominion
					}
					create_subject = {
						subject = DS7
						subject_type = dominion_tc
					}
					DS7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = SOUTH_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = GBR
			}
			modifier = {
				factor = 0
				capital_scope = {
					continent = africa
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						region = south_africa_region
					}
				}
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				trade_company_south_africa = {
					type = all
					owned_by = ROOT
					is_city = yes
					is_state = yes
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}

	create_dominion_in_east_africa = {
		potential = {
			NOT = { has_global_flag = se_dominions_disabled }
			NOT = { has_global_flag = extended_timeline_mod }
			OR = {
				AND = {
					NOT = { has_dlc = "Wealth of Nations" }
					NOT = { has_dlc = "Dharma" }
				}
				ai = no
			}
			is_subject = no
			can_be_overlord = dominion_tc
			NOT = { is_dominion_tag = yes }
			capital_scope = {
				NOT = { superregion = india_superregion }
				NOT = { superregion = china_superregion }
				NOT = { region = japan_region }
				NOT = { continent = oceania }
				NOT = { superregion = east_indies_superregion }
				NOT = { continent = africa }
			}
			OR = {
				AND = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DA1 }
				}
				AND = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DA2 }
				}
				AND = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DA3 }
				}
				AND = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DA4 }
				}
				AND = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DA5 }
				}
				AND = {
					religion_group = muslim
					NOT = { exists = DA6 }
				}
				NOT = { exists = DA7 }
			}
			NOT = {
				any_subject_country = {
					is_dominion_tag_in_east_africa = yes
				}
			}
			OR = {
				trade_company_east_africa = {
					has_discovered = ROOT
				}
				trade_company_zambezi = {
					has_discovered = ROOT
				}
				trade_company_great_lakes = {
					has_discovered = ROOT
				}
				trade_company_ethiopia = {
					has_discovered = ROOT
				}
				trade_company_gulf_of_aden = {
					continent = africa
					has_discovered = ROOT
				}
			}
			OR = {
				trade_company_east_africa = {
					owned_by = ROOT
				}
				trade_company_zambezi = {
					owned_by = ROOT
				}
				trade_company_great_lakes = {
					owned_by = ROOT
				}
				trade_company_ethiopia = {
					owned_by = ROOT
				}
				trade_company_gulf_of_aden = {
					continent = africa
					owned_by = ROOT
				}
			}
			trade_company_east_africa = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_zambezi = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_great_lakes = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_ethiopia = {
				type = all
				OR = {
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
			trade_company_gulf_of_aden = {
				type = all
				OR = {
					NOT = { continent = africa }
					NOT = { owned_by = ROOT }
					is_in_capital_area = no
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				trade_company_region = trade_company_east_africa
				trade_company_region = trade_company_zambezi
				trade_company_region = trade_company_great_lakes
				trade_company_region = trade_company_ethiopia
				AND = {
					trade_company_region = trade_company_gulf_of_aden
					continent = africa
				}
			}
			has_discovered = ROOT
		}
		allow = {
			treasury = 3000
			is_at_war = no
			OR = {
				has_idea_group = expansion_ideas
				has_idea_group = exploration_ideas
				has_idea_group = trade_ideas
			}
			OR = {
				trade_company_east_africa = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_zambezi = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_great_lakes = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_ethiopia = {
					owned_by = ROOT
					is_city = yes
				}
				trade_company_gulf_of_aden = {
					continent = africa
					owned_by = ROOT
					is_city = yes
				}
			}
		}
		effect = {
			add_treasury = -3000
			custom_tooltip = ALL_PROVINCES_IN_EAST_AFRICA_TRADE_COMPANY_REGIONS_CEDED_TO_DOMINION
			set_country_flag = is_releasing_dominion_in_trade_company_region
			# British East Africa:
			if = {
				limit = {
					OR = {
						culture_group = british
						tag = GBR
						tag = ENG
					}
					NOT = { exists = DA1 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA1
						}
						cede_province = DA1
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA1
						}
						cede_province = DA1
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA1
						}
						cede_province = DA1
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA1
						}
						cede_province = DA1
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA1
						}
						cede_province = DA1
					}
					create_subject = {
						subject = DA1
						subject_type = dominion
					}
					create_subject = {
						subject = DA1
						subject_type = dominion_tc
					}
					DA1 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Germanic East Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = germanic
						tag = GER
						tag = PRU
					}
					NOT = { exists = DA2 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA2
						}
						cede_province = DA2
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA2
						}
						cede_province = DA2
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA2
						}
						cede_province = DA2
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA2
						}
						cede_province = DA2
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA2
						}
						cede_province = DA2
					}
					create_subject = {
						subject = DA2
						subject_type = dominion
					}
					create_subject = {
						subject = DA2
						subject_type = dominion_tc
					}
					DA2 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Iberian East Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = iberian
						tag = SPA
						tag = POR
						tag = CAS
						tag = ARA
					}
					NOT = { exists = DA3 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA3
						}
						cede_province = DA3
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA3
						}
						cede_province = DA3
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA3
						}
						cede_province = DA3
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA3
						}
						cede_province = DA3
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA3
						}
						cede_province = DA3
					}
					create_subject = {
						subject = DA3
						subject_type = dominion
					}
					create_subject = {
						subject = DA3
						subject_type = dominion_tc
					}
					DA3 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# French East Africa:
			else_if = {
				limit = {
					OR = {
						culture_group = french
						tag = FRA
						tag = FR2
						tag = BRI
						tag = BUR
					}
					NOT = { exists = DA4 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA4
						}
						cede_province = DA4
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA4
						}
						cede_province = DA4
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA4
						}
						cede_province = DA4
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA4
						}
						cede_province = DA4
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA4
						}
						cede_province = DA4
					}
					create_subject = {
						subject = DA4
						subject_type = dominion
					}
					create_subject = {
						subject = DA4
						subject_type = dominion_tc
					}
					DA4 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Christian East Africa:
			else_if = {
				limit = {
					OR = {
						tag = PAP
						religion_group = christian
					}
					NOT = { exists = DA5 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA5
						}
						cede_province = DA5
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA5
						}
						cede_province = DA5
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA5
						}
						cede_province = DA5
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA5
						}
						cede_province = DA5
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA5
						}
						cede_province = DA5
					}
					create_subject = {
						subject = DA5
						subject_type = dominion
					}
					create_subject = {
						subject = DA5
						subject_type = dominion_tc
					}
					DA5 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Muslim East Africa:
			else_if = {
				limit = {
					religion_group = muslim
					NOT = { exists = DA6 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA6
						}
						cede_province = DA6
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA6
						}
						cede_province = DA6
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA6
						}
						cede_province = DA6
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA6
						}
						cede_province = DA6
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA6
						}
						cede_province = DA6
					}
					create_subject = {
						subject = DA6
						subject_type = dominion
					}
					create_subject = {
						subject = DA6
						subject_type = dominion_tc
					}
					DA6 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			# Dominion of East Africa:
			else_if = {
				limit = {
					NOT = { exists = DA7 }
				}
				hidden_effect = {
					trade_company_east_africa = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA7
						}
						cede_province = DA7
					}
					trade_company_zambezi = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA7
						}
						cede_province = DA7
					}
					trade_company_great_lakes = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA7
						}
						cede_province = DA7
					}
					trade_company_ethiopia = {
						limit = {
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA7
						}
						cede_province = DA7
					}
					trade_company_gulf_of_aden = {
						limit = {
							continent = africa
							owned_by = ROOT
							is_city = yes
						}
						if = {
							limit = {
								is_core = ROOT
							}
							remove_core = ROOT
							add_core = DA7
						}
						cede_province = DA7
					}
					create_subject = {
						subject = DA7
						subject_type = dominion
					}
					create_subject = {
						subject = DA7
						subject_type = dominion_tc
					}
					DA7 = {
						rename_dominion_accordingly_to_overlord = { dominion_region = EAST_AFRICA }
						add_treasury = 3000
						add_truce_with = ROOT
						country_event = { id = subjects_expanded_dominion_events.1 }
						define_ruler = {
							culture = ROOT
							religion = ROOT
						}
						change_religion = ROOT
						set_overlord_idea_groups = yes
						change_government = republic
						add_government_reform = presidential_despot_reform
						adopt_reform_progress = ROOT
						if = {
							limit = {
								any_owned_province = {
									PREV = { dominant_culture = PREV }
								}
							}
							random_owned_province = {
								limit = {
									PREV = { dominant_culture = PREV }
								}
								PREV = { change_primary_culture = PREV }
							}
						}
						else = {
							change_primary_culture = ROOT
						}
						every_province = {
							limit = {
								has_discovered = ROOT
							}
							discover_country = PREV
						}
					}
				}
			}
			clr_country_flag = is_releasing_dominion_in_trade_company_region
		}
		ai_will_do = {
			factor = 10

			modifier = {
				factor = 5
				tag = GBR
			}
			modifier = {
				factor = 0
				capital_scope = {
					continent = africa
				}
			}
			modifier = {
				factor = 0
				NOT = {
					num_of_owned_provinces_with = {
						value = 5
						region = east_africa_region
					}
				}
			}
			modifier = {
				factor = 0.1
				any_subject_country = {
					is_colonial_nation = yes
					variable_arithmetic_trigger = {
						export_to_variable = {
							which = their_total_dev_temp_var
							value = trigger_value:total_development
						}
						export_to_variable = {
							which = our_total_dev_temp_var
							value = trigger_value:total_development
							who = ROOT
						}
						divide_variable = { which = their_total_dev_temp_var value = 3 }

						check_variable = { which = their_total_dev_temp_var which = our_total_dev_temp_var }
					}
				}
			}
			modifier = {
				factor = 0
				OR = {
					trade_company_east_africa = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_zambezi = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_great_lakes = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_ethiopia = {
						type = all
						owned_by = ROOT
						is_city = yes
						is_state = yes
					}
					trade_company_gulf_of_aden = {
						type = all
						OR = {
							AND = {
								owned_by = ROOT
								is_city = yes
								is_state = yes
							}
							NOT = { continent = africa }
						}
					}
				}
			}
			modifier = {
				factor = 0.1
				calc_true_if = {
					all_subject_country = {
						is_any_trade_company_region_dominion_subject = yes
					}
					amount = 3
				}
			}
		}
	}
}