Turns out a Trophy can actually be any improvement a city has. I think a Trophy is specifically a building without a visible building on the map. But you can use the Trophy code for any building.
This is my modified code from your XtraTrading mod, first, from the XtraTradingItems.xml:
Code: xml
- <GameItemTypes>
- <GameItemType InternalName="AmuletOfFlames_RARE">
- <DisplayName>Amulet of Flames II</DisplayName>
- <Description>When it is worn even the wearer's caress burns those he or she touches. Although some see this as a weapon, the Quendar are known to use it for pleasure.</Description>
- <Type>Accessory</Type>
- <CanBeEquipped>1</CanBeEquipped>
- <ShopValue>300</ShopValue>
- <AdditionalTrainingTurns>24</AdditionalTrainingTurns>
- <Prereq>
- <Type>City_Trophy</Type>
- <Attribute>ShopVaultf1b</Attribute>
- <Target>City</Target>
- </Prereq>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>UnitStat_Attack_Fire</StrVal>
- <Value>3</Value>
- </GameModifier>
- <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
- <Likelihood>100</Likelihood>
- <RarityDisplay>Rare</RarityDisplay>
- <IsUsable>0</IsUsable>
- <Prereq>
- <Type>UnitStat_Level</Type>
- <Attribute>7</Attribute>
- </Prereq>
- <ArtDef>AmuletOfFlames_ArtDef2</ArtDef>
- <GameItemTypeArtDef InternalName="AmuletOfFlames_ArtDef2">
- <GameItemTypeModelPack InternalName="AmuletOfFlames_Default2">
- <IconFile>Gfx//Xtra//Icons//AmuletofFlame_Item2.png</IconFile>
- </GameItemTypeModelPack>
- </GameItemTypeArtDef>
- </GameItemType>
Second, a modified part of XtraTradingImprovements.xml:
Code: xml
- <ImprovementType InternalName="ShopVaultf1b">
- <DisplayName>A Vault I f1b</DisplayName>
- <Description>Supplies your local shop and local units with 1 rare item</Description>
- <RequiresCity>1</RequiresCity>
- <RequiresForceUnlock>1</RequiresForceUnlock>
- <BarredTerrain>River</BarredTerrain>
- <BarredTerrain>SwampTerrain</BarredTerrain>
- <PreferredTerrain>City</PreferredTerrain>
- <PreferredTerrain>Category:Land</PreferredTerrain>
- <PreferredTerrain>Forest</PreferredTerrain>
-
- <UnlocksShopItem>AmuletOfFlames_RARE</UnlocksShopItem>
- <Prereq>
- <Type>Resource</Type>
- <Attribute>TileYieldEssence</Attribute>
- </Prereq>
- <LaborToBuild>1</LaborToBuild>
- <AIData AIPersonality="AI_General">
- <AIPriority>10</AIPriority>
- <AITag>Merchant</AITag>
- </AIData>
- <ArtDef>Art_TreasuryVault</ArtDef>
- </ImprovementType>
And removed the bit about choosing a random modifier, so they all unlock:
Code: xml
- <SpellDef InternalName="SVault1FSpell">
- <DisplayName>Shop Vault I - Fortress</DisplayName>
- <Description>This fulfills one of the requirements to unlock the Shop Vault I Improvement</Description>
- <Image>SVault1FSpell.png</Image>
- <IconFG>SVault1FSpell.png</IconFG>
- <CanStack>0</CanStack>
- <SpellBookSortCategory>City</SpellBookSortCategory>
- <SpellBookSortSubCategory>CityCurse</SpellBookSortSubCategory>
- <SpellType>Strategic</SpellType>
- <SpellTargetType>FriendlyCity</SpellTargetType>
- <SpellResourceCost>
- <Resource>Gold</Resource>
- <Amount>10</Amount>
- </SpellResourceCost>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1a</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1b</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1c</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1d</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1e</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1f</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1g</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1h</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1i</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
- <GameModifier>
- <ModType>City</ModType>
- <Attribute>UnlockImprovement</Attribute>
- <StrVal>ShopVaultf1j</StrVal>
- <Duration>-1</Duration>
- </GameModifier>
So it is not necessary to have the tag to allow for unit design in the actual item definition, but it is necessary to use the unlocks shop item for an improvement to sell that item in that city.
Do you know how you will make one item require different versions of the shop vault? As far as I know, you can't have a whole lot of prereqs and say to the game "you only need one of these".
But for one item, all you need to do is define the item with the Trophy requirement of the Vault building for any building that unlocks that item for unit design, keep the UnlocksShopItem tag in there to unlock the item in the shop, and that item will be unlocked for unit design and the shop when that Trophy (read: improvement) is built.