Enchantments from weapons

Is there a way to add a Spell Enchantment when equipping a weapon?

 

For Example:

Code: xml
  1. <GameItemType InternalName="Shortbow_Tarth">
  2. blah blah blah...
  3. <GameModifier>
  4. <ModType>Unit</ModType>
  5. <Attribute>CastSpellDef</Attribute> ' this part is what would be missing.
  6. <StrVal>Courage</StrVal>
  7. <Provides>Courage Spell</Provides>
  8. </GameModifier>
  9. ....
  10. </GameItemType>

5,080 views 3 replies
Reply #1 Top

I'm not sure if it can be done. The <Attribute>???</Attribute> I do not know of a tag that would do what you suggest. There is a <Attribute>BattleAutoCastSpell</Attribute>

You also have

<Attribute>UnlockSpell</Attribute>

But I'm unsure whether a weapon can have these game modifiers.

So, why not just give that particular bow the game modifier of +3 hit points and +3 spell resistance instead. The only thing that this would not be doing is using the lifeshard bonus, but I'm not sure this would be something a weapon should utilize.

Reply #2 Top

Yeh i figured out what i needed to do.  I used the AutoBattleCastThing...

 

basically ive wired up a "Ranger" champion path that utilizes a new UnitStat of US_Attack_Ranged

and i needed the values to only be added to attack if you are using a bow.

 

AutoBattleCast now adds a spell that adds US_Attack_Ranged * US_IsBow

 

Thanks for the reply.

Reply #3 Top

The AutoBattleCast is assigned upon picking the "Ranger" path.