Thread: Stun Bug
View Single Post
  #2  
Old 10-05-2002, 12:00 AM
Kaiyodo
Hill Giant
 
Join Date: Jan 2002
Location: Midlands,UK
Posts: 149
Default

I think I know why this bug occurs. It will occur with spells that have a stun component which isn't the primary effect, in this specific case Anarchy has damage as it's main component and the stun as a secondary effect.

The code assumes that the duration of a stun spell is the base value of the first effect in the spell ..

Spells.cpp : Line 577

CastToClient()->Stun(spells[spell_id].base[0]);

For anarchy this value will be -171. What it should be using is the value of base[1] as the stun is the second spell effect. This gives a more reasonable value of '1'.

The reason you get such a long stun is that when -171 is converted to an unsigned number somewhere on the way to the stun function it becomes (assuming a 16 bit value) 65365. That's a 65 second stun!

K.
Reply With Quote