#scmr_build_castle_tech	按科技建造城堡建筑
#scmr_build_temple_tech	按科技建造寺庙建筑
#scmr_build_city_tech	按科技建造城市建筑
#scmr_build_tb_tech		按科技建造部落建筑
#scmr_build_nd_tech		按科技建造游牧建筑
#scmr_build_hp_tech		按科技建造医院建筑
#scmr_build_tr_tech		按科技建造贸易站建筑	


scmr_build_castle_tech = {
	if = {
		limit = {
			not = {
				has_building = ca_wall_q_1
			}
		}
		add_building = ca_wall_q_1
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_q_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 1
			}
		}
		add_building = ca_wall_q_2
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_q_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 3
			}
		}
		add_building = ca_wall_q_3
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_q_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 5
			}
		}
		add_building = ca_wall_q_4
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_q_5
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 7
			}
		}
		add_building = ca_wall_q_5
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_1
			}
		}
		add_building = ca_wall_1
	}
	if = {
		limit = {
			not = {
				has_building = ca_wall_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = ca_wall_2
	}
					if = {
	limit = {
		not = {
			has_building = ca_wall_3
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
		}
	}
	add_building = ca_wall_3
					}
					if = {
	limit = {
		not = {
			has_building = ca_wall_4
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
		}
	}
	add_building = ca_wall_4
					}
					if = {
	limit = {
		not = {
			has_building = ca_wall_5
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
		}
	}
	add_building = ca_wall_5
					}
					
					if = {
	limit = {
		not = {
			has_building = ca_keep_1
		}
	}
	add_building = ca_keep_1
					}
					if = {
	limit = {
		not = {
			has_building = ca_keep_2
		}
	}
	add_building = ca_keep_2
					}
					if = {
	limit = {
		not = {
			has_building = ca_keep_3
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
	}
	add_building = ca_keep_3
					}
					if = {
	limit = {
		not = {
			has_building = ca_keep_4
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
		}
	}
	add_building = ca_keep_4
					}
					if = {
	limit = {
		not = {
			has_building = ca_keep_5
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
		}
	}
	add_building = ca_keep_5
					}
					if = {
	limit = {
		not = {
			has_building = ca_keep_6
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
		}
	}
	add_building = ca_keep_6
					}
					if = {
	limit = {
		not = {
			has_building = ca_militia_barracks_1
		}
	}
	add_building = ca_militia_barracks_1
					}
					if = {
	limit = {
		not = {
			has_building = ca_militia_barracks_2
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 1
		}
	}
	add_building = ca_militia_barracks_2
					}
					if = {
	limit = {
		not = {
			has_building = ca_militia_barracks_3
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 5
		}
	}
	add_building = ca_militia_barracks_3
					}
					if = {
	limit = {
		not = {
			has_building = ca_militia_barracks_4
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 7
		}
	}
	add_building = ca_militia_barracks_4
					}
					if = {
	limit = {
		not = {
			has_building = ca_training_grounds_1
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_training_grounds_1
					}
					if = {
	limit = {
		not = {
			has_building = ca_training_grounds_2
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 3
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_training_grounds_2
					}
					if = {
	limit = {
		not = {
			has_building = ca_training_grounds_3
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 6
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_training_grounds_3
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_1
		}
	}
	add_building = ca_town_1
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_2
		}
	}
	add_building = ca_town_2
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_3
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 2
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_town_3
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_4
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 4
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_town_4
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_5
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 6
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_town_5
					}
					if = {
	limit = {
		not = {
			has_building = ca_town_6
		}
		location = {
			TECH_CASTLE_CONSTRUCTION = 8
		}
		or = {
			has_building = ca_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ca_town_6
					}
					if = {
	limit =
	{
		location = {
			terrain = steppe
		}
		holder_scope = {
			or = {
				culture_group = altaic
				culture_group = magyar
				culture = alan
				culture_group = iranian
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_1
			}
		}
		add_building = ca_steppe_barracks_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_2
			}
		}
		add_building = ca_steppe_barracks_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_barracks_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_4
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_barracks_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_5
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_barracks_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_6
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 5
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_barracks_6
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_1
			}
		}
		add_building = ca_steppe_stable_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_2
			}
		}
		add_building = ca_steppe_stable_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_3
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_stable_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_4
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_stable_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_5
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 6
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_stable_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_6
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 8
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_steppe_stable_6
	}
	}
	if = {
		limit = {
			location = {
				terrain = desert
			}
			holder_scope = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
				}
			}
		}
		if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_1
			}
		}
		add_building = ca_desert_stable_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_2
			}
		}
		add_building = ca_desert_stable_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_3
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_desert_stable_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_4
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_desert_stable_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_5
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 6
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_desert_stable_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_desert_stable_6
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 8
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_desert_stable_6
	}
		
	}
					if = {
	limit =
	{
		or = {
			not = {
				location =
				{
					terrain = steppe
				}
			}
			and = {
				not = 
				{
					holder_scope = {
						culture_group = altaic
					}
				}
				not =
				{
					holder_scope = {
						culture_group = magyar
					}
				}
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_1
				has_building = ca_barracks_1
			}
		}
		add_building = ca_barracks_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_2
				has_building = ca_barracks_2
			}
		}
		add_building = ca_barracks_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_3
				has_building = ca_barracks_3
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_barracks_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_4
				has_building = ca_barracks_4
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_barracks_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_5
				has_building = ca_barracks_5
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 5
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_barracks_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_barracks_6
				has_building = ca_barracks_6
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 7
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_barracks_6
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_1
				has_building = ca_desert_stable_1
				has_building = ca_stable_1
			}
		}
		add_building = ca_stable_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_2
				has_building = ca_desert_stable_2
				has_building = ca_stable_2
			}
		}
		add_building = ca_stable_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_3
				has_building = ca_desert_stable_3
				has_building = ca_stable_3
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_stable_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_4
				has_building = ca_desert_stable_4
				has_building = ca_stable_4
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_stable_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_5
				has_building = ca_desert_stable_5
				has_building = ca_stable_5
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 6
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_stable_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_steppe_stable_6
				has_building = ca_desert_stable_6
				has_building = ca_stable_6
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 8
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_stable_6
	}
					}
					if = {
	limit =
	{
		location = {
			port = yes
		}
	}
	if = {
		limit = {
			not = {
				has_building = ca_shipyard_1
			}
			location = {
				TECH_NAVAL = 1
			}
		}
		add_building = ca_shipyard_1
	}
	if = {
		limit = {
			not = {
				has_building = ca_shipyard_2
			}
			location = {
				TECH_NAVAL = 2
			}
		}
		add_building = ca_shipyard_2
	}
	if = {
		limit = {
			not = {
				has_building = ca_shipyard_3
			}
			location = {
				TECH_NAVAL = 3
			}
		}
		add_building = ca_shipyard_3
	}
	if = {
		limit = {
			not = {
				has_building = ca_shipyard_4
			}
			location = {
				TECH_NAVAL = 4
			}
		}
		add_building = ca_shipyard_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = english
				culture = welsh
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_saxon_english_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}			
		}
		add_building = ca_culture_saxon_english_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_saxon_english_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_saxon_english_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_saxon_english_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_saxon_english_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_saxon_english_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_saxon_english_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = scottish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_scottish_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_scottish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_scottish_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_scottish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_scottish_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_scottish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_scottish_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_scottish_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = baltic
				culture_group = finno_ugric
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_baltic_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_baltic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_baltic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_baltic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_baltic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_baltic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_baltic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_baltic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = altaic
				culture_group = iranian
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_altaic_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_altaic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_altaic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_altaic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_altaic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_altaic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_altaic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_altaic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = frankish
				culture = occitan
				culture = norman
				culture = german
				culture = breton
				culture = outremer
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_frank_norman_german_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_frank_norman_german_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_frank_norman_german_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_frank_norman_german_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_frank_norman_german_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_frank_norman_german_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_frank_norman_german_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_frank_norman_german_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = iberian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_iberian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_iberian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_iberian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_iberian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_iberian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_iberian_3
	}
	if = {
		limit = {
			not = {
				has_building = ca_culture_group_iberian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_iberian_4
	}
	}
	if = {
		limit = {
			location = {
				OR = { 
					culture = italian 
					culture = dalmatian
				}
			}
		}
	if = {
		limit = {
			not = {
				has_building = ca_culture_italian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_italian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_italian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_italian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_italian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_italian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_italian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_italian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = east_slavic
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_russian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_russian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_russian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_russian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_russian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_russian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_russian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_russian_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = north_germanic
				culture = saxon
				culture = old_saxon
				culture = frisian
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_north_germanic_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_north_germanic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_north_germanic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_north_germanic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_north_germanic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_north_germanic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_north_germanic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_north_germanic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = hungarian
				culture_group = west_slavic
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_hungarian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_hungarian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_hungarian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_hungarian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_hungarian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_hungarian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_hungarian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_hungarian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = arabic
			not = {
				culture = andalusian_arabic
				culture = maghreb_arabic
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_arabic_1					
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_arabic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_arabic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_arabic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_arabic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_arabic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_arabic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_arabic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = byzantine
			NOT = { culture = coptic }
			NOT = { culture = arberian }
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_byzantine_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_byzantine_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_byzantine_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_byzantine_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_byzantine_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_byzantine_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_byzantine_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_byzantine_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = irish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_irish_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_irish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_irish_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_irish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_irish_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_irish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_irish_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_irish_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = ethiopian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_ethiopian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_ethiopian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_ethiopian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_ethiopian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_ethiopian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_ethiopian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_ethiopian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_ethiopian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = somali
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_somali_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_somali_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_somali_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_somali_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_somali_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_somali_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_somali_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_somali_4
	}
					}
	if = {
		limit = {
			location = {
				OR = {
					culture_group = west_african 
					culture_group = central_african
					culture = daju
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_west_african_1
				}
				or = {
					has_building = ca_wall_2
					location =
					{
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
			}
			add_building = ca_culture_west_african_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_west_african_2
				}
				or = {
					has_building = ca_wall_2
					location =
					{
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_west_african_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_west_african_3
				}
				or = {
					has_building = ca_wall_2
					location =
					{
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_west_african_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_west_african_4
				}
				or = {
					has_building = ca_wall_2
					location =
					{
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_west_african_4
		}
	}
	if = {
	limit =
	{
		location = {
			culture_group = south_slavic
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_south_slavic_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_group_south_slavic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_south_slavic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_group_south_slavic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_south_slavic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_group_south_slavic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_group_south_slavic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_group_south_slavic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = dutch
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_dutch_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_dutch_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_dutch_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_dutch_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_dutch_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_dutch_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_dutch_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_dutch_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = nahuatl
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nahuatl_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_nahuatl_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nahuatl_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_nahuatl_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nahuatl_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_nahuatl_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nahuatl_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_nahuatl_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = israelite
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_jewish_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_jewish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_jewish_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_jewish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_jewish_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_jewish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_jewish_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_jewish_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = indo_aryan_group
				culture_group = dravidian_group
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_indian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_indian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_indian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_indian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_indian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_indian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_indian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_indian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = nubian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nubian_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_nubian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nubian_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_nubian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nubian_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_nubian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_nubian_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_nubian_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = lombard
				culture = old_frankish
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_germanic_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_germanic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_germanic_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_germanic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_germanic_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_germanic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_germanic_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_germanic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = pictish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_pictish_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_pictish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_pictish_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_pictish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_pictish_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_pictish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_pictish_4
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_pictish_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = suebi
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_suebi_1
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ca_culture_suebi_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_suebi_2
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = ca_culture_suebi_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ca_culture_suebi_3
			}
			or = {
				has_building = ca_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = ca_culture_suebi_3
	}
	if = {
		limit = {
			not = {
				has_building = ca_culture_suebi_4
			}
			or = {
				has_building = ca_wall_2
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			location = {
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = ca_culture_suebi_4
	}
	}
	if = {
		limit = {
			location = {
				or = {
					culture = andalusian_arabic
					culture = maghreb_arabic
				}
			}
		}
		if = {
			limit = {
				not =
				{
					has_building = ca_culture_moors_1
				}
				or =
				{
					has_building = ca_wall_2
					location = {
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
			}
			add_building = ca_culture_moors_1
		}
		if = {
			limit = {
				not =
				{
					has_building = ca_culture_moors_2
				}
				or =
				{
					has_building = ca_wall_2
					location = {
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location =
				{
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_moors_2
		}
		if = {
			limit = {
				not =
				{
					has_building = ca_culture_moors_3
				}
				or =
				{
					has_building = ca_wall_2
					location = {
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location =
				{
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_moors_3
		}
		if = {
			limit = {
				not =
				{
					has_building = ca_culture_moors_4
				}
				or =
				{
					has_building = ca_wall_2
					location = {
						TECH_FORTIFICATIONS_CONSTRUCTION = 2
					}
				}
				location =
				{
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_moors_4
		}
	}
					
	if = {
		limit = {
			location = {
				culture = han
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = ca_culture_chinese_han_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = ca_culture_chinese_han_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_chinese_han_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = ca_culture_chinese_han_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_chinese_han_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = ca_culture_chinese_han_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_chinese_han_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = ca_culture_chinese_han_4
		}
					
	}
					
	if = {
		limit = {
			location = {
				culture = jurchen
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = ca_culture_altaic_jurchen_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = ca_culture_altaic_jurchen_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_altaic_jurchen_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = ca_culture_altaic_jurchen_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_altaic_jurchen_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = ca_culture_altaic_jurchen_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_altaic_jurchen_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = ca_culture_altaic_jurchen_4
		}
					
	}
					
	if = {
		limit = {
			location = {
				culture_group = tibetan_group
			}
		}
	
		if = {
			limit = {
				not = {
					has_building = ca_culture_tibetan_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = ca_culture_tibetan_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_tibetan_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = ca_culture_tibetan_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_tibetan_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = ca_culture_tibetan_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_tibetan_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = ca_culture_tibetan_4
		}
					
	}
	
	if = {
		limit = {
			location = {
				culture = roman
			}
		}	
		if = {
			limit = {
				not = {
					has_building = ca_culture_roman_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = ca_culture_roman_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_roman_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = ca_culture_roman_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_roman_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = ca_culture_roman_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_roman_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = ca_culture_roman_4
		}
	}	
					
	if = {
		limit = {
			holder_scope = {
				government = theocratic_feudal_government
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = ca_government_monastery_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = ca_government_monastery_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_government_monastery_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = ca_government_monastery_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_government_monastery_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = ca_government_monastery_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_government_monastery_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = ca_government_monastery_4
		}
					
	}
					
	if = {
		limit = {
			location = {
				or = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_1
				}
				location = {
					terrain = steppe
				}
			}
			add_building = ca_steppe_barracks_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_2
				}
				has_building = ca_wall_1
				location = {
					terrain = steppe
				}
			}
			add_building = ca_steppe_barracks_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_3
				}
				has_building = ca_wall_2
				location = {
					terrain = steppe
				}
			}
			add_building = ca_steppe_barracks_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_4
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_steppe_barracks_4
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_5
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 3
				}
			}
			add_building = ca_steppe_barracks_5
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_barracks_6
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 5
				}
			}
			add_building = ca_steppe_barracks_6
		}
	}
					
	if = {
		limit = {
			location = {
				or = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_1
				}
				location = {
					terrain = steppe
				}
			}
			add_building = ca_steppe_stable_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_2
				}
				has_building = ca_wall_1
				location = {
					terrain = steppe
				}
			}
			add_building = ca_steppe_stable_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_3
				}
				has_building = ca_wall_2
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_steppe_stable_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_4
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_steppe_stable_4
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_5
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 6
				}
			}
			add_building = ca_steppe_stable_5
		}
		if = {
			limit = {
				not = {
					has_building = ca_steppe_stable_6
				}
				location = {
					terrain = steppe
					TECH_CASTLE_CONSTRUCTION = 8
				}
			}
			add_building = ca_steppe_stable_6
		}
	}
					
	if = {
		limit = {
			location = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_1
				}
				location = {
					terrain = desert
				}
			}
			add_building = ca_desert_stable_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_2
				}
				has_building = ca_wall_1
				location = {
					terrain = desert
				}
			}
			add_building = ca_desert_stable_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_3
				}
				has_building = ca_wall_2
				location = {
					terrain = desert
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_desert_stable_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_4
				}
				location = {
					terrain = desert
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_desert_stable_4
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_5
				}
				location = {
					terrain = desert
					TECH_CASTLE_CONSTRUCTION = 6
				}
			}
			add_building = ca_desert_stable_5
		}
		if = {
			limit = {
				not = {
					has_building = ca_desert_stable_6
				}
				location = {
					terrain = desert
					TECH_CASTLE_CONSTRUCTION = 8
				}
			}
			add_building = ca_desert_stable_6
		}
	}
	#Holy Fury
	if = {
		limit = {
			location = {
				culture = coptic
			}
			holder_scope = {
				culture = coptic
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_coptic_1
				}
				has_building = ca_wall_2
			}
			add_building = ca_culture_coptic_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_coptic_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_coptic_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_coptic_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_coptic_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_coptic_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_coptic_4
		}
	}
	
	if = {
		limit = {
			location = {
				OR = { 
					culture_group = horse_group 
					culture_group = cat_group 
					culture_group = bear_group 
					culture_group = hedgehog_group 
					culture_group = duck_group 
					culture_group = dog_group 
					culture_group = elephant_group 
					culture_group = dragon_group 
				}
			}
			holder_scope = {
				OR = { 
					culture_group = horse_group 
					culture_group = cat_group 
					culture_group = bear_group 
					culture_group = hedgehog_group 
					culture_group = duck_group 
					culture_group = dog_group 
					culture_group = elephant_group 
					culture_group = dragon_group 
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_animal_1
				}
				has_building = ca_wall_2
			}
			add_building = ca_culture_animal_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_animal_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_animal_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_animal_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_animal_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_animal_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_animal_4
		}
	}
	
	if = {
		limit = {
			location = {
				culture = arberian
			}
			holder_scope = {
				culture = arberian
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_arberian_1
				}
				has_building = ca_wall_2
			}
			add_building = ca_culture_arberian_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_arberian_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_arberian_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_arberian_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_arberian_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_arberian_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_arberian_4
		}
	}
	
	#new patch
	if = {
		limit = {
			location = {
				culture = sardinian
			}
			holder_scope = {
				culture = sardinian
			}
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_sardinian_1
				}
				has_building = ca_wall_2
			}
			add_building = ca_culture_sardinian_1
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_sardinian_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = ca_culture_sardinian_2
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_sardinian_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = ca_culture_sardinian_3
		}
		if = {
			limit = {
				not = {
					has_building = ca_culture_sardinian_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = ca_culture_sardinian_4
		}
	}
	
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_blood_building 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_blood_building 
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		if = {
			limit = {
				location = { TECH_CASTLE_CONSTRUCTION = 2 }
			}
			add_building = ca_oppressive_fortifications_1
		}
		if = {
			limit = {
				location = { TECH_CASTLE_CONSTRUCTION = 4 }
			}
			add_building = ca_oppressive_fortifications_2
		}
		if = {
			limit = {
				location = { TECH_CASTLE_CONSTRUCTION = 6 }
			}
			add_building = ca_oppressive_fortifications_3
		}
		if = {
			limit = {
				location = { TECH_CASTLE_CONSTRUCTION = 8 }
			}
			add_building = ca_oppressive_fortifications_4
		}
	}
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_castellan 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_castellan 
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		if = {
			limit = {
				location = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
			}
			add_building = ca_special_fortifications_1
		}
		if = {
			limit = {
				location = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
			}
			add_building = ca_special_fortifications_2
		}
		if = {
			limit = {
				location = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
			}
			add_building = ca_special_fortifications_3
		}
		if = {
			limit = {
				location = { TECH_FORTIFICATIONS_CONSTRUCTION = 7 }
			}
			add_building = ca_special_fortifications_4
		}
	}	
	
	refill_holding_levy = yes
}

scmr_build_temple_tech = {
	if = {
			limit = {
				not =
				{
		has_building = tp_wall_q_1
				}
			}
			add_building = tp_wall_q_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_q_2
				}
				or =
				{
		and = {
			has_building = tp_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 1
			}
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_wall_q_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_q_3
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 3
				}
			}
			add_building = tp_wall_q_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_q_4
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 5
				}
			}
			add_building = tp_wall_q_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_q_5
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 7
				}
			}
			add_building = tp_wall_q_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_1
				}
			}
			add_building = tp_wall_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_2
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			add_building = tp_wall_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_3
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 4
				}
			}
			add_building = tp_wall_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_4
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 6
				}
			}
			add_building = tp_wall_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_wall_5
				}
				location =
				{
		TECH_FORTIFICATIONS_CONSTRUCTION = 8
				}
			}
			add_building = tp_wall_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_1
				}
			}
			add_building = tp_monastery_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_2
				}
			}
			add_building = tp_monastery_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_3
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 2
				}
			}
			add_building = tp_monastery_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_4
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 4
				}
			}
			add_building = tp_monastery_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_5
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 6
				}
			}
			add_building = tp_monastery_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_monastery_6
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 8
				}
			}
			add_building = tp_monastery_6
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_1
				}
			}
			add_building = tp_barracks_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_2
				}
			}
			add_building = tp_barracks_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_3
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 1
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_barracks_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_4
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 3
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_barracks_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_5
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 5
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_barracks_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_barracks_6
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 7
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_barracks_6
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_1
				}
			}
			add_building = tp_elite_barracks_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_2
				}
			}
			add_building = tp_elite_barracks_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_3
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 2
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_elite_barracks_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_4
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 4
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_elite_barracks_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_5
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 6
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_elite_barracks_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_elite_barracks_6
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 8
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_elite_barracks_6
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_1
				}
			}
			add_building = tp_town_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_2
				}
			}
			add_building = tp_town_2
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_3
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 1
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_town_3
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_4
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 3
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_town_4
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_5
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 5
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_town_5
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_town_6
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 7
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_town_6
		}
		if = {
			limit = {
				location =
				{
		port = yes
				}
			}
			if = {
				limit = 
				{
		not = {
			has_building = tp_shipyard_1
		}
		location = {
			TECH_NAVAL = 1
		}
				}
				add_building = tp_shipyard_1
			}
			if = {
				limit = 
				{
		not = {
			has_building = tp_shipyard_2
		}
		location = {
			TECH_NAVAL = 2
		}
				}
				add_building = tp_shipyard_2
			}
			if = {
				limit = 
				{
		not = {
			has_building = tp_shipyard_3
		}
		location = {
			TECH_NAVAL = 3
		}
				}
				add_building = tp_shipyard_3
			}
			if = {
				limit = 
				{
		not = {
			has_building = tp_shipyard_4
		}
		location = {
			TECH_NAVAL = 4
		}
				}
				add_building = tp_shipyard_4
			}
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_school_1
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 3
				}
			}
			add_building = tp_school_1
		}
		if = {
			limit = {
				not =
				{
		has_building = tp_school_2
				}
				location =
				{
		TECH_CITY_CONSTRUCTION = 6
				}
				or =
				{
		has_building = tp_wall_2
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
				}
			}
			add_building = tp_school_2
		}
		#new addon
		if = {
			limit = {
				holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
					religion = norse_pagan
					liege = { 
						religion = norse_pagan
					} 
				}
			}
			add_building = tp_great_pillar_norse
		}
		#Holy Fury
		if = {
			limit = {
				holder_scope = {
					OR = {  
						religion = hellenic_pagan
						religion = hellenic_pagan_reformed
					}
				}	
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_zeus
				}
				add_building = tp_shrine_zeus
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_poseidon
				}
				add_building = tp_shrine_poseidon
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_hades
				}
				add_building = tp_shrine_hades
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_hermes
				}
				add_building = tp_shrine_hermes
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_demeter
				}
				add_building = tp_shrine_demeter
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_athena
				}
				add_building = tp_shrine_athena
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_apollo
				}
				add_building = tp_shrine_apollo
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_arthemis
				}
				add_building = tp_shrine_arthemis
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_ares
				}
				add_building = tp_shrine_ares
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_aphrodite
				}
				add_building = tp_shrine_aphrodite
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_ephaestus
				}
				add_building = tp_shrine_ephaestus
			}
			if = {
				limit = {
					has_title_flag = flag_dedicated_to_hestia
				}
				add_building = tp_shrine_hestia
			}
		}
		if = {
			limit = {
				location = {
					OR = {
						has_province_modifier = tomb_of_a_saint
						has_province_modifier = pillaged_tomb_of_a_saint
					}
				}
			}
			add_building = tp_saint_shrine
		}
		if = {
			limit = {
				holder_scope = {
					OR = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_monumental 
						}
						any_liege = {
							any_owned_bloodline = {
								has_bloodline_flag = bloodline_monumental 
							}	
						}
					}
					NOR = {
						is_tribal = yes
						is_nomadic = yes
					}
				}
			}
			if = {
				limit = {
					location = {
						TECH_CITY_CONSTRUCTION = 1
					}
				}	
				add_building = tp_monumental_shrines_1
			}
			if = {
				limit = {
					location = {
						TECH_CITY_CONSTRUCTION = 3
					}
				}	
				add_building = tp_monumental_shrines_2
			}
			if = {
				limit = {
					location = {
						TECH_CITY_CONSTRUCTION = 5
					}
				}	
				add_building = tp_monumental_shrines_3
			}
			if = {
				limit = {
					location = {
						TECH_CITY_CONSTRUCTION = 7
					}
				}	
				add_building = tp_monumental_shrines_4
			}
			
		}
		refill_holding_levy = yes
}

