06-29-2015, 02:35 PM
MissingBuffs is a lua function that we created, so the documentation is already pre-existing so to speak, as are most of our functions really. The API handles the basics, the lua API turns them into most of what you see being used.
In ffxiv_helpers.lua (currently line 1212):
In ffxiv_helpers.lua (currently line 1212):
Code:
function HasBuffs(entity, buffIDs, dura, ownerid)
local duration = dura or 0
local owner = ownerid or 0
local buffs = entity.buffs
if (buffs == nil or TableSize(buffs) == 0) then return false end
for _orids in StringSplit(buffIDs,",") do
local found = false
for _andid in StringSplit(_orids,"+") do
found = false
for i, buff in pairs(buffs) do
if (buff.id == tonumber(_andid)
and (duration == 0 or buff.duration > duration or HasInfiniteDuration(buff.id))
and (owner == 0 or buff.ownerid == owner))
then
found = true
end
end
if (not found) then
break
end
end
if (found) then
return true
end
end
return false
end
function MissingBuffs(entity, buffIDs, dura, ownerid)
local duration = dura or 0
local owner = ownerid or 0
--If we have no buffs, we are missing everything.
local buffs = entity.buffs
if (buffs == nil or TableSize(buffs) == 0) then
return true
end
--Start by assuming we have no buffs, so they are missing.
local missing = true
for _orids in StringSplit(buffIDs,",") do
missing = true
for _andid in StringSplit(_orids,"+") do
for i, buff in pairs(buffs) do
if (buff.id == tonumber(_andid)
and (duration == 0 or buff.duration > duration or HasInfiniteDuration(buff.id))
and (owner == 0 or buff.ownerid == owner))
then
missing = false
end
end
if (not missing) then
break
end
end
if (missing) then
return true
end
end
return false
end