﻿@holding_illustration_western = "gfx/interface/illustrations/holding_types/castle_western.dds"
@holding_illustration_mena = "gfx/interface/illustrations/holding_types/castle_mena.dds"
@holding_illustration_india = "gfx/interface/illustrations/holding_types/castle_india.dds"
@holding_illustration_mediterranean = "gfx/interface/illustrations/holding_types/castle_mediterranean.dds"
@holding_illustration_norse = "gfx/interface/illustrations/holding_types/fp1_castle_norse.dds"
@holding_illustration_iberian = "gfx/interface/illustrations/holding_types/fp2_castle_iberian.dds"
@holding_illustration_iranian = "gfx/interface/illustrations/holding_types/fp3_castle_iranian.dds"
@holding_illustration_byzantine = "gfx/interface/illustrations/holding_types/ep3_castle_byzantine.dds"
@holding_illustration_constantinople = "gfx/interface/illustrations/holding_types/ep3_castle_constantinople.dds"

@holding_illustration_gah_julan = "gfx/interface/illustrations/holding_types/castle_india.dds" ## need replacing
@holding_illustration_hlaalu = "gfx/interface/illustrations/holding_types/castle_india.dds" ## need replacing
@holding_illustration_telvanni = "gfx/interface/illustrations/holding_types/castle_india.dds" ## need replacing
@holding_illustration_argonian = "gfx/interface/illustrations/holding_types/ek_castle_argonian.dds"
@holding_illustration_celtic = "gfx/interface/illustrations/holding_types/fp1_castle_norse.dds" ## need replacing
@holding_illustration_magyar = "gfx/interface/illustrations/holding_types/mhg_castle_magyar.dds"
@holding_illustration_guinean = "gfx/interface/illustrations/holding_types/mhg_castle_african.dds"
@holding_illustration_sahelian = "gfx/interface/illustrations/holding_types/mhg_castle_sahelian.dds"
@holding_illustration_slavic = "gfx/interface/illustrations/holding_types/mhg_castle_slavic.dds"
@holding_illustration_japanese = "gfx/interface/illustrations/holding_types/mhg_castle_japanese.dds"

@holding_illustration_black_marsh_nede = "gfx/interface/illustrations/holding_types/mhg_castle_african.dds"

@holding_illustration_alinori = "gfx/interface/illustrations/holding_types/ek_castle_alinori.dds"

# EK NOTE graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)####

