1.06 bug - Troll Shaman confusion ability spell

The Troll Shaman has an ability that pops up "confusion" around a unit that reduces a units attack value. It tends to cast it twice per turn. However I've had one of my company of units with ~400 base attack, get reduced to -1000+ attack, only to have the shaman recast the spell and give me +12000 attack (really absurdly high attack values).

The ability also doesn't reset at the end of combat, but transfers over a couple game turns on the strategic map or a couple combat turns in a subsequent combat. So I could use my +12000 attack unit on a 2nd combat for a couple turns before the ability elapsed.

5,107 views 6 replies
Reply #1 Top

Yup, this is a bug with the spell/ability. I've had the same behavior.

Here's the spell's modifier function (from the data\English\CoreSpells_COMBAT_Tactical.xml file): [CDATA[[UnitStat_Attack] * -0.5]]

According to the text, it should just be [CDATA[[UnitStat_Attack] * 0.5]], so that the attack doesn't go negative.

There's something else going on with it as well, though, because it's not just a negative attack value but it grows. Maybe that's a side effect of a negative value being fed to whatever the next step in the attack value calculation is.

[Edit]

I should add that I haven't tried making that change yet to see if it's really that simple, but I probably will this afternoon.

Reply #2 Top

Had it cast on one of my dragons and he couldn't hit with his irresistible ability.

Reply #3 Top

I have idea what could happen with this spell.

Does wacky numbers only happen with grouped units?

In my last battle, I had as group of 4 observers (4x3att=12). two enemy shamans cast confusion twice on them without any change of attack value.

After battle, I got -6 and +6 attack buff on same unit, which wearied off turn later.

 

Here is what I think happened:

-spell pulled [UnitStat_Attack] value of full stack, which is 12

-then added -6 debuff per every solider in the group

-that means 3-6=-3 attack per solider, or group with attack of -12

-other casting of confusion did same thing in reverse, giving +6 attack per solider

-end result: everything stayed same

 

Reply #4 Top

I've experimented a bit with modding of Confusion spell (used both as troll ability and combat school spell).

This is original calculation code from the spell:

Code: xml
  1.             <Calculate InternalName="TargetAttack" ValueOwner="TargetUnit">
  2.                 <Expression><![CDATA[[UnitStat_Attack] * -0.5]]></Expression>
  3.             </Calculate>
  4.             <Calculate InternalName="Value">
  5.                 <Expression><![CDATA[[TargetUnitAttack]]]></Expression>
  6.             </Calculate>

If modified to this:

Code: xml
  1.             <Calculate InternalName="TargetAttack" ValueOwner="TargetUnit">
  2.                 <Expression><![CDATA[[UnitStat_Attack] * -0.5]]></Expression>
  3.             </Calculate>
  4.             <Calculate InternalName="TargetPerUnitAttack" ValueOwner="TargetUnit">
  5.                 <Expression><![CDATA[[TargetAttack] / [TroopCount]]]></Expression>
  6.             </Calculate>
  7.             <Calculate InternalName="Value">
  8.                 <Expression><![CDATA[[TargetPerUnitAttack]]]></Expression>
  9.             </Calculate>

Confusion will work properly for single units (as before) as well as for full groups. Additional code reduces penalty by number of people in group, so that penalty per person gets properly calculated.

Unfortunately, it only works good this way, if stack is fully healed, since [TroopCount] counts current number of troops in unit, while attack rating of the group never drops when soldiers start dying. This bug/feature messes up calculations.

So if there are 2 people in 4 unit group, spell will decrease attack rating for each unit in group by A*0.5/2=A/4, where A is attack rating of whole group (4 times higher then single solider attack regardless of losses). And since A/4 is also attack rating of single unit, in this particular scenario confusion will reduce attack rating of whole group to 0.

And in case of only one solider remaining in 4 unit group, it would lead to negative attack value (decrease per unit: A*0.5/1=A/2, so new attack of single solider is A/4-A/2= -A/4, and of full troop -A).

Reply #5 Top

There is additional issue with confusion too.

It affects very badly units with lots of strength.

Since it uses "total" attack rating of unit for calculations, but applies bonus to base attack, it can happen 1/2 of "total" be higher then base attack rating of units (especially true for various monsters that roam around), which could lead to negative attack rating after using confusion spell.

For example, a troll with base attack of 10 and strength of 30, has total attack rating of 30. When 15 is deduced from 10, you get -5 base attack, which multiplied by strength gives -15 attack after confusion.

Reply #6 Top

There is one more issue with confusion (1.07). Rewards are apparently tied to enemies combat rating and when you cast confusion that combat rating drops a lot. This means that when you cast confusion on the enemy and kill it while confusion is in effect, you will get less gildar/experience as a reward.