Release Candidate 3
This commit is contained in:
@@ -394,19 +394,22 @@ local playerHasPetOfNpcId = function(npcId)
|
||||
end
|
||||
|
||||
local addCooldownToTable = function(cooldowns, cooldownsHash, cooldownSpellId, timeNow)
|
||||
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(cooldownSpellId)
|
||||
|
||||
cooldowns[#cooldowns+1] = cooldownSpellId
|
||||
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(cooldownSpellId)
|
||||
cooldowns[#cooldowns+1] = timeLeft
|
||||
cooldowns[#cooldowns+1] = charges
|
||||
cooldowns[#cooldowns+1] = startTimeOffset
|
||||
cooldowns[#cooldowns+1] = duration
|
||||
cooldownsHash[cooldownSpellId] = {timeLeft, charges, startTimeOffset, duration, timeNow}
|
||||
cooldowns[#cooldowns+1] = auraDuration
|
||||
|
||||
cooldownsHash[cooldownSpellId] = {timeLeft, charges, startTimeOffset, duration, timeNow, auraDuration}
|
||||
end
|
||||
|
||||
local canAddCooldown = function(cooldownInfo)
|
||||
local needPetNpcId = cooldownInfo.pet
|
||||
if (needPetNpcId) then
|
||||
if (not playerHasPetOfNpcId(needPetNpcId)) then
|
||||
local petNpcIdNeeded = cooldownInfo.pet
|
||||
if (petNpcIdNeeded) then
|
||||
if (not playerHasPetOfNpcId(petNpcIdNeeded)) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -418,7 +421,7 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
|
||||
--this line might not be compatible with classic
|
||||
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
|
||||
local classNameLoc, className, classId = UnitClass("player")
|
||||
--local classNameLoc, className, classId = UnitClass("player") --not in use
|
||||
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
|
||||
|
||||
--get racials from the general tab
|
||||
@@ -430,8 +433,8 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
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
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
@@ -449,8 +452,8 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
if (spellType == "SPELL") then
|
||||
spellId = C_SpellBook.GetOverrideSpell(spellId)
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local isPassive = IsPassiveSpell(entryOffset, "player")
|
||||
if (spellName and not isPassive) then
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
@@ -469,14 +472,34 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
if (spellType == "SPELL") then
|
||||
spellId = C_SpellBook.GetOverrideSpell(spellId)
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local isPassive = IsPassiveSpell(entryOffset, "player")
|
||||
if (spellName and not isPassive) then
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local getNumPetSpells = function()
|
||||
--'HasPetSpells' contradicts the name and return the amount of pet spells available instead of a boolean
|
||||
return HasPetSpells()
|
||||
end
|
||||
|
||||
--get pet spells from the pet spellbook
|
||||
local numPetSpells = getNumPetSpells()
|
||||
if (numPetSpells) then
|
||||
for i = 1, numPetSpells do
|
||||
local spellName, _, unmaskedSpellId = GetSpellBookItemName(i, "pet")
|
||||
if (unmaskedSpellId) then
|
||||
unmaskedSpellId = C_SpellBook.GetOverrideSpell(unmaskedSpellId)
|
||||
local bIsPassive = IsPassiveSpell(unmaskedSpellId, "pet")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[unmaskedSpellId] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return completeListOfSpells
|
||||
end
|
||||
|
||||
@@ -525,14 +548,14 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
|
||||
|
||||
--check if the player has a talent which makes this cooldown unavailable
|
||||
local ignoredByTalentId = cooldownInfo.ignoredIfTalent
|
||||
local isIgnoredByTalentId = false
|
||||
local bIsIgnoredByTalentId = false
|
||||
if (ignoredByTalentId) then
|
||||
if (talentsHash[ignoredByTalentId]) then
|
||||
isIgnoredByTalentId = true
|
||||
bIsIgnoredByTalentId = true
|
||||
end
|
||||
end
|
||||
|
||||
if (not isIgnoredByTalentId) then
|
||||
if (not bIsIgnoredByTalentId) then
|
||||
if (talentId) then
|
||||
--check if the player has the talent selected
|
||||
if (talentsHash[talentId]) then
|
||||
@@ -557,10 +580,10 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
|
||||
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 bIsNewUnitAuraAvailable = C_UnitAuras and C_UnitAuras.GetAuraDataBySlot and true
|
||||
|
||||
local auraSpellID
|
||||
local foundAuraDuration
|
||||
local auraDurationTime
|
||||
|
||||
local handleBuffAura = function(aura)
|
||||
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID)
|
||||
@@ -568,7 +591,7 @@ local handleBuffAura = function(aura)
|
||||
local spellId = auraInfo.spellId
|
||||
if (auraSpellID == spellId) then
|
||||
auraSpellID = nil
|
||||
foundAuraDuration = auraInfo.duration
|
||||
auraDurationTime = auraInfo.duration
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -580,21 +603,20 @@ local getAuraDuration = function(spellId)
|
||||
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
|
||||
if (bIsNewUnitAuraAvailable) then
|
||||
local bBatchCount = false
|
||||
local bUsePackedAura = true
|
||||
auraSpellID = customBuffDuration or spellId
|
||||
foundAuraDuration = 0 --reset duration
|
||||
auraDurationTime = 0 --reset duration
|
||||
|
||||
AuraUtil.ForEachAura("player", "HELPFUL", batchCount, handleBuffAura, usePackedAura) --check auras to find a buff for the spellId
|
||||
AuraUtil.ForEachAura("player", "HELPFUL", bBatchCount, handleBuffAura, bUsePackedAura) --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)
|
||||
if (auraDurationTime == 0) then --if the buff wasn't found, attempt to get the duration from the file
|
||||
return LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].duration or 0
|
||||
end
|
||||
return foundAuraDuration
|
||||
return auraDurationTime
|
||||
else
|
||||
|
||||
--this is classic
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -64,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 = 72
|
||||
local CONST_LIB_VERSION = 76
|
||||
LIB_OPEN_RAID_CAN_LOAD = false
|
||||
|
||||
local unpack = table.unpack or _G.unpack
|
||||
@@ -121,8 +121,8 @@ local unpack = table.unpack or _G.unpack
|
||||
local CONST_SPECIALIZATION_VERSION_CLASSIC = 0
|
||||
local CONST_SPECIALIZATION_VERSION_MODERN = 1
|
||||
|
||||
local CONST_COOLDOWN_CHECK_INTERVAL = CONST_TWO_SECONDS
|
||||
local CONST_COOLDOWN_TIMELEFT_HAS_CHANGED = CONST_TWO_SECONDS
|
||||
local CONST_COOLDOWN_CHECK_INTERVAL = CONST_ONE_SECOND
|
||||
local CONST_COOLDOWN_TIMELEFT_HAS_CHANGED = CONST_ONE_SECOND
|
||||
|
||||
local CONST_COOLDOWN_INDEX_TIMELEFT = 1
|
||||
local CONST_COOLDOWN_INDEX_CHARGES = 2
|
||||
@@ -497,17 +497,17 @@ end
|
||||
local payload = tickerObject.payload
|
||||
local callback = tickerObject.callback
|
||||
|
||||
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
|
||||
if (not result) then
|
||||
sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
|
||||
end
|
||||
|
||||
if (tickerObject.isUnique) then
|
||||
local namespace = tickerObject.namespace
|
||||
local scheduleName = tickerObject.scheduleName
|
||||
openRaidLib.Schedules.CancelUniqueTimer(namespace, scheduleName)
|
||||
end
|
||||
|
||||
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
|
||||
if (not result) then
|
||||
sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
@@ -395,6 +395,8 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[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
|
||||
[107570] = {cooldown = 30, duration = 4, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Storm Bolt
|
||||
[23920] = {cooldown = 25, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Spell Refleciton
|
||||
|
||||
--warlock
|
||||
-- 265 - Affliction
|
||||
@@ -404,7 +406,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[113858] = {cooldown = 120, duration = 20, specs = {267}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Instability
|
||||
[113860] = {cooldown = 120, duration = 20, specs = {265}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Misery
|
||||
[267171] = {cooldown = 60, duration = 0, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Demonic Strength
|
||||
[333889] = {cooldown = 180, duration = 15, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Fel Domination
|
||||
[333889] = {cooldown = 180, duration = 15, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 5}, --Fel Domination
|
||||
[111898] = {cooldown = 120, duration = 15, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Grimoire: Felguard
|
||||
[5484] = {cooldown = 40, duration = 20, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 8}, --Howl of Terror
|
||||
[267217] = {cooldown = 180, duration = 20, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Nether Portal
|
||||
@@ -434,12 +436,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[192249] = {cooldown = 150, duration = 30, specs = {262}, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Storm Elemental
|
||||
[8143] = {cooldown = 60, duration = 10, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Tremor Totem
|
||||
[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
|
||||
[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
|
||||
@@ -488,6 +488,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[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
|
||||
[392060] = {cooldown = 60, duration = 3, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Wailing Arrow
|
||||
|
||||
--druid
|
||||
-- 102 - Balance
|
||||
@@ -588,6 +589,9 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[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
|
||||
|
||||
-- This needs more work to actually function
|
||||
--[342245] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 2}, --Alter Time
|
||||
|
||||
--priest
|
||||
-- 256 - Discipline
|
||||
-- 257 - Holy
|
||||
@@ -616,6 +620,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[64901] = {cooldown = 300, duration = 6, specs = {257}, talent = false, charges = 1, class = "PRIEST", type = 4}, --Symbol of Hope
|
||||
[15286] = {cooldown = 120, duration = 15, specs = {258}, talent = false, charges = 1, class = "PRIEST", type = 4}, --Vampiric Embrace
|
||||
[228260] = {cooldown = 90, duration = 15, specs = {258}, talent = false, charges = 1, class = "PRIEST", type = 1}, --Void Eruption
|
||||
[32375] = {cooldown = 45, duration= 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 7}, --Mass Dispell
|
||||
[586] = {cooldown = 30, duration= 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 2}, --Fade
|
||||
[108968] = {cooldown = 5*60,duration = 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 3}, --Void Shift
|
||||
|
||||
|
||||
--rogue
|
||||
-- 259 - Assasination
|
||||
@@ -787,6 +795,5 @@ LIB_OPEN_RAID_SPELL_DEFAULT_IDS = {
|
||||
--187827 vengeance need to test these spellIds
|
||||
--191427 havoc
|
||||
}
|
||||
--need to add mass dispell (32375)
|
||||
|
||||
LIB_OPEN_RAID_DATABASE_LOADED = true
|
||||
|
||||
Reference in New Issue
Block a user