castle_01 = {
	construction_time = slow_construction_time

	### WESTERN ###
	asset = {
		type = pdxmesh
		names = {
			"building_western_castle_01_mesh"
			"building_western_castle_01_b_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	names = {
	#		"building_western_castle_01_mena_mesh"
	#		"building_western_castle_01_b_mena_mesh"
	#	}
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		names = {
			"building_western_castle_01_mediterranean_mesh"
			"building_western_castle_01_b_mediterranean_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_iliac_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	names = {
	#		"building_western_castle_01_indian_mesh"
	#		"building_western_castle_01_b_indian_mesh"
	#	}
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_regions = { graphical_india }
	#}

	### INDIAN ###
	asset = {
		type = pdxmesh
		name = "building_indian_castle_01_western_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_ayleid_building_gfx ek_daedric_building_gfx }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_castle_01_mena_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_redguard_building_gfx  ek_dwemer_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_01_mediterranean_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_01_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	#
	#### MENA ###
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_western_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { mena_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_mediterranean_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_indian_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	
	### MEDITERRANEAN ###
	asset = {
		type = pdxmesh
		name = "building_mediterranean_castle_01_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_cyrodilic_building_gfx }
	}
	
	### FP1 Norse ###
	asset = {
		type = pdxmesh
		name = "fp1_building_norse_castle_01_mesh"
		requires_dlc_flag = the_northern_lords
		illustration = @holding_illustration_norse
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/nordic_castle" }
		graphical_cultures = { ek_nordic_building_gfx }
	}

	### FP2 Iberian ###
	asset = {
		type = pdxmesh
		name = "fp2_building_iberian_castle_01_mesh"
		requires_dlc_flag = the_fate_of_iberia
		illustration = @holding_illustration_iberian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/iberian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_strident_building_gfx }
	}
	#EK DISABLED: this style doesn't fit any tes culture
	### FP3 Iranian ###
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_01_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_01_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_01_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### EP3 Byzantine ###
	#EK DISABLED: No Byzantines right now.
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_01_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_constantinople
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	provinces = { 496 }
	#}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_01_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_byzantine
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}

	#Steppe fallbacks
	#Iranian
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_01_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	#mena
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_01_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	
	#### EK ADDITIONS ####
	### SEA (pellitine) ###
	asset = {
		type = pdxmesh
		name = "building_sea_castle_01_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_khajiit_building_gfx }
	}
	
	### EK WESTHOLDER (westholder) ###
	asset = {
		type = pdxmesh
		name = "building_westholder_castle_01_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_westholder_building_gfx }
	}

	### SLAVIC (cyro-nord) ###
	asset = {
		type = pdxmesh
		name = "slavic_castle_01_mesh"
		illustration = @holding_illustration_slavic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_cyro_nordic_building_gfx }
	}

	### MAGYAR (colovian) ###
	asset = {
		type = pdxmesh
		name = "magyar_castle_01_mesh"
		illustration = @holding_illustration_magyar
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { "ek_colovian_building_gfx" }
	}

	### CELTIC (nordic nedes) ###
	asset = {
		type = pdxmesh
		name = "building_celtic_hillfort_01_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_nedic_north_building_gfx }
	}

	### Brythonic (northern bretons) ###
	asset = {
		type = pdxmesh
		names = { "brythonic_castle_01_a_mesh" "brythonic_castle_01_b_mesh" }
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_northmen_building_gfx }
	}
	
	### EK HEARTLANDER (heartlander) ###
	asset = {
		type = pdxmesh
		name = "building_heartlander_castle_01_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_heartlander_building_gfx }
	}

	### EK GAH JULAN (gah julan / redoran / ashlander) ###         
	asset = {
		type = pdxmesh
		name = "building_gahjulan_castle_01_mesh"
		illustration = @holding_illustration_gah_julan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_gah_julan_building_gfx ek_dres_building_gfx }
	}
	
	### EK ARMUN AN (armun an / deshaan) ###
	asset = {
		type = pdxmesh
		name = "building_armun_castle_01_mesh"
		illustration = @holding_illustration_hlaalu
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_armun_an_building_gfx ek_velothi_building_gfx }
	}
	### EK TELVANNI (chi adduni) ###
	asset = {
		type = pdxmesh
		name = "building_telvanni_castle_01_mesh"
		illustration = @holding_illustration_telvanni
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_telvanni_building_gfx }
	}
	
	### ALINORI (alinori) ###
	asset = {
		type = pdxmesh
		name = "building_alinori_castle_01_mesh"
		illustration = @holding_illustration_alinori
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_aldmer_building_gfx }
	}
	
	### MESOAMERICAN (argonians) ###
	asset = {
		type = pdxmesh
		name = "meso_castle_01_mesh"
		illustration = @holding_illustration_argonian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_argonian_building_gfx }
	}

	### BLACK MARSH (black marsh nede) ###
	asset = {
		type = pdxmesh
		name = "black_marsh_castle_01_mesh"
		illustration = @holding_illustration_black_marsh_nede
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_nedic_south_building_gfx }
	}

	### Guinean (ket-keptu) ###
	asset = {
		type = pdxmesh
		name = "guinean_castle_01_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_nedic_keptu_building_gfx }
	}

	### Sahelian (yokudans) ###
	asset = {
		type = pdxmesh
		name = "building_african_castle_01_mesh"
		illustration = @holding_illustration_sahelian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_yokudan_building_gfx }
	}

	### Japanese (ilniviri) ###
	asset = {
		type = pdxmesh
		name = "building_japanese_castle_01_mesh"
		illustration = @holding_illustration_japanese
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 0 } }
		graphical_cultures = { ek_ilniviri_building_gfx }
	}
	#EK ADDITIONS END

	can_construct_potential = {
		barony_cannot_construct_holding = no
	}

	can_construct = {
		culture = {
			has_innovation = innovation_motte
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
		building_requirement_tribal_holding_in_county = yes
		building_requirement_nomad = no
		building_requirement_nomad_holding_in_county = yes
		building_requirement_herder = no
		building_requirement_herder_holding_in_county = yes
		ek_building_requirement_general = yes #EK ADDITION
	}

	cost_gold = main_building_tier_1_cost
	next_building = castle_02

	levy = normal_building_levy_tier_2
	max_garrison = good_building_max_garrison_tier_1
	garrison_reinforcement_factor = building_garrison_reinforcement_factor_tier_2
	province_modifier = {
		monthly_income = poor_building_tax_tier_2
		fort_level = great_building_fort_level_tier_1
		stationed_maa_damage_mult = normal_maa_damage_tier_1
		stationed_maa_toughness_mult = normal_maa_toughness_tier_1
		stationed_siege_weapon_siege_value_mult = normal_maa_siege_value_tier_1
		travel_danger = -10
	}

	province_terrain_modifier = {
		parameter = coastal_holding_bonuses
		is_coastal = yes
		build_speed = -0.1
	}

	province_culture_modifier = {
		parameter = castle_fortifications_increase
		defender_holding_advantage = 5
	}

	character_culture_modifier = {
		parameter = castle_grant_prestige
		monthly_prestige = 0.02
		monthly_dynasty_prestige = 0.01
	}

	province_terrain_modifier = {
		parameter = maritime_mercantilism_coastal_holdings
		is_coastal = yes
		tax_mult = maritime_mercantilism_coastal_holdings_value
	}

	province_terrain_modifier = {
		parameter = castle_holding_fort_level_in_jungle_bonus
		terrain = jungle
		additional_fort_level = castle_holding_fort_level_in_jungle_bonus_value
	}

	province_terrain_modifier = {
		parameter = coastal_holdings_give_defensive_bonus
		is_coastal = yes
		defender_holding_advantage = 2
	}
	
		province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = castle_holding_fort_level_in_valenwood_bonus
		terrain = valenwood
		additional_fort_level = castle_holding_fort_level_in_valenwood_bonus_value
	}

	province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = coastal_holding_fortifications
		is_coastal = yes
		defender_holding_advantage = 2
		additional_fort_level = 2
		hostile_raid_time = 0.5
	}
	
	flag = castle

	type_icon = "icon_building_ramparts.dds"

	on_complete = {
		county.holder = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = parochial
					}
					save_temporary_scope_as = holder_scope
				}
				custom_tooltip = parochial_vassal_approves_holding_construction
				hidden_effect = {
					every_vassal = {
						limit = {
							has_vassal_stance = parochial
						}
						add_opinion = {
							target = prev
							modifier = parochial_approves_holding_construction_opinion
						}
					}
				}
			}
			# EK DISABLED
			## Harrying logic.
			#if = {
			#	limit = {
			#		character_is_valid_for_harrying_of_the_north_trigger = yes
			#		is_important_or_vip_struggle_character = yes
			#	}
			#	global_var:harrying_of_the_north = { save_scope_as = story }
			#	if = {
			#		limit = { character_is_valid_norman_for_harrying_of_the_north_trigger = yes }
			#		ep3_increase_pacification_effect = { AMOUNT = harrying_medium_increase_value }
			#	}
			#	else_if = {
			#		limit = { character_is_valid_anglo_saxon_for_harrying_of_the_north_trigger = yes }
			#		ep3_increase_resistance_effect = { AMOUNT = harrying_medium_increase_value }
			#	}
			#}
			#EK ADDITION: new doctrine parameter
			if = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_castle_construction
					}
				}
				add_piety = major_piety_gain
			}
			#EK ADDITION END
		}
	}

	ai_value = {
		base = 100
		modifier = {
			factor = 0
			scope:holder = {
				government_has_flag = government_is_theocracy
			}
		}

		modifier = {
			add = 50
			county = {
				NOT = {
					any_county_province = {
						has_building_or_higher = castle_01
					}
				}
			}
		}
		modifier = {
			factor = 5
			scope:holder.culture = { has_cultural_parameter = ai_more_likely_to_castle }
		}
	}
}