scmr_build_city_tech = {
	if = {
	limit = {
		not = {
			has_building = ct_wall_q_1
		}
	}
	add_building = ct_wall_q_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_q_2
		}
		or = {
			and = {
				has_building = ct_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 1
				}
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_wall_q_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_q_3
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 3
		}
	}
	add_building = ct_wall_q_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_q_4
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 5
		}
	}
	add_building = ct_wall_q_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_q_5
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 7
		}
	}
	add_building = ct_wall_q_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_1
		}
	}
	add_building = ct_wall_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_2
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
	}
	add_building = ct_wall_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_3
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
		}
	}
	add_building = ct_wall_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_4
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
		}
	}
	add_building = ct_wall_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_wall_5
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
		}
	}
	add_building = ct_wall_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_1
		}
	}
	add_building = ct_training_grounds_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_2
		}
	}
	add_building = ct_training_grounds_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_3
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
		}
	}
	add_building = ct_training_grounds_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_4
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
		}
	}
	add_building = ct_training_grounds_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_5
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
		}
	}
	add_building = ct_training_grounds_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_training_grounds_6
		}
		location = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
		}
	}
	add_building = ct_training_grounds_6
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_1
		}
	}
	add_building = ct_barracks_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_2
		}
	}
	add_building = ct_barracks_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_3
		}
		location = {
			TECH_CITY_CONSTRUCTION = 1
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_barracks_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_4
		}
		location = {
			TECH_CITY_CONSTRUCTION = 3
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_barracks_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_5
		}
		location = {
			TECH_CITY_CONSTRUCTION = 5
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_barracks_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_barracks_6
		}
		location = {
			TECH_CITY_CONSTRUCTION = 7
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_barracks_6
					}
					if = {
	limit = {
		not = {
			has_building = ct_guard_1
		}
	}
	add_building = ct_guard_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_guard_2
		}
		location = {
			TECH_CITY_CONSTRUCTION = 2
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_guard_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_guard_3
		}
		location = {
			TECH_CITY_CONSTRUCTION = 4
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_guard_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_guard_4
		}
		location = {
			TECH_CITY_CONSTRUCTION = 6
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_guard_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_guard_5
		}
		location = {
			TECH_CITY_CONSTRUCTION = 8
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_guard_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_1
		}
	}
	add_building = ct_marketplace_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_2
		}
	}
	add_building = ct_marketplace_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_3
		}
		location = {
			TECH_CITY_CONSTRUCTION = 1
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_marketplace_3
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_4
		}
		location = {
			TECH_CITY_CONSTRUCTION = 3
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_marketplace_4
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_5
		}
		location = {
			TECH_CITY_CONSTRUCTION = 5
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_marketplace_5
					}
					if = {
	limit = {
		not = {
			has_building = ct_marketplace_6
		}
		location = {
			TECH_CITY_CONSTRUCTION = 7
		}
		or = {
			has_building = ct_wall_2
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
	}
	add_building = ct_marketplace_6
					}
					if = {
	limit = {
		not = {
			has_building = ct_university_1
		}
		location = {
			TECH_CITY_CONSTRUCTION = 2
		}
	}
	add_building = ct_university_1
					}
					if = {
	limit = {
		not = {
			has_building = ct_university_2
		}
		location = {
			TECH_CITY_CONSTRUCTION = 4
		}
	}
	add_building = ct_university_2
					}
					if = {
	limit = {
		not = {
			has_building = ct_university_3
		}
		location = {
			TECH_CITY_CONSTRUCTION = 8
		}
	}
	add_building = ct_university_3
					}
					if = {
	limit =
	{
		location = {
			port = yes
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_port_1
			}
		}
		add_building = ct_port_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_port_2
			}
			location = {
				TECH_TRADE_PRACTICES = 1
			}
		}
		add_building = ct_port_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_port_3
			}
			location = {
				TECH_TRADE_PRACTICES = 3
			}
			or = {
				has_building = ct_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ct_port_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_port_4
			}
			location = {
				TECH_TRADE_PRACTICES = 4
			}
			or = {
				has_building = ct_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ct_port_4
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_port_5
			}
			location = {
				TECH_TRADE_PRACTICES = 6
			}
			or = {
				has_building = ct_wall_2
				location =
				{
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
		}
		add_building = ct_port_5
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_shipyard_1
			}
			location = {
				TECH_NAVAL = 1
			}
		}
		add_building = ct_shipyard_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_shipyard_2
			}
			location = {
				TECH_NAVAL = 2
			}
		}
		add_building = ct_shipyard_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_shipyard_3
			}
			location = {
				TECH_NAVAL = 3
			}
		}
		add_building = ct_shipyard_3
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_shipyard_4
			}
			location = {
				TECH_NAVAL = 4
			}
		}
		add_building = ct_shipyard_4
	}
					}
					if = {
	limit =
	{
		holder_scope = {
			is_patrician = yes
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_rep_arsenal_1
			}
		}
		add_building = ct_rep_arsenal_1
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_rep_arsenal_2
			}
			location = {
				TECH_CITY_CONSTRUCTION = 4
			}
		}
		add_building = ct_rep_arsenal_2
	}
	if =
	{
		limit = {
			not = {
				has_building = ct_rep_arsenal_3
			}
			location = {
				TECH_CITY_CONSTRUCTION = 7
			}
		}
		add_building = ct_rep_arsenal_3
	}
					}
					
	#Holy Fury				
	if = {
		limit = {
			holder_scope = {
				OR = {
					any_owned_bloodline = {
						has_bloodline_flag = bloodline_architect 
					}
					any_liege = {
						any_owned_bloodline = {
							has_bloodline_flag = bloodline_architect 
						}	
					}
				}
				NOR = {
					is_tribal = yes
					is_nomadic = yes
				}
			}
		}
		if = { 
			limit = {
				location = { TECH_CITY_CONSTRUCTION = 1 }
			}
			add_building = ct_planned_infrastructure_1
		}
		if = { 
			limit = {
				location = { TECH_CITY_CONSTRUCTION = 3 }
			}
			add_building = ct_planned_infrastructure_2
		}
		if = { 
			limit = {
				location = { TECH_CITY_CONSTRUCTION = 5 }
			}
			add_building = ct_planned_infrastructure_3
		}
		if = { 
			limit = {
				location = { TECH_CITY_CONSTRUCTION = 7 }
			}
			add_building = ct_planned_infrastructure_4
		}
	}				
					
	
	refill_holding_levy = yes
}

