I was trying to make some tests using delay_mod attribute from the character object.
I made an attack hook that, in its end, changed the delay mod to:
-1 * CURRENT_SWING_DELAY + X;
so it'd ignore pol's calculated delay and use X as new swing delay.
here is the code: http://darvia.50webs.com/attack.txt
To help you, to just read the attack() function (which is the important one), here it goes:
ws2ms() gets the weapon speed and some value to be used as dexterity and return the time in ms to wait to do another attack.
attackerInfo.cfginfo = "::itemdesc" (it can vary, but this is its value within the test I've made).
attackerInfo.type = object type of intrinsic weapon (it can vary, but this is its value within the test I've made).
weaponSpeed = is holding the intrinsic weapon speed (found in itemdesc) (it can vary, but this is its value within the test I've made).
delayTime = -3000
now, the possible bug is pol core is chancing delay_mod to 0. the output of syslog is returning something like this:
Code: Select all
[pkg/combat/attack.ecl]: delay mod:0
[10/04 03:43:30] [pkg/combat/attack.ecl]: delay mod:-3000
[10/04 03:43:31] [pkg/combat/attack.ecl]: delay mod:0
[10/04 03:43:34] [pkg/combat/attack.ecl]: delay mod:-3000
[pkg/combat/attack.ecl]: delay mod:0
[10/04 03:43:37] [pkg/combat/attack.ecl]: delay mod:0
[pkg/combat/attack.ecl]: delay mod:-3000
[10/04 03:43:41] [pkg/combat/attack.ecl]: delay mod:-3000
[pkg/combat/attack.ecl]: delay mod:0
[10/04 03:43:44] [pkg/combat/attack.ecl]: delay mod:0
[pkg/combat/attack.ecl]: delay mod:-3000
[10/04 03:43:48] [pkg/combat/attack.ecl]: delay mod:-3000
[pkg/combat/attack.ecl]: delay mod:0
[10/04 03:43:51] [pkg/combat/attack.ecl]: delay mod:0
You'll notice, also, that I have two lines like this:
Code: Select all
attacker.delay_mod := delayTime;
Before using delayTime, I was using this:
Code: Select all
(-1 * ws2ms(weaponSpeed, dexterity)) + 500
It can be helpful to point out that my pc's dex is very very low, 35 to be exact.
In general, the possible bug here is that POL is changing the value os delay_mod to 0 before using it, which makes it useless.
As a post note here, what I think it is happening is that POL CORE automaticaly changes delay_mod to 0 after using it (tries to), I think this set to 0 thing could be left to the scripter, don't you think?
using:
Windows XP sp2
POL 097 released at: September 01, 2008
when POL is starting, this msg appears, it seems to be a version identifier, so, its here too:
Code: Select all
POL097-2008-09-01 Coregina (VS.NET 2003)
compiled on Sep 1 2008 21:57:58