As far as I remember, this functionnality is included in the "temple" buildings in EDB. If you call your building temple_something, then you will only be able to build one in each city and it will auto destruct when cdonquering a city with a different religion. The temple_ has hardcoded functionalities. in red here
Code:
building temple_horus-re
{
levels small_temple_horus-re temple_horus-re large_temple_horus-re
{
small_temple_horus-re requires factions { moors, sicily, }
{
capability
{
law_bonus bonus 2
}
material wooden
construction 6
cost 2000
settlement_min large_town
upgrades
{
temple_horus-re
}
}
temple_horus-re requires factions { moors, sicily, }
{
capability
{
law_bonus bonus 4
}
material wooden
construction 10
cost 5000
settlement_min city
upgrades
{
large_temple_horus-re
}
}
large_temple_horus-re requires factions { moors, sicily, }
{
capability
{
law_bonus bonus 6
}
material wooden
construction 15
cost 10000
settlement_min large_city
upgrades
{
}
}
}
plugins
{
}
}
If you want to have multiple religions in a city, then you must use other names and it will also remove the auto-destruct. Like in the following
Code:
building church_corellon_larethian
{
levels church_corellon_larethian temple_corellon_larethian cathedral_corellon_larethian
{
church_corellon_larethian requires factions { papal_states, russia, }
{
capability
{
recruits_exp_bonus bonus 1
recruit_pool "Yuirwood Druids" 5 5 5 0 requires factions { russia, } and hidden_resource yuirwood
}
material wooden
construction 6
cost 2000
settlement_min large_town
upgrades
{
temple_corellon_larethian
}
}
temple_corellon_larethian city requires factions { papal_states, russia, }
{
capability
{
recruits_exp_bonus bonus 2
recruit_pool "Yuirwood Druids" 5 5 5 0 requires factions { russia, } and hidden_resource yuirwood
}
material wooden
construction 10
cost 5000
settlement_min city
upgrades
{
cathedral_corellon_larethian
}
}
cathedral_corellon_larethian city requires factions { papal_states, russia, }
{
capability
{
recruits_exp_bonus bonus 4
recruit_pool "Yuirwood Druids" 5 5 5 0 requires factions { russia, } and hidden_resource yuirwood
}
material wooden
construction 15
cost 10000
settlement_min large_city
upgrades
{
}
}
}
plugins
{
}
}