scmr_build_tb_tech = {
	add_building = tb_hillfort_1
    add_building = tb_hillfort_2
    add_building = tb_market_town_1
    add_building = tb_market_town_2
    add_building = tb_training_grounds_1
    add_building = tb_training_grounds_2
    add_building = tb_training_grounds_3
    add_building = tb_training_grounds_4
    add_building = tb_war_camp_1
    add_building = tb_war_camp_2
    add_building = tb_war_camp_3
    add_building = tb_war_camp_4
	add_building = tb_arsenal_1
    add_building = tb_arsenal_2
    add_building = tb_arsenal_3
    add_building = tb_arsenal_4
    add_building = tb_practice_range_1
    add_building = tb_practice_range_2
    add_building = tb_practice_range_3
    add_building = tb_practice_range_4
	if = {
		limit = {
			location = {
				TECH_CASTLE_CONSTRUCTION = 1
			}
			NOT = {
				has_building = tb_hillfort_4
			}
		}
		add_building = tb_hillfort_3
		add_building = tb_hillfort_4
	}
	if = {
		limit = {
			location = {
				TECH_CITY_CONSTRUCTION = 1
			}
			NOT = {
				has_building = tb_market_town_4
			}
		}
		add_building = tb_market_town_3
		add_building = tb_market_town_4
	}
	if = {
		limit = {
			location = {
				terrain = steppe
			}
			holder_scope = {
				OR = {
					culture_group = altaic
					culture_group = magyar
				}
			}
			NOT = {
				has_building = tb_steppe_barracks_4
			}
		}
		add_building = tb_steppe_barracks_1
		add_building = tb_steppe_barracks_2
		add_building = tb_steppe_barracks_3
		add_building = tb_steppe_barracks_4
	}
	if = {
		limit = {
			location = {
				OR = {
					terrain = plains
					terrain = steppe
				}
			}
			holder_scope = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
				}
			}
			NOT = {
				has_building = tb_steppe_stable_4
			}
		}
		add_building = tb_steppe_stable_1
		add_building = tb_steppe_stable_2
		add_building = tb_steppe_stable_3
		add_building = tb_steppe_stable_4
	}
	if = {
		limit = {
			location = {
				terrain = desert
			}
			holder_scope = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
				}
			}
			NOT = {
				has_building = tb_desert_stable_4
			}
		}
		add_building = tb_desert_stable_1
		add_building = tb_desert_stable_2
		add_building = tb_desert_stable_3
		add_building = tb_desert_stable_4
	}
	if = {
		limit = {
			location = {
				port = yes
			}
		}
		if = {
			limit = {
				not = {
					has_building = tb_shipyard_1
				}
				location = {
					TECH_NAVAL = 1
				}
			}
			add_building = tb_shipyard_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_shipyard_2
				}
				location = {
					TECH_NAVAL = 2
				}
			}
			add_building = tb_shipyard_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_shipyard_3
				}
				location = {
					TECH_NAVAL = 3
				}
			}
			add_building = tb_shipyard_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_shipyard_4
				}
				location = {
					TECH_NAVAL = 4
				}
			}
			add_building = tb_shipyard_4
		}
	}
	
	#new addon
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = norse_pagan
				liege = { 
					is_tribal = yes 
					religion = norse_pagan
				} 
			}
		}
		add_building = tb_great_pillar_norse
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = tengri_pagan
				liege = { 
					is_tribal = yes 
					religion = tengri_pagan
				} 
			}
		}
		add_building = tb_great_pillar_tengri
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = slavic_pagan
				liege = { 
					is_tribal = yes 
					religion = slavic_pagan
				} 
			}
		}
		add_building = tb_great_pillar_slavic
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = baltic_pagan
				liege = { 
					is_tribal = yes 
					religion = baltic_pagan
				} 
			}
		}
		add_building = tb_great_pillar_baltic
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = finnish_pagan
				liege = { 
					is_tribal = yes 
					religion = finnish_pagan
				} 
			}
		}
		add_building = tb_great_pillar_finnish
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = west_african_pagan
				liege = { 
					is_tribal = yes 
					religion = west_african_pagan
				} 
			}
		}
		add_building = tb_great_pillar_west_african
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = aztec
				liege = { 
					is_tribal = yes 
					religion = aztec
				} 
			}
		}
		add_building = tb_great_pillar_aztec
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = bon
				liege = { 
					is_tribal = yes 
					religion = bon
				} 
			}
		}
		add_building = tb_great_pillar_bon
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = zun_pagan
				liege = { 
					is_tribal = yes 
					religion = zun_pagan
				} 
			}
		}
		add_building = tb_great_pillar_zun
	}
	if = {
		limit = {
			holder_scope = { #Owner and his liege must be of the founding religion, otherwise the building becomes inactive.
				is_tribal = yes 
				religion = hellenic_pagan
				liege = { 
					is_tribal = yes 
					religion = hellenic_pagan
				} 
			}
		}
		add_building = tb_great_pillar_hellenic
	}
	
	#Holy Fury
	if = {
	limit =
	{
		location = {
			or = {
				culture = english
				culture = welsh
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_saxon_english_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}		
		}
		add_building = tb_culture_saxon_english_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_saxon_english_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_saxon_english_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_saxon_english_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_saxon_english_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_saxon_english_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_saxon_english_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = scottish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_scottish_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_scottish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_scottish_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_scottish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_scottish_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_scottish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_scottish_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_scottish_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = baltic
				culture_group = finno_ugric
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_baltic_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_baltic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_baltic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_baltic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_baltic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_baltic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_baltic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_baltic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = altaic
				culture_group = iranian
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_altaic_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_altaic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_altaic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_altaic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_altaic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_altaic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_altaic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_altaic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = frankish
				culture = occitan
				culture = norman
				culture = german
				culture = breton
				culture = outremer
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_frank_norman_german_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_frank_norman_german_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_frank_norman_german_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_frank_norman_german_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_frank_norman_german_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_frank_norman_german_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_frank_norman_german_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_frank_norman_german_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = iberian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_iberian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_iberian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_iberian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_iberian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_iberian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_iberian_3
	}
	if = {
		limit = {
			not = {
				has_building = tb_culture_group_iberian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_iberian_4
	}
	}
	if = {
		limit = {
			location = {
				OR = { 
					culture = italian 
					culture = dalmatian
				}
			}
		}
	if = {
		limit = {
			not = {
				has_building = tb_culture_italian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_italian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_italian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_italian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_italian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_italian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_italian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_italian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = east_slavic
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_russian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_russian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_russian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_russian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_russian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_russian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_russian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_russian_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = north_germanic
				culture = saxon
				culture = old_saxon
				culture = frisian
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_north_germanic_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_north_germanic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_north_germanic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_north_germanic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_north_germanic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_north_germanic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_north_germanic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_north_germanic_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = hungarian
				culture_group = west_slavic
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_hungarian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_hungarian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_hungarian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_hungarian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_hungarian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_hungarian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_hungarian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_hungarian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = arabic
			not = {
				culture = andalusian_arabic
				culture = maghreb_arabic
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_arabic_1					
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_arabic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_arabic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_arabic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_arabic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_arabic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_arabic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_arabic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = byzantine
			NOT = { culture = coptic }
			NOT = { culture = arberian }
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_byzantine_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_byzantine_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_byzantine_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_byzantine_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_byzantine_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_byzantine_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_byzantine_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_byzantine_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = irish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_irish_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_irish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_irish_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_irish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_irish_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_irish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_irish_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_irish_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = ethiopian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_ethiopian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_ethiopian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_ethiopian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_ethiopian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_ethiopian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_ethiopian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_ethiopian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_ethiopian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = somali
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_somali_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_somali_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_somali_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_somali_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_somali_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_somali_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_somali_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_somali_4
	}
					}
	if = {
		limit = {
			location = {
				OR = {
					culture_group = west_african 
					culture_group = central_african
					culture = daju
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_west_african_1
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_west_african_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_west_african_2
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = tb_culture_west_african_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_west_african_3
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_west_african_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_west_african_4
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = tb_culture_west_african_4
		}
	}
	if = {
	limit =
	{
		location = {
			culture_group = south_slavic
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_south_slavic_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_south_slavic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_south_slavic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_group_south_slavic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_south_slavic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_group_south_slavic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_group_south_slavic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_group_south_slavic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = dutch
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_dutch_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_dutch_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_dutch_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_dutch_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_dutch_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_dutch_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_dutch_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_dutch_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = nahuatl
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nahuatl_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_nahuatl_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nahuatl_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_nahuatl_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nahuatl_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_nahuatl_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nahuatl_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_nahuatl_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture_group = israelite
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_jewish_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_jewish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_jewish_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_jewish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_jewish_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_jewish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_jewish_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_jewish_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture_group = indo_aryan_group
				culture_group = dravidian_group
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_indian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_indian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_indian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_indian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_indian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_indian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_indian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_indian_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = nubian
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nubian_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_nubian_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nubian_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_nubian_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nubian_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_nubian_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_nubian_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_nubian_4
	}
					}
					if = {
	limit =
	{
		location = {
			or = {
				culture = lombard
				culture = old_frankish
			}
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_germanic_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_germanic_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_germanic_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_germanic_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_germanic_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_germanic_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_germanic_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_germanic_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = pictish
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_pictish_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_pictish_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_pictish_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_pictish_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_pictish_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_pictish_3
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_pictish_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_pictish_4
	}
					}
					if = {
	limit =
	{
		location = {
			culture = suebi
		}
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_suebi_1
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_suebi_1
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_suebi_2
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 1
			}
		}
		add_building = tb_culture_suebi_2
	}
	if =
	{
		limit = {
			not = {
				has_building = tb_culture_suebi_3
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 2
			}
		}
		add_building = tb_culture_suebi_3
	}
	if = {
		limit = {
			not = {
				has_building = tb_culture_suebi_4
			}
			location = {
				TECH_FORTIFICATIONS_CONSTRUCTION = 2
				TECH_CASTLE_CONSTRUCTION = 4
			}
		}
		add_building = tb_culture_suebi_4
	}
	}
	if = {
		limit = {
			location = {
				or =
				{
					culture = andalusian_arabic
					culture = maghreb_arabic
				}
			}
		}
		if = {
			limit = {
				not =
				{
					has_building = tb_culture_moors_1
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_moors_1
		}
		if = {
			limit = {
				not =
				{
					has_building = tb_culture_moors_2
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = tb_culture_moors_2
		}
		if = {
			limit = {
				not =
				{
					has_building = tb_culture_moors_3
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_moors_3
		}
		if = {
			limit = {
				not =
				{
					has_building = tb_culture_moors_4
				}
				location = {
					TECH_FORTIFICATIONS_CONSTRUCTION = 2
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = tb_culture_moors_4
		}
	}
					
	if = {
		limit = {
			location = {
				culture = han
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = tb_culture_chinese_han_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = tb_culture_chinese_han_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_chinese_han_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = tb_culture_chinese_han_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_chinese_han_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = tb_culture_chinese_han_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_chinese_han_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = tb_culture_chinese_han_4
		}
					
	}
					
	if = {
		limit = {
			location = {
				culture = jurchen
			}
		}
		
		if = {
			limit = {
				not = {
					has_building = tb_culture_altaic_jurchen_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = tb_culture_altaic_jurchen_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_altaic_jurchen_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = tb_culture_altaic_jurchen_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_altaic_jurchen_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = tb_culture_altaic_jurchen_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_altaic_jurchen_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = tb_culture_altaic_jurchen_4
		}
					
	}
					
	if = {
		limit = {
			location = {
				culture_group = tibetan_group
			}
		}
	
		if = {
			limit = {
				not = {
					has_building = tb_culture_tibetan_1
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 0
				}	
			}
			add_building = tb_culture_tibetan_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_tibetan_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}	
			}
			add_building = tb_culture_tibetan_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_tibetan_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}	
			}
			add_building = tb_culture_tibetan_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_tibetan_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}	
			}
			add_building = tb_culture_tibetan_4
		}
					
	}
	#Holy Fury
	if = {
		limit = {
			location = {
				culture = coptic
			}
			holder_scope = {
				culture = coptic
			}
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_coptic_1
				}
				
			}
			add_building = tb_culture_coptic_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_coptic_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = tb_culture_coptic_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_coptic_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_coptic_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_coptic_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = tb_culture_coptic_4
		}
	}
	
	if = {
		limit = {
			location = {
				OR = { 
					culture_group = horse_group 
					culture_group = cat_group 
					culture_group = bear_group 
					culture_group = hedgehog_group 
					culture_group = duck_group 
					culture_group = dog_group 
					culture_group = elephant_group 
					culture_group = dragon_group 
				}
			}
			holder_scope = {
				OR = { 
					culture_group = horse_group 
					culture_group = cat_group 
					culture_group = bear_group 
					culture_group = hedgehog_group 
					culture_group = duck_group 
					culture_group = dog_group 
					culture_group = elephant_group 
					culture_group = dragon_group 
				}
			}
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_animal_1
				}
				
			}
			add_building = tb_culture_animal_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_animal_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = tb_culture_animal_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_animal_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_animal_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_animal_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = tb_culture_animal_4
		}
	}
	
	if = {
		limit = {
			location = {
				culture = arberian
			}
			holder_scope = {
				culture = arberian
			}
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_arberian_1
				}
				
			}
			add_building = tb_culture_arberian_1
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_arberian_2
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 1
				}
			}
			add_building = tb_culture_arberian_2
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_arberian_3
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 2
				}
			}
			add_building = tb_culture_arberian_3
		}
		if = {
			limit = {
				not = {
					has_building = tb_culture_arberian_4
				}
				location = {
					TECH_CASTLE_CONSTRUCTION = 4
				}
			}
			add_building = tb_culture_arberian_4
		}
	}
	
	refill_holding_levy = yes
}

scmr_build_nd_tech = {
	add_building = no_horse_breeder_1
	add_building = no_horse_breeder_2
	add_building = no_riding_contests_1
	add_building = no_cattle_pens_2
	add_building = no_ox_wagon_1
	add_building = no_ox_wagon_2
	add_building = no_sheep_1
	add_building = no_sheep_2
	add_building = no_felt_crafter_1
	add_building = no_wrestling_1
	add_building = no_shrine_1
	add_building = no_hunting_parties_1
	add_building = no_hunting_parties_2
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 1 }
		}
		add_building = no_horse_breeder_3
		add_building = no_horse_breeder_4
		add_building = no_riding_contests_2
		add_building = no_riding_contests_3
		add_building = no_wrestling_2
		add_building = no_wrestling_3
		add_building = no_hunting_parties_3
		add_building = no_hunting_parties_4
	}
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 2 }
		}
		add_building = no_horse_breeder_5
		add_building = no_horse_breeder_6
		add_building = no_riding_contests_4
		add_building = no_riding_contests_5
		add_building = no_wrestling_4
		add_building = no_hunting_parties_5
		add_building = no_hunting_parties_6
	}
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 3 }
		}
		add_building = no_horse_breeder_7
		add_building = no_horse_breeder_8
		add_building = no_riding_contests_6
		add_building = no_wrestling_5
		add_building = no_hunting_parties_7
		add_building = no_hunting_parties_8
	}
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 4 }
		}
		add_building = no_riding_contests_7
		add_building = no_wrestling_6
	}
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 5 }
		}
		add_building = no_riding_contests_8
		add_building = no_wrestling_7
	}
	if = {
		limit = {
			location = { TECH_CASTLE_CONSTRUCTION = 6 }
		}
		add_building = no_wrestling_8
	}	
	
	if = {
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 1 }
		}
		add_building = no_airag_producer_1
		add_building = no_airag_producer_2
		add_building = no_cattle_pens_3
		add_building = no_cattle_pens_4
		add_building = no_ox_wagon_3
		add_building = no_meat_preserver_1
		add_building = no_meat_preserver_2
		add_building = no_sheep_3
		add_building = no_sheep_4
		add_building = no_felt_crafter_2
		add_building = no_felt_crafter_3
		add_building = no_ger_crafter_1
		add_building = no_shrine_2
		add_building = no_shrine_3
	}
	if = {
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 2 }
		}
		add_building = no_airag_producer_3
		add_building = no_airag_producer_4
		add_building = no_cattle_pens_5
		add_building = no_cattle_pens_6
		add_building = no_ox_wagon_4
		add_building = no_ox_wagon_5
		add_building = no_meat_preserver_3
		add_building = no_meat_preserver_4
		add_building = no_sheep_5
		add_building = no_sheep_6
		add_building = no_felt_crafter_4
		add_building = no_ger_crafter_2
		add_building = no_ger_crafter_3
		add_building = no_shrine_4
	}
	if = {
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 3 }
		}
		add_building = no_airag_producer_5
		add_building = no_cattle_pens_7
		add_building = no_cattle_pens_8
		add_building = no_ox_wagon_6
		add_building = no_meat_preserver_5
		add_building = no_meat_preserver_6
		add_building = no_sheep_7
		add_building = no_sheep_8
		add_building = no_felt_crafter_5
		add_building = no_ger_crafter_4
		add_building = no_shrine_5
	}
	if = { 
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 4 }
		}
		add_building = no_airag_producer_6
		add_building = no_ox_wagon_7
		add_building = no_ox_wagon_8
		add_building = no_meat_preserver_7
		add_building = no_felt_crafter_6
		add_building = no_ger_crafter_5
		add_building = no_ger_crafter_6
		add_building = no_shrine_6
		add_building = no_shrine_7
	}
	if = {
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 5 }
		}
		add_building = no_airag_producer_7
		add_building = no_meat_preserver_8
		add_building = no_felt_crafter_7
		add_building = no_ger_crafter_7
		add_building = no_shrine_8
	}
	if = {
		limit = {
			location = { TECH_CITY_CONSTRUCTION = 6 }
		}
		add_building = no_airag_producer_8
		add_building = no_felt_crafter_8
		add_building = no_ger_crafter_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_yam_1 }
		}
		add_building = no_yam_1
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_2 }
		}
		add_building = no_yam_2
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_3 }
			location = { TECH_TRADE_PRACTICES = 1 }
		}
		add_building = no_yam_3
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_4 }
			location = { TECH_TRADE_PRACTICES = 1 }
		}
		add_building = no_yam_4
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_5 }
			location = { TECH_TRADE_PRACTICES = 2 }
		}
		add_building = no_yam_5
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_6 }
			location = { TECH_TRADE_PRACTICES = 2 }
		}
		add_building = no_yam_6
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_7 }
			location = { TECH_TRADE_PRACTICES = 3 }
		}
		add_building = no_yam_7
	}
	if = {
		limit = {
			NOT = { has_building = no_yam_8 }
			location = { TECH_TRADE_PRACTICES = 4 }
		}
		add_building = no_yam_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_1 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
		}
		add_building = no_baghatur_council_1
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_2 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
		}
		add_building = no_baghatur_council_2
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_3 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
		}
		add_building = no_baghatur_council_3
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_4 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
		}
		add_building = no_baghatur_council_4
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_5 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
		}
		add_building = no_baghatur_council_5
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_6 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
		}
		add_building = no_baghatur_council_6
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_7 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
		}
		add_building = no_baghatur_council_7
	}
	if = {
		limit = {
			NOT = { has_building = no_baghatur_council_8 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 6 }
		}
		add_building = no_baghatur_council_8
	}
	
	if = {
		limit = {
			location = { port = yes }
			}
		if = {
			limit = {
			NOT = { has_building = no_harbor_1 }
		}
		add_building = no_harbor_1
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_2 }
		location = { TECH_NAVAL = 1 }
			}
			add_building = no_harbor_2
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_3 }
		location = { TECH_NAVAL = 2 }
			}
			add_building = no_harbor_3
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_4 }
		location = { TECH_NAVAL = 3 }
			}
			add_building = no_harbor_4
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_5 }
		location = { TECH_NAVAL = 4 }
			}
			add_building = no_harbor_5
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_6 }
		location = { TECH_NAVAL = 5 }
			}
			add_building = no_harbor_6
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_7 }
		location = { TECH_NAVAL = 6 }
			}
			add_building = no_harbor_7
		}
		if = {
			limit = {
		NOT = { has_building = no_harbor_8 }
		location = { TECH_NAVAL = 7 }
			}
			add_building = no_harbor_8
		}
		
		if = {
			limit = {
			NOT = { has_building = no_fishing_village_1 }
		}
		add_building = no_fishing_village_1
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_2 }
			}
			add_building = no_fishing_village_2
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_3 }
		location = { TECH_CITY_CONSTRUCTION = 1 }
			}
			add_building = no_fishing_village_3
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_4 }
		location = { TECH_CITY_CONSTRUCTION = 1 }
			}
			add_building = no_fishing_village_4
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_5 }
		location = { TECH_CITY_CONSTRUCTION = 2 }
			}
			add_building = no_fishing_village_5
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_6 }
		location = { TECH_CITY_CONSTRUCTION = 2 }
			}
			add_building = no_fishing_village_6
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_7 }
		location = { TECH_CITY_CONSTRUCTION = 3 }
			}
			add_building = no_fishing_village_7
		}
		if = {
			limit = {
		NOT = { has_building = no_fishing_village_8 }
		location = { TECH_CITY_CONSTRUCTION = 3 }
			}
			add_building = no_fishing_village_8
		}
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_1 }
			location = { TECH_CASTLE_CONSTRUCTION = 1 }
		}
		add_building = no_composite_bow_crafter_1
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_2 }
			location = { TECH_CASTLE_CONSTRUCTION = 2 }
		}
		add_building = no_composite_bow_crafter_2
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_3 }
			location = { TECH_CASTLE_CONSTRUCTION = 3 }
		}
		add_building = no_composite_bow_crafter_3
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_4 }
			location = { TECH_CASTLE_CONSTRUCTION = 4 }
		}
		add_building = no_composite_bow_crafter_4
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_5 }
			location = { TECH_CASTLE_CONSTRUCTION = 4 }
		}
		add_building = no_composite_bow_crafter_5
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_6 }
			location = { TECH_CASTLE_CONSTRUCTION = 5 }
		}
		add_building = no_composite_bow_crafter_6
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_7 }
			location = { TECH_CASTLE_CONSTRUCTION = 6 }
		}
		add_building = no_composite_bow_crafter_7
	}
	if = {
		limit = {
			NOT = { has_building = no_composite_bow_crafter_8 }
			location = { TECH_CASTLE_CONSTRUCTION = 7 }
		}
		add_building = no_composite_bow_crafter_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_1 }
		}
		add_building = no_lamellar_armor_crafter_1
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_2 }
			location = { TECH_CASTLE_CONSTRUCTION = 1 }
		}
		add_building = no_lamellar_armor_crafter_2
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_3 }
			location = { TECH_CASTLE_CONSTRUCTION = 1 }
		}
		add_building = no_lamellar_armor_crafter_3
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_4 }
			location = { TECH_CASTLE_CONSTRUCTION = 2 }
		}
		add_building = no_lamellar_armor_crafter_4
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_5 }
			location = { TECH_CASTLE_CONSTRUCTION = 3 }
		}
		add_building = no_lamellar_armor_crafter_5
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_6 }
			location = { TECH_CASTLE_CONSTRUCTION = 4 }
		}
		add_building = no_lamellar_armor_crafter_6
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_7 }
			location = { TECH_CASTLE_CONSTRUCTION = 5 }
		}
		add_building = no_lamellar_armor_crafter_7
	}
	if = {
		limit = {
			NOT = { has_building = no_lamellar_armor_crafter_8 }
			location = { TECH_CASTLE_CONSTRUCTION = 6 }
		}
		add_building = no_lamellar_armor_crafter_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_1 }
		}
		add_building = no_minority_shrine_1
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_2 }
			location = { TECH_CITY_CONSTRUCTION = 1 }
		}
		add_building = no_minority_shrine_2
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_3 }
			location = { TECH_CITY_CONSTRUCTION = 1 }
		}
		add_building = no_minority_shrine_3
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_4 }
			location = { TECH_CITY_CONSTRUCTION = 2 }
		}
		add_building = no_minority_shrine_4
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_5 }
			location = { TECH_CITY_CONSTRUCTION = 2 }
		}
		add_building = no_minority_shrine_5
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_6 }
			location = { TECH_CITY_CONSTRUCTION = 3 }
		}
		add_building = no_minority_shrine_6
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_7 }
			location = { TECH_CITY_CONSTRUCTION = 4 }
		}
		add_building = no_minority_shrine_7
	}
	if = {
		limit = {
			NOT = { has_building = no_minority_shrine_8 }
			location = { TECH_CITY_CONSTRUCTION = 5 }
		}
		add_building = no_minority_shrine_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_1 }
		}
		add_building = no_gathering_hall_1
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_2 }
		}
		add_building = no_gathering_hall_2
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_3 }
			location = { TECH_CITY_CONSTRUCTION = 1 }
		}
		add_building = no_gathering_hall_3
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_4 }
			location = { TECH_CITY_CONSTRUCTION = 1 }
		}
		add_building = no_gathering_hall_4
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_5 }
			location = { TECH_CITY_CONSTRUCTION = 2 }
		}
		add_building = no_gathering_hall_5
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_6 }
			location = { TECH_CITY_CONSTRUCTION = 2 }
		}
		add_building = no_gathering_hall_6
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_7 }
			location = { TECH_CITY_CONSTRUCTION = 3 }
		}
		add_building = no_gathering_hall_7
	}
	if = {
		limit = {
			NOT = { has_building = no_gathering_hall_8 }
			location = { TECH_CITY_CONSTRUCTION = 4 }
		}
		add_building = no_gathering_hall_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_minter_1 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 1 
		}
			
		}
		add_building = no_minter_1
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_2 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 1 
		}
			
		}
		add_building = no_minter_2
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_3 }
			location = { 
				has_trade_post = yes
				TECH_TRADE_PRACTICES = 2 
			}
		}
		add_building = no_minter_3
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_4 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 2 
		}
			
		}
		add_building = no_minter_4
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_5 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 3 
		}
			
		}
		add_building = no_minter_5
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_6 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 4
		}
			
		}
		add_building = no_minter_6
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_7 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 5 
		}
			
		}
		add_building = no_minter_7
	}
	if = {
		limit = {
			NOT = { has_building = no_minter_8 }
			location = { 
			has_trade_post = yes
			TECH_TRADE_PRACTICES = 6 
		}
			
		}
		add_building = no_minter_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_1 }
		}
		add_building = no_camp_fortifications_1
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_2 }
		}
		add_building = no_camp_fortifications_2
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_3 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
		}
		add_building = no_camp_fortifications_3
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_4 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 1 }
		}
		add_building = no_camp_fortifications_4
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_5 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 2 }
		}
		add_building = no_camp_fortifications_5
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_6 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 3 }
		}
		add_building = no_camp_fortifications_6
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_7 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 4 }
		}
		add_building = no_camp_fortifications_7
	}
	if = {
		limit = {
			NOT = { has_building = no_camp_fortifications_8 }
			location = { TECH_FORTIFICATIONS_CONSTRUCTION = 5 }
		}
		add_building = no_camp_fortifications_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_1 }
			location = { 
			terrain = desert
			}
		}
		add_building = no_camel_breeder_1
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_2 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 1 
		}
			
		}
		add_building = no_camel_breeder_2
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_3 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 1 
		}
			
		}
		add_building = no_camel_breeder_3
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_4 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 2 
		}
			
		}
		add_building = no_camel_breeder_4
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_5 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 3 
		}
			
		}
		add_building = no_camel_breeder_5
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_6 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 4
		}
			
		}
		add_building = no_camel_breeder_6
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_7 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 5 
		}
			
		}
		add_building = no_camel_breeder_7
	}
	if = {
		limit = {
			NOT = { has_building = no_camel_breeder_8 }
			location = { 
			terrain = desert
			TECH_CASTLE_CONSTRUCTION = 6 
		}
			
		}
		add_building = no_camel_breeder_8
	}
	
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_1 }
			location = { 
			terrain = jungle
			}
		}
		add_building = no_elephant_camp_1
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_2 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 1 
		}
			
		}
		add_building = no_elephant_camp_2
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_3 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 1 
		}
			
		}
		add_building = no_elephant_camp_3
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_4 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 2 
		}
			
		}
		add_building = no_elephant_camp_4
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_5 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 3 
		}
			
		}
		add_building = no_elephant_camp_5
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_6 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 4
		}
			
		}
		add_building = no_elephant_camp_6
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_7 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 5 
		}
			
		}
		add_building = no_elephant_camp_7
	}
	if = {
		limit = {
			NOT = { has_building = no_elephant_camp_8 }
			location = { 
			terrain = jungle
			TECH_CASTLE_CONSTRUCTION = 6 
		}
			
		}
		add_building = no_elephant_camp_8
	}
	refill_holding_levy = yes
}

