###########
## Special buildings rewarded from legends
###########

legendary_shrine = {

	asset = {
		type = pdxmesh
		name = "fp4_legendary_steppe_shrine_01_a_mesh"
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_building_christian_shrine_01_mesh"
		graphical_faiths = { "catholic_gfx" }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_islamic_shrine_01_a_mesh"
		graphical_faiths = { "islamic_gfx" "judaism_gfx" }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_building_norse_shrine_01_a_mesh"
		graphical_cultures = { norse_building_gfx }
		graphical_faiths = { pagan_gfx }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_dharmic_shrine_01_a_mesh"
		graphical_faiths = { dharmic_gfx }
	}

	construction_time = very_slow_construction_time

	type_icon = "icon_building_legendary_shrine.dds"

	is_enabled = {
		always = yes
	}

	cost = {
		gold = 1000
		piety = 1000
	}

	character_modifier = {
		monthly_piety = 0.15
		zealot_opinion = 5
		zealot_tax_contribution_mult = 0.05
		same_faith_opinion = 5
		zealot_tax_contribution_mult = 0.1
		life_expectancy = 5
	}

	county_modifier = {
		tax_mult = 0.05
		monthly_county_control_growth_add = 0.1
	}

	province_modifier = {
		monthly_income = 0.2
	}

	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for special buildings
			factor = 0
			free_building_slots > 0
		}
	}

	on_complete = {
		root = { save_scope_as = legendary_province }

		county.holder = {
			if = {
				limit = {
					has_trait = pilgrim
				}
				add_trait_xp = {
					trait = pilgrim
					value = 30
				}
			}
			else = {
				add_trait = pilgrim
				add_trait_xp = {
					trait = pilgrim
					value = 30
				}
			}
		}
	}

	type = special

	flag = travel_point_of_interest_religious
}

legendary_palace = {

	asset = {
		type = pdxmesh
		name = "fp4_legendary_western_palace_01_a_mesh"
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_islamic_palace_01_a_mesh"
		graphical_faiths = { "islamic_gfx" }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_india_palace_01_a_mesh"
		graphical_regions = { "graphical_india" }
	}

	construction_time = very_slow_construction_time

	type_icon = "icon_building_legendary_palace.dds"

	is_enabled = {
		always = yes
	}

	cost = {
		gold = 1500
	}

	character_modifier = {
		courtly_opinion = 5
		courtly_tax_contribution_mult = 0.05
		legitimacy_gain_mult = 0.05
		owned_hostile_scheme_success_chance_add = 5
		owned_personal_scheme_success_chance_add = 5
		owned_hostile_scheme_success_chance_max_add = 5
		monthly_lifestyle_xp_gain_mult = 0.1
	}

	county_modifier = {
		tax_mult = 0.1
		development_growth_factor = 0.15
	}

	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for special buildings
			factor = 0
			free_building_slots > 0
		}
	}

	on_complete = {
		root = { save_scope_as = legendary_province }

		county.holder = {
			if = {
				limit = {
					has_trait = lifestyle_reveler
				}
				add_trait_xp = {
					trait = lifestyle_reveler
					value = 30
				}
			}
			else = {
				add_trait = lifestyle_reveler
				add_trait_xp = {
					trait = lifestyle_reveler
					value = 30
				}
			}
		}
	}

	type = special

	flag = travel_point_of_interest_diplomatic
}

legendary_statue = {

	asset = {
		type = pdxmesh
		name = "fp4_legendary_western_hero_01_mesh"
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_heroes_pillar_india_01_a_mesh"
		graphical_regions = { "graphical_india" }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_mediterranean_monument_01_a_mesh"
		graphical_regions = { "graphical_mediterranean" }
	}

	construction_time = very_slow_construction_time

	type_icon = "icon_building_legendary_statue.dds"

	is_enabled = {
		always = yes
	}

	cost = {
		gold = 1000
		prestige = 1000
	}

	character_modifier = {
		glory_hound_opinion = 5
		glory_hound_tax_contribution_mult = 0.05
		monthly_dynasty_prestige_mult = 0.05
		monthly_prestige_gain_mult = 0.2
	}

	county_modifier = {
		county_opinion_add = 5
	}

	province_modifier = {
		stationed_maa_damage_add = 20
		stationed_maa_damage_mult = 0.1
	}

	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for special buildings
			factor = 0
			free_building_slots > 0
		}
	}

	on_complete = {
		root = { save_scope_as = legendary_province }

		county.holder = {
			if = {
				limit = {
					has_trait = august
				}
				add_prestige = 400
			}
			else = {
				add_trait = august
			}
		}
	}

	type = special

	flag = travel_point_of_interest_martial
}

