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

#<tag> = {
#	desc = description used in the tooltip of the building
#	trigger = used for tech requirement of the building, set to 0 if no requirement so it can be build automatically on new games
#	gold_cost = cost to build the building
#	build_time = time to build, in days
#
#	ai_creation_factor = weight that the AI uses to determine what building to build
#	extra_tech_building_start = when starting a new game this building will be pre-built if the province has higher tech than the requirement + this + random 0-1
#}

#Trade Post
trade_post = {
	# Trade Port
	tr_port_1 = {
		desc = tr_port_1_desc
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 95
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 10

		potential = {
			is_coastal = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_port_2 = {
		desc = tr_port_2_desc
		upgrades_from = tr_port_1
		gold_cost = 150
		build_time = 274
		ai_creation_factor = 94
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 15

		potential = {
			is_coastal = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 3

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_port_3 = {
		desc = tr_port_3_desc
		upgrades_from = tr_port_2
		gold_cost = 200
		build_time = 365
		ai_creation_factor = 93
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 20

		potential = {
			is_coastal = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 4

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Enclave
	tr_enclave_1 = {
		desc = tr_enclave_1_desc
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 90
		extra_tech_building_start = 10.0 # Never get at start of game

		tax_income = 1

		potential = {
			is_coastal = yes
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	tr_enclave_2 = {
		desc = tr_enclave_2_desc
		upgrades_from = tr_enclave_1
		gold_cost = 150
		build_time = 274
		ai_creation_factor = 89
		extra_tech_building_start = 10.0 # Never get at start of game

		tax_income = 1.5

		potential = {
			is_coastal = yes
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	tr_enclave_3 = {
		desc = tr_enclave_3_desc
		upgrades_from = tr_enclave_2
		gold_cost = 200
		build_time = 365
		ai_creation_factor = 88
		extra_tech_building_start = 10.0 # Never get at start of game

		tax_income = 2

		scouting = yes

		potential = {
			is_coastal = yes
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	# Garrison
	tr_garrison_1 = {
		desc = tr_garrison_1_desc
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 91
		extra_tech_building_start = 10.0 # Never get at start of game

		retinuesize = 20
		garrison_size = 1.0
		fort_level = 1

		potential = {
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	tr_garrison_2 = {
		desc = tr_garrison_2_desc
		upgrades_from = tr_garrison_1
		gold_cost = 150
		build_time = 274
		ai_creation_factor = 90
		extra_tech_building_start = 10.0 # Never get at start of game

		retinuesize = 30
		garrison_size = 1.5
		fort_level = 2

		potential = {
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	tr_garrison_3 = {
		desc = tr_garrison_3_desc
		upgrades_from = tr_garrison_2
		gold_cost = 200
		build_time = 365
		ai_creation_factor = 89
		extra_tech_building_start = 10.0 # Never get at start of game

		retinuesize = 50
		garrison_size = 2.0
		fort_level = 3

		potential = {
			FROM = { is_patrician = yes }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	# Silk Road Trading Post
	tr_silk_road_1 = {
		desc = tr_silk_road_1_desc
		gold_cost = 200
		build_time = 150
		ai_creation_factor = 95
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_wealth = 1 # Affects total value of trade route
		tradevalue = 30

		add_number_to_name = no

		potential = {
			trade_route = silk_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1
		}
	}

	tr_silk_road_2 = { # Silk Road Market
		desc = tr_silk_road_2_desc
		upgrades_from = tr_silk_road_1
		gold_cost = 400
		build_time = 300
		ai_creation_factor = 95
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_wealth = 1.7 # Affects total value of trade route
		tradevalue = 50
		fort_level = 1

		add_number_to_name = no

		trigger = {
			TECH_TRADE_PRACTICES >= 2
		}
	}

	tr_silk_road_3 = { # Major Silk Road City
		desc = tr_silk_road_3_desc
		upgrades_from = tr_silk_road_2
		gold_cost = 800
		build_time = 600
		ai_creation_factor = 95
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_wealth = 3.4 # Affects total value of trade route
		tradevalue = 70
		fort_level = 1

		add_number_to_name = no

		trigger = {
			TECH_TRADE_PRACTICES >= 4
		}
	}

	# Trade Offices
	trade_offices_1 = {
		desc = tr_silk_road_office_1_desc
		gold_cost = 200
		build_time = 600
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		tech_growth_modifier = 0.25
		monthly_character_prestige = 0.25
		retinuesize = 50

		add_number_to_name = no

		potential = {
			trade_route = silk_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1
		}
	}

	trade_offices_2 = {
		desc = tr_silk_road_office_2_desc
		upgrades_from = trade_offices_1
		gold_cost = 600
		build_time = 600
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		monthly_character_prestige = 0.5
		retinuesize = 100

		add_number_to_name = no

		potential = {
			trade_route = silk_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 2
		}
	}

	trade_offices_3 = {
		upgrades_from = trade_offices_2
		desc = tr_silk_road_office_3_desc
		gold_cost = 1200
		build_time = 600
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		monthly_character_prestige = 1.75
		retinuesize = 150

		add_number_to_name = no

		potential = {
			trade_route = silk_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 4
		}
	}

	# Mercenary Garrison
	mercenary_garrison_1 = {
		desc = tr_silk_road_garrison_1_desc
		gold_cost = 200
		build_time = 600
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 3
		tradevalue = -1 # 1 gold per year lost, to pay mercs

		add_number_to_name = no

		potential = {
			OR = {
				trade_route = silk_road
				FROM = { is_patrician = yes } # Patricians can get these anywhere
			}
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1
		}
	}

	mercenary_garrison_2 = {
		desc = tr_silk_road_garrison_2_desc
		gold_cost = 400
		build_time = 600
		upgrades_from = mercenary_garrison_1
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 4
		fort_level = 1
		tradevalue = -2			# 2 gold per year lost, to pay mercs

		add_number_to_name = no

		potential = {
			OR = {
				trade_route = silk_road
				FROM = { is_patrician = yes } # Patricians can get these anywhere
			}
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 2
		}
	}

	mercenary_garrison_3 = {
		desc = tr_silk_road_garrison_3_desc
		upgrades_from = mercenary_garrison_2
		gold_cost = 600
		build_time = 600
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 5
		fort_level = 2
		tradevalue = -3	# 3 gold per year lost, to pay mercs

		add_number_to_name = no

		potential = {
			OR = {
				trade_route = silk_road
				FROM = { is_patrician = yes } # Patricians can get these anywhere
			}
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 4
		}
	}

	# Radhanite Quarter
	radhanite_quarter_1 = {
		desc = radhanite_quarter_1_desc
		gold_cost = 150
		build_time = 400
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 10
		trade_route_wealth = 0.4
		garrison_size = 0.1
		tech_growth_modifier = 0.05
		military_techpoints = 0.01
		economy_techpoints = 0.01
		culture_techpoints = 0.01

		add_number_to_name = no

		potential = {
			trade_route = silk_road
			silk_road_trade_post_trigger = yes

			FROM = {
				OR = {
					culture_group = israelite
					religion_group = jewish_group
					culture = khazar
                }
            }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1
		}
	}

	radhanite_quarter_2 = {
		desc = radhanite_quarter_1_desc
		upgrades_from = radhanite_quarter_1
		gold_cost = 250
		build_time = 600
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 20
		trade_route_wealth = 0.8
		garrison_size = 0.2
		tech_growth_modifier = 0.1
		military_techpoints = 0.02
		economy_techpoints = 0.02
		culture_techpoints = 0.02

		add_number_to_name = no

		potential = {
			trade_route = silk_road
			silk_road_trade_post_trigger = yes

			FROM = {
				OR = {
					culture_group = israelite
					religion_group = jewish_group
					culture = khazar
                }
            }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 3
		}
	}

	radhanite_quarter_3 = {
		desc = radhanite_quarter_1_desc
		upgrades_from = radhanite_quarter_2
		gold_cost = 350
		build_time = 800
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 40
		trade_route_wealth = 1.7
		garrison_size = 0.3
		tech_growth_modifier = 0.15
		military_techpoints = 0.03
		economy_techpoints = 0.03
		culture_techpoints = 0.03

		add_number_to_name = no

		potential = {
			trade_route = silk_road
			silk_road_trade_post_trigger = yes

			FROM = {
				OR = {
					culture_group = israelite
					religion_group = jewish_group
					culture = khazar
                }
            }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 4
		}
	}

	# Roads
	tr_generic_road_1 = { # Generic Road Improvement Stage 1
		desc = tr_generic_road_1_desc
		gold_cost = 100
		build_time = 150
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		tradevalue = 6					 # 6 gold per year generated
		local_movement_speed = 0.1 		 # 0.1 = 10% boost

		potential = {
			is_land_trade_route_trigger = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_generic_road_2 = { # Generic Road Improvement Stage 2
		desc = tr_generic_road_2_desc
		gold_cost = 150
		build_time = 300
		upgrades_from = tr_generic_road_1
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 #Never get at start of game

		trade_route_value = 2			# Affects your cut of the trade route income
		tradevalue = 6					# 6 gold per year generated
		local_movement_speed = 0.2		# 0.2 = 20% boost

		trigger = {
			TECH_TRADE_PRACTICES >= 3

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_generic_road_3 = { # Generic Road Improvement Stage 3
		desc = tr_generic_road_3_desc
		upgrades_from = tr_generic_road_2
		gold_cost = 300
		build_time = 600
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 6			# Affects your cut of the trade route income
		tradevalue = 10					# 10 gold per year generated
		local_movement_speed = 0.3 		# 0.3 = 30% boost
		monthly_character_prestige = 0.3

		trigger = {
			TECH_TRADE_PRACTICES >= 6

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Toll Booths
	tr_generic_toll_booth_1 = { # Generic Toll Booth Stage 1
		desc = tr_generic_toll_booth_1_desc
		gold_cost = 100
		build_time = 150
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 2 # Affects your cut of the trade route income

		potential = {
			is_land_trade_route_trigger = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_generic_toll_booth_2 = {	# Generic Toll Booth Stage 2
		desc = tr_generic_toll_booth_2_desc
		upgrades_from = tr_generic_toll_booth_1
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 3 # Affects your cut of the trade route income

		trigger = {
			TECH_TRADE_PRACTICES >= 3

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_generic_toll_booth_3 = {	# Generic Toll Booth Stage 3
		desc = tr_generic_toll_booth_3_desc
		upgrades_from = tr_generic_toll_booth_2
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 4 # Affects your cut of the trade route income

		trigger = {
			TECH_TRADE_PRACTICES >= 4

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Customs House
	tr_customs_house_1 = { # Customs House Stage 1
		desc = tr_customs_house_1_desc
		gold_cost = 100
		build_time = 150
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 2 # Affects your cut of the trade route income

		potential = {
			is_coastal = yes
			is_sea_trade_route_trigger = yes
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 1

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_customs_house_2 = { # Customs House Stage 2
		desc = tr_customs_house_2_desc
		upgrades_from = tr_customs_house_1
		gold_cost = 200
		build_time = 200
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 3 # Affects your cut of the trade route income

		trigger = {
			TECH_TRADE_PRACTICES >= 3

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_customs_house_3 = { # Customs House Stage 3
		desc = tr_customs_house_3_desc
		upgrades_from = tr_customs_house_2
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 105
		extra_tech_building_start = 10.0 # Never get at start of game

		trade_route_value = 4 # Affects your cut of the trade route income

		trigger = {
			TECH_TRADE_PRACTICES >= 4

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Rus Trade Guild
	tr_rus_road_trade_guild_1 = { # Rus Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = rus_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_rus_road_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_rus_road_trade_guild_2 = { # Rus Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_rus_road_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = rus_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_rus_road_trade_guild_3 = { # Rus Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_rus_road_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = rus_road
		}

		trigger = {
			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}
		}
	}

	# Amber Road Trade Guild
	tr_amber_road_trade_guild_1 = {	# Amber Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = amber_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_amber_road_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_amber_road_trade_guild_2 = {	# Amber Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_amber_road_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = amber_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_amber_road_trade_guild_3 = {	# Amber Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_amber_road_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = amber_road
		}

		trigger = {
			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}
		}
	}

	# Balkan Road Trade Guild
	tr_balkan_road_trade_guild_1 = { # Balkan Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = balkan_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_balkan_road_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_balkan_road_trade_guild_2 = { # Balkan Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_balkan_road_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = balkan_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_balkan_road_trade_guild_3 = { # Balkan Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_balkan_road_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = balkan_road
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# French Trade Guild
	tr_french_trade_guild_1 = {	# French Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = french_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_french_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_french_trade_guild_2 = {	# French Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_french_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = french_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_french_trade_guild_3 = {	# French Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_french_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = french_trade
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq #Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Iberian Trade Guild
	tr_iberian_trade_guild_1 = { # Iberian Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = iberian_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_iberian_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_iberian_trade_guild_2 = { # Iberian Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_iberian_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = iberian_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_iberian_trade_guild_3 = { # Iberian Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_iberian_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = iberian_trade
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# British Trade Guild
	tr_british_trade_guild_1 = { # British Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = british_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_british_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_british_trade_guild_2 = { # British Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_british_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = british_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_british_trade_guild_3 = { # British Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_british_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = british_trade
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Atlantic Trade Guild
	tr_atlantic_trade_guild_1 = { # Atlantic Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = atlantic_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_atlantic_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_atlantic_trade_guild_2 = { # Atlantic Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_atlantic_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = atlantic_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_atlantic_trade_guild_3 = { # Atlantic Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_atlantic_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = atlantic_trade
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq #Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Baltic Trade Guild
	tr_baltic_trade_guild_1 = { # Baltic Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = baltic_sea
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_baltic_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_baltic_trade_guild_2 = { # Baltic Trade Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_baltic_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = baltic_sea
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_baltic_trade_guild_3 = {	# Baltic Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_baltic_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = baltic_sea
		}

		trigger = {
			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq #Only one guild headquarters in the world per route
			}
		}
	}

	# Mediterranean Trade Guild
	tr_mediterranean_trade_guild_1 = { # Mediterranean Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = mediterranean_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_mediterranean_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_mediterranean_trade_guild_2 = { # Mediterranean Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_mediterranean_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = mediterranean_trade
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_mediterranean_trade_guild_3 = { # Mediterranean Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_mediterranean_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = mediterranean_trade
		}

		trigger = {
			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}
		}
	}

	# Salt Road Trade Guild
	tr_salt_road_trade_guild_1 = { # Salt Road Trade Guild Stage 1
		desc = tr_trade_guild_1_desc
		gold_cost = 300
		build_time = 300
		ai_creation_factor = 120
		extra_tech_building_start = 6.0

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 6	# Affects your cut of the trade route income
		tradevalue = 15			# 15 gold per year generated

		potential = {
			trade_route = salt_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}

			# May only have 1 of the same type of guild every 300 range
			custom_tooltip = {
				text = TR_TRADE_GUILD_3_OTHER_PROVINCES_CONDITION

				NOT = {
					any_trade_route_province = {
						trade_post_has_building = tr_salt_road_trade_guild_1

						distance = {
							where = ROOT
							value < 300
						}
					}
				}
			}

			no_other_trade_guild_types_trigger = yes
		}
	}

	tr_salt_road_trade_guild_2 = { # Salt Road Guild Stage 2
		desc = tr_trade_guild_2_desc
		upgrades_from = tr_salt_road_trade_guild_1
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_wealth = 10	# Affects total value of trade route
		trade_route_value = 12	# Affects your cut of the trade route income
		tradevalue = 20			# 20 gold per year generated

		potential = {
			trade_route = salt_road
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 7

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tr_salt_road_trade_guild_3 = { # Salt Road Trade Guild Stage 3
		desc = tr_trade_guild_3_desc
		upgrades_from = tr_salt_road_trade_guild_2
		gold_cost = 600
		build_time = 400
		ai_creation_factor = 120
		extra_tech_building_start = 8

		trade_route_value = 24	# Affects your cut of the trade route income
		trade_route_wealth = 10	# Affects total value of trade route
		tradevalue = 30			# 30 gold per year generated

		potential = {
			trade_route = salt_road
		}

		trigger = {
			custom_tooltip = {
				text = TR_TRADE_GUILD_1_IN_WORLD
				has_province_modifier = trade_guild_hq # Only one guild headquarters in the world per route
			}

			FROM = { # Tribals and Nomads are not allowed to have anything past a trade post
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Trade Post Garrison
	tr_tp_garrison_1 = {
		desc = tr_tp_garrison_1_desc
		gold_cost = 100
		build_time = 182
		ai_creation_factor = 91
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 0.3
		fort_level = 0.3

		potential = {
			FROM = { is_patrician = no }

			OR = {
				trade_route = silk_road
				is_land_trade_route_trigger = yes
				is_sea_trade_route_trigger = yes
			}
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 0
		}
	}

	tr_tp_garrison_2 = {
		desc = tr_tp_garrison_2_desc
		upgrades_from = tr_tp_garrison_1
		gold_cost = 150
		build_time = 274
		ai_creation_factor = 90
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 0.6
		fort_level = 0.6

		potential = {
			FROM = { is_patrician = no }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 3
		}
	}

	tr_tp_garrison_3 = {
		desc = tr_tp_garrison_3_desc
		upgrades_from = tr_tp_garrison_2
		gold_cost = 200
		build_time = 365
		ai_creation_factor = 89
		extra_tech_building_start = 10.0 # Never get at start of game

		garrison_size = 1.0
		fort_level = 1

		potential = {
			FROM = { is_patrician = no }
		}

		trigger = {
			TECH_TRADE_PRACTICES >= 5
		}
	}
}

hospital = {
	# Quarantine
	tr_quarantine_1 = {
		desc = tr_quarantine_1_desc
		gold_cost = 200
		build_time = 365
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		disease_defence = 0.1
		trade_route_value = -1

		add_number_to_name = no

		potential = {
			has_trade_post = yes
			has_dlc = "Reapers"
		}

		trigger = {
			TECH_CONSTRUCTION >= 5
		}
	}

	tr_quarantine_2 = {
		desc = tr_quarantine_2_desc
		upgrades_from = tr_quarantine_1
		gold_cost = 400
		build_time = 365
		ai_creation_factor = 5
		extra_tech_building_start = 10.0 # Never get at start of game

		prerequisites = {
			tr_quarantine_1
			tr_port_2
		}

		potential = {
			has_trade_post = yes
			is_coastal = yes
			has_dlc = "Reapers"
		}

		trigger = {
			TECH_CONSTRUCTION >= 5
		}

		disease_defence = 0.2
		trade_route_value = -2

		add_number_to_name = no
	}
}