 # 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
 #}
 
 # Castle
	
castle = {
	
	ca_palace_1 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		desc = "The seat of a local lord."
		gold_cost = 300
		build_time = 300
		liege_prestige = 0.5
		feudal_opinion = 3
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}
	ca_palace_2 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_palace_1
		desc = "This palace affords its owner a few luxuries in the Medieval World, such as a bathing house."
		gold_cost = 600
		build_time = 400
		liege_prestige = 0.75
		feudal_opinion = 3
		ai_creation_factor = 95

		extra_tech_building_start = 0.4
	}
	ca_palace_3 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_palace_2
		desc = "The owner of this palace commands an immense amount of wealth as evident from the large gardens and spewing fountains."
		gold_cost = 800
		build_time = 400
		liege_prestige = 1
		feudal_opinion = 3
		ai_creation_factor = 95

		extra_tech_building_start = 0
	}
	ca_palace_4 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_CASTLE_CONSTRUCTION = 7 }
		upgrades_from = ca_palace_3
		desc = "This vast estate is home to many residences and luxuries, there's even a wine cellar so large the steward often gets lost."
		gold_cost = 1000
		build_time = 400
		liege_prestige = 1.25
		ai_creation_factor = 95

		extra_tech_building_start = 0
	}

	ca_taxoffice_1 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_LEGALISM = 1 }
		desc = "The lord's taxes are stored here."
		gold_cost = 300
		build_time = 300
		tax_income = 1
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}
	ca_taxoffice_2 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_LEGALISM = 3 }
		desc = "The castle's treasury collects taxes from the whole area."
		upgrades_from = ca_taxoffice_1
		gold_cost = 600
		build_time = 300
		tax_income = 1
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}

	ca_taxoffice_3 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_LEGALISM = 5 }
		desc = "New taxes and increased bureaucracy are increasing tax yields."
		upgrades_from = ca_taxoffice_2
		gold_cost = 900
		build_time = 300
		tax_income = 2
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}

	ca_taxoffice_4 = {
		potential = {
			FROM = { 
				capital_holding = {
					title = FROMFROM
				}
			}
		}
		trigger = { TECH_LEGALISM = 7 }
		desc = "The bureaucratic apperatus of this country rivals that of Byzantium."
		upgrades_from = ca_taxoffice_3
		gold_cost = 900
		build_time = 300
		tax_income = 2
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}

	
	ca_towncenter_1 = {
		desc = "A small patch of dirt that serves as the local population's gathering place."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 50
		build_time = 100
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.8
	}
	ca_towncenter_2 = {
		desc = "A local tavern to entertain the local population."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		upgrades_from = ca_towncenter_1
		gold_cost = 100
		build_time = 200
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0
	}
	ca_towncenter_3 = {
		desc = "Where local men prove their might, only to be beaten by a brave adventurer."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_towncenter_2
		gold_cost = 150
		build_time = 200
		tax_income = 1
		land_morale = 0.1
		levy_reinforce_rate = 0.1
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0
	}
	ca_towncenter_4 = {
		desc = "The theatre guild entertaining the local population, often at your expense."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_towncenter_3
		gold_cost = 200
		build_time = 400
		tax_income = 2
		culture_techpoints = 0.04
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0
	}
	ca_town_1 = {
		desc = "Just a small collection of huts around the lord's hall."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 30
		build_time = 100
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0
	}
	ca_town_2 = {
		desc = "The collection of huts has grown to match the growing food supply."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_farms_2 }
		upgrades_from = ca_town_1
		gold_cost = 50
		build_time = 200
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_town_3 = {
		desc = "A small town has formed, thanks to increased protection and food."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_farms_3 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_town_2
		gold_cost = 100
		build_time = 300
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_town_4 = {
		desc = "The local town is bustling thanks to the local lord's investment and protection."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		prerequisites = { ca_farms_4 }
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_town_3
		gold_cost = 200
		build_time = 400
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_town_5 = {
		desc = "This castle's population is more akin to a city than a town."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		prerequisites = { ca_farms_4 }
		prerequisites = { ca_wall_3 }
		upgrades_from = ca_town_4
		gold_cost = 300
		build_time = 500
		tax_income = 1
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farms_1 = {
		desc = "These fields have been worked since the Iron age."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 30
		build_time = 100
		tax_income = 0.25
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0
	}
	ca_farms_2 = {
		desc = "A few more cleared fields goes a long way to supporting the local populaton."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		upgrades_from = ca_farms_1
		gold_cost = 60
		build_time = 200
		tax_income = 0.25
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.8
	}
	ca_farms_3 = {
		desc = "With growing towns comes larger fields."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		upgrades_from = ca_farms_2
		gold_cost = 60
		build_time = 300
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farms_4 = {
		desc = "The Three Fields System was a method of farming that involved rotating a series of different crops to maximize soil output."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_farms_3
		gold_cost = 100
		build_time = 300
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farms_5 = {
		desc = "Recovering cities will require even more food to maintain their population."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_farms_4
		gold_cost = 150
		build_time = 400
		tax_income = 1
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farms_6 = {
		desc = "Vast fields cover the land, creating a never ending connection between our city and the local towns."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_farms_5
		gold_cost = 300
		build_time = 500
		tax_income = 1
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farminfrastructure_1 = {
		desc = "A cozy windmill rest among the growing fields."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_farms_2 }
		gold_cost = 100
		build_time = 200
		tax_income = 0.5
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farminfrastructure_2 = {
		desc = "Local bakeries now process the flour from the windmill into bread for the local population."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_farminfrastructure_1
		prerequisites = { ca_farms_4 }
		gold_cost = 200
		build_time = 300
		tax_income = 1
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_farminfrastructure_3 = {
		desc = "The grain market supplies the whole city with the staples of the Medieval world."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_farminfrastructure_2
		prerequisites = { ca_farms_5 }
		gold_cost = 200
		build_time = 300
		tax_income = 2
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_roads_1 = {
		desc = "Humble dirt paths connecting the village."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 10
		build_time = 100
		tax_income = 0.25
		ai_creation_factor = 110
		add_number_to_name = no
		
		extra_tech_building_start = 0.2
	}
	ca_roads_2 = {
		desc = "Gravel roads to accompany a growing village."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		upgrades_from = ca_roads_1
		gold_cost = 30
		build_time = 200
		tax_income = 0.25
		ai_creation_factor = 109
		add_number_to_name = no

		extra_tech_building_start = 0.8
	}
	ca_roads_3 = {
		desc = "Cobbeled streets remind one of civilization."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_roads_2
		gold_cost = 50
		build_time = 300
		tax_income = 0.25
		ai_creation_factor = 109
		add_number_to_name = no

		extra_tech_building_start = 0.2
	}
	ca_roads_4 = {
		desc = "Stone streets are the foundation for any great city."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_roads_3
		gold_cost = 100
		build_time = 300
		tax_income = 0.25
		ai_creation_factor = 109
		add_number_to_name = no

		extra_tech_building_start = 0.2
	}
	ca_roads_5 = {
		desc = "Cobbeled Roads connect all the local towns to the castle."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_roads_4
		gold_cost = 100
		build_time = 600
		tax_income = 0.5
		ai_creation_factor = 109
		add_number_to_name = no

		extra_tech_building_start = 0.2
	}
	ca_roads_6 = {
		desc = "A road network to rival Rome."
		trigger = { TECH_CASTLE_CONSTRUCTION = 7 }
		upgrades_from = ca_roads_5
		gold_cost = 200
		build_time = 600
		tax_income = 0.5
		ai_creation_factor = 109
		add_number_to_name = no

		extra_tech_building_start = 0.2
	}
	ca_wall_q_1 = {
		desc = ca_wall_q_1_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 80
		
		extra_tech_building_start = 1.0
	}
	ca_wall_q_2 = {
		desc = ca_wall_q_2_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
		upgrades_from = ca_wall_q_1
		prerequisites = { ca_wall_1 }
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 79

		extra_tech_building_start = 1.4
	}
	ca_wall_q_3 = {
		desc = ca_wall_q_3_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
		upgrades_from = ca_wall_q_2
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 78
		
		extra_tech_building_start = 1.2
	}
	ca_wall_q_4 = {
		desc = ca_wall_q_4_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
		upgrades_from = ca_wall_q_3
		gold_cost = 100
		build_time = 365
		fort_level = 1.0
		ai_creation_factor = 77
		
		extra_tech_building_start = 0.8
	}
	ca_wall_q_5 = {
		desc = ca_wall_q_5_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 7 }
		upgrades_from = ca_wall_q_4
		gold_cost = 100
		build_time = 365
		fort_level = 1.0
		ai_creation_factor = 76

		extra_tech_building_start = 0.4
	}
	
	#Walls, gives fortlevel, levysize and income
	ca_wall_1 = {
		desc = ca_wall_1_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
		gold_cost = 50
		build_time = 365
		fort_level = 0.5
		levy_size = 0.025
		tax_income = 0.2
		ai_creation_factor = 90
		
		extra_tech_building_start = 1.0
	}
	ca_wall_2 = {
		desc = ca_wall_2_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
		upgrades_from = ca_wall_1
		gold_cost = 50
		build_time = 547 #1.5y
		fort_level = 0.5
		levy_size = 0.025
		tax_income = 0.2
		ai_creation_factor = 89
		
		extra_tech_building_start = 1.4
	}
	ca_wall_3 = {
		desc = ca_wall_3_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
		upgrades_from = ca_wall_2
		gold_cost = 100
		build_time = 730 #2y
		fort_level = 1.0
		levy_size = 0.05
		tax_income = 0.2
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_wall_4 = {
		desc = ca_wall_4_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 6 }
		upgrades_from = ca_wall_3
		gold_cost = 150
		build_time = 1095 #3y
		fort_level = 1.0
		levy_size = 0.05
		tax_income = 0.2
		ai_creation_factor = 87

		extra_tech_building_start = 0.8
	}
	ca_wall_5 = {
		desc = ca_wall_5_desc
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 8 }
		upgrades_from = ca_wall_4
		gold_cost = 150
		build_time = 1460 #4y
		fort_level = 1.5
		levy_size = 0.1
		tax_income = 0.5
		ai_creation_factor = 86

		extra_tech_building_start = 0.4
	}
	ca_con_wall_6 = { # Theodosian Walls
		potential = {
			FROMFROM = { title = b_constantinople }
		}
		desc = ca_con_wall_6_desc
		upgrades_from = ca_wall_5
		gold_cost = 150
		build_time = 1460 #4y
		fort_level = 6.0
		garrison_size = 1.00
		ai_creation_factor = 86

		extra_tech_building_start = 0.0
	}

	#Keeps, gives levy and garrison size
	ca_keep_1 = {
		desc = "A small hall for the local lord."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
		gold_cost = 150
		build_time = 547 #1.5y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 102
		
		extra_tech_building_start = 1.0
	}
	ca_keep_2 = {
		desc = "The hall has grown to include a kitchen and larger royal quarters."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 0 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_keep_1
		gold_cost = 200
		build_time = 730 #2y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 101

		extra_tech_building_start = 2.2
	}
	ca_keep_3 = {
		desc = "A large hall with a quality dining area and servant quarters."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_keep_2
		gold_cost = 300
		build_time = 1095 #3y
		levy_size = 0.1
		garrison_size = 0.1
		ai_creation_factor = 100
		
		extra_tech_building_start = 1.6
	}
	ca_keep_4 = {	
		desc = "A small stone keep has replaced the wooden hall."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
		upgrades_from = ca_keep_3
		gold_cost = 400
		build_time = 1460 #4y
		levy_size = 0.1
		garrison_size = 0.1
		ai_creation_factor = 99

		extra_tech_building_start = 1.0
	}
	ca_keep_5 = {
		desc = "A growing keep can muster even more local forces."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 6 }
		upgrades_from = ca_keep_4
		gold_cost = 500
		build_time = 2190 #6y
		levy_size = 0.15
		garrison_size = 0.15
		ai_creation_factor = 98

		extra_tech_building_start = 1.0
	}
	ca_keep_6 = {
		desc = "A vast keep at the center of a sprawling castle, the local lord must be immensley wealthy."
		trigger = { TECH_FORTIFICATIONS_CONSTRUCTION = 8 }
		upgrades_from = ca_keep_5
		gold_cost = 500
		build_time = 2190 #6y
		levy_size = 0.15
		garrison_size = 0.15
		ai_creation_factor = 97
		
		extra_tech_building_start = 0.2
	}
	
	# Militia barracks, gives light infantry and archers.
	ca_militia_barracks_1 = {
		desc = ca_militia_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 100
		build_time = 365
		light_infantry = 40
		archers = 20
		ai_creation_factor = 100
		
		extra_tech_building_start = 1.0
	}
	ca_militia_barracks_2 = {
		desc = ca_militia_barracks_2_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_militia_barracks_1
		gold_cost = 120
		build_time = 547
		light_infantry = 40
		archers = 40
		ai_creation_factor = 99

		extra_tech_building_start = 2.2
	}
	ca_militia_barracks_3 = {
		desc = ca_militia_barracks_3_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_militia_barracks_2
		gold_cost = 200
		build_time = 1095
		light_infantry = 20
		archers = 60
		ai_creation_factor = 98

		extra_tech_building_start = 1.2
	}
	ca_militia_barracks_4 = {
		desc = ca_militia_barracks_3_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 7 }
		upgrades_from = ca_militia_barracks_3
		gold_cost = 300
		build_time = 1095
		light_infantry = 20
		archers = 80
		ai_creation_factor = 98

		extra_tech_building_start = 0.5
	}

	#Training grounds, gives morale and reinforce rate
	ca_training_grounds_1 = {
		desc = ca_training_grounds_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_wall_2 }
		gold_cost = 200
		build_time = 730
		land_morale = 0.1
		levy_reinforce_rate = 0.1
		retinuesize = 20
		ai_creation_factor = 89

		extra_tech_building_start = 1.2
	}
	ca_training_grounds_2 = {
		desc = ca_training_grounds_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_training_grounds_1
		gold_cost = 250
		build_time = 1095
		land_morale = 0.15
		levy_reinforce_rate = 0.15
		retinuesize = 20
		ai_creation_factor = 88
		
		extra_tech_building_start = 1.0
	}
	ca_training_grounds_3 = {
		desc = ca_training_grounds_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_training_grounds_2
		gold_cost = 300
		build_time = 2190
		land_morale = 0.2
		levy_reinforce_rate = 0.2
		retinuesize = 20
		ai_creation_factor = 88
		
		extra_tech_building_start = 1.0
	}
	
	# Barracks, gives heavy infantry and pikemen
	ca_barracks_1 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 100
		build_time = 365
		heavy_infantry = 25
		ai_creation_factor = 105
		
		extra_tech_building_start = 0.2
	}
	ca_barracks_2 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_barracks_1
		gold_cost = 120
		build_time = 547
		heavy_infantry = 30
		ai_creation_factor = 104
		
		extra_tech_building_start = 2.2
	}
	ca_barracks_3 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_barracks_2
		gold_cost = 200
		build_time = 730
		heavy_infantry = 30
		pikemen = 10
		ai_creation_factor = 103

		extra_tech_building_start = 3.0
	}
	ca_barracks_4 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_barracks_3
		gold_cost = 300
		build_time = 1095
		heavy_infantry = 40
		pikemen = 20
		ai_creation_factor = 102

		extra_tech_building_start = 2.0
	}
	ca_barracks_5 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_barracks_4
		gold_cost = 400
		build_time = 2190
		heavy_infantry = 60
		pikemen = 30
		ai_creation_factor = 101

		extra_tech_building_start = 1.0
	}
	ca_barracks_6 = {
		desc = ca_barracks_1_desc
		trigger = { TECH_CASTLE_CONSTRUCTION = 7 }
		upgrades_from = ca_barracks_5
		gold_cost = 500
		build_time = 2190
		heavy_infantry = 40
		pikemen = 60
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_blacksmith_1 = {
		desc = "A local blacksmith produces a majority of the castle's weapons."
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_barracks_1 }
		gold_cost = 50
		build_time = 200
		heavy_infantry_offensive = 0.10
		light_infantry_offensive = 0.10
		pikemen_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_blacksmith_2 = {
		desc = "A few more blacksmiths and an increased iron supply has improved our weapon quality."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		prerequisites = { ca_barracks_2 }
		upgrades_from = ca_blacksmith_1
		gold_cost = 200
		build_time = 300
		heavy_infantry_offensive = 0.10
		light_infantry_offensive = 0.10
		pikemen_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_blacksmith_3 = {
		desc = "Steel is becoming more common and these blacksmiths are using it to improve our weapon quality."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		prerequisites = { ca_barracks_3 }
		upgrades_from = ca_blacksmith_2
		gold_cost = 400
		build_time = 600
		heavy_infantry_offensive = 0.10
		light_infantry_offensive = 0.10
		pikemen_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_shieldmaker_1 = {
		desc = "A humble shield maker's hut manufactures shields to protect your army from the enemy."
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_barracks_1 }
		gold_cost = 50
		build_time = 200
		heavy_infantry_defensive = 0.10
		light_infantry_defensive = 0.10
		pikemen_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_shieldmaker_2 = {
		desc = "The adoption of the kite shield has increased our defensive capabilities."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		prerequisites = { ca_barracks_2 }
		upgrades_from = ca_shieldmaker_1
		gold_cost = 200
		build_time = 300
		heavy_infantry_defensive = 0.10
		light_infantry_defensive = 0.10
		pikemen_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_shieldmaker_3 = {
		desc = "Incorporating metal into wooden and leather shields has increased our shield's effectiveness."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		prerequisites = { ca_barracks_3 }
		upgrades_from = ca_shieldmaker_2
		gold_cost = 400
		build_time = 600
		heavy_infantry_defensive = 0.10
		light_infantry_defensive = 0.10
		pikemen_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_spearmaker_1 = {
		desc = "A humble spear maker's hut manufactures spears for your army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_barracks_1 }
		gold_cost = 20
		build_time = 200
		light_infantry = 60
		light_infantry_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 1
	}
	ca_spearmaker_2 = {
		desc = "More spears will be needed for a growing army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_barracks_2 }
		upgrades_from = ca_spearmaker_1
		gold_cost = 100
		build_time = 200
		light_infantry = 80
		light_infantry_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 1.2
	}
	ca_spearmaker_3 = {
		desc = "More advanced spear making techniques have led to superior pike formations."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		prerequisites = { ca_barracks_3 }
		upgrades_from = ca_spearmaker_2
		gold_cost = 200
		build_time = 300
		light_infantry = -100
		pikemen = 60
		pikemen_defensive = 0.20
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_spearmaker_4 = {
		desc = "The pike maker's hut has evolved into a pike making workshop."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		prerequisites = { ca_barracks_4 }
		upgrades_from = ca_spearmaker_3
		gold_cost = 300
		build_time = 500
		pikemen = 80
		pikemen_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_spearmaker_5 = {
		desc = "The pike has become the dominant weapon on the battlefield of Europe and our military must reflect that."
		trigger = { TECH_CASTLE_CONSTRUCTION = 7 }
		prerequisites = { ca_spearmaker_4 }
		prerequisites = { ca_axemaker_4 }
		gold_cost = 500
		build_time = 600
		pikemen = 200
		light_infantry = -200
		pikemen_defensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_axemaker_1 = {
		desc = "An axe maker's hut produces weapons of agression for your army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_barracks_1 }
		gold_cost = 20
		build_time = 300
		light_infantry = -20
		heavy_infantry = 20
		heavy_infantry_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 1
	}
	ca_axemaker_2 = {
		desc = "More axes will be needed for a growing army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_barracks_2 }
		upgrades_from = ca_axemaker_1
		gold_cost = 100
		build_time = 300
		heavy_infantry = 25
		light_infantry = -25
		heavy_infantry_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 1.2
	}
	ca_axemaker_3 = {
		desc = "More advanced axe making techniques have led to the introduction of battleaxes."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		prerequisites = { ca_barracks_3 }
		upgrades_from = ca_axemaker_2
		gold_cost = 200
		build_time = 300
		light_infantry = -30
		heavy_infantry = 30
		heavy_infantry_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_axemaker_4 = {
		desc = "The axe maker's hut has evolved into a axe making workshop."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		prerequisites = { ca_barracks_4 }
		upgrades_from = ca_axemaker_3
		gold_cost = 300
		build_time = 500
		heavy_infantry = 40
		heavy_infantry_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_bowmaker_1 = {
		desc = "A humble bow maker's hut manufactures bows and arrows for your army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_militia_barracks_1 }
		gold_cost = 20
		build_time = 300
		archers = 40
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_bowmaker_2 = {
		desc = "More bows will be needed for a growing army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		upgrades_from = ca_bowmaker_1
		prerequisites = { ca_militia_barracks_2 }
		gold_cost = 100
		build_time = 300
		archers = 60
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_bowpractice_1 = {
		desc = "A good archer will need a good range."
		trigger = { TECH_CASTLE_CONSTRUCTION = 1 }
		prerequisites = { ca_bowmaker_2 }
		gold_cost = 200
		build_time = 300
		archers = 20
		archers_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_bowpractice_2 = {
		desc = "A larger range for more men."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		upgrades_from = ca_bowpractice_1
		gold_cost = 300
		build_time = 500
		archers = 20
		archers_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_bowpractice_3 = {
		desc = "An entire field is dedicated to this castles archers."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_bowpractice_2
		gold_cost = 300
		build_time = 500
		archers = 30
		archers_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_crossbowmaker_1 = {
		desc = "A crossbow maker has appeared, its ease of use has rapidly increased the amount of archers in your army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 3 }
		prerequisites = { ca_bowmaker_2 }
		gold_cost = 200
		build_time = 300
		archers = 100
		ai_creation_factor = 100
		archers_offensive = -0.10

		extra_tech_building_start = 0.2
	}
	ca_crossbowmaker_2 = {
		desc = "A crossbow workshop is revolutionizing how peasants join the army."
		trigger = { TECH_CASTLE_CONSTRUCTION = 5 }
		upgrades_from = ca_crossbowmaker_1
		gold_cost = 500
		build_time = 600
		archers = 200
		archers_offensive = -0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	#Stable, gives light cavalry and some heavy cavalry
	ca_stable_1 = {
		desc = "A small stable for the lord's horses."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 50
		build_time = 200
		light_cavalry = 20
		ai_creation_factor = 89
		
		extra_tech_building_start = 0.8
	}
	ca_stable_2 = {
		desc = "A few more stalls for a growing cavalry force."
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_stable_1
		gold_cost = 100
		build_time = 400
		light_cavalry = 25
		ai_creation_factor = 88

		extra_tech_building_start = 2.2
	}
	ca_stable_3 = {
		desc = "A decent sized stable occupies an entire section of the castle."
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_stable_2
		gold_cost = 200
		build_time = 500
		light_cavalry = 30
		ai_creation_factor = 87

		extra_tech_building_start = 1.6
	}
	ca_stable_4 = {
		desc = "With growing Medieval armies comes growing cavalry forces."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_stable_3
		gold_cost = 300
		build_time = 600
		light_cavalry = 40
		ai_creation_factor = 86

		extra_tech_building_start = 1.2
	}
	ca_stable_5 = {
		desc = "A large stable with all the horses and waste expected of a large stable."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_stable_4
		gold_cost = 400
		build_time = 700
		light_cavalry = 50
		ai_creation_factor = 85

		extra_tech_building_start = 0.8
	}
	ca_stable_6 = {
		desc = "The demand for more horses has led to the creation of a manor size stable."
		trigger = { TECH_CASTLE_CONSTRUCTION = 8 }
		upgrades_from = ca_stable_5
		gold_cost = 500
		build_time = 800
		light_cavalry = 60
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}

	ca_heavystable_1 = {
		desc = "These knight's represent the best this lord has to offer."
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_stable_2 }
		gold_cost = 200
		build_time = 500
		knights = 10
		ai_creation_factor = 87

		extra_tech_building_start = 1.6
	}
	ca_heavystable_2 = {
		desc = "With more war comes more knights, or is it the other way around."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_heavystable_1
		gold_cost = 300
		build_time = 600
		knights = 15
		ai_creation_factor = 86

		extra_tech_building_start = 1.2
	}
	ca_heavystable_3 = {
		desc = "Heavy cavalry is slowly replacing light cavalry in importance on the battlefield, as powerful charges turn the tide of more and more battles."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_heavystable_2
		gold_cost = 400
		build_time = 700
		knights = 20
		ai_creation_factor = 85

		extra_tech_building_start = 0.8
	}
	ca_heavystable_4 = {
		desc = "Knights and their steeds are the greatest representation of valor in the Medieval period, these knights at least cost as much."
		trigger = { TECH_CASTLE_CONSTRUCTION = 8 }
		upgrades_from = ca_heavystable_3
		gold_cost = 500
		build_time = 800
		knights = 40
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}
	ca_horsepractice_1 = {
		desc = "A horse trainer is improving the quality of our calvary."
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_stable_2 }
		gold_cost = 200
		build_time = 300
		light_cavalry_offensive = 0.10
		knights_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_horsepractice_2 = {
		desc = "Horse breeding is improving the power of our horses."
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_horsepractice_1
		prerequisites = { ca_heavystable_1 }
		prerequisites = { ca_stable_3 }
		gold_cost = 300
		build_time = 500
		light_cavalry_offensive = 0.10
		knights_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	ca_horsepractice_3 = {
		desc = "Armies will need constant access to horses."
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_horsepractice_2
		prerequisites = { ca_heavystable_3 }
		prerequisites = { ca_stable_5 }
		gold_cost = 500
		build_time = 700
		light_cavalry_offensive = 0.10
		knights_offensive = 0.10
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	
	
	ca_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = { TECH_NAVAL = 1 }
		gold_cost = 100
		build_time = 365
		galleys = 6
		ai_creation_factor = 100
		
		extra_tech_building_start = 0.3
	}
	
	ca_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = { TECH_NAVAL = 2 }
		upgrades_from = ca_shipyard_1
		gold_cost = 100
		build_time = 730
		galleys = 7
		ai_creation_factor = 99
		
		extra_tech_building_start = 0.3
	}
	
	ca_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = { TECH_NAVAL = 3 }
		upgrades_from = ca_shipyard_2
		gold_cost = 100
		build_time = 1095
		galleys = 8
		ai_creation_factor = 98
		
		extra_tech_building_start = 0.3
	}
	
	ca_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = { TECH_NAVAL = 4 }
		upgrades_from = ca_shipyard_3
		gold_cost = 100
		build_time = 1460
		galleys = 9
		ai_creation_factor = 97
		
		extra_tech_building_start = 0.3
	}

	#Castellan Bloodline buildings.
	ca_special_fortifications_1 = { #Insulated Sections
		desc = ca_special_fortifications_1_desc
		potential = { 
			OR = {
				FROMFROM = { has_building = ca_special_fortifications_1 } #Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROM = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_castellan 
					}
				}
				FROM = {
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_castellan 
						}	
					}
				}
			}
		}
		trigger = { 
			TECH_FORTIFICATIONS_CONSTRUCTION = 1 
			custom_tooltip = {
				text = tooltip_has_castellan_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_castellan 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_castellan 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}

		gold_cost = 125
		build_time = 365
		fort_level = 0.5
		land_morale = 0.05
		
		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_2 = { #Killing Fields
		desc = ca_special_fortifications_2_desc
		trigger = { 
			TECH_FORTIFICATIONS_CONSTRUCTION = 3
			custom_tooltip = {
				text = tooltip_has_castellan_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_castellan 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_castellan 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_special_fortifications_1
		gold_cost = 250
		build_time = 560
		fort_level = 1
		land_morale = 0.05
		garrison_size = 0.05

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_3 = { #Extended Machicolations
		desc = ca_special_fortifications_3_desc
		trigger = { 
			TECH_FORTIFICATIONS_CONSTRUCTION = 5
			custom_tooltip = {
				text = tooltip_has_castellan_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_castellan 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_castellan 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_special_fortifications_2
		gold_cost = 450
		build_time = 760
		fort_level = 1.5
		garrison_size = 0.15
		archers = 50

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_special_fortifications_4 = { #Reinforced Barbican
		desc = ca_special_fortifications_4_desc
		trigger = { 
			TECH_FORTIFICATIONS_CONSTRUCTION = 7
			custom_tooltip = {
				text = tooltip_has_castellan_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_castellan 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_castellan 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_special_fortifications_3
		gold_cost = 750
		build_time = 1250
		fort_level = 2
		levy_size = 0.2
		garrison_size = 0.3
		light_infantry = 100

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}

	#Murder Builder Bloodline buildings.
	ca_oppressive_fortifications_1 = { #Gloomy Monument
		desc = ca_oppressive_fortifications_1_desc
		potential = { 
			OR = {
				FROMFROM = { has_building = ca_oppressive_fortifications_1 } #Show the building only if it has been already built or if the owner has the proper bloodline to build it.
				FROM = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_blood_building 
					}
				}
				FROM = {
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_blood_building 
						}	
					}
				}
			}
		}
		trigger = { 
			TECH_CASTLE_CONSTRUCTION = 2 
			custom_tooltip = {
				text = tooltip_has_murder_builder_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_blood_building 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_blood_building 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}

		gold_cost = 125
		build_time = 365
		local_revolt_risk = -0.05
		liege_prestige = 0.05
		
		add_number_to_name = no

		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_2 = { #Connected Watchtowers
		desc = ca_oppressive_fortifications_2_desc
		trigger = { 
			TECH_CASTLE_CONSTRUCTION = 4
			custom_tooltip = {
				text = tooltip_has_murder_builder_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_blood_building 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_blood_building 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_oppressive_fortifications_1
		gold_cost = 250
		build_time = 560
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_3 = { #Lonely Spire
		desc = ca_oppressive_fortifications_3_desc
		trigger = { 
			TECH_CASTLE_CONSTRUCTION = 6
			custom_tooltip = {
				text = tooltip_has_murder_builder_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_blood_building 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_blood_building 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_oppressive_fortifications_2
		gold_cost = 300
		build_time = 560
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_oppressive_fortifications_4 = { #Palace of Justice
		desc = ca_oppressive_fortifications_4_desc
		trigger = { 
			TECH_CASTLE_CONSTRUCTION = 8
			custom_tooltip = {
				text = tooltip_has_murder_builder_bloodline
				hidden_tooltip = {
					OR = {
						FROM = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_blood_building 
							}
						}
						FROM = {
							any_liege = {
								any_owned_bloodline = {
									has_bloodline_flag = bloodline_blood_building 
								}	
							}
						}
					}
				}
			}
		}
		is_active_trigger = {
			FROM = {
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		upgrades_from = ca_oppressive_fortifications_3
		gold_cost = 450
		build_time = 760
		fort_level = 1
		local_revolt_risk = -0.05
		garrison_size = 0.05

		add_number_to_name = no
		
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
}