legendary_watchtower = {

	asset = {
		type = pdxmesh
		name = "fp4_legendary_western_watchtower_01_a_mesh"
	}

	construction_time = very_slow_construction_time

	type_icon = "icon_building_legendary_watchtower.dds"

	can_construct = {
		scope:holder = {
			dynasty = {
				has_dynasty_perk = ce1_heroic_legacy_5
			}
		}
	}

	is_enabled = {
		always = yes
	}

	cost = {
		gold = 1000
		prestige = 1000
	}

	character_modifier = {
		glory_hound_opinion = 5
		men_at_arms_limit = 1
	}

	county_modifier = {
		tax_mult = 0.1
		development_growth_factor = 0.1
		supply_limit = 2000
		hostile_raid_time = 0.35
	}

	province_modifier = {
		stationed_maa_toughness_add = 10
		stationed_maa_toughness_mult = 0.2
		stationed_maa_damage_add = 10
		stationed_maa_damage_mult = 0.2
		fort_level = 4
		garrison_size = 2
		travel_danger = -25
	}

	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for special buildings
			factor = 0
			free_building_slots > 0
		}
	}

	on_complete = {
		root = { save_scope_as = legendary_province }

		county.holder = {
			if = {
				limit = {
					has_trait = lifestyle_blademaster
				}
				add_trait_xp = {
					trait = lifestyle_blademaster
					value = 30
				}
			}
			else = {
				add_trait = lifestyle_blademaster
				add_trait_xp = {
					trait = lifestyle_blademaster
					value = 30
				}
			}
		}
	}

	type = special

	flag = travel_point_of_interest_martial
}

legendary_hunting_lodge = {

	asset = {
		type = pdxmesh
		name = "fp4_legendary_desert_hunting_lodge_01_a_mesh"
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_hunting_lodge_01_a_mesh"
		graphical_regions = { graphical_western graphical_mediterranean }
	}

	asset = {
		type = pdxmesh
		name = "fp4_legendary_building_norse_meadhall_01_a_mesh"
		graphical_cultures = { norse_building_gfx }
		graphical_regions = { graphical_western }
	}

	construction_time = very_slow_construction_time

	type_icon = "icon_building_legendary_hunting_grounds.dds"

	is_enabled = {
		always = yes
	}

	cost = {
		gold = 1000
		prestige = 1000
	}
	effect_desc = ep2_activities_legacy_4_hunts_up_legendary_hunt_sightings_effect 

	character_modifier = {
		lifestyle_hunter_xp_gain_mult = 0.2
		parochial_opinion = 5
		parochial_tax_contribution_mult = 0.1
		monthly_prestige_gain_mult = 0.05
		stress_gain_mult = -0.15
		stress_loss_mult = 0.15
		court_grandeur_baseline_add = 4
	}

	county_modifier = {
		tax_mult = 0.1
	}

	province_modifier = {
		travel_danger = -5
		stationed_maa_toughness_add = 20
		stationed_maa_toughness_mult = 0.1
	}

	ai_value = {
		base = 100
		modifier = { # Fill all building slots before going for special buildings
			factor = 0
			free_building_slots > 0
		}
	}

	on_complete = {
		root = { save_scope_as = legendary_province }

		county.holder = {
			if = {
				limit = {
					has_trait = lifestyle_hunter
				}
				add_trait_xp = {
					trait = lifestyle_hunter
					track = hunter
					value = 30
				}
			}
			else = {
				add_trait = lifestyle_hunter
				add_trait_xp = {
					trait = lifestyle_hunter
					track = hunter
					value = 30
				}
			}
		}
	}

	type = special

	flag = travel_point_of_interest_martial
}
