Release Candidate 1

This commit is contained in:
Tercio Jose
2022-11-18 16:54:25 -03:00
parent bbbda84c68
commit 1c8dfb3ab7
96 changed files with 3053 additions and 1427 deletions
+129 -28
View File
@@ -19,6 +19,10 @@ local CONST_COOLDOWN_TYPE_DEFENSIVE_RAID = 4
local CONST_COOLDOWN_TYPE_UTILITY = 5
local CONST_COOLDOWN_TYPE_INTERRUPT = 6
--hold spellIds and which custom caches the spell is in
--map[spellId] = map[filterName] = true
local spellsWithCustomFiltersCache = {}
--simple non recursive table copy
function openRaidLib.TCopy(tableToReceive, tableToCopy)
if (not tableToCopy) then
@@ -137,8 +141,9 @@ function openRaidLib.GetUnitID(playerName)
return openRaidLib.UnitIDCache[playerName] or playerName
end
local filterStringToCooldownType = { --report: "filterStringToCooldownType doesn't include the new filters."
--report: "filterStringToCooldownType doesn't include the new filters."
--answer: custom filter does not have a cooldown type, it is a mesh of spells
local filterStringToCooldownType = {
["defensive-raid"] = CONST_COOLDOWN_TYPE_DEFENSIVE_RAID,
["defensive-target"] = CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET,
["defensive-personal"] = CONST_COOLDOWN_TYPE_DEFENSIVE_PERSONAL,
@@ -147,34 +152,116 @@ local filterStringToCooldownType = { --report: "filterStringToCooldownType doesn
["interrupt"] = CONST_COOLDOWN_TYPE_INTERRUPT,
}
function openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filters)
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local cooldownData = allCooldownsData[spellId]
if (cooldownData) then
for filter in filters:gmatch("([^,%s]+)") do
local cooldownType = filterStringToCooldownType[filter]
if (cooldownData.type == cooldownType) then
return true
elseif (cooldownData[filter]) then --custom filter
return true
end
end
else
return false
local filterStringToCooldownTypeReverse = {
[CONST_COOLDOWN_TYPE_DEFENSIVE_RAID] = "defensive-raid",
[CONST_COOLDOWN_TYPE_DEFENSIVE_TARGET] = "defensive-target",
[CONST_COOLDOWN_TYPE_DEFENSIVE_PERSONAL] = "defensive-personal",
[CONST_COOLDOWN_TYPE_OFFENSIVE] = "ofensive",
[CONST_COOLDOWN_TYPE_UTILITY] = "utility",
[CONST_COOLDOWN_TYPE_INTERRUPT] = "interrupt",
}
local removeSpellFromCustomFilterCache = function(spellId, filterName)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
if (spellFilterCache) then
spellFilterCache[filterName] = nil
end
end
local addSpellToCustomFilterCache = function(spellId, filterName)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
if (not spellFilterCache) then
spellFilterCache = {}
spellsWithCustomFiltersCache[spellId] = spellFilterCache
end
spellFilterCache[filterName] = true
end
local getSpellCustomFiltersFromCache = function(spellId)
local spellFilterCache = spellsWithCustomFiltersCache[spellId]
local result = {}
if (spellFilterCache) then
for filterName in pairs(spellFilterCache) do
result[filterName] = true
end
end
return result
end
--LIB_OPEN_RAID_COOLDOWNS_INFO store all registered cooldowns in the file ThingsToMantain_<game version>
function openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
return LIB_OPEN_RAID_COOLDOWNS_INFO
end
function openRaidLib.CooldownManager.GetCooldownInfo(spellId)
return openRaidLib.CooldownManager.GetAllRegisteredCooldowns()[spellId]
end
--return a map of filter names which the spell is in, map: {[filterName] = true}
--API Call documented in the docs.txt as openRaidLib.GetSpellFilters() the declaration is on the main file of the lib
function openRaidLib.CooldownManager.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
local result = {}
if (not customFiltersOnly) then
local thisCooldownInfo = openRaidLib.CooldownManager.GetCooldownInfo(spellId)
local cooldownTypeFilter = filterStringToCooldownTypeReverse[thisCooldownInfo.type]
if (cooldownTypeFilter) then
result[cooldownTypeFilter] = true
end
end
if (defaultFilterOnly) then
return result
end
local customFilters = getSpellCustomFiltersFromCache(spellId)
for filterName in pairs(customFilters) do
result[filterName] = true
end
return result
end
function openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filters)
--table with information about a single cooldown
local thisCooldownInfo = openRaidLib.CooldownManager.GetCooldownInfo(spellId)
--check if this spell is registered as a cooldown
if (thisCooldownInfo) then
for filter in filters:gmatch("([^,%s]+)") do
--filterStringToCooldownType is a map where the key is the filter name and value is the cooldown type
local cooldownType = filterStringToCooldownType[filter]
--cooldown type is a number from 1 to 8 telling its type
if (cooldownType == thisCooldownInfo.type) then
return true
--check for custom filter, the custom filter name is set as a key in the cooldownInfo: cooldownInfo[filterName] = true
elseif (thisCooldownInfo[filter]) then
return true
end
end
end
return false
end
local getCooldownsForFilter = function(unitName, allCooldowns, unitDataFilteredCache, filter)
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local allCooldownsData = openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
local filterTable = unitDataFilteredCache[filter]
--if the unit already sent its full list of cooldowns, the cache can be built
--when NeedRebuildFilters is true, HasFullCooldownList is always true
--bug: filterTable is nil and HasFullCooldownList is also nil, happening after leaving a grou´p internal callback
if ((not filterTable and openRaidLib.CooldownManager.HasFullCooldownList[unitName]) or openRaidLib.CooldownManager.NeedRebuildFilters[unitName]) then
--bug: filterTable is nil and HasFullCooldownList is also nil, happening after leaving a group internal callback
--November 06, 2022 note: is this bug still happening?
local doesNotHaveFilterYet = not filterTable and openRaidLib.CooldownManager.HasFullCooldownList[unitName]
local isDirty = openRaidLib.CooldownManager.NeedRebuildFilters[unitName]
if (doesNotHaveFilterYet or isDirty) then
--reset the filterTable
filterTable = {}
unitDataFilteredCache[filter] = filterTable
--
for spellId, cooldownInfo in pairs(allCooldowns) do
local cooldownData = allCooldownsData[spellId]
if (cooldownData) then
@@ -190,27 +277,41 @@ local getCooldownsForFilter = function(unitName, allCooldowns, unitDataFilteredC
return filterTable
end
--API Call
--@filterName: a string representing a name of the filter
--@spells: an array of spellIds
--important: a spell can be part of any amount of custom filters,
--declaring a spell on a new filter does NOT remove it from other filters where it was previously added
function openRaidLib.AddCooldownFilter(filterName, spells)
--integrity check
if (type(filterName) ~= "string") then
openRaidLib.DiagnosticError("Usage: openRaidLib.AddFilter(string: filterName, table: spells)", debugstack())
return false
end
if (type(spells) ~= "table") then
elseif (type(spells) ~= "table") then
openRaidLib.DiagnosticError("Usage: openRaidLib.AddFilter(string: filterName, table: spells)", debugstack())
return false
end
--clear previous filter spell table of the same name
for spellId, cooldownData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do
local allCooldownsData = openRaidLib.CooldownManager.GetAllRegisteredCooldowns()
--iterate among the all cooldowns table and erase the filterName from all spells
for spellId, cooldownData in pairs(allCooldownsData) do
cooldownData[filterName] = nil
removeSpellFromCustomFilterCache(spellId, filterName)
end
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
--iterate among spells passed within the spells table and set the new filter on them
--problem: the filter is set directly into the global cooldown table
--this could in rare cases make an addon to override settings of another addon
for spellIndex, spellId in ipairs(spells) do
local cooldownData = allCooldownsData[spellId]
cooldownData[filterName] = true
if (cooldownData) then
cooldownData[filterName] = true
addSpellToCustomFilterCache(spellId, filterName)
else
openRaidLib.DiagnosticError("A spellId on your spell list for openRaidLib.AddFilter isn't registered as cooldown:", spellId, debugstack())
end
end
--tag all cache filters as dirt
@@ -222,8 +323,9 @@ function openRaidLib.AddCooldownFilter(filterName, spells)
return true
end
--@allCooldowns: all cooldowns sent by an unit, {[spellId] = cooldownInfo}
--@filters: string with filters, "defensive-raid, "defensive-personal"
--API Call
--@allCooldowns: all cooldowns sent by a unit, map{[spellId] = cooldownInfo}
--@filters: string with filter names: array{"defensive-raid, "defensive-personal"}
function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters)
local allDataFiltered = openRaidLib.CooldownManager.UnitDataFilterCache --["unitName"] = {defensive-raid = {[spellId = cooldownInfo]}}
local unitDataFilteredCache = allDataFiltered[unitName]
@@ -238,7 +340,6 @@ function openRaidLib.FilterCooldowns(unitName, allCooldowns, filters)
return filterAlreadyInCache
end
local allCooldownsData = LIB_OPEN_RAID_COOLDOWNS_INFO
local resultFilters = {}
--break the string into pieces and filter cooldowns
+74 -10
View File
@@ -18,6 +18,7 @@ local CONST_TALENT_VERSION_DRAGONFLIGHT = 5
local CONST_BTALENT_VERSION_COVENANTS = 9
local CONST_SPELLBOOK_CLASSSPELLS_TABID = 2
local CONST_SPELLBOOK_GENERAL_TABID = 1
local isTimewalkWoW = function()
local _, _, _, buildInfo = GetBuildInfo()
@@ -418,6 +419,23 @@ local getSpellListAsHashTableFromSpellBook = function()
--this line might not be compatible with classic
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
local classNameLoc, className, classId = UnitClass("player")
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
--get racials from the general tab
local tabName, tabTexture, offset, numSpells, isGuild, offspecId = GetSpellTabInfo(CONST_SPELLBOOK_GENERAL_TABID)
offset = offset + 1
local tabEnd = offset + numSpells
for entryOffset = offset, tabEnd - 1 do
local spellType, spellId = GetSpellBookItemInfo(entryOffset, "player")
if (spellId and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId] and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId].raceid == playerRaceId) then
spellId = C_SpellBook.GetOverrideSpell(spellId)
local spellName = GetSpellInfo(spellId)
local isPassive = IsPassiveSpell(entryOffset, "player")
if (spellName and not isPassive) then
completeListOfSpells[spellId] = true
end
end
end
--get spells from the Spec spellbook
for i = 1, GetNumSpellTabs() do
@@ -464,13 +482,13 @@ end
local updateCooldownAvailableList = function()
table.wipe(LIB_OPEN_RAID_PLAYERCOOLDOWNS)
local _, playerClass = UnitClass("player")
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
local spellBookSpellList = getSpellListAsHashTableFromSpellBook()
--build a list of all spells assigned as cooldowns for the player class
for spellID, spellData in pairs(LIB_OPEN_RAID_COOLDOWNS_INFO) do
if (spellData.class == playerClass) then
if (spellData.class == playerClass or spellData.raceid == playerRaceId) then --need to implement here to get the racial as racial cooldowns does not carry a class
if (spellBookSpellList[spellID]) then
LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellID] = spellData
end
@@ -538,32 +556,78 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
return {}
end
--aura frame handles only UNIT_AURA events to grab the duration of the buff placed by the aura
local IS_NEW_UNIT_AURA_AVAILABLE = C_UnitAuras and C_UnitAuras.GetAuraDataBySlot and true
local auraSpellID
local foundAuraDuration
local handleBuffAura = function(aura)
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID)
if (auraInfo) then
local spellId = auraInfo.spellId
if (auraSpellID == spellId) then
auraSpellID = nil
foundAuraDuration = auraInfo.duration
return true
end
end
end
local getAuraDuration = function(spellId)
--some auras does not have the same spellId of the cast as the spell for its aura duration
--in these cases, it's necessary to declare the buff spellId which tells the duration of the effect by adding 'durationSpellId = spellId' within the cooldown data
local customBuffDuration = LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].durationSpellId
--spellId = customBuffDuration or spellId --can't replace the spellId by customBuffDurationSpellId has it wount be found in LIB_OPEN_RAID_PLAYERCOOLDOWNS
if (IS_NEW_UNIT_AURA_AVAILABLE) then
local batchCount = nil
local usePackedAura = true
auraSpellID = customBuffDuration or spellId
foundAuraDuration = 0 --reset duration
AuraUtil.ForEachAura("player", "HELPFUL", batchCount, handleBuffAura, usePackedAura) --check auras to find a buff for the spellId
if (foundAuraDuration == 0) then --if the buff wasn't found, attempt to get the duration from the file
local spellName = GetSpellInfo(spellId)
return LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].duration or 0
end
return foundAuraDuration
else
end
end
function openRaidLib.CooldownManager.GetSpellBuffDuration(spellId)
return getAuraDuration(spellId)
end
--check if a player cooldown is ready or if is in cooldown
--@spellId: the spellId to check for cooldown
--return timeLeft, charges, startTimeOffset, duration, buffDuration
function openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
--check if is a charge spell
local cooldownInfo = LIB_OPEN_RAID_COOLDOWNS_INFO[spellId]
if (cooldownInfo) then
if (cooldownInfo.charges and cooldownInfo.charges > 1) then
local chargesAvailable, chargesTotal, start, duration = GetSpellCharges(spellId)
local buffDuration = getAuraDuration(spellId)
local chargesAvailable, chargesTotal, start, duration = GetSpellCharges(spellId)
if chargesAvailable then
if (chargesAvailable == chargesTotal) then
return 0, chargesTotal, 0, 0 --all charges are ready to use
return 0, chargesTotal, 0, 0, 0 --all charges are ready to use
else
--return the time to the next charge
local timeLeft = start + duration - GetTime()
local startTimeOffset = start - GetTime()
return ceil(timeLeft), chargesAvailable, startTimeOffset, duration --time left, charges, startTime
return ceil(timeLeft), chargesAvailable, startTimeOffset, duration, buffDuration --time left, charges, startTime, duration, buffDuration
end
else
local start, duration = GetSpellCooldown(spellId)
if (start == 0) then --cooldown is ready
return 0, 1, 0, 0 --time left, charges, startTime
return 0, 1, 0, 0, 0 --time left, charges, startTime
else
local timeLeft = start + duration - GetTime()
local startTimeOffset = start - GetTime()
return ceil(timeLeft), 0, ceil(startTimeOffset), duration --time left, charges, startTime, duration
return ceil(timeLeft), 0, ceil(startTimeOffset), duration, buffDuration --time left, charges, startTime, duration, buffDuration
end
end
else
+85 -73
View File
@@ -14,7 +14,18 @@ Code Rules:
- Internal callbacks are the internal communication of the library, e.g. when an event triggers it send to all modules that registered that event.
- Public callbacks are callbacks registered by an external addon.
Change Log:
Change Log (most recent on 2022 Nov 18):
- added racials with cooldown type 9
- added buff duration in the index 6 of the cooldownInfo table returned on any cooldown event
- added 'durationSpellId' for cooldowns where the duration effect is another spell other than the casted cooldown spellId, add this member on cooldown table at LIB_OPEN_RAID_COOLDOWNS_INFO
------- Nov 07 and older
- added:
* added openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly) (see docs)
- passing a spellId of a non registered cooldown on LIB_OPEN_RAID_COOLDOWNS_INFO will trigger a diagnostic error if diagnostic errors are enabled.
- player cast doesn't check anymore for cooldowns in the player spec, now it check towards the cache LIB_OPEN_RAID_PLAYERCOOLDOWNS.
LIB_OPEN_RAID_PLAYERCOOLDOWNS is a cache built with cooldowns present in the player spellbook.
- things to maintain now has 1 file per expansion
- player conduits, covenant internally renamed to playerInfo1 and playerInfo2 to make the lib more future proof
- player conduits tree is now Borrowed Talents Tree, for future proof
@@ -25,29 +36,14 @@ Change Log:
* openRaidLib.GetFlaskTierFromAura(auraInfo)
* openRaidLib.GetFoodInfoBySpellId(spellId)
* openRaidLib.GetFoodTierFromAura(auraInfo)
- added dragonflight talents support
* added dragonflight talents support
* added openRaidLib.RequestCooldownInfo(spellId)
* added openRaidLib.AddCooldownFilter(filterName, spells)
- ensure to register events after 'PLAYER_ENTERING_WORLD' has triggered
- added openRaidLib.RequestCooldownInfo(spellId)
- added openRaidLib.AddCooldownFilter(filterName, spells)
- if Ace Comm is installed, use it
- added "KeystoneWipe" callback
- finished keystone info, see docs
- added interrupts to cooldown tracker, new filter: "interrupt"
- after encounter_end cooldowns now check for cooldowns reset.
- each module now controls what to do with regen_enabled.
- filter cooldowns done.
- move portions of the code to other files to make this one smaller.
- major function and variables rename.
- implemented pvp talents.
- player information is always available even when not in a group.
- added cooldown check to se which cooldown has removed or added into the list.
- added two new callbacks: "CooldownAdded" and "CooldownRemoved", see documents.
TODO:
- make talents changes also send only cooldowns added or changed
- add into gear info how many tier set parts the player has
- raid lockouts normal-heroic-mythic
- soulbind character (covenant choise) - probably not used in 10.0
BUGS:
- after a /reload, it is not starting new tickers for spells under cooldown
@@ -68,7 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
end
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 69
local CONST_LIB_VERSION = 72
LIB_OPEN_RAID_CAN_LOAD = false
local unpack = table.unpack or _G.unpack
@@ -133,6 +129,7 @@ local unpack = table.unpack or _G.unpack
local CONST_COOLDOWN_INDEX_TIMEOFFSET = 3
local CONST_COOLDOWN_INDEX_DURATION = 4
local CONST_COOLDOWN_INDEX_UPDATETIME = 5
local CONST_COOLDOWN_INDEX_AURA_DURATION = 6
local GetContainerNumSlots = GetContainerNumSlots or C_Container.GetContainerNumSlots
local GetContainerItemID = GetContainerItemID or C_Container.GetContainerItemID
@@ -1632,14 +1629,14 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
end
tickerObject.cooldownTimeLeft = tickerObject.cooldownTimeLeft - CONST_COOLDOWN_CHECK_INTERVAL
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local bUpdateLocally = false
--is the spell ready to use?
if (timeLeft == 0) then
--it's ready
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, 0, charges, 0, 0)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, 0, charges, 0, 0, 0)
openRaidLib.CooldownManager.CooldownTickers[spellId] = nil
tickerObject:Cancel()
bUpdateLocally = true
@@ -1647,7 +1644,7 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
--check if the time left has changed, this check if the cooldown got its time reduced and if the cooldown time has been slow down by modRate
if (not openRaidLib.isNearlyEqual(tickerObject.cooldownTimeLeft, timeLeft, CONST_COOLDOWN_TIMELEFT_HAS_CHANGED)) then
--there's a deviation, send a comm to communicate the change in the time left
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
tickerObject.cooldownTimeLeft = timeLeft
bUpdateLocally = true
end
@@ -1655,9 +1652,9 @@ local cooldownTimeLeftCheck_Ticker = function(tickerObject)
if (bUpdateLocally) then
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration, auraDuration) --need 7 values
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
local cooldownInfo = openRaidLib.GetUnitCooldownInfo(playerName, spellId)
@@ -1696,7 +1693,7 @@ end
function openRaidLib.CooldownManager.CleanupCooldownTickers()
for spellId, tickerObject in pairs(openRaidLib.CooldownManager.CooldownTickers) do
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
if (timeLeft == 0) then
tickerObject:Cancel()
openRaidLib.CooldownManager.CooldownTickers[spellId] = nil
@@ -1722,22 +1719,26 @@ end
local cooldownGetSpellInfo = function(unitName, spellId)
local unitCooldownTable = cooldownGetUnitTable(unitName)
local spellIdTable = unitCooldownTable[spellId]
return spellIdTable
local cooldownInfo = unitCooldownTable[spellId]
return cooldownInfo
end
--update a single cooldown timer
--called when the player casted a cooldown and when received a cooldown update from another player
--only update the db, no other action is taken
function openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, newTimeLeft, newCharges, startTimeOffset, duration)
--cooldownInfo: [1] timeLeft [2] charges [3] startOffset [4] duration [5] updateTime [6] auraDuration
function openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, newTimeLeft, newCharges, startTimeOffset, duration, auraDuration)
--get the cooldown table where all cooldowns are stored for this unit
local unitCooldownTable = cooldownGetUnitTable(unitName)
local spellIdTable = unitCooldownTable[spellId] or {}
spellIdTable[CONST_COOLDOWN_INDEX_TIMELEFT] = newTimeLeft
spellIdTable[CONST_COOLDOWN_INDEX_CHARGES] = newCharges
spellIdTable[CONST_COOLDOWN_INDEX_TIMEOFFSET] = startTimeOffset
spellIdTable[CONST_COOLDOWN_INDEX_DURATION] = duration
spellIdTable[CONST_COOLDOWN_INDEX_UPDATETIME] = GetTime()
unitCooldownTable[spellId] = spellIdTable
--is this a cooldown info?
local cooldownInfo = unitCooldownTable[spellId] or {}
cooldownInfo[CONST_COOLDOWN_INDEX_TIMELEFT] = newTimeLeft
cooldownInfo[CONST_COOLDOWN_INDEX_CHARGES] = newCharges
cooldownInfo[CONST_COOLDOWN_INDEX_TIMEOFFSET] = startTimeOffset
cooldownInfo[CONST_COOLDOWN_INDEX_DURATION] = duration
cooldownInfo[CONST_COOLDOWN_INDEX_UPDATETIME] = GetTime()
cooldownInfo[CONST_COOLDOWN_INDEX_AURA_DURATION] = auraDuration
unitCooldownTable[spellId] = cooldownInfo
end
--API Calls
@@ -1774,6 +1775,10 @@ end
return openRaidLib.CooldownManager.DoesSpellPassFilters(spellId, filter)
end
function openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
return openRaidLib.CooldownManager.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
end
--return values about the cooldown time
--values returned: timeLeft, charges, timeOffset, duration, updateTime
function openRaidLib.GetCooldownTimeFromUnitSpellID(unitId, spellId)
@@ -1781,7 +1786,7 @@ end
if (unitCooldownsTable) then
local cooldownInfo = unitCooldownsTable[spellId]
if (cooldownInfo) then
return unpack(cooldownInfo)
return openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
end
@@ -1790,7 +1795,7 @@ end
--values returned: timeLeft, charges, timeOffset, duration, updateTime
function openRaidLib.GetCooldownTimeFromCooldownInfo(cooldownInfo)
if (cooldownInfo) then
return unpack(cooldownInfo)
return openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
@@ -1833,12 +1838,12 @@ end
--values returned: isReady, timeLeft, charges, normalized percent, minValue, maxValue, currentValue
--values are in the GetTime() format
function openRaidLib.GetCooldownStatusFromUnitSpellID(unitId, spellId)
local timeLeft, charges, timeOffset, duration, updateTime
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration
local unitCooldownsTable = openRaidLib.GetUnitCooldowns(unitId)
if (unitCooldownsTable) then
local cooldownInfo = unitCooldownsTable[spellId]
if (cooldownInfo) then
timeLeft, charges, timeOffset, duration, updateTime = unpack(cooldownInfo)
timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
end
end
@@ -1851,39 +1856,40 @@ end
--values are in the GetTime() format
--GetPercentFromCooldownInfo
function openRaidLib.GetCooldownStatusFromCooldownInfo(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime = unpack(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
return calculatePercent(timeOffset, duration, updateTime, charges)
end
--internals
function openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = unpack(cooldownInfo)
return timeLeft, charges, timeOffset, duration, updateTime, auraDuration
end
function openRaidLib.CooldownManager.OnPlayerCast(event, spellId, isPlayerPet) --~cast
--player casted a spell, check if the spell is registered as cooldown
--local playerSpec = openRaidLib.GetPlayerSpecId() --should be deprecated with cooldowns from spellbook
--if (playerSpec) then
--if (LIB_OPEN_RAID_COOLDOWNS_BY_SPEC[playerSpec] and LIB_OPEN_RAID_COOLDOWNS_BY_SPEC[playerSpec][spellId]) then --kinda deprecated with the new spell from spellbook
--issue: pet spells isn't in this table yet, might mess with pet interrupts
if (LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId]) then --check if the casted spell is a cooldown the player has available
local playerName = UnitName("player")
--issue: pet spells isn't in this table yet, might mess with pet interrupts
if (LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId]) then --check if the casted spell is a cooldown the player has available
local playerName = UnitName("player")
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration)
local cooldownInfo = cooldownGetSpellInfo(playerName, spellId)
--update the cooldown
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, startTimeOffset, duration, auraDuration) --receive 7 values
local cooldownInfo = cooldownGetSpellInfo(playerName, spellId)
--trigger a public callback
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
openRaidLib.publicCallback.TriggerCallback("CooldownUpdate", "player", spellId, cooldownInfo, playerCooldownTable, openRaidLib.CooldownManager.UnitData)
--trigger a public callback
local playerCooldownTable = openRaidLib.GetUnitCooldowns(playerName)
openRaidLib.publicCallback.TriggerCallback("CooldownUpdate", "player", spellId, cooldownInfo, playerCooldownTable, openRaidLib.CooldownManager.UnitData)
--send to comm
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
--send to comm
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
--create a timer to monitor the time of this cooldown
--as there's just a few of them to monitor, there's no issue on creating one timer per spell
cooldownStartTicker(spellId, timeLeft)
end
--end
--create a timer to monitor the time of this cooldown
--as there's just a few of them to monitor, there's no issue on creating one timer per spell
cooldownStartTicker(spellId, timeLeft)
end
end
--when the player is ressed while in a group, send the cooldown list
@@ -2015,8 +2021,8 @@ function openRaidLib.CooldownManager.OnReceiveUnitCooldownChanges(data, unitName
local cooldownsAddedUnpacked = openRaidLib.UnpackTable(addedCooldowns, 1, true, true, 5)
for spellId, cooldownInfo in pairs(cooldownsAddedUnpacked) do
--add the spell into the list of cooldowns of this unit
local timeLeft, charges, timeOffset, duration = unpack(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, timeLeft, charges, timeOffset, duration)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, timeLeft, charges, timeOffset, duration, auraDuration)
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[unitName] = true
@@ -2054,15 +2060,16 @@ function openRaidLib.CooldownManager.CheckForSpellsAdeedOrRemoved()
for spellId, cooldownInfo in pairs(newCooldownList) do
if (not currentCooldowns[spellId]) then
--a spell has been added
local timeLeft, charges, timeOffset, duration = unpack(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, timeOffset, duration)
local timeLeft, charges, timeOffset, duration, updateTime, auraDuration = openRaidLib.CooldownManager.GetCooldownInfoValues(cooldownInfo)
openRaidLib.CooldownManager.CooldownSpellUpdate(playerName, spellId, timeLeft, charges, timeOffset, duration, auraDuration)
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId) --return 5 values
spellsAdded[#spellsAdded+1] = spellId
spellsAdded[#spellsAdded+1] = timeLeft
spellsAdded[#spellsAdded+1] = charges
spellsAdded[#spellsAdded+1] = startTimeOffset
spellsAdded[#spellsAdded+1] = duration
spellsAdded[#spellsAdded+1] = auraDuration
--mark the filter cache of this unit as dirt
openRaidLib.CooldownManager.NeedRebuildFilters[playerName] = true
@@ -2126,6 +2133,7 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNUPDATE_PREFIX, function(
local charges = tonumber(dataAsArray[3])
local startTime = tonumber(dataAsArray[4])
local duration = tonumber(dataAsArray[5])
local auraDuration = tonumber(dataAsArray[6])
--check integrity
if (not spellId or spellId == 0) then
@@ -2142,10 +2150,14 @@ openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNUPDATE_PREFIX, function(
elseif (not duration) then
return openRaidLib.DiagnosticError("CooldownManager|comm received|duration is invalid")
elseif (not auraDuration) then
return openRaidLib.DiagnosticError("CooldownManager|comm received|auraDuration is invalid")
end
--update
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, cooldownTimer, charges, startTime, duration)
--unitName, spellId, cooldownTimer, charges, startTime, duration, auraDuration
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, cooldownTimer, charges, startTime, duration, auraDuration)
local cooldownInfo = cooldownGetSpellInfo(unitName, spellId)
local unitCooldownTable = openRaidLib.GetUnitCooldowns(unitName)
@@ -2180,8 +2192,8 @@ function openRaidLib.CooldownManager.SendAllPlayerCooldowns()
end
--send to comm a specific cooldown that was just used, a charge got available or its cooldown is over (ready to use)
function openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, cooldownTimeLeft, charges, startTimeOffset, duration)
local dataToSend = "" .. CONST_COMM_COOLDOWNUPDATE_PREFIX .. "," .. spellId .. "," .. cooldownTimeLeft .. "," .. charges .. "," .. startTimeOffset .. "," .. duration
function openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, cooldownTimeLeft, charges, startTimeOffset, duration, auraDuration)
local dataToSend = "" .. CONST_COMM_COOLDOWNUPDATE_PREFIX .. "," .. spellId .. "," .. cooldownTimeLeft .. "," .. charges .. "," .. startTimeOffset .. "," .. duration .. "," .. auraDuration
openRaidLib.commHandler.SendCommData(dataToSend)
diagnosticComm("SendPlayerCooldownUpdate| " .. dataToSend) --debug
end
@@ -2219,8 +2231,8 @@ function openRaidLib.CooldownManager.OnReceiveRequestForCooldownInfoUpdate(data,
end
--get the cooldown time for this spell
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration)
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(spellId)
openRaidLib.CooldownManager.SendPlayerCooldownUpdate(spellId, timeLeft, charges, startTimeOffset, duration, auraDuration)
end
openRaidLib.commHandler.RegisterComm(CONST_COMM_COOLDOWNREQUEST_PREFIX, openRaidLib.CooldownManager.OnReceiveRequestForCooldownInfoUpdate)
@@ -2533,7 +2545,7 @@ C_Timer.After(0.1, function()
--trigger a cooldown usage
local duration = cooldownInfo.duration
--time left, charges, startTimeOffset, duration
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, duration, 0, 0, duration)
openRaidLib.CooldownManager.CooldownSpellUpdate(unitName, spellId, duration, 0, 0, duration, 0)
local cooldownInfo = cooldownGetSpellInfo(unitName, spellId)
local unitCooldownsTable = openRaidLib.GetUnitCooldowns(unitName)
@@ -260,6 +260,10 @@ LIB_OPEN_RAID_MELEE_SPECS = {
--/dump GetTalentInfo (talentTier, talentColumn, 1)
--example: to get the second talent of the last talent line, use: /dump GetTalentInfo (7, 2, 1)
--todo:
--get cooldown duration from the buff placed on the player or target player
--spell scanner not getting the spell from the pet spellbook
LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- Filter Types:
@@ -269,7 +273,53 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- 4 raid defensive cooldown
-- 5 personal utility cooldown
-- 6 interrupt
-- 7 dispel
-- 8 crowd control
-- 9 racials
--racials
--maintanance: login into the new race and type /run Details.GenerateRacialSpellList()
--this command give a formated line to paste here
[312411] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Bag of Tricks (Vulpera)
--[312370] = {cooldown = 600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Make Camp (Vulpera)
--[312372] = {cooldown = 3600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Return to Camp (Vulpera)
--[312425] = {cooldown = 300, duration = 0, specs = {}, talent = false, charges = 1, raceid = 35, race = "Vulpera", class = "", type = 9}, --Rummage Your Bag (Vulpera)
[274738] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 36, race = "MagharOrc", class = "", type = 9}, --Ancestral Call (MagharOrc)
--[292752] = {cooldown = 432000, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Embrace of the Loa (ZandalariTroll)
--[281954] = {cooldown = 900, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Pterrordax Swoop (ZandalariTroll)
[291944] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 31, race = "ZandalariTroll", class = "", type = 9}, --Regeneratin' (ZandalariTroll)
[255654] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 28, race = "HighmountainTauren", class = "", type = 9}, --Bull Rush (HighmountainTauren)
[260364] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 27, race = "Nightborne", class = "", type = 9}, --Arcane Pulse (Nightborne)
--[255661] = {cooldown = 600, duration = 0, specs = {}, talent = false, charges = 1, raceid = 27, race = "Nightborne", class = "", type = 9}, --Cantrips (Nightborne)
--[69046] = {cooldown = 1800, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Pack Hobgoblin (Goblin)
[69041] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Rocket Barrage (Goblin)
[69070] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 9, race = "Goblin", class = "", type = 9}, --Rocket Jump (Goblin)
[20549] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 6, race = "Tauren", class = "", type = 9}, --War Stomp (Tauren)
--[20577] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 5, race = "Scourge", class = "", type = 9}, --Cannibalize (Scourge)
[7744] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 5, race = "Scourge", class = "", type = 9}, --Will of the Forsaken (Scourge)
[20572] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 2, race = "Orc", class = "", type = 9}, --Blood Fury (Orc)
[312924] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 37, race = "Mechagnome", class = "", type = 9}, --Hyper Organic Light Originator (Mechagnome)
--[312890] = {cooldown = 0, duration = 0, specs = {}, talent = false, charges = 1, raceid = 37, race = "Mechagnome", class = "", type = 9}, --Skeleton Pinkie (Mechagnome)
[287712] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 32, race = "KulTiran", class = "", type = 9}, --Haymaker (KulTiran)
[265221] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 34, race = "DarkIronDwarf", class = "", type = 9}, --Fireblood (DarkIronDwarf)
--[265225] = {cooldown = 1800, duration = 0, specs = {}, talent = false, charges = 1, raceid = 34, race = "DarkIronDwarf", class = "", type = 9}, --Mole Machine (DarkIronDwarf)
--[259930] = {cooldown = 900, duration = 0, specs = {}, talent = false, charges = 1, raceid = 30, race = "LightforgedDraenei", class = "", type = 9}, --Forge of Light (LightforgedDraenei)
[255647] = {cooldown = 150, duration = 0, specs = {}, talent = false, charges = 1, raceid = 30, race = "LightforgedDraenei", class = "", type = 9}, --Light's Judgment (LightforgedDraenei)
[256948] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 29, race = "VoidElf", class = "", type = 9}, --Spatial Rift (VoidElf)
--[358733] = {cooldown = 1, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Glide (Dracthyr)
[368970] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Tail Swipe (Dracthyr)
[357214] = {cooldown = 90, duration = 0, specs = {}, talent = false, charges = 1, raceid = 52, race = "Dracthyr", class = "", type = 9}, --Wing Buffet (Dracthyr)
[107079] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 25, race = "Pandaren", class = "", type = 9}, --Quaking Palm (Pandaren)
[68992] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 22, race = "Worgen", class = "", type = 9}, --Darkflight (Worgen)
--[68996] = {cooldown = 1, duration = 0, specs = {}, talent = false, charges = 1, raceid = 22, race = "Worgen", class = "", type = 9}, --Two Forms (Worgen)
[26297] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 8, race = "Troll", class = "", type = 9}, --Berserking (Troll)
[20589] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, raceid = 7, race = "Gnome", class = "", type = 9}, --Escape Artist (Gnome)
[232633] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 10, race = "BloodElf", class = "", type = 9}, --Arcane Torrent (BloodElf)
[59752] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 1, race = "Human", class = "", type = 9}, --Will to Survive (Human)
[20594] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 3, race = "Dwarf", class = "", type = 9}, --Stoneform (Dwarf)
[58984] = {cooldown = 120, duration = 0, specs = {}, talent = false, charges = 1, raceid = 4, race = "NightElf", class = "", type = 9}, --Shadowmeld (NightElf)
[59542] = {cooldown = 180, duration = 0, specs = {}, talent = false, charges = 1, raceid = 11, race = "Draenei", class = "", type = 9}, --Gift of the Naaru (Draenei)
--interrupts
[6552] = {class = "WARRIOR", specs = {71, 72, 73}, cooldown = 15, silence = 4, talent = false, cooldownWithTalent = false, cooldownTalentId = false, type = 6, charges = 1}, --Pummel
@@ -319,6 +369,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
--[343527] = {cooldown = 1 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 1}, --Execution Sentence
--[343721] = {cooldown = 1 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 1}, --Final Reckoning
--[391054] = {cooldown = 10 min cooldown, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 5}, --Intercession (battle ress)
[20066] = {cooldown = 15, duration = 0, specs = {}, talent = false, charges = 1, class = "PALADIN", type = 8}, --Repentance
--warrior
-- 71 - Arms
@@ -342,6 +393,8 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[376079] = {cooldown = 90, duration = 4, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Spear of Bastion
[392966] = {cooldown = 90, duration = 20, specs = {73}, talent = false, charges = 1, class = "WARRIOR", type = 2}, --Spell Block
[384318] = {cooldown = 90, duration = 0, specs = {71, 72, 73}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Thunderous Roar
[46968] = {cooldown = 40, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Shockwave
[23920] = {cooldown = 25, duration = 5, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Shockwave
--warlock
-- 265 - Affliction
@@ -383,6 +436,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[192077] = {cooldown = 120, duration = 15, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Wind Rush Totem
--[198838] = {cooldown = 60, duration = 15, specs = {264}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Earthen Wall Totem
[51485] = {cooldown = 60, duration = 20, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Earthgrab Totem
--[383017] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Stoneskin Totem
[51514] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Hex
[108968] = {cooldown = 5*60, duration = 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 3}, --Void Shift
--monk
-- 268 - Brewmaster
@@ -408,6 +465,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[115176] = {cooldown = 300, duration = 8, specs = {268}, talent = false, charges = 1, class = "MONK", type = 2}, --Zen Meditation
[388686] = {cooldown = 120, duration = 30, specs = {268, 269, 270}, talent = false, charges = 1, class = "MONK", type = 1}, --Summon White Tiger Statue
--[322109] = {cooldown = 180, duration = 0, specs = {268, 269, 270}, talent = false, charges = 1, class = "MONK", type = 1}, --Touch of Death
[116841] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "MONK", type = 5}, --Tiger's Lust
--hunter
@@ -422,13 +480,14 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[109248] = {cooldown = 45, duration = 10, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Binding Shot
[199483] = {cooldown = 60, duration = 60, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Camouflage
[266779] = {cooldown = 120, duration = 20, specs = {255}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Coordinated Assault
[109304] = {cooldown = 120, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Exhilaration
[109304] = {cooldown = 120, duration = 8, durationSpellId = 385540, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Exhilaration
[187650] = {cooldown = 25, duration = 60, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Freezing Trap
[19577] = {cooldown = 60, duration = 5, specs = {253, 255}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Intimidation
[201430] = {cooldown = 180, duration = 12, specs = {253}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Stampede
[281195] = {cooldown = 180, duration = 6, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
--[281195] = {cooldown = 180, duration = 6, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[288613] = {cooldown = 180, duration = 15, specs = {254}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot
[264735] = {cooldown = 180, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
[187698] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Tar Trap
--druid
-- 102 - Balance
@@ -458,6 +517,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[102793] = {cooldown = 60, duration = 10, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 8}, --Ursol's Vortex
[124974] = {cooldown = 90, duration = 0, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 3}, --Nature's Vigil
[106898] = {cooldown = 120, duration = 8, specs = {102, 103, 104, 105}, talent = false, charges = 1, class = "DRUID", type = 5}, --Stampeding Roar
[5211] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "DRUID", type = 8}, --Mighty Bash
--death knight
-- 252 - Unholy
@@ -484,7 +544,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[207289] = {cooldown = 78, duration = 12, specs = {252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 1}, --Unholy Assault
[55233] = {cooldown = 90, duration = 10, specs = {250}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Vampiric Blood
[212552] = {cooldown = 60, duration = 4, specs = {250, 251, 252}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 2}, --Wraith Walk
[49576] = {cooldown = 25, duration = 0, specs = {}, talent = false, charges = 1, class = "DEATHKNIGHT", type = 8}, --Death Grip
--demon hunter
-- 577 - Havoc
@@ -510,6 +570,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
-- 62 - Arcane
-- 63 - Fire
-- 64 - Frost
[365350] = {cooldown = 90, duration = 15, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Surge
[12042] = {cooldown = 90, duration = 10, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 1}, --Arcane Power
[235313] = {cooldown = 25, duration = 60, specs = {63}, talent = false, charges = 1, class = "MAGE", type = 5}, --Blazing Barrier
[235219] = {cooldown = 300, duration = 0, specs = {64}, talent = false, charges = 1, class = "MAGE", type = 2}, --Cold Snap
@@ -525,6 +586,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[235450] = {cooldown = 25, duration = 60, specs = {62}, talent = false, charges = 1, class = "MAGE", type = 5}, --Prismatic Barrier
[205021] = {cooldown = 78, duration = 5, specs = {64}, talent = false, charges = 1, class = "MAGE", type = 1}, --Ray of Frost
[113724] = {cooldown = 45, duration = 10, specs = {62, 63, 64}, talent = false, charges = 1, class = "MAGE", type = 8}, --Ring of Frost
[31661] = {cooldown = 45, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 8}, --Dragon's Breath
--priest
-- 256 - Discipline
@@ -571,11 +633,14 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
[114018] = {cooldown = 360, duration = 15, specs = {259, 260, 261}, talent = false, charges = 1, class = "ROGUE", type = 5}, --Shroud of Concealment
[1856] = {cooldown = 120, duration = 3, specs = {259, 260, 261}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vanish
[79140] = {cooldown = 120, duration = 20, specs = {259}, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vendetta
[1776] = {cooldown = 20, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 8}, --Gouge
[408] = {cooldown = 20, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 8}, --Kidney Shot
[1966] = {cooldown = 15, duration = 0, specs = {}, talent = false, charges = 1, class = "ROGUE", type = 2}, --Feint
--evoker
-- 1467 - Devastation
-- 1468 - Preservation
--[374251] = {cooldown = 60, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Cauterizing Flame
[374251] = {cooldown = 60, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Cauterizing Flame
--[365585] = {cooldown = 8, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Expunge
--[360823] = {cooldown = 8, duration = 0, specs = {1468}, talent = false, charges = 1, class = "EVOKER", type = 7}, --Naturalize
[357210] = {cooldown = 120, duration = 0, specs = {1467, 1468}, talent = false, charges = 1, class = "EVOKER", type = 1}, --Deep Breath
+6
View File
@@ -55,6 +55,12 @@ local isReady, normalizedPercent, timeLeft, charges, minValue, maxValue, current
@spells: a table containing spellIds {spellId, spellId, spellId, ...}
openRaidLib.AddCooldownFilter(filterName, spells)
--get a list of filters which a spell has, returns a table in map format: {[filterName] = true}
--@spellId: the ID of a spell
--@defaultFilterOnly (bool): if true only return built-in filters, example: "defensive-raid", "ofensive".
--@customFiltersOnly (bool): if true onlt return a list of custom filters where the spell was added.
local filterListArray = openRaidLib.GetSpellFilters(spellId, defaultFilterOnly, customFiltersOnly)
--request information about a spell for all units in the raid, units which has this cooldown will report back with a "CooldownUpdate" event
openRaidLib.RequestCooldownInfo(spellId)