Newbie Question: Granting Strategic Spells via Equipped Weapon?
Alas, it stubbornly insists on not working.
I'm trying to create a staff that, for as long as it remains equipped, gives the sovereign/champion access to the Corruption spell (turn a shard into a Death shard). I've had no problem getting combat spells to work, but no matter what I try, I can't get Corruption to show up outside of tactical combat. (I did manage to have it appear within combat, but that's not entirely useful.)
Here's the staff:
- <GameItemType InternalName="Staff_Soulwrack">
- <DisplayName>Soulwrack Staff</DisplayName>
- <Description>The Soulwrack Staff is not merely a symbol of the High Priest's office: It is a conduit to his dying homeland. Reaching across the infinite nothing of the Fractured Deep, it writhes with the corrupt magics of Hex---and it bequeaths upon its wielder the ability to channel the Void in the land of Elemental.</Description>
- <Type>Weapon</Type>
- <Type>Defense</Type>
- <WeaponType>Spear</WeaponType>
- <WeaponUpgradeType>Staff</WeaponUpgradeType>
- <CanBeEquipped>1</CanBeEquipped>
- <CustomizationPointCost>2</CustomizationPointCost>
- <ShopValue>390</ShopValue>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>UnitStat_Attack_Pierce</StrVal>
- <Value>4</Value>
- </GameModifier>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>UnitStat_ChanceToCrit</StrVal>
- <Value>-1</Value>
- </GameModifier>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>AdjustUnitStat</Attribute>
- <StrVal>UnitStat_SpellDamage</StrVal>
- <Value>25</Value>
- <Provides>+25% Spell Damage</Provides>
- </GameModifier>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>UnlockUnitAbility</Attribute>
- <StrVal>Spell_ExNihilo</StrVal>
- <Provides>Unlocks Ex Nihilo, a spell that can convert any shard under your control into a Death shard.</Provides>
- </GameModifier>
- <GameModifier>
- <ModType>Unit</ModType>
- <Attribute>UnlockCombatAbility</Attribute>
- <StrVal>ShadowsReach</StrVal>
- <Provides>Unlocks Shadow's Reach, a spell that causes all negative spells on a unit to spread to each of its allies.</Provides>
- </GameModifier>
- <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
- <RarityDisplay>Unique</RarityDisplay>
- <HeroOnly>1</HeroOnly>
- <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
- <AIData AIPersonality="AI_General">
- <AIPrefType>AIPrefType_BLUNT</AIPrefType>
- <AIPriority>79</AIPriority>
- </AIData>
- <ArtDef>Staff_Spell_ArtDef</ArtDef>
- <GameItemTypeArtDef InternalName="Staff_Spell_ArtDef">
- (art def stuff)
- </GameItemTypeArtDef>
- </GameItemType>
Shadow's Reach works fine; Ex Nihilo is the problem. I originally had it set up like Shadow's Reach (as a combat ability), but that only made it available in combat. After poking around the game's XML files, I followed the template for Spell_ObsessionAbility (in CoreAbilities.xml), and tried to make the staff grant an ability, which in turn granted access to the spell:
- <AbilityBonus InternalName="Spell_ExNihiloAbility">
- <AbilityBonusOption InternalName="Spell_ExNihilo">
- <DisplayName>Ex Nihilo</DisplayName>
- <Description>Unlocks Ex Nihilo, a spell that can convert any shard under your control into a Death shard.</Description>
- <Icon>S_ExNihilo_Icon.png</Icon>
- <GameModifier>
- <Provides>Darken a shard in your empire with the long shadow of Hex, destroying all that it was until only the empty void of a Death shard remains.</Provides>
- </GameModifier>
- <IsCombatAbility>1</IsCombatAbility>
- <AIData AIPersonality="AI_General">
- <AIPriority>5</AIPriority>
- </AIData>
- </AbilityBonusOption>
- </AbilityBonus>
... and then the spell itself:
- <SpellDef InternalName="ExNihilo">
- <DisplayName>Ex Nihilo</DisplayName>
- <Description>Darken a shard in your empire with the long shadow of Hex, destroying all that it was until only the empty void of a Death shard remains.</Description>
- <Image>S_ExNihilo_Painting.png</Image>
- <IconFG>S_ExNihilo_Icon.png</IconFG>
- <AutoUnlock>1</AutoUnlock>
- <SpellBookSortCategory>World</SpellBookSortCategory>
- <SpellBookSortSubCategory>Other</SpellBookSortSubCategory>
- <SpellType>Strategic</SpellType>
- <SpellClass>Other</SpellClass>
- <SpellSubClass>Other</SpellSubClass>
- <SpellTargetType>RegularShard</SpellTargetType>
- <SpellTargetZOCType>Friendly</SpellTargetZOCType>
- <Prereq>
- <Type>AbilityBonusOption</Type>
- <Attribute>Spell_ExNihilo</Attribute>
- </Prereq>
- <SpellResourceCost>
- <Resource>Mana</Resource>
- <Amount>50</Amount>
- </SpellResourceCost>
- <GameModifier>
- <ModType>Map</ModType>
- <Attribute>ChangeShardType</Attribute>
- <StrVal>DeathShard</StrVal>
- </GameModifier>
- <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>
It occurs to me that this might not be doable, considering there's little use for it (I mean, for strategic spells, you could always just equip the weapon, cast the spell, then tuck it away somewhere). But I'm hoping it's possible, as I'm going for a thematic effect here more than anything.
Any help/insights you can offer are much appreciated, and I apologize in advance if I've made some obvious typo that explains everything---I've been tinkering and experimenting with this all afternoon to no avail, and this is only my most recent attempt!