Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative time on debuffs #5

Open
pogramos opened this issue Jun 9, 2022 · 5 comments
Open

Negative time on debuffs #5

pogramos opened this issue Jun 9, 2022 · 5 comments
Assignees

Comments

@pogramos
Copy link

pogramos commented Jun 9, 2022

Problem

Everytime I cast a ninjutsu on a monster for the first time, it starts with the normal time till zero and then it keeps going...

Should it behave like this?

I tested with other debuffs like "Dia" and it worked normally

image

@lenonk lenonk assigned lenonk and ThornyFFXI and unassigned lenonk Jun 9, 2022
@lenonk
Copy link
Owner

lenonk commented Jun 9, 2022

No, it shouldn't, but it's because the duration library that it depends on is still beta and incomplete. I haven't looked at the code to make sure of that, but I'm all but certain that's the case, since this code doesn't handle any durations at all.

Edit: At least, it was beta and incomplete the last time I talked to the owner about it. I haven't been able to play FFXI in months, so I haven't heard much about it. We'll let him weigh in here.

@ThornyFFXI
Copy link
Collaborator

By the sounds of it, the correct time is displayrd and its failing to clear at 0. I would guess ninjutsu uses a different action message to notify you it wore off and the addon isn't recognizing it, so it isn't cleared when it wears. This is almost certainly not related to duration lib, but if you are unable to look into it I can probably do so in the next week.

@lenonk
Copy link
Owner

lenonk commented Jun 9, 2022

@ThornyFFXI You're probably right. The last time I saw this exact problem it was because the duration of the ability was reported incorrectly (too short) by the duration lib, but if you're sure those are correct, then the wear off message isn't being handled appropriately. Should be an easy fix, but I've got my hands full writing Suricata modules 16 hours a day at the moment. It's probably a 5 minute fix though. I'll see if I can find some time to look into it on Saturday, unless you get to it first.

@lenonk
Copy link
Owner

lenonk commented Jun 9, 2022

@ThornyFFXI If it is a missing action message, the code in question is:

`local function HandleActionMessage(data)
local message = {}
message.target_id = struct.unpack('I', data, 0x09)
message.param_1 = struct.unpack('I', data, 0x0D)
message.message_id = struct.unpack('H', data, 0x19) % 32768

local db_target = debuffs.debuffs[message.target_id] or nil

-- Target died
if T{6, 20, 113, 406, 605, 646}:hasval(message.message_id) then
    debuffs.debuffs[message.target_id] = nil
    
-- Debuff expired
elseif T{64, 204, 206, 350, 531}:hasval(message.message_id) then
    if db_target and db_target.effects[message.param_1] then
        db_target.effects[message.param_1].duration = -1
        db_target.effects[message.param_1].o_time = ashita.time.clock()['ms']
    end
end

end`

The appropriate message ID just needs to be added in the elseif above, which is line 162 in debuffs.lua.

@ThornyFFXI
Copy link
Collaborator

I looked into this. Huton doesn't display a visible action message upon expiration, it's just elemental resistance-. It seems that you're using a default debuff image, and your code does not actually clear debuffs unless a message is received? This is nothing to do with my lib, and I did not sign up to manage someone else's code.

@ThornyFFXI ThornyFFXI assigned lenonk and unassigned ThornyFFXI Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants