#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
#}

#Temple
temple = {
	# Temple
	tp_temple_1 = {
		gold_cost = 150
		build_time = 547
		ai_creation_factor = 96
		extra_tech_building_start = -1

		levy_size = 0.05
		garrison_size = 0.05
		liege_piety = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			ai_can_build_trigger = yes
		}
	}

	tp_temple_2 = {
		upgrades_from = tp_temple_1
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 95
		extra_tech_building_start = 0.7

		levy_size = 0.05
		garrison_size = 0.05
		liege_piety = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 2
			ai_can_build_trigger = yes
		}
	}

	tp_temple_3 = {
		upgrades_from = tp_temple_2
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 94
		extra_tech_building_start = 0.9

		levy_size = 0.05
		garrison_size = 0.05
		liege_piety = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 4
			ai_can_build_trigger = yes
		}
	}

	tp_temple_4 = {
		upgrades_from = tp_temple_3
		gold_cost = 400
		build_time = 1460
		ai_creation_factor = 93
		extra_tech_building_start = 1.1

		levy_size = 0.05
		garrison_size = 0.05
		liege_piety = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			ai_can_build_trigger = yes
		}
	}

	tp_temple_5 = {
		upgrades_from = tp_temple_4
		gold_cost = 600
		build_time = 2190
		ai_creation_factor = 92
		extra_tech_building_start = 1.3

		levy_size = 0.1
		garrison_size = 0.1
		liege_piety = 0.1

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 8
			ai_can_build_trigger = yes
		}
	}

	# School
	tp_school_1 = {
		prerequisites = { tp_wall_1 }
		gold_cost = 200
		build_time = 547
		extra_tech_building_start = 0.5
		ai_creation_factor = 93

		tech_growth_modifier = 0.1
		culture_techpoints = 0.05

		add_number_to_name = no

		potential = {
			OR = {
				FROMFROM = { has_building = tp_school_1 }

				AND = {
					FROMFROM = { has_building = tp_temple_1 }
					TECH_TEMPLE_CONSTRUCTION >= 2
				}
			}
		}

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 2
			ai_can_build_trigger = yes
		}
	}

	tp_school_2 = {
		desc = tp_school_1_desc
		upgrades_from = tp_school_1
		prerequisites = { tp_wall_2 }
		gold_cost = 400
		build_time = 547
		extra_tech_building_start = 0.7
		ai_creation_factor = 92

		tech_growth_modifier = 0.2
		culture_techpoints = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 4
			ai_can_build_trigger = yes
		}
	}

	tp_school_3 = {
		desc = tp_school_1_desc
		prerequisites = { tp_wall_3 }
		upgrades_from = tp_school_2
		gold_cost = 600
		build_time = 547
		ai_creation_factor = 92
		extra_tech_building_start = 0.2

		tech_growth_modifier = 0.3
		culture_techpoints = 0.05

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			ai_can_build_trigger = yes
		}
	}

	# Order Houses
	tp_order_house_1 = {
		gold_cost = 300
		build_time = 365
		ai_creation_factor = 95
		extra_tech_building_start = 0.8

		heavy_infantry = 100

		potential = {
			OR = {
				FROMFROM = { has_building = tp_order_house_1 }

				AND = {
					FROMFROM = { has_building = tp_temple_1 }
					TECH_TEMPLE_CONSTRUCTION >= 3
				}
			}
		}

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_order_house_2 = {
		upgrades_from = tp_order_house_1
		gold_cost = 700
		build_time = 730
		ai_creation_factor = 94
		extra_tech_building_start = 1.5

		heavy_infantry = 225

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			ai_can_build_trigger = yes
		}
	}

	# Training Grounds
	tp_training_grounds_1 = {
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 89
		extra_tech_building_start = 1.4

		land_morale = 0.1
		levy_reinforce_rate = 0.1
		retinuesize = 20

		potential = {
			FROMFROM = {
				OR = {
					has_building = tp_temple_1
					has_building = tp_training_grounds_1
				}
			}
		}

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			ai_can_build_trigger = yes
		}
	}

	tp_training_grounds_2 = {
		upgrades_from = tp_training_grounds_1
		gold_cost = 250
		build_time = 1095
		ai_creation_factor = 88
		extra_tech_building_start = 0.9

		land_morale = 0.15
		levy_reinforce_rate = 0.15
		retinuesize = 20

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_training_grounds_3 = {
		upgrades_from = tp_training_grounds_2
		gold_cost = 300
		build_time = 2190
		ai_creation_factor = 88
		extra_tech_building_start = 0.8

		land_morale = 0.2
		levy_reinforce_rate = 0.2
		retinuesize = 20

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			ai_can_build_trigger = yes
		}
	}

	# Town Market
	tp_town_market_1 = {
		prestige_cost = 0
		build_time = 0
		ai_creation_factor = 120
		extra_tech_building_start = -1

		tax_income = 0.5

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
		}
	}

	tp_town_market_2 = {
		upgrades_from = tp_town_market_1
		gold_cost = 100
		build_time = 547
		ai_creation_factor = 120
		extra_tech_building_start = 1.2

		tax_income = 0.5

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_town_market_3 = {
		upgrades_from = tp_town_market_2
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 120
		extra_tech_building_start = 0.8

		tax_income = 1

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_town_market_4 = {
		upgrades_from = tp_town_market_3
		gold_cost = 250
		build_time = 1095
		ai_creation_factor = 120
		extra_tech_building_start = 1.0

		tax_income = 3

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_town_market_5 = {
		upgrades_from = tp_town_market_4
		gold_cost = 300
		build_time = 2190
		ai_creation_factor = 120
		extra_tech_building_start = 1.2

		tax_income = 5

		add_number_to_name = no

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 7
			ai_can_build_trigger = yes
		}
	}

	# Housing
	tp_housing_1 = {
		prestige_cost = 0
		build_time = 0
		ai_creation_factor = 120
		extra_tech_building_start = -1

		land_morale = 0.05
		levy_size = 0.025
		levy_reinforce_rate = 0.05
		light_infantry = 16
		archers = 12

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
		}
	}

	tp_housing_2 = {
		prerequisites = { tp_town_market_1 }
		upgrades_from = tp_housing_1
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 89
		extra_tech_building_start = 1.4

		land_morale = 0.05
		levy_size = 0.025
		levy_reinforce_rate = 0.05
		light_infantry = 16
		archers = 12

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_housing_3 = {
		upgrades_from = tp_housing_2
		gold_cost = 250
		build_time = 1095
		ai_creation_factor = 88
		extra_tech_building_start = 0.9

		land_morale = 0.05
		levy_size = 0.025
		levy_reinforce_rate = 0.05
		light_infantry = 16
		archers = 12

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_housing_4 = {
		upgrades_from = tp_housing_3
		gold_cost = 400
		build_time = 1095
		ai_creation_factor = 88
		extra_tech_building_start = 0.9

		land_morale = 0.05
		levy_size = 0.025
		levy_reinforce_rate = 0.05
		light_infantry = 16
		archers = 12

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_housing_5 = {
		upgrades_from = tp_housing_4
		gold_cost = 500
		build_time = 1095
		ai_creation_factor = 88
		extra_tech_building_start = 0.9

		land_morale = 0.15
		levy_size = 0.025
		levy_reinforce_rate = 0.25
		light_infantry = 16
		archers = 12

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 7
			ai_can_build_trigger = yes
		}
	}

	# Stable
	tp_stable_1 = {
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 89
		extra_tech_building_start = 0.6

		light_cavalry = 46

		potential = {
			OR = {
				FROMFROM = { has_building = tp_stable_1 }

				AND = {
					TECH_CAVALRY >= 1

					FROMFROM = {
						OR = {
							has_building = tp_temple_1

							AND = {
								has_building = tp_town_market_1
								has_building = tp_housing_1
							}
						}
					}
				}
			}
		}

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_stable_2 = {
		upgrades_from = tp_stable_1
		gold_cost = 120
		build_time = 547
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		light_cavalry = 56

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_stable_3 = {
		upgrades_from = tp_stable_2
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 87
		extra_tech_building_start = 0.8

		light_cavalry = 66

		trigger = {
			TECH_CAVALRY >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_stable_4 = {
		upgrades_from = tp_stable_3
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 86
		extra_tech_building_start = 1.0

		light_cavalry = 66
		knights = 15

		trigger = {
			TECH_CAVALRY >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_stable_5 = {
		upgrades_from = tp_stable_4
		gold_cost = 400
		build_time = 2190
		ai_creation_factor = 85
		extra_tech_building_start = 1.2

		light_cavalry = 66
		knights = 20

		trigger = {
			TECH_CAVALRY >= 7
			ai_can_build_trigger = yes
		}
	}

	# Desert Stable
	tp_desert_stable_1 = {
		replaces = tp_stable_1
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 89
		extra_tech_building_start = 0.6

		camel_cavalry = 46

		potential = {
			terrain = desert

			OR = {
				FROMFROM = { has_building = tp_desert_stable_1 }

				AND = {
					TECH_CAVALRY >= 1

					FROMFROM = {
						OR = {
							has_building = tp_temple_1

							AND = {
								has_building = tp_town_market_1
								has_building = tp_housing_1
							}
						}
					}
				}
			}
		}

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_desert_stable_2 = {
		replaces = tp_stable_2
		upgrades_from = tp_desert_stable_1
		gold_cost = 120
		build_time = 547
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		camel_cavalry = 56

		potential = {
			terrain = desert
		}

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_desert_stable_3 = {
		replaces = tp_stable_3
		upgrades_from = tp_desert_stable_2
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 87
		extra_tech_building_start = 0.8

		camel_cavalry = 66

		potential = {
			terrain = desert
		}

		trigger = {
			TECH_CAVALRY >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_desert_stable_4 = {
		replaces = tp_stable_4
		upgrades_from = tp_desert_stable_3
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 86
		extra_tech_building_start = 1.0

		camel_cavalry = 66
		knights = 15

		potential = {
			terrain = desert
		}

		trigger = {
			TECH_CAVALRY >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_desert_stable_5 = {
		replaces = tp_stable_5
		upgrades_from = tp_desert_stable_4
		gold_cost = 400
		build_time = 2190
		ai_creation_factor = 85
		extra_tech_building_start = 1.2

		camel_cavalry = 66
		knights = 20

		potential = {
			terrain = desert
		}

		trigger = {
			TECH_CAVALRY >= 7
			ai_can_build_trigger = yes
		}
	}

	# Steppe Stable
	tp_steppe_stable_1 = {
		replaces = tp_stable_1
		gold_cost = 100
		build_time = 365
		extra_tech_building_start = 0.6
		ai_creation_factor = 89

		light_cavalry = 32
		horse_archers = 14

		potential = {
			terrain = steppe

			OR = {
				FROMFROM = { has_building = tp_steppe_stable_1 }

				AND = {
					TECH_CAVALRY >= 1

					FROMFROM = {
						OR = {
							has_building = tp_temple_1

							AND = {
								has_building = tp_town_market_1
								has_building = tp_housing_1
							}
						}
					}
				}
			}
		}

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_steppe_stable_2 = {
		replaces = tp_stable_2
		upgrades_from = tp_steppe_stable_1
		gold_cost = 120
		build_time = 547
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		light_cavalry = 42
		horse_archers = 24

		potential = {
			terrain = steppe
		}

		trigger = {
			TECH_CAVALRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_steppe_stable_3 = {
		replaces = tp_stable_3
		upgrades_from = tp_steppe_stable_2
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 87
		extra_tech_building_start = 0.8

		light_cavalry = 42
		horse_archers = 24

		potential = {
			terrain = steppe
		}

		trigger = {
			TECH_CAVALRY >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_steppe_stable_4 = {
		replaces = tp_stable_4
		upgrades_from = tp_steppe_stable_3
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 86
		extra_tech_building_start = 1.0

		light_cavalry = 42
		horse_archers = 24
		knights = 15

		potential = {
			terrain = steppe
		}

		trigger = {
			TECH_CAVALRY >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_steppe_stable_5 = {
		replaces = tp_stable_5
		upgrades_from = tp_steppe_stable_4
		gold_cost = 400
		build_time = 2190
		ai_creation_factor = 85
		extra_tech_building_start = 1.2

		light_cavalry = 42
		horse_archers = 24
		knights = 20

		potential = {
			terrain = steppe
		}

		trigger = {
			TECH_CAVALRY >= 7
			ai_can_build_trigger = yes
		}
	}

	# City Wall
	tp_wall_1 = {
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 90
		extra_tech_building_start = 1.2

		fort_level = 1

		potential = {
			OR = {
				FROMFROM = { has_building = tp_wall_1 }

				AND = {
					TECH_FORTIFICATIONS_CONSTRUCTION >= 1

					FROMFROM = {
						has_building = tp_town_market_1
						has_building = tp_housing_1
					}
				}
			}
		}

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_wall_2 = {
		upgrades_from = tp_wall_1
		gold_cost = 100
		build_time = 547 #1.5y
		ai_creation_factor = 89
		extra_tech_building_start = 0.6

		fort_level = 0.75

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 2
			ai_can_build_trigger = yes
		}
	}

	tp_wall_3 = {
		upgrades_from = tp_wall_2
		gold_cost = 200
		build_time = 730 #2y
		ai_creation_factor = 88
		extra_tech_building_start = 0.8

		fort_level = 1.5

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 4
			ai_can_build_trigger = yes
		}
	}

	tp_wall_4 = {
		upgrades_from = tp_wall_3
		gold_cost = 200
		build_time = 1095 #3y
		ai_creation_factor = 87
		extra_tech_building_start = 1.0

		fort_level = 1.5

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 6
			ai_can_build_trigger = yes
		}
	}

	tp_wall_5 = {
		desc = tp_wall_5_desc
		upgrades_from = tp_wall_4
		gold_cost = 300
		build_time = 1460 #4y
		ai_creation_factor = 86
		extra_tech_building_start = 1.2

		fort_level = 2.0

		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 8
			ai_can_build_trigger = yes
		}
	}

	# Militia
	tp_militia_1 = {
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 100
		extra_tech_building_start = 1.2

		light_infantry = 50
		archers = 100

		potential = {
			FROMFROM = {
				OR = {
					has_building = tp_militia_1

					AND = {
						has_building = tp_town_market_1
						has_building = tp_housing_1
					}
				}
			}
		}

		trigger = {
			TECH_LIGHT_INFANTRY >= 0
			ai_can_build_trigger = yes
		}
	}

	tp_militia_2 = {
		upgrades_from = tp_militia_1
		gold_cost = 120
		build_time = 547
		ai_creation_factor = 98
		extra_tech_building_start = 1.2

		light_infantry = 50
		archers = 100

		trigger = {
			TECH_LIGHT_INFANTRY >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_militia_3 = {
		upgrades_from = tp_militia_2
		gold_cost = 200
		build_time = 1095
		light_infantry = 50
		archers = 100
		ai_creation_factor = 98
		extra_tech_building_start = 1.2

		trigger = {
			TECH_LIGHT_INFANTRY >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_militia_4 = {
		upgrades_from = tp_militia_2
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 98
		extra_tech_building_start = 1.2

		light_infantry = 50
		archers = 100

		trigger = {
			TECH_LIGHT_INFANTRY >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_militia_5 = {
		upgrades_from = tp_militia_2
		gold_cost = 400
		build_time = 1095
		ai_creation_factor = 98
		extra_tech_building_start = 1.2

		light_infantry = 50
		archers = 100

		trigger = {
			TECH_LIGHT_INFANTRY >= 7
			ai_can_build_trigger = yes
		}
	}

	# Navy
	tp_shipyard_1 = {
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 85
		extra_tech_building_start = 0.5

		galleys = 10

		port = yes

		potential = {
			OR = {
				FROMFROM = { has_building = tp_shipyard_1 }

				AND = {
					TECH_NAVAL >= 1

					FROMFROM = {
						OR = {
							has_building = tp_temple_1

							AND = {
								has_building = tp_town_market_1
								has_building = tp_housing_1
							}
						}
					}
				}
			}
		}

		trigger = {
			TECH_NAVAL >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_shipyard_2 = {
		upgrades_from = tp_shipyard_1
		gold_cost = 100
		build_time = 730
		ai_creation_factor = 85
		extra_tech_building_start = 0.7

		galleys = 5

		port = yes

		trigger = {
			TECH_NAVAL >= 2
			ai_can_build_trigger = yes
		}
	}

	tp_shipyard_3 = {
		upgrades_from = tp_shipyard_2
		gold_cost = 100
		build_time = 1095
		ai_creation_factor = 85
		extra_tech_building_start = 0.9

		galleys = 7

		port = yes

		trigger = {
			TECH_NAVAL >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_shipyard_4 = {
		upgrades_from = tp_shipyard_3
		gold_cost = 100
		build_time = 1460
		ai_creation_factor = 85
		extra_tech_building_start = 1.1

		galleys = 8

		port = yes

		trigger = {
			TECH_NAVAL >= 4
			ai_can_build_trigger = yes
		}
	}

	tp_shipyard_5 = {
		upgrades_from = tp_shipyard_4
		gold_cost = 100
		build_time = 1460
		ai_creation_factor = 85
		extra_tech_building_start = 1

		galleys = 10

		port = yes

		trigger = {
			TECH_NAVAL >= 5
			ai_can_build_trigger = yes
		}
	}

	# Trade
	tp_port_1 = {
		gold_cost = 100
		build_time = 365
		ai_creation_factor = 130
		extra_tech_building_start = 0

		tax_income = 0.5

		port = yes

		potential = {
			OR = {
				FROMFROM = { has_building = tp_port_1 }

				AND = {
					TECH_NAVAL >= 1
					TECH_TRADE_PRACTICES >= 1

					FROMFROM = {
						has_building = tp_town_market_1
						has_building = tp_housing_1
					}
				}
			}
		}

		trigger = {
			TECH_NAVAL >= 1
			TECH_TRADE_PRACTICES >= 1
			ai_can_build_trigger = yes
		}
	}

	tp_port_2 = {
		upgrades_from = tp_port_1
		gold_cost = 150
		build_time = 547
		ai_creation_factor = 130
		extra_tech_building_start = 0.6

		tax_income = 0.5

		port = yes

		trigger = {
			TECH_TRADE_PRACTICES >= 3
			ai_can_build_trigger = yes
		}
	}

	tp_port_3 = {
		upgrades_from = tp_port_2
		gold_cost = 200
		build_time = 730
		ai_creation_factor = 130
		extra_tech_building_start = 0.8

		tax_income = 0.5

		port = yes

		trigger = {
			TECH_TRADE_PRACTICES >= 5
			ai_can_build_trigger = yes
		}
	}

	tp_port_4 = {
		upgrades_from = tp_port_3
		gold_cost = 300
		build_time = 1095
		ai_creation_factor = 130
		extra_tech_building_start = 1.0

		tax_income = 0.5

		port = yes

		trigger = {
			TECH_TRADE_PRACTICES >= 6
			ai_can_build_trigger = yes
		}
	}

	tp_port_5 = {
		upgrades_from = tp_port_4
		gold_cost = 400
		build_time = 2190
		ai_creation_factor = 130
		extra_tech_building_start = 1.2

		tax_income = 1

		port = yes

		trigger = {
			TECH_TRADE_PRACTICES >= 7
			ai_can_build_trigger = yes
		}
	}

	# Monumental Bloodline buildings.
	tp_monumental_shrines_1 = { # Monumental Shrines
		desc = tp_monumental_shrines_1_desc
		gold_cost = 125
		build_time = 365
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		liege_piety = 0.05
		tax_income = 1

		add_number_to_name = yes

		potential = {
			# Show the building only if it has been already built or if the owner has the proper bloodline to build it.
			OR = {
				FROMFROM = { has_building = tp_monumental_shrines_1 }

				FROM = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental
							bloodline_is_active_for = PREV
						}

						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental
								bloodline_is_active_for = PREV
							}
						}
					}
				}
			}
		}

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 1

			custom_tooltip = {
				text = tooltip_has_monumental_bloodline

				FROM = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental
							bloodline_is_active_for = PREV
						}

						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental
								bloodline_is_active_for = PREV
							}
						}
					}
				}
			}
		}

		is_active_trigger = {
			FROM = {
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tp_monumental_shrines_2 = {
		desc = tp_monumental_shrines_2_desc
		upgrades_from = tp_monumental_shrines_1
		gold_cost = 250
		build_time = 560
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		liege_piety = 0.1
		tax_income = 1

		add_number_to_name = yes

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 31

			custom_tooltip = {
				text = tooltip_has_monumental_bloodline

				FROM = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental
							bloodline_is_active_for = PREV
						}

						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental
								bloodline_is_active_for = PREV
							}
						}
					}
				}
			}
		}

		is_active_trigger = {
			FROM = {
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tp_monumental_shrines_3 = {
		desc = tp_monumental_shrines_3_desc
		upgrades_from = tp_monumental_shrines_2
		gold_cost = 250
		build_time = 560
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		liege_piety = 0.15
		tax_income = 1

		add_number_to_name = yes

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 51

			custom_tooltip = {
				text = tooltip_has_monumental_bloodline

				FROM = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental
							bloodline_is_active_for = PREV
						}

						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental
								bloodline_is_active_for = PREV
							}
						}
					}
				}
			}
		}

		is_active_trigger = {
			FROM = {
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	tp_monumental_shrines_4 = {
		desc = tp_monumental_shrines_4_desc
		upgrades_from = tp_monumental_shrines_3
		gold_cost = 250
		build_time = 560
		ai_creation_factor = 88
		extra_tech_building_start = 1.2

		liege_piety = 0.25
		tax_income = 1

		add_number_to_name = yes

		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 71

			custom_tooltip = {
				text = tooltip_has_monumental_bloodline

				FROM = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental
							bloodline_is_active_for = PREV
						}

						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental
								bloodline_is_active_for = PREV
							}
						}
					}
				}
			}
		}

		is_active_trigger = {
			FROM = {
				show_only_failed_conditions = yes

				is_tribal = no
				is_nomadic = no
			}
		}
	}

	# Hellenic Dedicated temples
	tp_shrine_zeus = {
		desc = tp_shrine_zeus_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		liege_prestige = 0.15

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_zeus }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_poseidon = {
		desc = tp_shrine_poseidon_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		local_build_time_modifier = -0.1
		local_build_cost_modifier = -0.1

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_poseidon }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_hades = {
		desc = tp_shrine_hades_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		tax_income = 3

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hades }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_hermes = {
		desc = tp_shrine_hermes_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		tradevalue = 15

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hermes }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_demeter = {
		desc = tp_shrine_demeter_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		economy_techpoints = 0.05

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_demeter }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_athena = {
		desc = tp_shrine_athena_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		military_techpoints = 0.05

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_athena }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_apollo = {
		desc = tp_shrine_apollo_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		culture_techpoints = 0.05

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_apollo }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_arthemis = {
		desc = tp_shrine_arthemis_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		liege_piety = 0.1

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_arthemis }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_ares = {
		desc = tp_shrine_ares_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		levy_reinforce_rate = 0.05

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_ares }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_aphrodite = {
		desc = tp_shrine_aphrodite_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		local_revolt_risk = -0.1

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_aphrodite }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_ephaestus = {
		desc = tp_shrine_ephaestus_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		fort_level = 0.4
		tech_growth_modifier = 0.15

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_ephaestus }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_shrine_hestia = {
		desc = tp_shrine_hestia_desc
		gold_cost = 500
		build_time = 50
		ai_creation_factor = 92

		land_morale = 0.05

		add_number_to_name = no

		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hestia }
			FROM = { religion_openly_hellenic_or_reformed_trigger = yes }
		}
	}

	tp_saint_shrine = {
		desc = tp_saint_shrine
		gold_cost = 150
		build_time = 210
		ai_creation_factor = 92

		liege_piety = 0.3
		local_revolt_risk = -0.05
		tax_income = 2

		add_number_to_name = no

		potential = {
			OR = {
				FROMFROM = { has_building = tp_saint_shrine }
				has_province_modifier = tomb_of_a_saint
				has_province_modifier = pillaged_tomb_of_a_saint
			}
		}

		is_active_trigger = {
			custom_tooltip = {
				text = tp_saint_shrine_TT
				has_province_modifier = tomb_of_a_saint
			}

			custom_tooltip = {
				text = tp_saint_shrine_TT_2
				FROM = { religion_group = christian }
			}
		}
	}
}