scmr_build_hp_tech = {
	if = {
		limit = {  
			location = { TECH_CONSTRUCTION = 2 }
		} 
		add_to_extra_holding = { type = hospital building = hospital_building_1 }
		add_to_extra_holding = { type = hospital building = leper_colony_1 }
		add_to_extra_holding = { type = hospital building = soup_kitchen_1 }
	}
	if = {
		limit = {  
			location = { TECH_CONSTRUCTION = 3 }
		} 
		add_to_extra_holding = { type = hospital building = hospital_building_2 }
		add_to_extra_holding = { type = hospital building = chapel_1 }
		add_to_extra_holding = { type = hospital building = translation_house_1 }
		add_to_extra_holding = { type = hospital building = pilgrims_inn_1 }
		add_to_extra_holding = { type = hospital building = library_1 }
	}
	if = {
		limit = {  
			location = { TECH_CONSTRUCTION = 4 }
		}
		add_to_extra_holding = { type = hospital building = hospital_building_3 }
		add_to_extra_holding = { type = hospital building = pharmacology_laboratory_1 }
		add_to_extra_holding = { type = hospital building = medical_academy_1 }
		add_to_extra_holding = { type = hospital building = observatory_1 }
	}
	if = {
		limit = {  
			location = { TECH_CONSTRUCTION = 5 }
		}
		add_to_extra_holding = { type = hospital building = hospital_building_4 }
	}
	if = {
		limit = {  
			location = { TECH_CONSTRUCTION = 6 }
		}
		add_to_extra_holding = { type = hospital building = hospital_building_5 }
	}
}

