I'm skared/befuddled. Trying to apply stat modifier to an item.

OK, so I'm trying to make an item (let's call it a Mage's Robe for now), that adds 1/3 of the Wearer's INT to his defense/armor stat.

I've seen this (copied from a spell):

 <Calculate InternalName="DamageFromINT" ValueOwner="CastingUnit">
        <Expression><![CDATA[[UnitStat_Intelligence] * 0.3]]></Expression>
      </Calculate>
      
      <Calculate InternalName="Value">
        <Expression><![CDATA[[DamageFromINT]]]></Expression>
      </Calculate>

But, I am not sure how to translate this into a 'persistent' effect, i.e the bonus applies as long as the Mage wears the robe.  Any suggestions on how I should phrase this so that the item applies the intended bonus?

I saw an earlier thread where a guy tried to do something similar (back in August), but it wasn't working for him, and he didn't get a response...

Help!!!

3,045 views 8 replies
Reply #1 Top

As far as I know, you can't have <Calculate> tags used in anything except spells.

Reply #2 Top

So, I'm guessing something like this won't work either:

    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>AdjustUnitStat</Attribute>
      <StrVal>UnitStat_Defense</StrVal>
      <Value>[[UnitStat_Intelligence]*.33]</Value>
    </GameModifier>

Edit: Yup, this doesn't work...

Reply #3 Top

Game items don't allow you to calculate at all, so you can't have items which scale based upon the dude. I hope in the future that this is changed, but for now, you will have to simply add some kind of temp effect.

Reply #4 Top

Quoting tjashen, reply 2
So, I'm guessing something like this won't work either:

    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>AdjustUnitStat</Attribute>
      <StrVal>UnitStat_Defense</StrVal>
      <Value>[[UnitStat_Intelligence]*.33]</Value>
    </GameModifier>

Edit: Yup, this doesn't work...
End of tjashen's quote

 

How about instead of using value, you try <Multiplier>1.33</Multiplier>

 

Reply #5 Top

Just tried

<Multiplier>[[UnitStat_Intelligence]*1.33]</Multiplier>

No dice.  Value is 0.

I'm trying to increase Defense by 1/3 of Intelligence.  There's a more cluttered way to do this, but I'd rather not have to make multiple items...

Reply #6 Top

Just tried

[[UnitStat_Intelligence]*1.33]

No dice. Value is 0.

I'm trying to increase Defense by 1/3 of Intelligence. There's a more cluttered way to do this, but I'd rather not have to make multiple items...
End of quote

Im fairly certain that these calculations are done when the item is loaded into the game and so unitstat_intelligence is 0. What is this more cluttered method you speak of?

Reply #7 Top

Essentially, making multiple items, each with higher bonuses, with minimum Intelligence requirements to purchase.  Assuming you could do a <prerequisite>Intelligence check...

Another way is to make a spell effect, but that'd take action points to 'activate' the bonus to defense.  I was hoping for an easier solution.

Reply #8 Top

Regarding the ValueOwner tag:

I've seen CastingUnit and TargetUnit as variables. 

What would be nice is if there was an EquippedUnit variable as well, for items.