castle_02 = {
	construction_time = slow_construction_time

	### WESTERN ###
	asset = {
		type = pdxmesh
		name = "building_western_castle_02_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_02_mena_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		name = "building_western_castle_02_mediterranean_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_iliac_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_02_indian_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_regions = { graphical_india }
	#}
	
	### MENA ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_02_western_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mena_building_gfx }
	#}
	asset = {
		type = pdxmesh
		name = "building_mena_castle_02_mesh"
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_redguard_building_gfx  ek_dwemer_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_02_mediterranean_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_02_indian_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	
	### INDIAN ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_02_western_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { indian_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_02_mena_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_02_mediterranean_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	asset = {
		type = pdxmesh
		name = "building_indian_castle_02_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_ayleid_building_gfx ek_daedric_building_gfx }
	}
	
	### MEDITERRANEAN ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_02_western_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_02_mena_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_castle_02_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_cyrodilic_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_02_indian_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	
	### FP1 Norse ###
	asset = {
		type = pdxmesh
		name = "fp1_building_norse_castle_02_mesh"
		requires_dlc_flag = the_northern_lords
		illustration = @holding_illustration_norse
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/nordic_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_nordic_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_02_mena_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_02" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_02_mediterranean_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_02" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_02_indian_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_02" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### FP2 Iberian ###
	asset = {
		type = pdxmesh
		name = "fp2_building_iberian_castle_02_mesh"
		requires_dlc_flag = the_fate_of_iberia
		illustration = @holding_illustration_iberian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/iberian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_strident_building_gfx }
	}
	#EK DISABLED: this style doesn't fit any tes culture
	### FP3 Iranian ###
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_02_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_02_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_02_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}

	### EP3 Byzantine ###
	#EK DISABLED: No Byzantines right now.
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_02_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_constantinople
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	provinces = { 496 }
	#}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_02_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_byzantine
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}

	#Steppe fallbacks
	#Iranian
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_02_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	#mena
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_02_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	
	#### EK ADDITIONS ####
	### SEA (pellitine) ###
	asset = {
		type = pdxmesh
		name = "building_sea_castle_02_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_khajiit_building_gfx }
	}

	### SLAVIC ( cyro-nord ) ###
	asset = {
		type = pdxmesh
		name = "slavic_castle_02_mesh"
		illustration = @holding_illustration_slavic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_cyro_nordic_building_gfx }
	}

	### MAGYAR (colovian) ###
	asset = {
		type = pdxmesh
		name = "magyar_castle_02_mesh"
		illustration = @holding_illustration_magyar
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { "ek_colovian_building_gfx" }
	}
	
	### EK WESTHOLDER (westholder) ###
	asset = {
		type = pdxmesh
		name = "building_westholder_castle_02_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_westholder_building_gfx }
	}

	### CELTIC (nordic nedes) ###
	asset = {
		type = pdxmesh
		name = "building_celtic_hillfort_02_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_nedic_north_building_gfx }
	}

	### Brythonic (northern bretons) ###
	asset = {
		type = pdxmesh
		name = "brythonic_castle_02_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_northmen_building_gfx }
	}
	
	### EK HEARTLANDER (heartlander) ###
	asset = {
		type = pdxmesh
		name = "building_heartlander_castle_02_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_heartlander_building_gfx }
	}
	
	### EK GAH JULAN (gah julan / redoran / ashlander) ###              
	asset = {
		type = pdxmesh
		name ="building_gahjulan_castle_02_mesh"
		illustration = @holding_illustration_gah_julan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_gah_julan_building_gfx ek_dres_building_gfx }
	}
	
	### EK ARMUN AN (armun an / deshaan) ###
	asset = {
		type = pdxmesh
		name = "building_armun_castle_02_mesh"
		illustration = @holding_illustration_hlaalu
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_armun_an_building_gfx ek_velothi_building_gfx }
	}
	
	### EK TELVANNI (chi adduni) ###
	asset = {
		type = pdxmesh
		name = "building_telvanni_castle_02_mesh"
		illustration = @holding_illustration_telvanni
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_telvanni_building_gfx }
	}
	
	### ALINORI (alinori) ###
	asset = {
		type = pdxmesh
		name = "building_alinori_castle_02_mesh"
		illustration = @holding_illustration_alinori
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_aldmer_building_gfx }
	}

	### MESOAMERICAN (argonians) ###
	asset = {
		type = pdxmesh
		name = "meso_castle_02_mesh"
		illustration = @holding_illustration_argonian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_argonian_building_gfx }
	}
	
	### BLACK MARSH (black marsh nede) ###
	asset = {
		type = pdxmesh
		name = "black_marsh_castle_02_mesh"
		illustration = @holding_illustration_black_marsh_nede
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_nedic_south_building_gfx }
	}

	### Guinean (ket-keptu) ###
	asset = {
		type = pdxmesh
		name = "guinean_castle_02_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_nedic_keptu_building_gfx }
	}

	### Sahelian (yokudans) ###
	asset = {
		type = pdxmesh
		name = "building_african_castle_02_mesh"
		illustration = @holding_illustration_sahelian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_yokudan_building_gfx }
	}

	### Japanese (ilniviri) ###
	asset = {
		type = pdxmesh
		name = "building_japanese_castle_02_mesh"
		illustration = @holding_illustration_japanese
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 1 } }
		graphical_cultures = { ek_ilniviri_building_gfx }
	}
	#EK ADDITIONS END

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_battlements
		}
	}
	#EK ADDITION
	can_construct_showing_failures_only = {
		ek_upgrading_requirement_general = yes
	}
	#EK ADDITION END
	
	cost_gold = main_building_tier_2_cost
	next_building = castle_03

	levy = normal_building_levy_tier_4
	max_garrison = good_building_max_garrison_tier_3
	garrison_reinforcement_factor = building_garrison_reinforcement_factor_tier_4
	province_modifier = {
		monthly_income = poor_building_tax_tier_4
		fort_level = great_building_fort_level_tier_2
		stationed_maa_damage_mult = normal_maa_damage_tier_2
		stationed_maa_toughness_mult = normal_maa_toughness_tier_2
		stationed_siege_weapon_siege_value_mult = normal_maa_siege_value_tier_2
		travel_danger = -12
	}

	province_terrain_modifier = {
		parameter = coastal_holding_bonuses
		is_coastal = yes
		build_speed = -0.1
	}

	province_culture_modifier = {
		parameter = castle_fortifications_increase
		defender_holding_advantage = 10
	}

	character_culture_modifier = {
		parameter = castle_grant_prestige
		monthly_prestige = 0.03
		monthly_dynasty_prestige = 0.02
	}

	province_terrain_modifier = {
		parameter = maritime_mercantilism_coastal_holdings
		is_coastal = yes
		tax_mult = maritime_mercantilism_coastal_holdings_value
	}

	province_terrain_modifier = {
		parameter = castle_holding_fort_level_in_jungle_bonus
		terrain = jungle
		additional_fort_level = castle_holding_fort_level_in_jungle_bonus_value
	}

	province_terrain_modifier = {
		parameter = coastal_holdings_give_defensive_bonus
		is_coastal = yes
		defender_holding_advantage = 3
	}

	province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = coastal_holding_fortifications
		is_coastal = yes
		defender_holding_advantage = 2
		additional_fort_level = 2
		hostile_raid_time = 0.5
	}
	
	province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = coastal_levies
		is_coastal = yes
		levy_size = 0.1
	}

	flag = castle

	on_complete = {
		barony.holder = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = parochial
					}
					save_temporary_scope_as = holder_scope
				}
				custom_tooltip = parochial_vassal_approves_holding_upgrade
				hidden_effect = {
					every_vassal = {
						limit = {
							has_vassal_stance = parochial
						}
						add_opinion = {
							target = prev
							modifier = parochial_approves_holding_upgrade_opinion
						}
					}
				}
			}
			#EK ADDITION: new doctrine parameter
			if = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_castle_construction
					}
				}
				add_piety = major_piety_gain
			}
			#EK ADDITION END
		}
	}

	ai_value = {
		base = 9
		ai_general_building_modifier = yes
		modifier = {
			add = 1
			scope:holder.culture = { has_cultural_parameter = ai_more_likely_to_castle }
		}
		modifier = {
			add = 10
			scope:holder.culture = { has_cultural_era_or_later = culture_era_high_medieval }
		}
		modifier = {
			factor = 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 0.1
			free_building_slots >= 1
			years_from_game_start >= 1
		}
		modifier = {
			factor = 0.1
			combined_building_level <= 10
			years_from_game_start >= 1
		}
		modifier = {
			factor = 0.3
			years_from_game_start <= 0.01
		}
	}
}

