I'm trying to create a Strategic spell that (1) randomly transforms a friendly shard into either a Fire Shard or a Death Shard AND (2) cannot be used more than once on the same shard.
I've gotten (1) to work as an independent spell, by using <AppliesRandomModifier> to choose between two separate <GameModifier> tags.
I've gotten (2) to work as an independent spell, thanks to Heavenfall's really clever solution, bless his heart: Make the spell also change the terrain type beneath the shard, and restrict the spell from being cast on that terrain type. This, too, works perfectly---the spell can change the terrain type while changing the shard, and doing so prevents the spell from working again on the same shard.
Problem: Getting (1) and (2) to work together in the same spell.
If I simply add the terrain-changing effect from (2) into (1) as a third <GameModifier>, it becomes affected by <AppliesRandomModifier> along with the two Shard-change options. (So, instead of a 50/50 chance to create a Fire/Death shard, with a 100% chance to change the terrain, I get a 33/33/33 split between creating a fire shard, creating a death shard, or changing the terrain.)
So, I'm looking for a way to restrict the scope of <AppliesRandomModifier> to the two shard-changing effects, and ensure the spell always applies the terrain-change effect.
Right now, I'm trying to solve this by breaking (1) and (2) into two independent "Sub-Spells", then having the main spell cast both of them via the UseSpell attribute. Unfortunately, this doesn't work: When I cast the spell, nothing happens but for the particle effect.
Here are the three spells:
Main Spell:
Code: xml
- <SpellDef InternalName="PromiseOfAsshai">
- <DisplayName>Promise of Asshai</DisplayName>
- <Description>Channel the essence of Asshai into the land of Elemental, randomly transforming a shard in your empire into a Fire shard or a Death shard.</Description>
- <Image>S_PromiseOfAsshai_Painting.png</Image>
- <IconFG>S_PromiseOfAsshai_Icon.png</IconFG>
- <AutoUnlock>1</AutoUnlock>
- <SpellType>Strategic</SpellType>
- <SpellClass>Other</SpellClass>
- <SpellSubClass>Other</SpellSubClass>
- <SpellTargetType>RegularShard</SpellTargetType>
- <SpellBookSortCategory>World</SpellBookSortCategory>
- <SpellBookSortSubCategory>Other</SpellBookSortSubCategory>
- <SpellTargetZOCType>Friendly</SpellTargetZOCType>
- <Prereq>
- <Type>UnitStat</Type>
- <Attribute>Spell_PromiseOfAsshai</Attribute>
- <Value>1</Value>
- </Prereq>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>UseSpell</Attribute>
- <StrVal>PromiseOfAsshai_ShardChange</StrVal>
- <Provides>Channel the essence of Asshai into the land of Elemental, randomly transforming a shard in your empire into a Fire shard or a Death shard.</Provides>
- </GameModifier>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>UseSpell</Attribute>
- <StrVal>PromiseOfAsshai_AshenLand</StrVal>
- <Provides>Channel the essence of Asshai into the land of Elemental, randomly transforming a shard in your empire into a Fire shard or a Death shard.</Provides>
- </GameModifier>
- <SpellResourceCost>
- <Resource>Mana</Resource>
- <Amount>50</Amount>
- </SpellResourceCost>
- <!-- Not sure if "BarredTerrain" works here, but I'd already done it this way when I saw that tag even existed, so... yeah. -->
- <ValidTerrainType>Land</ValidTerrainType>
- <ValidTerrainType>Rugged_Land</ValidTerrainType>
- <ValidTerrainType>Fertile_Land</ValidTerrainType>
- <ValidTerrainType>Chasm</ValidTerrainType>
- <ValidTerrainType>ChasmEdge</ValidTerrainType>
- <ValidTerrainType>DesertTerrain</ValidTerrainType>
- <ValidTerrainType>HillsTerrain</ValidTerrainType>
- <ValidTerrainType>SwampTerrain</ValidTerrainType>
- <ValidTerrainType>ArcticTerrain</ValidTerrainType>
- <ValidTerrainType>MountainRange</ValidTerrainType>
- <ValidTerrainType>MountainSide</ValidTerrainType>
- <ValidTerrainType>Forest</ValidTerrainType>
- <ValidTerrainType>Beach</ValidTerrainType>
- <ValidTerrainType>Cliff</ValidTerrainType>
- <ValidTerrainType>River</ValidTerrainType>
- <ValidTerrainType>City</ValidTerrainType>
- <ValidTerrainType>Submerged</ValidTerrainType>
- <ValidTerrainType>BurningLands</ValidTerrainType>
- <ValidTerrainType>Fissure</ValidTerrainType>
- <ValidTerrainType>CurgensTomb</ValidTerrainType>
- <ValidTerrainType>Imperium</ValidTerrainType>
- <ValidTerrainType>Scrapyard</ValidTerrainType>
- <ValidTerrainType>CaveWall</ValidTerrainType>
- <ValidTerrainType>Unknown</ValidTerrainType>
- <ValidTerrainType>Tomb</ValidTerrainType>
- <AIData AIPersonality="AI_General">
- <AIPriority>5</AIPriority>
- </AIData>
- <HitSoundFX>Spell_Consume_01</HitSoundFX>
- <SpellDefEffect>
- <EffectName>S_Corruption_Particle</EffectName>
- <LocalPosition>0,0,0</LocalPosition>
- <EffectScale>2</EffectScale>
- <EffectDelay>0</EffectDelay>
- <SnapToTerrain>1</SnapToTerrain>
- </SpellDefEffect>
- </SpellDef>
"Sub-Spell" (1), Changing the Shard:
Code: xml
- <SpellDef InternalName="PromiseOfAsshai_ShardChange">
- <DisplayName>Promise of Asshai</DisplayName>
- <Description>Channel the essence of Asshai into the land of Elemental, randomly transforming a shard in your empire into a Fire shard or a Death shard.</Description>
- <Image>S_PromiseOfAsshai_Painting.png</Image>
- <IconFG>S_PromiseOfAsshai_Icon.png</IconFG>
- <SpellType>Strategic</SpellType>
- <CanStack>0</CanStack>
- <HideInHiergamenon>1</HideInHiergamenon>
- <SpellClass>Other</SpellClass>
- <SpellSubClass>Other</SpellSubClass>
- <SpellTargetType>RegularShard</SpellTargetType>
- <SpellTargetZOCType>Friendly</SpellTargetZOCType>
- <IsCastable>0</IsCastable>
- <Prereq>
- <Type>AbilityBonusOption</Type>
- <Attribute>Unknowable</Attribute>
- </Prereq>
- <AppliesRandomModifier>1</AppliesRandomModifier>
- <GameModifier>
- <ModType>Map</ModType>
- <Attribute>ChangeShardType</Attribute>
- <StrVal>DeathShard</StrVal>
- </GameModifier>
- <GameModifier>
- <ModType>Map</ModType>
- <Attribute>ChangeShardType</Attribute>
- <StrVal>FireShard</StrVal>
- </GameModifier>
- <AIData AIPersonality="AI_General">
- <AIPriority>5</AIPriority>
- </AIData>
- <SpellDefEffect>
- <EffectName>S_Corruption_Particle</EffectName>
- <LocalPosition>0,0,0</LocalPosition>
- <EffectScale>2</EffectScale>
- <EffectDelay>0</EffectDelay>
- <SnapToTerrain>1</SnapToTerrain>
- </SpellDefEffect>
- </SpellDef>
"Sub-Spell" (2), Changing the Terrain:
Code: xml
- <SpellDef InternalName="PromiseOfAsshai_AshenLand">
- <DisplayName>Promise of Asshai</DisplayName>
- <Description>Channel the essence of Asshai into the land of Elemental, randomly transforming a shard in your empire into a Fire shard or a Death shard.</Description>
- <Image>S_PromiseOfAsshai_Painting.png</Image>
- <IconFG>S_PromiseOfAsshai_Icon.png</IconFG>
- <SpellType>Strategic</SpellType>
- <CanStack>0</CanStack>
- <HideInHiergamenon>1</HideInHiergamenon>
- <SpellClass>Other</SpellClass>
- <SpellSubClass>Other</SpellSubClass>
- <SpellTargetType>RegularShard</SpellTargetType>
- <SpellTargetZOCType>Friendly</SpellTargetZOCType>
- <IsCastable>0</IsCastable>
- <Prereq>
- <Type>AbilityBonusOption</Type>
- <Attribute>Unknowable</Attribute>
- </Prereq>
- <GameModifier>
- <ModType>Map</ModType>
- <Attribute>PlaceTerrain</Attribute>
- <TerrainType>AshenLand</TerrainType>
- </GameModifier>
- <AIData AIPersonality="AI_General">
- <AIPriority>5</AIPriority>
- </AIData>
- <SpellDefEffect>
- <EffectName>S_Corruption_Particle</EffectName>
- <LocalPosition>0,0,0</LocalPosition>
- <EffectScale>2</EffectScale>
- <EffectDelay>0</EffectDelay>
- <SnapToTerrain>1</SnapToTerrain>
- </SpellDefEffect>
- </SpellDef>
I suspect this has something to do with "UseSpell" not being intended for use in this manner (it only appeared on consumable items). But I couldn't find any other attributes that could call another spell outside of tactical combat.
Anyone know how I could pull this off? It's the final piece of the puzzle!