spell creation

I'm trying to create a spell that does 1 damage per caster level plus 1 per shard.  Unfortunately XML defeats me.  Here's what I got, but its not working, it always does 0 damage.  Can anyone tell me the problem?

 

 <GameModifier>

            <ModType>Unit</ModType>
            <Attribute>CurHealth</Attribute>
            <IsForFormattedDescription>1</IsForFormattedDescription>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[UnitOwner_GetNumDeathShards] + [UnitOwner_GetNumFireShards] + [UnitOwner_GetNumEarthShards] + [UnitOwner_GetNumLifeShards] + [UnitOwner_GetNumAirShards] + [UnitOwner_GetNumWaterShards] + [UnitOwner_GetLevel]]></Expression>
            </Calculate>UnitOwner_GetLevel
            <Calculate InternalName="Value">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
            <Calculate InternalName="ValueForFormattedDescription">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
        </GameModifier>
4,083 views 6 replies
Reply #1 Top

You have to break up your calculate tags into sections with one operator each.

Calc1 = UnitOwner_GetNumDeathShards + UnitOwner_GetNumFireShards

Calc2 = Calc1 + Unit_Owner_GetNumEarthShards

Calc3 = Calc2 + UnitOwner_GetNumLifeShards

and so on.

The ONLY exception to using one operator is when you use * or / and want to inverse the second value with a - ie

Calc1 = 6 * -3

Reply #2 Top

Also try UnitOwner_GetNumAllShards I see it in the fallenenchantress.exe code but I don't know if it includes everything right.

Reply #3 Top

Quoting Heavenfall, reply 2

Also try UnitOwner_GetNumAllShards I see it in the fallenenchantress.exe code but I don't know if it includes everything right.

I'm pretty sure it's not working correctly.

Reply #4 Top

Quoting Heavenfall, reply 1

 The ONLY exception to using one operator is when you use * or / and want to inverse the second value with a - ie

Calc1 = 6 * -3

Has the - to be on the second operator? Can't it be  

Code: xml
  1. Calc1 = -6 * 3
    ?

Reply #5 Top

Don't know.

Reply #6 Top


If that was the case, it would explain some "ghost" bugs.