 # Triggers are in Province scope. The From Scope contains the settlement holder (character)
 # start trigger is in title scope.

trade_post = {
	tr_port_1 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_port_1_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 95
		
		tradevalue = 10
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_port_2 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_port_2_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 150
		build_time = 274
		upgrades_from = tr_port_1
		ai_creation_factor = 94
		
		tradevalue = 15
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_port_3 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_port_3_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 200
		build_time = 365
		upgrades_from = tr_port_2
		ai_creation_factor = 93
		
		tradevalue = 20
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_enclave_1 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
			NOR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
			}
		}
		desc = tr_enclave_1_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 90
		
		tax_income = 1
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_enclave_2 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_enclave_2_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 150
		build_time = 274
		upgrades_from = tr_enclave_1
		ai_creation_factor = 89
		
		tax_income = 1.5
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_enclave_3 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_enclave_3_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 200
		build_time = 365
		upgrades_from = tr_enclave_2
		ai_creation_factor = 88
		
		scouting = yes
		tax_income = 2
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_garrison_1 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
			NOR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
			}
		}
		desc = tr_garrison_1_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 91
		
		retinuesize = 20
		garrison_size = 1.0
		fort_level = 1
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}

	tr_garrison_2 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_garrison_2_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 150
		build_time = 274
		upgrades_from = tr_garrison_1
		ai_creation_factor = 90
		
		retinuesize = 30
		garrison_size = 1.5
		fort_level = 2
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_garrison_3 = {
		potential = {
			port = yes
			FROM = {
				is_patrician = yes
			}
		}
		desc = tr_garrison_3_desc
		trigger = { TECH_TRADE_PRACTICES = 0 }
		gold_cost = 200
		build_time = 365
		upgrades_from = tr_garrison_2
		ai_creation_factor = 89
		
		retinuesize = 50
		garrison_size = 2.0
		fort_level = 3
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}

	tr_silk_road_1 = {	# Silk Road Trading Post
		potential = {
		OR = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
			FROM = { is_patrician = yes }
		}
		}
		desc = tr_silk_road_1_desc
		trigger = {
			TECH_TRADE_PRACTICES = 1
			custom_tooltip = {
				text = TR_SILK_ROAD_1_OTHER_PROVINCES_CONDITION
				NOT = {
					any_trade_route_province = {
						NOT = {
							distance = {
								where = ROOT
								value = 50
							}
						}
						OR = {
							trade_post_has_building = tr_silk_road_1
							trade_post_has_building = tr_silk_road_2
							trade_post_has_building = tr_silk_road_3
						}
					}
				}
			}
		}
		gold_cost = 200
		build_time = 150
		ai_creation_factor = 95
		
		trade_route_wealth = 1	# Affects total value of trade route
		trade_route_value = 1	# Affects your cut of the trade route income
		tradevalue = 10
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_silk_road_2 = {	# Silk Road Market
		desc = tr_silk_road_2_desc
		trigger = {
			TECH_TRADE_PRACTICES = 4
			custom_tooltip = {
				text = TR_SILK_ROAD_2_OTHER_PROVINCES_CONDITION
				NOT = {
					any_trade_route_province = {
						NOT = {
							distance = {
								where = ROOT
								value = 75
							}
						}
						OR = {
							trade_post_has_building = tr_silk_road_2
							trade_post_has_building = tr_silk_road_3
						}
					}
				}
			}
		}
		gold_cost = 300
		build_time = 300
		upgrades_from = tr_silk_road_1
		ai_creation_factor = 95
		
		trade_route_wealth = 3	# Affects total value of trade route
		trade_route_value = 3	# Affects your cut of the trade route income
		tradevalue = 10
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_silk_road_3 = {	# Major Silk Road City
		desc = tr_silk_road_3_desc
		trigger = {
			TECH_TRADE_PRACTICES = 6
			custom_tooltip = {
				text = TR_SILK_ROAD_3_OTHER_PROVINCES_CONDITION
				NOT = {
					any_trade_route_province = {
						NOT = {
							distance = {
								where = ROOT
								value = 125
							}
						}
						trade_post_has_building = tr_silk_road_3
					}
				}
			}
		}
		gold_cost = 400
		build_time = 600
		upgrades_from = tr_silk_road_2
		ai_creation_factor = 95
		
		trade_route_wealth = 7	# Affects total value of trade route
		trade_route_value = 7	# Affects your cut of the trade route income
		tradevalue = 20
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_guard_tower_1 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		trigger = {
			TECH_TRADE_PRACTICES = 2
		}
		prerequisites = { 
			tr_silk_road_1
		}
		gold_cost = 100
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 2
		retinuesize = 50
		garrison_size = 1.0
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_warehouse_1 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		trigger = {
			TECH_TRADE_PRACTICES = 2
		}
		prerequisites = { 
			tr_silk_road_1
		}
		gold_cost = 100
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 2
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_port = {	# Guard Tower to protect the trade
		potential = {
			AND = {
				OR = {
					trade_route = silk_road
					trade_route = amber_route
					trade_route = baltic_trade
					trade_route = via_regia
					trade_route = saharan_gold_trade
				}
				port = yes
			}
		}
		trigger = {
			TECH_TRADE_PRACTICES = 2
		}
		prerequisites = { 
			tr_silk_road_1
		}
		gold_cost = 175
		build_time = 300
		ai_creation_factor = 95
		
		trade_route_wealth = 3
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_tollbooth_1 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		trigger = {
			TECH_TRADE_PRACTICES = 2
		}
		prerequisites = { 
			tr_silk_road_1
		}
		gold_cost = 150
		build_time = 200
		ai_creation_factor = 95
	
		trade_route_value = 3
		tradevalue = 20
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}

	tr_trade_post_silk_warehouse = {	# Guard Tower to protect the trade
		prerequisites = {
			tr_trade_post_warehouse_1
			tr_silk_road_2
		}
		potential = {
			trade_route = silk_road
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
		}
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_amber_warehouse = {	# Guard Tower to protect the trade
		prerequisites = {
			tr_trade_post_warehouse_1
			tr_silk_road_2
		}
		potential = {
			trade_route = amber_route
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
		}
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_baltic_warehouse = {	# Guard Tower to protect the trade
		prerequisites = {
			tr_trade_post_warehouse_1
			tr_silk_road_2
		}
		potential = {
			trade_route = baltic_trade
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
			custom_tooltip = {
				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_trade_post_warehouse
					}
				}
			}
		}
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_warehouse_common_goods = {	# Guard Tower to protect the trade
		prerequisites = {
			tr_trade_post_warehouse_1
			tr_silk_road_2
		}
		potential = {
			trade_route = via_regia
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
			custom_tooltip = {
				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_trade_post_warehouse
					}
				}
			}
		}
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}

	tr_trade_post_gold_warehouse = {	# Guard Tower to protect the trade
		prerequisites = {
			tr_trade_post_warehouse_1
			tr_silk_road_2
		}
		potential = {
			trade_route = saharan_gold_trade
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
			custom_tooltip = {
				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_trade_post_warehouse
					}
				}
			}
		}
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_roadnetwork = {
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		trigger = {
			TECH_TRADE_PRACTICES = 4
		}
		prerequisites = { 
			tr_silk_road_2
		}
		gold_cost = 300
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 4
		trade_route_value = 2
		tradevalue = 7
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_guard_tower_2 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		prerequisites = { 
			tr_trade_post_guard_tower_1
			tr_silk_road_2
		}
		trigger = {
			TECH_TRADE_PRACTICES = 5
		}
		upgrades_from = tr_trade_post_guard_tower_1
		gold_cost = 300
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 6
		retinuesize = 150
		garrison_size = 2.0
		fort_level = 1.0
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_warehouse_2 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		prerequisites = { 
			tr_silk_road_2
		}
		trigger = {
			TECH_TRADE_PRACTICES = 5
		}
		upgrades_from = tr_trade_post_warehouse_1
		gold_cost = 300
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 10
		trade_route_value = 6
		tradevalue = 15
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_tollbooth_2 = {	# Guard Tower to protect the trade
		potential = {
			OR = {
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		prerequisites = { 
			tr_silk_road_2
		}
		trigger = {
			TECH_TRADE_PRACTICES = 5
		}
		upgrades_from = tr_trade_post_tollbooth_1
		gold_cost = 250
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_value = 9
		tradevalue = 15
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
	
	tr_trade_post_important_center_of_trade = {	# The most important center of trade in the region
		potential = {
			calc_true_if = {
				amount = 2
				trade_route = silk_road
				trade_route = amber_route
				trade_route = baltic_trade
				trade_route = via_regia
				trade_route = saharan_gold_trade
			}
		}
		prerequisites = { 
			tr_silk_road_3
			tr_trade_post_warehouse_2
			tr_trade_post_guard_tower_2
			tr_trade_post_roadnetwork
		}
		trigger = {
			TECH_TRADE_PRACTICES = 6
		}
		gold_cost = 350
		build_time = 200
		ai_creation_factor = 95
		
		trade_route_wealth = 15
		trade_route_value = 15
		tradevalue = 30
		tax_income = 5
		
		extra_tech_building_start = 10.0 # Never get at start of game
	}
}

