You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
local ____exports = {}
|
|
local _, _Mekanome = ...
|
|
local Mekanome = _Mekanome
|
|
--- Creates a useable aura
|
|
local function Create(id, isPlayerAura)
|
|
return {id = id, isPlayerAura = isPlayerAura}
|
|
end
|
|
--- Returns whether or not an aura is active in a list of auras
|
|
local function IsUp(aura, mob, secondsToIgnore)
|
|
local isUp = false
|
|
for ____, auraData in pairs(mob.auras) do
|
|
local matchesPlayerFilter = aura.isPlayerAura == nil or auraData.sourceUnit == "player"
|
|
if auraData.spellId == aura.id and matchesPlayerFilter then
|
|
if auraData.expirationTime == 0 then
|
|
isUp = true
|
|
else
|
|
local expirationTime = auraData.expirationTime - GetTime()
|
|
if secondsToIgnore ~= nil then
|
|
isUp = expirationTime > secondsToIgnore
|
|
else
|
|
isUp = expirationTime > 0
|
|
end
|
|
end
|
|
break
|
|
end
|
|
end
|
|
return isUp
|
|
end
|
|
local _AuraUtils = {IsUp = IsUp, Create = Create}
|
|
Mekanome.AuraUtils = _AuraUtils
|
|
return ____exports
|
|
|