castle_03 = {
	construction_time = slow_construction_time

	### WESTERN ###
	asset = {
		type = pdxmesh
		name = "building_western_castle_03_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_03_mena_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		name = "building_western_castle_03_mediterranean_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_iliac_building_gfx }
	}
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_03_indian_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_regions = { graphical_india }
	#}
	
	### MENA ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_03_western_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { mena_building_gfx }
	#}
	asset = {
		type = pdxmesh
		name = "building_mena_castle_03_mesh"
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_redguard_building_gfx  ek_dwemer_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_03_mediterranean_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_03_indian_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	
	### INDIAN ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_03_western_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { indian_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_03_mena_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_03_mediterranean_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	asset = {
		type = pdxmesh
		name = "building_indian_castle_03_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_ayleid_building_gfx ek_daedric_building_gfx }
	}

	### MEDITERRANEAN ###
	asset = {
		type = pdxmesh
		name = "building_mediterranean_castle_03_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_cyrodilic_building_gfx }
	}

	### FP1 Norse ###
	asset = {
		type = pdxmesh
		name = "fp1_building_norse_castle_03_mesh"
		requires_dlc_flag = the_northern_lords
		illustration = @holding_illustration_norse
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/nordic_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_nordic_building_gfx }
	}

	### FP2 Iberian ###
	asset = {
		type = pdxmesh
		name = "fp2_building_iberian_castle_03_mesh"
		requires_dlc_flag = the_fate_of_iberia
		illustration = @holding_illustration_iberian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/iberian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_strident_building_gfx }
	}
	
	### FP3 Iranian ###
	#EK DISABLED: this style doesn't fit any tes culture
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_03_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_03_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_03_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_03_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### EP3 Byzantine ###
	#EK DISABLED: No Byzantines right now.
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_03_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_constantinople
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	provinces = { 496 }
	#}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_03_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_byzantine
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}

	#Steppe fallbacks
	#Iranian
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_03_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	#mena
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_03_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}

	#### EK ADDITIONS ####
	### SEA (pellitine) ###
	asset = {
		type = pdxmesh
		name = "building_sea_castle_03_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_khajiit_building_gfx }
	}

	### SLAVIC (cyro-nord) ###
	asset = {
		type = pdxmesh
		name = "slavic_castle_03_mesh"
		illustration = @holding_illustration_slavic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_cyro_nordic_building_gfx }
	}

	### MAGYAR (colovian) ###
	asset = {
		type = pdxmesh
		name = "magyar_castle_03_mesh"
		illustration = @holding_illustration_magyar
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { "ek_colovian_building_gfx" }
	}

	### EK WESTHOLDER (westholder) ###
	asset = {
		type = pdxmesh
		name = "building_westholder_castle_03_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_westholder_building_gfx }
	}

	### CELTIC (nordic nedes / northern bertons) ###
	asset = {
		type = pdxmesh
		name = "building_celtic_hillfort_03_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_nedic_north_building_gfx }
	}

	### Brythonic (northern bretons) ###
	asset = {
		type = pdxmesh
		name = "brythonic_castle_03_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_northmen_building_gfx }
	}
	
	### EK HEARTLANDER (heartlander) ###
	asset = {
		type = pdxmesh
		name = "building_heartlander_castle_03_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_heartlander_building_gfx }
	}
	
	### EK GAH JULAN (gah julan / redoran / ashlander) ###                
	asset = {
		type = pdxmesh
		name = "building_gahjulan_castle_03_mesh"
		illustration = @holding_illustration_gah_julan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_gah_julan_building_gfx ek_dres_building_gfx }
	}
	
	### EK ARMUN AN (armun an / deshaan) ###
	asset = {
		type = pdxmesh
		name = "building_armun_castle_03_mesh"
		illustration = @holding_illustration_hlaalu
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_armun_an_building_gfx ek_velothi_building_gfx }
	}
	
	### EK TELVANNI (chi adduni) ###
	asset = {
		type = pdxmesh
		name = "building_telvanni_castle_03_mesh"
		illustration = @holding_illustration_telvanni
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_telvanni_building_gfx }
	}
	
	### EK ALINORI (alinori) ###
	asset = {
		type = pdxmesh
		name = "building_alinori_castle_03_mesh"
		illustration = @holding_illustration_alinori
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_aldmer_building_gfx }
	}
	
	### MESOAMERICAN (argonians) ###
	asset = {
		type = pdxmesh
		name = "meso_castle_03_mesh"
		illustration = @holding_illustration_argonian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_argonian_building_gfx }
	}
	
	### BLACK MARSH (black marsh nede) ###
	asset = {
		type = pdxmesh
		name = "black_marsh_castle_03_mesh"
		illustration = @holding_illustration_black_marsh_nede
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_nedic_south_building_gfx }
	}

	### Guinean (ket-keptu) ###
	asset = {
		type = pdxmesh
		name = "guinean_castle_03_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_nedic_keptu_building_gfx }
	}

	### Sahelian (yokudans) ###
	asset = {
		type = pdxmesh
		name = "building_african_castle_03_mesh"
		illustration = @holding_illustration_sahelian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_yokudan_building_gfx }
	}

	### Japanese (ilniviri) ###
	asset = {
		type = pdxmesh
		name = "building_japanese_castle_03_mesh"
		illustration = @holding_illustration_japanese
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 2 } }
		graphical_cultures = { ek_ilniviri_building_gfx }
	}
	#EK ADDITIONS END

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_hoardings
		}
	}
	#EK ADDITION
	can_construct_showing_failures_only = {
		ek_upgrading_requirement_general = yes
	}#EK ADDITION END
	
	cost_gold = main_building_tier_3_cost
	next_building = castle_04

	levy = normal_building_levy_tier_6
	max_garrison = good_building_max_garrison_tier_5
	garrison_reinforcement_factor = building_garrison_reinforcement_factor_tier_6
	province_modifier = {
		monthly_income = poor_building_tax_tier_6
		fort_level = great_building_fort_level_tier_3
		stationed_maa_damage_mult = normal_maa_damage_tier_3
		stationed_maa_toughness_mult = normal_maa_toughness_tier_3
		stationed_siege_weapon_siege_value_mult = normal_maa_siege_value_tier_3
		travel_danger = -14
	}

	province_terrain_modifier = {
		parameter = coastal_holding_bonuses
		is_coastal = yes
		build_speed = -0.1
	}

	province_culture_modifier = {
		parameter = castle_fortifications_increase
		defender_holding_advantage = 15
	}

	character_culture_modifier = {
		parameter = castle_grant_prestige
		monthly_prestige = 0.04
		monthly_dynasty_prestige = 0.03
	}

	province_terrain_modifier = {
		parameter = maritime_mercantilism_coastal_holdings
		is_coastal = yes
		tax_mult = maritime_mercantilism_coastal_holdings_value
	}

	province_terrain_modifier = {
		parameter = castle_holding_fort_level_in_jungle_bonus
		terrain = jungle
		additional_fort_level = castle_holding_fort_level_in_jungle_bonus_value
	}

	province_terrain_modifier = {
		parameter = coastal_holdings_give_defensive_bonus
		is_coastal = yes
		defender_holding_advantage = 4
	}

	province_terrain_modifier = { #EK EDIT: new parameter
		parameter = coastal_holding_fortifications
		is_coastal = yes
		defender_holding_advantage = 4
		additional_fort_level = 2
		hostile_raid_time = 0.5
	}
	
	province_terrain_modifier = { #EK EDIT: new parameter
		parameter = coastal_levies
		is_coastal = yes
		levy_size = 0.1
	}
	
	flag = castle

	on_complete = {
		barony.holder = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = parochial
					}
					save_temporary_scope_as = holder_scope
				}
				custom_tooltip = parochial_vassal_approves_holding_upgrade
				hidden_effect = {
					every_vassal = {
						limit = {
							has_vassal_stance = parochial
						}
						add_opinion = {
							target = prev
							modifier = parochial_approves_holding_upgrade_opinion
						}
					}
				}
			}
			#EK ADDITION: new doctrine parameter
			if = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_castle_construction
					}
				}
				add_piety = major_piety_gain
			}
			#EK ADDITION END
		}
	}

	ai_value = {
		base = 8
		ai_general_building_modifier = yes
		modifier = {
			add = 1
			scope:holder.culture = { has_cultural_parameter = ai_more_likely_to_castle }
		}
		modifier = {
			add = 10
			scope:holder.culture = { has_cultural_era_or_later = culture_era_late_medieval }
		}
		modifier = {
			factor = 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 0.2
			combined_building_level <= 20
			years_from_game_start >= 1
		}
	}
}