scmr_build_tr_tech = {
	if = {
		limit = {
			trade_post_owner = { is_patrician = yes }
			location = { port = yes }
		}
		add_to_extra_holding = { type = trade_post building = tr_port_1 }
		add_to_extra_holding = { type = trade_post building = tr_port_2 }
		add_to_extra_holding = { type = trade_post building = tr_port_3 }
		add_to_extra_holding = { type = trade_post building = tr_enclave_1 }
		add_to_extra_holding = { type = trade_post building = tr_enclave_2 }
		add_to_extra_holding = { type = trade_post building = tr_enclave_3 }
		add_to_extra_holding = { type = trade_post building = tr_garrison_1 }
		add_to_extra_holding = { type = trade_post building = tr_garrison_2 }
		add_to_extra_holding = { type = trade_post building = tr_garrison_3 }
	}
	if = {
		limit = {
			location = {
				trade_route = silk_road
				silk_road_trade_post_trigger = yes
			}
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 1 }
			}
			add_to_extra_holding = { type = trade_post building = tr_silk_road_1 }
			add_to_extra_holding = { type = trade_post building = trade_offices_1 }
			add_to_extra_holding = { type = trade_post building = mercenary_garrison_1 }
			
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 2 }
			}
			add_to_extra_holding = { type = trade_post building = tr_silk_road_2 }
			add_to_extra_holding = { type = trade_post building = trade_offices_2 }
			add_to_extra_holding = { type = trade_post building = mercenary_garrison_2 }
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 4 }
			}
			add_to_extra_holding = { type = trade_post building = tr_silk_road_3 }
			add_to_extra_holding = { type = trade_post building = trade_offices_3 }
			add_to_extra_holding = { type = trade_post building = mercenary_garrison_3 }
		}
	}
	
	if = {
		limit = {
			location = {
				trade_route = silk_road
				silk_road_trade_post_trigger = yes
			}
			trade_post_owner = {
				OR = { 
					culture_group = israelite
					religion_group = jewish_group
					culture = khazar
				}
			}
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 1 }
			}
			add_to_extra_holding = { type = trade_post building = radhanite_quarter_1 }
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 3 }
			}
			add_to_extra_holding = { type = trade_post building = radhanite_quarter_2 }
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 4 }
			}
			add_to_extra_holding = { type = trade_post building = radhanite_quarter_3 }
		}
	}
	
	#Holy Fury
	if = {
		limit = {
			location = {
				trade_route = trans_saharan_trade_route
				trans_saharan_trade_post_market_trigger = yes
			}
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 1 }
			}
			add_to_extra_holding = { type = trade_post building = tr_sahara_1 }
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 2 }
			}
			add_to_extra_holding = { type = trade_post building = tr_sahara_2 }
		}
		if = {
			limit = {
				location = { TECH_TRADE_PRACTICES = 4 }
			}
			add_to_extra_holding = { type = trade_post building = tr_sahara_3 }
		}
	}
	
	if = {
		limit = {    
			location = { 
				trade_route = trans_saharan_trade_route
				trans_saharan_trade_post_gold_mine_trigger = yes
				NOT = { has_province_modifier = depleted_gold_mine }
			}
		} 
		add_to_extra_holding = { type = trade_post building = tr_gold_mine_1 }
		if = {
			limit = {
				TECH_TRADE_PRACTICES = 1
				TECH_CONSTRUCTION = 1
			}
			add_to_extra_holding = { type = trade_post building = tr_gold_mine_2 }
		}
		if = {
			limit = {
				TECH_TRADE_PRACTICES = 2
				TECH_CONSTRUCTION = 2
			}
			add_to_extra_holding = { type = trade_post building = tr_gold_mine_3 }
		}
	}
	
	if = {
		limit = {    
			location = { 
				trade_route = trans_saharan_trade_route
				OR = {
					province_id = 912
					province_id = 916
				}
				TECH_CONSTRUCTION = 1
			}
		} 
		add_to_extra_holding = { type = trade_post building = tr_salt_mine_1 }
	}
	if = {
		limit = {    
			location = { 
				trade_route = trans_saharan_trade_route
				province_id = 911
				TECH_TRADE_PRACTICES = 1
			}
		} 
		add_to_extra_holding = { type = trade_post building = tr_cloth_production_1 }
	}
	
}