((3 * caster_spl_lvl) + spl_cast_time) - dagger_hit_time = duration in seconds
The dagger hit time is when creature walks into dagger, whether instantly when spell is cast or later if it misses. So the duration of THAC0 debuff is based on when the spell was initially cast and starts counting down from there. If the creature gets hit immediately, then the hit time should be the same as the cast time so the duration would work out to be 3 * caster_spl_lvl (caster level has minimum of 3, so you can never have shorter time than 9 seconds from initial cast).
The bug in original version is caused by that the caster spell level value plus cast time is never set. So you have it calculating the duration as (0 - dagger_hit_time) which ends up being a very large number (negative rolls into positive). That's why the spell never wears off over time.
To fix it, I just added some code that makes sure that initial value gets set when creature is immediately hit with an Ice Knife dagger. The duration will be the maximum for getting hit right away, so 3 * caster level in seconds.
Many TNO's died in the process of testing Ice Knife traps.


Find content
Not Telling
Display name history

