This is really bugging me (no pun intended) so I researched it as much as I could.
What seemed wrong was:
Which made no sense. The time argument was a packed string of some sort, I could tell because the original writer used:
Code: Select all
print unpack("H2",$args->{time})."\n";
This actually seemed out of place to me since it would print a random string in the console. It did not seem like something that would be in the finished product. I figured out, after staring at it for a couple hours, that it was probably used to see what the unpacked string turned out to be when unpacked using different methods (by changing the "H2" parameter).
So I researched some perl and found that the "H2" parameter for unpack basically returns a 2 digit hex value. That seemed wrong, since I know the $time argument for setstatus() is supposed to be in milliseconds. At this point I basically figured, what the hell, why not just try different unpack parameters and see if any of them return reasonable decimal values. I picked "S" to start with and I was very pleased to find that the resulting values returned matched exactly with every skill re use delay I tested.
I switched it to "L" because shorts won't work for some of the longer re-use delays. (Mandragora howling, 30minutes or 1800000 ms).
When committed, the following code will correctly apply "<skillname> Delay" as a status effect (viewable by console command "s") for the correct duration. This can be used by the statusActive, statusInactive, and associated conditions in the blocks in the config.txt file.
sub skill_post_delay {
my ($self, $args) = @_;
my $ID = $args->{ID};
my $time = unpack("L",$args->{time});
my $skillName = (new Skill(idn=>$ID))->getName();
my $status = defined $statusName{'EFST_DELAY'} ? $statusName{'EFST_DELAY'} : ' Delay';
$char->setStatus($skillName.$status,1,$time);
}
Now, I don't know jack about perl or svn or trunk changes. So can someone help me with that?