castle_04 = {
	construction_time = slow_construction_time

	### WESTERN ###
	asset = {
		type = pdxmesh
		name = "building_western_castle_04_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_04_mena_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		names = {
			"building_western_castle_04_mediterranean_mesh"
		}
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_iliac_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_western_castle_04_indian_mesh"
	#	illustration = @holding_illustration_western
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_regions = { graphical_india }
	#}

	### MENA ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_04_western_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mena_building_gfx }
	#}
	asset = {
		type = pdxmesh
		name = "building_mena_castle_04_mesh"
		illustration = @holding_illustration_mena
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_redguard_building_gfx  ek_dwemer_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_04_mediterranean_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_04_indian_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mena_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### INDIAN ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_04_western_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { indian_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_04_mena_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_04_mediterranean_mesh"
	#	illustration = @holding_illustration_india
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { indian_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	asset = {
		type = pdxmesh
		name = "building_indian_castle_04_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_ayleid_building_gfx ek_daedric_building_gfx }
	}

	### MEDITERRANEAN ###
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_04_western_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_04_mena_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_castle_04_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_cyrodilic_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "building_mediterranean_castle_04_indian_mesh"
	#	illustration = @holding_illustration_mediterranean
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { mediterranean_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### FP1 Norse ###	
	asset = {
		type = pdxmesh
		name = "fp1_building_norse_castle_04_mesh"
		requires_dlc_flag = the_northern_lords
		illustration = @holding_illustration_norse
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/nordic_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_nordic_building_gfx }
	}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_04_mena_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_04" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_04_mediterranean_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_04" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "fp1_building_norse_castle_04_indian_mesh"
	#	requires_dlc_flag = the_northern_lords
	#	illustration = @holding_illustration_norse
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/norse_castle_tier_04" }
	#	graphical_cultures = { norse_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### FP2 Iberian ###
	asset = {
		type = pdxmesh
		name = "fp2_building_iberian_castle_04_mesh"
		requires_dlc_flag = the_fate_of_iberia
		illustration = @holding_illustration_iberian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/iberian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_strident_building_gfx }
	}
	
	### FP3 Iranian ###
	#EK DISABLED: this style doesn't fit any tes culture
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_04_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_04_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_04_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_mena }
	#}
	#asset = {
	#	type = pdxmesh
	#	name = "building_indian_castle_04_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 0 } }
	#	graphical_cultures = { iranian_building_gfx }
	#	graphical_regions = { graphical_india }
	#}

	### EP3 Byzantine ###
	#EK DISABLED: No Byzantines right now.
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_04_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_constantinople
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	provinces = { 496 }
	#}
	#EK DISABLED: graphical_regions removed due to bugging the mod (if interested ask AJ or Azwraith)
	#asset = {
	#	type = pdxmesh
	#	name = "ep3_byzantine_castle_04_a_mesh"
	#	requires_dlc_flag = roads_to_power
	#	illustration = @holding_illustration_byzantine
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { byzantine_building_gfx }
	#	graphical_regions = { graphical_mediterranean }
	#}

	#Steppe fallbacks
	#Iranian
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "fp3_building_persian_castle_04_a_01_mesh"
	#	requires_dlc_flag = legacy_of_persia
	#	illustration = @holding_illustration_iranian
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	#mena
	#EK DISABLED: No steppe buildings for now.
	#asset = {
	#	type = pdxmesh
	#	name = "building_mena_castle_04_mesh"
	#	illustration = @holding_illustration_mena
	#	soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
	#	graphical_cultures = { steppe_building_gfx }
	#}
	
	#### EK ADDITIONS ####
	### SEA (pellitine) ###
	asset = {
		type = pdxmesh
		name = "building_sea_castle_04_mesh"
		illustration = @holding_illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_khajiit_building_gfx }
	}

	### SLAVIC (cyro-nord) ###
	asset = {
		type = pdxmesh
		name = "slavic_castle_04_mesh"
		illustration = @holding_illustration_slavic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_cyro_nordic_building_gfx }
	}

	### MAGYAR (colovian) ###
	asset = {
		type = pdxmesh
		name = "magyar_castle_04_mesh"
		illustration = @holding_illustration_magyar
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { "ek_colovian_building_gfx" }
	}

	### EK WESTHOLDER (westholder) ###
	asset = {
		type = pdxmesh
		name = "building_westholder_castle_04_mesh"
		illustration = @holding_illustration_western
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_westholder_building_gfx }
	}
	
	### EK HEARTLANDER (heartlander) ###
	asset = {
		type = pdxmesh
		name = "building_heartlander_castle_04_mesh"
		illustration = @holding_illustration_mediterranean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mediterranean_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_heartlander_building_gfx }
	}

	### CELTIC (nordic nedes) ###
	asset = {
		type = pdxmesh
		name = "building_celtic_hillfort_04_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_nedic_north_building_gfx }
	}

	### Brythonic (northern bretons) ###
	asset = {
		type = pdxmesh
		name = "brythonic_castle_04_mesh"
		illustration = @holding_illustration_celtic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_northmen_building_gfx }
	}
	
	### EK GAH JULAN (gah julan / redoran / ashlander) ###              
	asset = {
		type = pdxmesh
		name = "building_gahjulan_castle_04_mesh"
		illustration = @holding_illustration_gah_julan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_gah_julan_building_gfx ek_dres_building_gfx }
	}
	
	### EK ARMUN AN (armun an / deshaan) ###
	asset = {
		type = pdxmesh
		name = "building_armun_castle_04_mesh"
		illustration = @holding_illustration_hlaalu
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_armun_an_building_gfx ek_velothi_building_gfx }
	}
	
	### EK TELVANNI (chi adduni) ###
	asset = {
		type = pdxmesh
		name = "building_telvanni_castle_04_mesh"
		illustration = @holding_illustration_telvanni
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_telvanni_building_gfx }
	}

	### ALINORI (alinori) ###
	asset = {
		type = pdxmesh
		name = "building_alinori_castle_04_mesh"
		illustration = @holding_illustration_alinori
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_aldmer_building_gfx }
	}
	
	### MESOAMERICAN (argonians) ###
	asset = {
		type = pdxmesh
		name = "meso_castle_04_mesh"
		illustration = @holding_illustration_argonian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_argonian_building_gfx }
	}
	
	### BLACK MARSH (black marsh nede) ###
	asset = {
		type = pdxmesh
		name = "black_marsh_castle_04_mesh"
		illustration = @holding_illustration_black_marsh_nede
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_nedic_south_building_gfx }
	}

	### Guinean (ket-keptu) ###
	asset = {
		type = pdxmesh
		name = "guinean_castle_04_mesh"
		illustration = @holding_illustration_guinean
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/indian_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_nedic_keptu_building_gfx }
	}

	### Sahelian (yokudans) ###
	asset = {
		type = pdxmesh
		name = "building_african_castle_04_mesh"
		illustration = @holding_illustration_sahelian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/mena_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_yokudan_building_gfx }
	}

	### Japanese (ilniviri) ###
	asset = {
		type = pdxmesh
		name = "building_japanese_castle_04_mesh"
		illustration = @holding_illustration_japanese
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Castle/western_castle" soundparameter = { "Tier" = 3 } }
		graphical_cultures = { ek_ilniviri_building_gfx }
	}
	#EK ADDITIONS END
	
	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_machicolations
		}
	}
	can_construct_showing_failures_only = { #EK ADDITION
		ek_upgrading_requirement_general = yes
	} #EK ADDITION END
	
	cost_gold = main_building_tier_4_cost

	levy = normal_building_levy_tier_8
	max_garrison = good_building_max_garrison_tier_7
	garrison_reinforcement_factor = building_garrison_reinforcement_factor_tier_8
	province_modifier = {
		monthly_income = poor_building_tax_tier_8
		fort_level = great_building_fort_level_tier_4
		stationed_maa_damage_mult = normal_maa_damage_tier_4
		stationed_maa_toughness_mult = normal_maa_toughness_tier_4
		stationed_siege_weapon_siege_value_mult = normal_maa_siege_value_tier_4
		travel_danger = -16
	}

	province_terrain_modifier = {
		parameter = coastal_holding_bonuses
		is_coastal = yes
		build_speed = -0.1
	}

	province_culture_modifier = {
		parameter = castle_fortifications_increase
		defender_holding_advantage = 20
	}

	character_culture_modifier = {
		parameter = castle_grant_prestige
		monthly_prestige = 0.05
		monthly_dynasty_prestige = 0.04
	}

	province_terrain_modifier = {
		parameter = maritime_mercantilism_coastal_holdings
		is_coastal = yes
		tax_mult = maritime_mercantilism_coastal_holdings_value
	}

	province_terrain_modifier = {
		parameter = castle_holding_fort_level_in_jungle_bonus
		terrain = jungle
		additional_fort_level = castle_holding_fort_level_in_jungle_bonus_value
	}

	province_terrain_modifier = {
		parameter = coastal_holdings_give_defensive_bonus
		is_coastal = yes
		defender_holding_advantage = 5
	}

	province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = coastal_holding_fortifications
		is_coastal = yes
		defender_holding_advantage = 5
		additional_fort_level = 2
		hostile_raid_time = 0.5
	}

	province_terrain_modifier = { #EK ADDITION: new parameter
		parameter = coastal_levies
		is_coastal = yes
		levy_size = 0.1
	}
	
	flag = castle

	on_complete = {
		barony.holder = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = parochial
					}
					save_temporary_scope_as = holder_scope
				}
				custom_tooltip = parochial_vassal_approves_holding_upgrade
				hidden_effect = {
					every_vassal = {
						limit = {
							has_vassal_stance = parochial
						}
						add_opinion = {
							target = prev
							modifier = parochial_approves_holding_upgrade_opinion
						}
					}
				}
			}
			#EK ADDITION: new doctrine parameter
			if = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_castle_construction
					}
				}
				add_piety = major_piety_gain
			}
			#EK ADDITION END
		}
	}

	ai_value = {
		base = 17
		ai_general_building_modifier = yes
		modifier = {
			add = 1
			scope:holder.culture = { has_cultural_parameter = ai_more_likely_to_castle }
		}
		modifier = {
			factor = 3
			scope:holder.capital_province = this
		}
		modifier = {
			factor = 0.2
			combined_building_level <= 30
			years_from_game_start >= 1
		}
	}
}
