Probably I'm doing something wrong... Somehow the indices in UnitBuffInfo( unit, int index ) and UnitBuffLeftTime( unit, int index ) seem to be mixed up...
I have the following buffs
an this code:
for j=1,100 do
local buff_name, _, _, buff_id = UnitBuffInfo("player", j)
if buff_name ~= nil then
local buff_time_left = UnitBuffLeftTime("player", j)
DEFAULT_CHAT_FRAME:AddMessage(buff_name.."-"..tostring(buff_id).."-"..tostring(buff_time_left))
end
end
which gives
Fine:
* Fioletowa Aura-1500333-nil
* Cierpliwość Arcadii-1500765-nil
* Opieka nad Wierzchowcem VIII-502986-438.4860534668
* Wiążąca Umowa-620951-nil
* Kryształ Natury-503948-nil
* Sys1501924_name-1501924-nil (probably, no idea :P)
But the rest is mess:
* Modlitwa Zniszczenia-1501466-6136.5874023438 - left time should be nil, seems to be time left for Dusza Trenera Broni-1500352
* Sys1500766_name-1500766-5.334990978241 - this seems like time for Przyspieszenie Kryształu-620703?
* Dusza Trenera Broni-1500352-nil - the 6.1k above would be right
* Przyspieszenie Kryształu-620703-nil - the 5 seconds above would be right
I'm probably doing it wrong: what is the correct way to find matching UnitBuffInfo and UnitBuffLeftTime?