From 328059f707398de9cd4fa753c709ba0bfeb0de94 Mon Sep 17 00:00:00 2001 From: "Ashley (CuteOne)" Date: Sun, 17 Aug 2025 19:34:52 -0400 Subject: [PATCH 01/65] MoP Classic Support --- 3rd Party Files/NoName/_BRLoader.lua | 90 +- BadRotations.lua | 10 +- BadRotations.toc | 2 +- Rotations/Death Knight/Blood/BloodCuteOne.lua | 4 +- Rotations/Druid/Feral/FeralCuteOne.lua | 1507 +++++++---------- Rotations/Druid/Initial/InitialDruid.lua | 171 +- System/API/CD.lua | 6 +- System/API/Debuff.lua | 74 +- System/API/Item.lua | 6 +- System/API/Module.lua | 370 ++-- System/API/Power.lua | 2 +- System/Core.lua | 8 +- System/Functions/Aura.lua | 5 +- System/Functions/Cast.lua | 37 +- System/Functions/Custom.lua | 2 +- System/Functions/Item.lua | 8 +- System/Functions/LastCast.lua | 8 +- System/Functions/Misc.lua | 28 +- System/Functions/Power.lua | 4 +- System/Functions/Range.lua | 2 +- System/Functions/Spell.lua | 37 +- System/Lists/Spells.lua | 593 +++---- System/Loader/cBuilder.lua | 103 +- System/Loader/cCharacter.lua | 4 +- System/Misc/foodflaskpot.lua | 4 +- System/UI/SettingsManagement.lua | 4 +- System/engines/EnemiesEngineFunctions.lua | 4 +- System/engines/HealingEngine.lua | 11 +- System/engines/QuestTracker.lua | 2 +- System/readers/combatlog.lua | 22 +- System/readers/common.lua | 76 +- Unlockers/nn.lua | 3 +- unusedFunctions.lua | 2 +- 33 files changed, 1544 insertions(+), 1665 deletions(-) diff --git a/3rd Party Files/NoName/_BRLoader.lua b/3rd Party Files/NoName/_BRLoader.lua index eb421c193d..0920aa540e 100644 --- a/3rd Party Files/NoName/_BRLoader.lua +++ b/3rd Party Files/NoName/_BRLoader.lua @@ -1,4 +1,5 @@ local Nn = ... +print("test TP 1") -- if --[[(...).name ~= "Nn" or]] Nn == nil then return end -- local read = Nn.Utils.Storage.read -- local write = Nn.Utils.Storage.write @@ -6,9 +7,17 @@ local Nn = ... -- local AceGUI = Nn.Utils.AceGUI --Only load BR if in retail 10.2.7 (UI Update); Classic/Cata Not Supported. -if select(4,GetBuildInfo()) < 100207 then return end +-- if select(4,GetBuildInfo()) < 100207 then return end + +local toc = "" +local tocPath = '/scripts/BadRotations/BadRotations.toc' +if not FileExists(tocPath) then print(tocPath, 'does not exist') return end +if FileExists(tocPath) then + toc = ReadFile(tocPath) +else + print('TOC file does not exist:', tocPath) +end -local toc = ReadFile('/scripts/BadRotations/BadRotations.toc') local br = {} br.files = {} @@ -50,43 +59,47 @@ br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalStyle-1.0/Media/Standar br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalStyle-1.0/Media/UbuntuMono-B.ttf', load = true} br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalStyle-1.0/Media/UbuntuMono-R.ttf', load = true} +LoadFilesFromTOC(toc) + -- Add Lua Files from .toc -for line in toc:gmatch("([^\n]*)\n?") do - local thisLine = line:trim() - if thisLine:find('#') == nil and thisLine:len() > 0 - and thisLine:find('.lua') ~= nil - then - thisLine = thisLine:gsub("\\","/") - thisLine = thisLine:gsub(" ","") - thisLine = thisLine:gsub(".lua","") - thisLine = 'BadRotations/'..thisLine - br.files[#br.files+1] = { - file = thisLine, - load = true - } - -- Lua Files loaded via XML Files - if thisLine == "BadRotations/Libs/DiesalStyle-1.0/DiesalStyle-1.0" then - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/DiesalGUI-1.0', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Window', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollFrame', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollingEditBox', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollingMessageFrame', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/CheckBox', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Button', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Spinner', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Input', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Dropdown', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/DropdownItem', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ComboBox', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ComboBoxItem', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Accordian', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/AccordianSection', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Tree', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Branch', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Bar', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/DiesalMenu-1.0', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/Objects/MenuItem', load = true} - br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/Objects/Menu', load = true} +function LoadFilesFromTOC(tocFile) + for line in tocFile:gmatch("([^\n]*)\n?") do + local thisLine = line:trim() + if thisLine:find('#') == nil and thisLine:len() > 0 + and thisLine:find('.lua') ~= nil + then + thisLine = thisLine:gsub("\\","/") + thisLine = thisLine:gsub(" ","") + thisLine = thisLine:gsub(".lua","") + thisLine = 'BadRotations/'..thisLine + br.files[#br.files+1] = { + file = thisLine, + load = true + } + -- Lua Files loaded via XML Files + if thisLine == "BadRotations/Libs/DiesalStyle-1.0/DiesalStyle-1.0" then + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/DiesalGUI-1.0', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Window', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollFrame', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollingEditBox', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ScrollingMessageFrame', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/CheckBox', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Button', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Spinner', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Input', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Dropdown', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/DropdownItem', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ComboBox', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/ComboBoxItem', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Accordian', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/AccordianSection', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Tree', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Branch', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalGUI-1.0/Objects/Bar', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/DiesalMenu-1.0', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/Objects/MenuItem', load = true} + br.files[#br.files+1] = {file = 'BadRotations/Libs/DiesalMenu-1.0/Objects/Menu', load = true} + end end end end @@ -110,3 +123,4 @@ if UnitExists('player') then print "[Nn] Loading BR" br.load() end +print("test TP 2") \ No newline at end of file diff --git a/BadRotations.lua b/BadRotations.lua index 80b17baf23..03e3b8863f 100644 --- a/BadRotations.lua +++ b/BadRotations.lua @@ -3,12 +3,14 @@ local _, br = ... br._G = setmetatable({}, { __index = _G }) br._G.GetSpellInfo = function(spellIdentifier) - local spellInfo = br._G.C_Spell.GetSpellInfo(spellIdentifier) - if spellInfo then + local spellInfo = _G["GetSpellInfo"](spellIdentifier) + if spellInfo and type(spellInfo) == "table" then ---@diagnostic disable-next-line: redundant-return-value return spellInfo.name, _, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, ---@diagnostic disable-next-line: redundant-return-value spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID + else + return _G["GetSpellInfo"](spellIdentifier) end end br.unlock = {} @@ -95,7 +97,7 @@ end -- Run function br.Run() if br.selectedSpec == nil then - br.selectedSpecID, br.selectedSpec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + br.selectedSpecID, br.selectedSpec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if br.selectedSpec == "" then br.selectedSpec = "Initial" end @@ -200,7 +202,7 @@ end function br.load() -- Update Selected Spec - br.selectedSpecID, br.selectedSpec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + br.selectedSpecID, br.selectedSpec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if br.selectedSpec == "" then br.selectedSpec = "Initial" end diff --git a/BadRotations.toc b/BadRotations.toc index 117a9b8be0..3090b6468a 100644 --- a/BadRotations.toc +++ b/BadRotations.toc @@ -4,7 +4,7 @@ ## Author: CuteOne ## Version: 1.36.0 ## Dependencies: SharedMedia -## Enabled: true +## Enabled: false ## Libs diff --git a/Rotations/Death Knight/Blood/BloodCuteOne.lua b/Rotations/Death Knight/Blood/BloodCuteOne.lua index 5e9f5b8e40..f9ca2aa58f 100644 --- a/Rotations/Death Knight/Blood/BloodCuteOne.lua +++ b/Rotations/Death Knight/Blood/BloodCuteOne.lua @@ -113,6 +113,7 @@ local charges local debuff local enemies local module +local pet local runes local runicPower local talent @@ -330,7 +331,7 @@ actionList.Combat = function() if actionList.Racials() then return true end -- Sacrificial Pact -- sacrificial_pact,if=!buff.dancing_rune_weapon.up&(pet.ghoul.remains<2|target.time_to_die= unit.health(thisUnit) + local lower = tonumber(damage:match("^(%d+)%-%d+$")) + finishHim = tonumber(lower) >= unit.health(thisUnit) end return finishHim end -- Primal Wrath Usable -local function usePrimalWrath() - if talent.primalWrath and cast.able.primalWrath("player", "aoe", 1, 8) - and ui.useAOE(8, 2) - and not unit.isExplosive("target") - then - if ui.value("Primal Wrath Usage") == 1 and ui.useAOE(8, 3) then return true end - local ripCount = 0 - for i = 1, #enemies.yards8 do - local thisUnit = enemies.yards8[i] - if debuff.rip.remain(thisUnit) <= 4 and (unit.ttd(thisUnit) > 8 or unit.isDummy(thisUnit)) then - ripCount = ripCount + 1 - end - end - return ripCount > 1 - end - return false -end +-- local function usePrimalWrath() +-- if talent.primalWrath and cast.able.primalWrath("player", "aoe", 1, 8) +-- and ui.useAOE(8, 2) +-- and not unit.isExplosive("target") +-- then +-- if ui.value("Primal Wrath Usage") == 1 and ui.useAOE(8, 3) then return true end +-- local ripCount = 0 +-- for i = 1, #enemies.yards8 do +-- local thisUnit = enemies.yards8[i] +-- if debuff.rip.remain(thisUnit) <= 4 and (unit.ttd(thisUnit) > 8 or unit.isDummy(thisUnit)) then +-- ripCount = ripCount + 1 +-- end +-- end +-- return ripCount > 1 +-- end +-- return false +-- end -- Get Mark Unit Option local getMarkUnitOption = function(option) local thisTar = ui.value(option) @@ -401,7 +412,7 @@ actionList.Extras = function() -- Cat Form if cast.able.catForm() and not buff.catForm.exists() and not unit.mounted() and not unit.flying() then -- Cat Form when not swimming or flying or stag and not in combat - if unit.moving() and not unit.swimming() and not unit.flying() and not buff.travelForm.exists() and not buff.soulshape.exists() then + if unit.moving() and not unit.swimming() and not unit.flying() and not buff.travelForm.exists() then if cast.catForm("player") then ui.debug("Casting Cat Form [No Swim / Travel / Combat]") return true @@ -518,82 +529,82 @@ actionList.Defensive = function() local opValue local thisUnit -- Rebirth - if ui.checked("Rebirth") and unit.inCombat() then - opValue = ui.value("Rebirth - Target") - if opValue == 1 then - thisUnit = "target" - elseif opValue == 2 then - thisUnit = "mouseover" - end - if cast.able.rebirth(thisUnit, "dead") and unit.deadOrGhost(thisUnit) - and (unit.friend(thisUnit) or unit.player(thisUnit)) - then - if unit.form() ~= 0 then - unit.cancelForm() - ui.debug("Cancel Form [Rebirth]") - elseif unit.form() == 0 then - if cast.rebirth(thisUnit, "dead") then - ui.debug("Casting Rebirth on " .. unit.name(thisUnit)) - return true - end - end - end - end + -- if ui.checked("Rebirth") and unit.inCombat() then + -- opValue = ui.value("Rebirth - Target") + -- if opValue == 1 then + -- thisUnit = "target" + -- elseif opValue == 2 then + -- thisUnit = "mouseover" + -- end + -- if cast.able.rebirth(thisUnit, "dead") and unit.deadOrGhost(thisUnit) + -- and (unit.friend(thisUnit) or unit.player(thisUnit)) + -- then + -- if unit.form() ~= 0 then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Rebirth]") + -- elseif unit.form() == 0 then + -- if cast.rebirth(thisUnit, "dead") then + -- ui.debug("Casting Rebirth on " .. unit.name(thisUnit)) + -- return true + -- end + -- end + -- end + -- end -- Revive - if ui.checked("Revive") and not unit.inCombat() then - opValue = ui.value("Revive - Target") - if opValue == 1 then - thisUnit = "target" - elseif opValue == 2 then - thisUnit = "mouseover" - end - if cast.able.revive(thisUnit, "dead") and unit.deadOrGhost(thisUnit) - and (unit.friend(thisUnit) and unit.player(thisUnit)) - then - if cast.revive(thisUnit, "dead") then - ui.debug("Casting Revive on " .. unit.name(thisUnit)) - return true - end - end - end + -- if ui.checked("Revive") and not unit.inCombat() then + -- opValue = ui.value("Revive - Target") + -- if opValue == 1 then + -- thisUnit = "target" + -- elseif opValue == 2 then + -- thisUnit = "mouseover" + -- end + -- if cast.able.revive(thisUnit, "dead") and unit.deadOrGhost(thisUnit) + -- and (unit.friend(thisUnit) and unit.player(thisUnit)) + -- then + -- if cast.revive(thisUnit, "dead") then + -- ui.debug("Casting Revive on " .. unit.name(thisUnit)) + -- return true + -- end + -- end + -- end -- Remove Corruption - if ui.checked("Remove Corruption") then - opValue = ui.value("Remove Corruption - Target") - if opValue == 1 then - thisUnit = "player" - elseif opValue == 2 then - thisUnit = "target" - elseif opValue == 3 then - thisUnit = "mouseover" - end - if cast.able.removeCorruption() and (unit.friend(thisUnit) or unit.player(thisUnit)) - and cast.dispel.removeCorruption(thisUnit) - then - if cast.removeCorruption(thisUnit) then - ui.debug("Casting Remove Corruption on " .. unit.name(thisUnit)) - return true - end - end - end + -- if ui.checked("Remove Corruption") then + -- opValue = ui.value("Remove Corruption - Target") + -- if opValue == 1 then + -- thisUnit = "player" + -- elseif opValue == 2 then + -- thisUnit = "target" + -- elseif opValue == 3 then + -- thisUnit = "mouseover" + -- end + -- if cast.able.removeCorruption() and (unit.friend(thisUnit) or unit.player(thisUnit)) + -- and cast.dispel.removeCorruption(thisUnit) + -- then + -- if cast.removeCorruption(thisUnit) then + -- ui.debug("Casting Remove Corruption on " .. unit.name(thisUnit)) + -- return true + -- end + -- end + -- end -- Soothe - if ui.checked("Soothe") and cast.able.soothe() then - for i = 1, #enemies.yards40 do - local sootheUnit = enemies.yards40[i] - if cast.dispel.soothe(sootheUnit) then - if cast.soothe(sootheUnit) then - ui.debug("Casting Soothe on " .. unit.name(sootheUnit)) - return true - end - end - end - end + -- if ui.checked("Soothe") and cast.able.soothe() then + -- for i = 1, #enemies.yards40 do + -- local sootheUnit = enemies.yards40[i] + -- if cast.dispel.soothe(sootheUnit) then + -- if cast.soothe(sootheUnit) then + -- ui.debug("Casting Soothe on " .. unit.name(sootheUnit)) + -- return true + -- end + -- end + -- end + -- end -- Renewal - if ui.checked("Renewal") and unit.inCombat() and cast.able.renewal() and unit.hp() <= ui.value("Renewal") then - if cast.renewal() then - ui.debug("Casting Renewal") - return true - end - end + -- if ui.checked("Renewal") and unit.inCombat() and cast.able.renewal() and unit.hp() <= ui.value("Renewal") then + -- if cast.renewal() then + -- ui.debug("Casting Renewal") + -- return true + -- end + -- end -- PowerShift - Breaks Crowd Control (R.I.P Powershifting) if ui.checked("Break Crowd Control") and cast.able.catForm() then if not cast.noControl.catForm() and var.lastForm ~= 0 then @@ -619,7 +630,7 @@ actionList.Defensive = function() end end -- Resto Affinity - if talent.restorationAffinity and not (unit.mounted() or unit.flying()) + if --[[talent.restorationAffinity and]] not (unit.mounted() or unit.flying()) and (ui.value("Auto Heal") ~= 1 or (ui.value("Auto Heal") == 1 and unit.distance(br.friend[1].unit) < 40)) then @@ -631,20 +642,20 @@ actionList.Defensive = function() thisHP = fhp; thisUnit = lowestUnit end -- Swiftmend - local swiftPercent = ui.value("Swiftmend") - if ui.checked("Swiftmend") and cast.able.swiftmend() - and ((not unit.inCombat() and thisHP <= swiftPercent) or (unit.inCombat() and thisHP <= swiftPercent / 2)) - then - if unit.form() ~= 0 then - unit.cancelForm() - ui.debug("Cancel Form [Swiftmend]") - elseif unit.form() == 0 then - if cast.swiftmend(thisUnit) then - ui.debug("Casting Swiftmend on " .. unit.name(thisUnit)) - return true - end - end - end + -- local swiftPercent = ui.value("Swiftmend") + -- if ui.checked("Swiftmend") and cast.able.swiftmend() + -- and ((not unit.inCombat() and thisHP <= swiftPercent) or (unit.inCombat() and thisHP <= swiftPercent / 2)) + -- then + -- if unit.form() ~= 0 then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Swiftmend]") + -- elseif unit.form() == 0 then + -- if cast.swiftmend(thisUnit) then + -- ui.debug("Casting Swiftmend on " .. unit.name(thisUnit)) + -- return true + -- end + -- end + -- end -- Rejuvenation local rejuvPercent = ui.value("Rejuvenation") if ui.checked("Rejuvenation") and cast.able.rejuvenation() and buff.rejuvenation.refresh(thisUnit) @@ -661,106 +672,106 @@ actionList.Defensive = function() end end -- Wild Growth - if ui.checked("Wild Growth") and not unit.inCombat() and cast.able.wildGrowth() then - for i = 1, #br.friend do - local wildGrowthUnit = br.friend[i].unit - local lowHealthCandidates = br.getUnitsToHealAround(wildGrowthUnit, 30, ui.value("Wild Growth"), - #br.friend) - if #lowHealthCandidates > 1 and not unit.moving() then - if unit.form() ~= 0 then - unit.cancelForm() - ui.debug("Cancel Form [Wild Growth]") - elseif unit.form() == 0 then - if cast.wildGrowth(br.friend[i].unit) then - ui.debug("Casting Wild Growth on " .. unit.name(wildGrowthUnit)) - return true - end - end - end - end - end - end - -- Regrowth - if ui.checked("Regrowth") and cast.able.regrowth("player") and not (unit.mounted() or unit.flying()) and not cast.current.regrowth() then - local thisHP = unit.hp() - local regrowthUnit = "player" - local lowestUnit = unit.lowest(40) - local fhp = unit.hp(lowestUnit) - if ui.value("Auto Heal") == 1 and unit.distance(lowestUnit) < 40 then - thisHP = fhp; regrowthUnit = lowestUnit - else - regrowthUnit = "player" - end - if not unit.inCombat() and thisHP <= ui.value("Regrowth") and (not unit.moving() or buff.predatorySwiftness.exists()) then - -- Break Form - if ui.value("Regrowth - OoC") == 1 and unit.form() ~= 0 and not buff.predatorySwiftness.exists() and unit.isUnit(regrowthUnit, "player") then - unit.cancelForm() - ui.debug("Cancel Form [Regrowth - OoC Break]") - end - -- Lowest Party/Raid or Player - if unit.form() == 0 or buff.predatorySwiftness.exists() then - if cast.regrowth(regrowthUnit) then - ui.debug("Casting Regrowth [OoC] on " .. unit.name(regrowthUnit)) - return true - end - end - elseif unit.inCombat() and (buff.predatorySwiftness.exists() or unit.level() < 49) then - -- Always Use Predatory Swiftness when available - if ui.value("Regrowth - InC") == 1 or not talent.bloodtalons then - -- Lowest Party/Raid or Player - if (thisHP <= ui.value("Regrowth") and unit.level() >= 49) or (unit.level() < 49 and thisHP <= ui.value("Regrowth") / 2) then - if unit.form() ~= 0 and not buff.predatorySwiftness.exists() and unit.isUnit(regrowthUnit, "player") then - unit.cancelForm() - ui.debug("Cancel Form [Regrowth - InC Break]") - elseif unit.form() == 0 or buff.predatorySwiftness.exists() then - if cast.regrowth(regrowthUnit) then - ui.debug("Casting Regrowth [IC Instant] on " .. unit.name(regrowthUnit)) - return true - end - end - end - end - -- Hold Predatory Swiftness for Bloodtalons unless Health is Below Half of Threshold or Predatory Swiftness is about to Expire. - if ui.value("Regrowth - InC") == 2 and talent.bloodtalons then - -- Lowest Party/Raid or Player - if (thisHP <= ui.value("Regrowth") / 2) or buff.predatorySwiftness.remain() < unit.gcd(true) * 2 then - if unit.form() ~= 0 and not buff.predatorySwiftness.exists() then - unit.cancelForm() - ui.debug("Cancel Form [Regrowth - InC Break]") - elseif unit.form() == 0 or buff.predatorySwiftness.exists() then - if cast.regrowth(regrowthUnit) then - ui.debug("Casting Regrowth [IC BT Hold] on " .. unit.name(regrowthUnit)) - return true - end - end - end - end - end - end - -- Barkskin - if ui.checked("Barkskin") and unit.inCombat() and cast.able.barkskin() and unit.hp() <= ui.value("Barkskin") then - if cast.barkskin() then - ui.debug("Casting Barkskin") - return true - end - end - -- Survival Instincts - if ui.checked("Survival Instincts") and unit.inCombat() and cast.able.survivalInstincts() - and unit.hp() <= ui.value("Survival Instincts") - and not buff.survivalInstincts.exists() and charges.survivalInstincts.count() > 0 - then - if cast.survivalInstincts() then - ui.debug("Casting Survival Instincts") - return true - end - end - -- Fleshcraft - if cast.able.fleshcraft() and unit.exists("target") and unit.deadOrGhost("target") and not unit.moving() and unit.ooCombatTime() > 2 then - if cast.fleshcraft("player") then - ui.debug("Casting Fleshcraft") - return true - end + -- if ui.checked("Wild Growth") and not unit.inCombat() and cast.able.wildGrowth() then + -- for i = 1, #br.friend do + -- local wildGrowthUnit = br.friend[i].unit + -- local lowHealthCandidates = br.getUnitsToHealAround(wildGrowthUnit, 30, ui.value("Wild Growth"), + -- #br.friend) + -- if #lowHealthCandidates > 1 and not unit.moving() then + -- if unit.form() ~= 0 then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Wild Growth]") + -- elseif unit.form() == 0 then + -- if cast.wildGrowth(br.friend[i].unit) then + -- ui.debug("Casting Wild Growth on " .. unit.name(wildGrowthUnit)) + -- return true + -- end + -- end + -- end + -- end + -- end end + -- -- Regrowth + -- if ui.checked("Regrowth") and cast.able.regrowth("player") and not (unit.mounted() or unit.flying()) and not cast.current.regrowth() then + -- local thisHP = unit.hp() + -- local regrowthUnit = "player" + -- local lowestUnit = unit.lowest(40) + -- local fhp = unit.hp(lowestUnit) + -- if ui.value("Auto Heal") == 1 and unit.distance(lowestUnit) < 40 then + -- thisHP = fhp; regrowthUnit = lowestUnit + -- else + -- regrowthUnit = "player" + -- end + -- if not unit.inCombat() and thisHP <= ui.value("Regrowth") and (not unit.moving() or buff.predatorySwiftness.exists()) then + -- -- Break Form + -- if ui.value("Regrowth - OoC") == 1 and unit.form() ~= 0 and not buff.predatorySwiftness.exists() and unit.isUnit(regrowthUnit, "player") then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Regrowth - OoC Break]") + -- end + -- -- Lowest Party/Raid or Player + -- if unit.form() == 0 or buff.predatorySwiftness.exists() then + -- if cast.regrowth(regrowthUnit) then + -- ui.debug("Casting Regrowth [OoC] on " .. unit.name(regrowthUnit)) + -- return true + -- end + -- end + -- elseif unit.inCombat() and (buff.predatorySwiftness.exists() or unit.level() < 49) then + -- -- Always Use Predatory Swiftness when available + -- if ui.value("Regrowth - InC") == 1 or not talent.bloodtalons then + -- -- Lowest Party/Raid or Player + -- if (thisHP <= ui.value("Regrowth") and unit.level() >= 49) or (unit.level() < 49 and thisHP <= ui.value("Regrowth") / 2) then + -- if unit.form() ~= 0 and not buff.predatorySwiftness.exists() and unit.isUnit(regrowthUnit, "player") then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Regrowth - InC Break]") + -- elseif unit.form() == 0 or buff.predatorySwiftness.exists() then + -- if cast.regrowth(regrowthUnit) then + -- ui.debug("Casting Regrowth [IC Instant] on " .. unit.name(regrowthUnit)) + -- return true + -- end + -- end + -- end + -- end + -- -- Hold Predatory Swiftness for Bloodtalons unless Health is Below Half of Threshold or Predatory Swiftness is about to Expire. + -- if ui.value("Regrowth - InC") == 2 and talent.bloodtalons then + -- -- Lowest Party/Raid or Player + -- if (thisHP <= ui.value("Regrowth") / 2) or buff.predatorySwiftness.remain() < unit.gcd(true) * 2 then + -- if unit.form() ~= 0 and not buff.predatorySwiftness.exists() then + -- unit.cancelForm() + -- ui.debug("Cancel Form [Regrowth - InC Break]") + -- elseif unit.form() == 0 or buff.predatorySwiftness.exists() then + -- if cast.regrowth(regrowthUnit) then + -- ui.debug("Casting Regrowth [IC BT Hold] on " .. unit.name(regrowthUnit)) + -- return true + -- end + -- end + -- end + -- end + -- end + -- end + -- -- Barkskin + -- if ui.checked("Barkskin") and unit.inCombat() and cast.able.barkskin() and unit.hp() <= ui.value("Barkskin") then + -- if cast.barkskin() then + -- ui.debug("Casting Barkskin") + -- return true + -- end + -- end + -- -- Survival Instincts + -- if ui.checked("Survival Instincts") and unit.inCombat() and cast.able.survivalInstincts() + -- and unit.hp() <= ui.value("Survival Instincts") + -- and not buff.survivalInstincts.exists() and charges.survivalInstincts.count() > 0 + -- then + -- if cast.survivalInstincts() then + -- ui.debug("Casting Survival Instincts") + -- return true + -- end + -- end + -- -- Fleshcraft + -- if cast.able.fleshcraft() and unit.exists("target") and unit.deadOrGhost("target") and not unit.moving() and unit.ooCombatTime() > 2 then + -- if cast.fleshcraft("player") then + -- ui.debug("Casting Fleshcraft") + -- return true + -- end + -- end end -- End Defensive Toggle end -- End Action List - Defensive @@ -781,17 +792,17 @@ actionList.Interrupts = function() end end -- Mighty Bash - if ui.checked("Mighty Bash") and cast.able.mightyBash() then - for i = 1, #enemies.yards5f do - thisUnit = enemies.yards5f[i] - if unit.interruptable(thisUnit, ui.value("Interrupt At")) then - if cast.mightyBash(thisUnit) then - ui.debug("Casting Mighty Bash on " .. unit.name(thisUnit)) - return true - end - end - end - end + -- if ui.checked("Mighty Bash") and cast.able.mightyBash() then + -- for i = 1, #enemies.yards5f do + -- thisUnit = enemies.yards5f[i] + -- if unit.interruptable(thisUnit, ui.value("Interrupt At")) then + -- if cast.mightyBash(thisUnit) then + -- ui.debug("Casting Mighty Bash on " .. unit.name(thisUnit)) + -- return true + -- end + -- end + -- end + -- end -- Maim if ui.checked("Maim") and cast.able.maim() then for i = 1, #enemies.yards5f do @@ -813,16 +824,16 @@ end -- End Action List - Interrupts actionList.PreCombat = function() if not unit.inCombat() and not (unit.flying() or unit.mounted()) then if not (buff.prowl.exists() or buff.shadowmeld.exists()) then - if (ui.checked("Pre-Pull Timer") and ui.pullTimer() <= ui.value("Pre-Pull Timer")) or unit.isDummy("target") then - -- Heart of the Wild - -- heart_of_the_wild - if cast.able.heartOfTheWild() then --and unit.valid("target") and unit.exists("target") and unit.distance("target") < 5 then - if cast.heartOfTheWild() then - ui.debug("Casting Heart Of The Wild [Pre-Combat]") - return true - end - end - end + -- if (ui.checked("Pre-Pull Timer") and ui.pullTimer() <= ui.value("Pre-Pull Timer")) or unit.isDummy("target") then + -- -- Heart of the Wild + -- -- heart_of_the_wild + -- if cast.able.heartOfTheWild() then --and unit.valid("target") and unit.exists("target") and unit.distance("target") < 5 then + -- if cast.heartOfTheWild() then + -- ui.debug("Casting Heart Of The Wild [Pre-Combat]") + -- return true + -- end + -- end + -- end -- Prowl -- prowl,if=!buff.prowl.up if cast.able.prowl("player") and buff.catForm.exists() and autoProwl() and ui.mode.prowl == 1 @@ -893,7 +904,7 @@ actionList.Combat = function() local thisUnit = enemies.yards5f[i] if cast.able.ferociousBite(thisUnit) and unit.distance(units.dyn5) < 5 then -- execute - if ferociousBiteFinish(thisUnit) and not usePrimalWrath() then + if ferociousBiteFinish(thisUnit) then--and not usePrimalWrath() then if ui.value("Ferocious Bite Execute") == 1 and ferociousBiteFinish(thisUnit) then ui.print("Ferocious Bite Finished! " .. unit.name(thisUnit) .. " with " .. br.round2(unit.hp(thisUnit), 0) .. "% health remaining.") @@ -919,7 +930,7 @@ actionList.Combat = function() end -- Call Action List - Variables -- call_action_list,name=variables - if actionList.Variables() then return true end + -- if actionList.Variables() then return true end -- Auto Attack -- auto_attack,if=!buff.prowl.up&!buff.shadowmeld.up if cast.able.autoAttack(units.dyn5) and unit.distance(units.dyn5) < 5 and not buff.prowl.exists() and not buff.shadowmeld.exists() then @@ -928,462 +939,458 @@ actionList.Combat = function() return true end end - -- Tiger's Fury - -- tigers_fury,if=(energy.deficit>35|combo_points=5|combo_points>=3&dot.rip.refreshable&buff.bloodtalons.up)&(fight_remains<=15|(cooldown.bs_inc.remains>20&target.time_to_die>5)|(cooldown.bs_inc.ready&target.time_to_die>12|target.time_to_die=fight_remains)) - if ui.checked("Tiger's Fury") and cast.able.tigersFury() - and ((energy.deficit() > 35 or comboPoints() == 5 or comboPoints() >= 3 and debuff.rip.refresh(units.dyn5) and buff.bloodtalons.exists()) - and (unit.ttdGroup(40) <= 15 or (cd.bsInc.remains() > 20 and unit.ttd(units.dyn5) > 5) - or (cd.bsInc.remains() == 0 and unit.ttd(units.dyn5) > 12 or unit.ttd(units.dyn5) == unit.ttdGroup(40)))) + -- Call Action List - AoE + -- swap_action_list,name=aoe,if=active_enemies>=5 + if ui.useAOE(8,5) then + if actionList.AoE() then return true end + end + -- Ravage + -- ravage,if=buff.stealthed.up + if cast.able.ravage(units.dyn5) and (buff.prowl.exists() or buff.shadowmeld.exists()) then + if cast.ravage(units.dyn5) then + ui.debug("Casting Ravage [Combat]") + return true + end + end + -- Ferocious Bite + -- # Keep Rip from falling off during execute range. + -- ferocious_bite,if=dot.rip.ticking&dot.rip.remains<=3&target.health.pct<=25 + if cast.able.ferociousBite(units.dyn5) and debuff.rip.exists(units.dyn5) + and debuff.rip.remains(units.dyn5) <= 3 and unit.hp(units.dyn5) <= 25 then - if cast.tigersFury() then - ui.debug("Casting Tigers Fury [Combat]") + if cast.ferociousBite(units.dyn5) then + ui.debug("Casting Ferocious Bite [Combat]"); return true + end + end + -- Faerie Fire + -- faerie_fire,if=debuff.weakened_armor.stack<3 + if cast.able.faerieFire(units.dyn5) and debuff.weakenedArmor.stack(units.dyn5) < 3 then + if cast.faerieFire(units.dyn5) then + ui.debug("Casting Faerie Fire [Combat]") return true end end - -- Rake - -- rake,target_if=max:refreshable+(persistent_multiplier>dot.rake.pmultiplier),if=buff.shadowmeld.up|buff.prowl.up - if cast.able.rake(var.maxRakePandemicUnit) and ((buff.shadowmeld.exists() or buff.prowl.exists())) then - if cast.rake(var.maxRakePandemicUnit) then - ui.debug("Casting Rake [Combat]") + -- Healing Touch + -- # Proc Dream of Cenarius at 4+ CP or when PS is about to expire. + -- healing_touch,if=talent.dream_of_cenarius.enabled&buff.predatory_swiftness.up&buff.dream_of_cenarius.down&(buff.predatory_swiftness.remains<1.5|combo_points>=4) + if cast.able.healingTouch() and buff.predatorySwiftness.exists() + and not buff.dreamOfCenarius.exists() and (buff.predatorySwiftness.remains() < 1.5 or comboPoints() >= 4) + then + if cast.healingTouch("player") then + ui.debug("Casting Healing Touch [Combat]") return true end end - -- Nature's Vigil - -- natures_vigil,if=spell_targets.swipe_cat>0&variable.regrowth - if ui.alwaysCdNever("Nature's Vigil") and cast.able.naturesVigil() and ui.useAOE(8, 1) and var.regrowth then - if cast.naturesVigil() then - ui.debug("Casting Natures Vigil [Combat]") + -- Savage Roar + -- savage_roar,if=buff.savage_roar.down + if cast.able.savageRoar() and buff.savageRoar.exists() then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - No Exist [Combat]") return true end end - -- Renewal - -- renewal,if=spell_targets.swipe_cat>0&variable.regrowth - if cast.able.renewal() and ui.useAOE(8, 1) and var.regrowth then - if cast.renewal() then - ui.debug("Casting Renewal [Combat]") + -- Virmen's Bite + -- virmens_bite_potion,if=(target.health.pct<30&buff.berserk.up)|target.time_to_die<=40 + + -- Tiger's Fury + -- tigers_fury,if=energy<=35&!buff.omen_of_clarity.react + if cast.able.tigersFury() and energy.deficit() > 35 and not buff.clearcasting.exists() then + if cast.tigersFury() then + ui.debug("Casting Tiger's Fury [Combat]") return true end end - -- Adaptive Swarm - if ui.alwaysCdNever("Adaptive Swarm") then - -- adaptive_swarm,target_if=dot.adaptive_swarm_damage.stack<3&(!dot.adaptive_swarm_damage.ticking|dot.adaptive_swarm_damage.remains<2),if=!action.adaptive_swarm_damage.in_flight&(spell_targets=1|!talent.unbridled_swarm)&(dot.rip.ticking|hero_tree.druid_of_the_claw) - for i = 1, #enemies.yards40 do - local thisUnit = enemies.yards40[i] - if cast.able.adaptiveSwarm(thisUnit) and debuff.adaptiveSwarmDamage.count(thisUnit) < 3 - and (not debuff.adaptiveSwarmDamage.exists(thisUnit) or debuff.adaptiveSwarmDamage.remains(thisUnit) < 2) - and not cast.inFlight.adaptiveSwarmDamage() and (ui.useST(8, 1) or not talent.unbridledSwarm) - and (debuff.rip.exists(thisUnit) or heroTree.druidOfTheClaw) - then - if cast.adaptiveSwarm(thisUnit) then - ui.debug("Casting Adaptive Swarm [Combat]") - return true - end - end + -- Berserk + -- berserk,if=buff.tigers_fury.up|(target.time_to_die<18&cooldown.tigers_fury.remains>6) + if cast.able.berserk() and (buff.tigersFury.exists() or (unit.ttd(units.dyn5) < 18 and cd.tigersFury.remains() > 6)) then + if cast.berserk() then + ui.debug("Casting Berserk [Combat]") + return true end - -- adaptive_swarm,target_if=max:(1+dot.adaptive_swarm_damage.stack)*dot.adaptive_swarm_damage.stack<3*time_to_die,if=buff.cat_form.up&dot.adaptive_swarm_damage.stack<3&talent.unbridled_swarm.enabled&spell_targets.swipe_cat>1&dot.rip.ticking - if cast.able.adaptiveSwarm(var.maxAdaptiveSwarmUnit) and debuff.adaptiveSwarmDamage.count(var.maxAdaptiveSwarmUnit) < 3 - and talent.unbridledSwarm and ui.useAOE(8, 2) and debuff.rip.exists(var.maxAdaptiveSwarmUnit) - then - if cast.adaptiveSwarm(var.maxAdaptiveSwarmUnit) then - ui.debug("Casting Adaptive Swarm - Unbridled Swarm [Combat]") - return true - end + end + -- Use Item - Hands + -- use_item,slot=hands,if=buff.tigers_fury.up + + -- Thrash + -- thrash_cat,if=buff.omen_of_clarity.react&dot.thrash_cat.remains<3&target.time_to_die>=6 + if cast.able.thrash() and buff.clearcasting.exists() and debuff.thrash.remains(units.dyn5) < 3 and unit.ttd(units.dyn5) >= 6 then + if cast.thrash(units.dyn5) then + ui.debug("Casting Thrash [Combat]") + return true end end -- Ferocious Bite - -- ferocious_bite,if=buff.apex_predators_craving.up&!(variable.need_bt&active_bt_triggers=2) - if cast.able.ferociousBite() and buff.apexPredatorsCraving.exists() and not (var.needBt and var.btGen.triggers == 2) then - if cast.ferociousBite() then - ui.debug("Casting Ferocious Bite [Combat - Apex]") + -- ferocious_bite,if=target.time_to_die<=1&combo_points>=3 + if cast.able.ferociousBite(units.dyn5) and unit.ttd(units.dyn5) <= 1 and comboPoints() >= 3 then + if cast.ferociousBite(units.dyn5) then + ui.debug("Casting Ferocious Bite - TTD <= 1 [Combat]") return true end end - -- Call Action List - Cooldown - -- call_action_list,name=cooldown,if=dot.rip.ticking - if debuff.rip.exists(units.dyn5) then - if actionList.Cooldown() then return true end + -- Savage Roar + -- savage_roar,if=buff.savage_roar.remains<=3&combo_points>0&target.health.pct<25 + if cast.able.savageRoar() and buff.savageRoar.remains() <= 3 and comboPoints() > 0 and unit.hp(units.dyn5) < 25 then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - Low Target HP [Combat]") + return true + end end -- Rip - -- rip,if=spell_targets=1&hero_tree.wildstalker&!(talent.raging_fury&talent.veinripper)&(buff.bloodtalons.up|!talent.bloodtalons)&(dot.rip.remains<5&buff.tigers_fury.remains>10&combo_points>=3|((buff.tigers_fury.remains<3&combo_points=5)|buff.tigers_fury.remains<=1)&buff.tigers_fury.up&combo_points>=3&remains 10 and comboPoints() >= 3 - or (((buff.tigersFury.remains() < 3 and comboPoints() == 5) or buff.tigersFury.remains() <= 1) - and buff.tigersFury.exists() and comboPoints() >= 3 and debuff.rip.remains(units.dyn5) < cd.tigersFury.remains())) - then + -- # Overwrite Rip if it's at least 15% stronger than the current. + -- rip,if=combo_points>=5&action.rip.tick_damage%dot.rip.tick_dmg>=1.15&target.time_to_die>30 + if comboPoints() >= 5 and debuff.rip.calc() % debuff.rip.applied(units.dyn5) >= 1.15 and unit.ttd(units.dyn5) > 30 then if cast.rip(units.dyn5) then - ui.debug("Casting Rip [Combat]") + ui.debug("Casting Rip - Overwrite [Combat]") return true end end - -- Action List - Finisher - -- call_action_list,name=finisher,if=combo_points==5 - if comboPoints() == 5 then - if actionList.Finisher() then return true end - end - -- Action List - Builder - -- call_action_list,name=builder,if=spell_targets.swipe_cat=1&combo_points<5&(variable.time_to_pool<=0|!variable.need_bt|variable.proccing_bt) - if ui.useST(8, 2, "player") and comboPoints() < 5 and (var.timeToPool <= 0 or not var.needBt or var.proccingBt) then - if actionList.Builder() then return true end - end - -- Action List - Aoe Builder - -- call_action_list,name=aoe_builder,if=spell_targets.swipe_cat>=2&combo_points<5&(variable.time_to_pool<=0|!variable.need_bt|variable.proccing_bt) - if ui.useAOE(8, 2, "player") and comboPoints() < 5 and (var.timeToPool <= 0 or not var.needBt or var.proccingBt) then - if actionList.AoeBuilder() then return true end + -- Pool Resource + -- # Pool 50 energy for Ferocious Bite. + -- pool_resource,if=combo_points>=5&target.health.pct<=25&dot.rip.ticking&!(energy>=50|(buff.berserk.up&energy>=25)) + if comboPoints() >= 5 and unit.hp(units.dyn5) <= 25 and debuff.rip.exists(units.dyn5) + and not (energy() >= 50 or (buff.berserk.exists() and energy() >= 25)) + then + -- ui.debug("Pooling 50 energy for Ferocious Bite [Combat]") + return true end - -- Regrowth - -- regrowth,if=buff.predatory_swiftness.up&variable.regrowth - if cast.able.regrowth() and buff.predatorySwiftness.exists() and var.regrowth then - if cast.regrowth() then - ui.debug("Casting Regrowth") + -- Ferocious Bite + -- ferocious_bite,if=combo_points>=5&dot.rip.ticking&target.health.pct<=25 + if cast.able.ferociousBite(units.dyn5) and comboPoints() >= 5 and debuff.rip.exists(units.dyn5) + and unit.hp(units.dyn5) <= 25 + then + if cast.ferociousBite(units.dyn5) then + ui.debug("Casting Ferocious Bite - Low Target HP [Combat]") return true end end - end -end -- End Action List - Combat - --- Action List - AoEBuilder -actionList.AoeBuilder = function() - -- Thrash Cat - -- thrash_cat,if=refreshable&!talent.thrashing_claws&!(variable.need_bt&buff.bt_thrash.up) - if cast.able.thrashCat("player", "aoe", 1, 8) and debuff.thrashCat.refresh(units.dyn8AOE) - and not talent.thrashingClaws and not (var.needBt and var.btGen.thrash) - then - if cast.thrashCat("player", "aoe", 1, 8) then - ui.debug("Casting Thrash Cat - Refresh [Aoe Builder]") - return true + -- Rip + -- rip,if=combo_points>=5&target.time_to_die>=6&dot.rip.remains<2&(buff.berserk.up|dot.rip.remains+1.9<=cooldown.tigers_fury.remains) + if cast.able.rip() and comboPoints() >= 5 and unit.ttd(units.dyn5) >= 6 and debuff.rip.remains(units.dyn5) < 2 + and (buff.berserk.exists() or debuff.rip.remains(units.dyn5) + 1.9 <= cd.tigersFury.remains()) + then + if cast.rip(units.dyn5) then + ui.debug("Casting Rip [Combat]") + return true + end end - end - -- Brutal Slash - -- brutal_slash,target_if=min:time_to_die,if=(cooldown.brutal_slash.full_recharge_time<4|time_to_die<4|raid_event.adds.remains<4|(buff.bs_inc.up&spell_targets>=3-hero_tree.druid_of_the_claw))&!(variable.need_bt&buff.bt_swipe.up&(buff.bs_inc.down|spell_targets<3-hero_tree.druid_of_the_claw)) - if talent.brutalSlash and cast.able.brutalSlash("player", "aoe", ui.value("Brutal Slash Targets"), 8) - and (charges.brutalSlash.timeTillFull() < 4 or unit.ttd(var.minTTDUnit) < 4 or unit.ttdGroup(40) < 4 - or (buff.bsInc.exists() and ui.useAOE(8, 3 - var.druidOfTheClaw))) - and not (var.needBt and var.btGen.swipe and (not buff.bsInc.exists() or ui.useST(8, 3 - var.druidOfTheClaw))) - then - if cast.brutalSlash("player", "aoe", ui.value("Brutal Slash Targets"), 8) then - ui.debug("Casting Brutal Slash - Max Charges / Low TTD / High Enemy Count [Aoe Builder]") - return true + -- Savage Roar + -- savage_roar,if=buff.savage_roar.remains<=3&combo_points>0&buff.savage_roar.remains+2>dot.rip.remains + if cast.able.savageRoar() and buff.savageRoar.remains() <= 3 and comboPoints() > 0 + and buff.savageRoar.remains() + 2 > debuff.rip.remains(units.dyn5) + then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - Remain <= 3 [Combat]") + return true + end end - end - -- Swipe Cat - -- swipe_cat,target_if=min:time_to_die,if=talent.wild_slashes&(time_to_die<4|raid_event.adds.remains<4|buff.bs_inc.up&spell_targets>=3-hero_tree.druid_of_the_claw)&!(variable.need_bt&buff.bt_swipe.up&(buff.bs_inc.down|spell_targets<3-hero_tree.druid_of_the_claw)) - if not talent.brutalSlash and cast.able.swipeCat("player", "aoe", 1, 8) and talent.wildSlashes - and (unit.ttd(var.minTTDUnit) < 4 or unit.ttdGroup(40) < 4 or (buff.bsInc.exists() and ui.useAOE(8, 3 - var.druidOfTheClaw))) - and not (var.needBt and var.btGen.swipe and (not buff.bsInc.exists() or ui.useST(8, 3 - var.druidOfTheClaw))) - then - if cast.swipeCat("player", "aoe", 1, 8) then - ui.debug("Casting Swipe Cat - Low TTD Wild Slashes [Aoe Builder]") - return true + -- savage_roar,if=buff.savage_roar.remains<=6&combo_points>=5&buff.savage_roar.remains+2<=dot.rip.remains&dot.rip.ticking + if cast.able.savageRoar() and buff.savageRoar.remains() <= 6 and comboPoints() >= 5 + and buff.savageRoar.remains() + 2 <= debuff.rip.remains(units.dyn5) and debuff.rip.exists(units.dyn5) + then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - Remain <= 6 [Combat]") + return true + end end - end - -- swipe_cat,if=time_to_die<4|(talent.wild_slashes&spell_targets.swipe_cat>4&!(variable.need_bt&buff.bt_swipe.up)) - if not talent.brutalSlash and cast.able.swipeCat("player", "aoe", 1, 8) and (unit.ttd(var.minTTDUnit) < 4 - or (talent.wildSlashes and #enemies.yards8 > 4 and not (var.needBt and var.btGen.swipe))) - then - if cast.swipeCat("player", "aoe", 1, 8) then - ui.debug("Casting Swipe Cat - High Enemy Count Wild Slashes [Aoe Builder]") - return true + -- # Savage Roar if we're about to energy cap and it will keep our Rip from expiring around the same time as Savage Roar. + -- savage_roar,if=buff.savage_roar.remains<=12&combo_points>=5&energy.time_to_max<=1&buff.savage_roar.remains<=dot.rip.remains+6&dot.rip.ticking + if cast.able.savageRoar() and buff.savageRoar.remains() <= 12 and comboPoints() >= 5 + and energy.ttm() <= 1 and buff.savageRoar.remains() <= debuff.rip.remains(units.dyn5) + 6 + and debuff.rip.exists(units.dyn5) + then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - Energy Cap [Combat]") + return true + end end - end - -- Prowl - -- prowl,target_if=dot.rake.refreshable|dot.rake.pmultiplier<1.4,if=!(variable.need_bt&buff.bt_rake.up)&action.rake.ready&gcd.remains=0&!buff.sudden_ambush.up&!variable.cc_capped - if cast.able.prowl("player") and buff.catForm.exists() and autoProwl() and ui.mode.prowl == 1 and not buff.prowl.exists() - and not (var.needBt and var.btGen.rake) and cast.able.rake(var.rakeRefreshUnit) and unit.gcd() == 0 and not buff.suddenAmbush.exists() and not var.ccCapped - then - if cast.prowl("player") then - ui.debug("Casting Prowl [Aoe Builder]") - return true + -- Rake + -- # Rake if we can apply a stronger Rake or if it's about to fall off and clipping the last tick won't waste too much damage. + -- rake,cycle_targets=1,if=target.time_to_die-dot.rake.remains>3&(action.rake.tick_damage>dot.rake.tick_dmg|(dot.rake.remains<3&action.rake.tick_damage%dot.rake.tick_dmg>=0.75)) + for i = 1, #enemies.yards5f do + local thisUnit = enemies.yards5f[i] + if cast.able.rake(thisUnit) and (unit.ttd(thisUnit) - debuff.rake.remains(thisUnit) > 3) + and (debuff.rake.calc(thisUnit) > debuff.rake.applied(thisUnit) + or (debuff.rake.remains(thisUnit) < 3 + and debuff.rake.calc(thisUnit) % debuff.rake.applied(thisUnit) >= 0.75)) + then + if cast.rake(thisUnit) then + ui.debug("Casting Rake on " .. unit.name(thisUnit) .. " [Combat]") + return true + end + end end - end - -- Shadowmeld - -- shadowmeld,target_if=dot.rake.refreshable|dot.rake.pmultiplier<1.4,if=!(variable.need_bt&buff.bt_rake.up)&action.rake.ready&!buff.sudden_ambush.up&!buff.prowl.up&!variable.cc_capped - if ui.checked("Racial") and race == "NightElf" and cast.able.racial() and ui.useCDs() and not unit.moving() - and unit.distance(var.rakeRefreshUnit) < 5 and not var.solo and var.friendsInRange - then - if not (var.needBt and var.btGen.rake) and cast.able.rake(var.rakeRefreshUnit) and not buff.suddenAmbush.exists() and not buff.prowl.exists() and not var.ccCapped then - if cast.racial() then - ui.debug("Casting Shadowmeld [Aoe Builder]") + -- Thrash + -- thrash_cat,if=target.time_to_die>=6&dot.thrash_cat.remains<3&(dot.rip.remains>=8&buff.savage_roar.remains>=12|buff.berserk.up|combo_points>=5)&dot.rip.ticking + if cast.able.thrash() and unit.ttd(units.dyn5) >= 6 and debuff.thrash.remains(units.dyn5) < 3 + and ((debuff.rip.remains(units.dyn5) >= 8 and buff.savageRoar.remains() >= 12) + or buff.berserk.exists() or comboPoints() >= 5) and debuff.rip.exists(units.dyn5) + then + -- Pool Energy for Thrash + -- # Pool energy for and maintain Thrash. + -- pool_resource,for_next=1 + if energy() <50 then return true end + if cast.thrash() then + ui.debug("Casting Thrash [Combat]") return true end end - end - -- Rake - -- rake,target_if=refreshable,if=talent.doubleclawed_rake&!(variable.need_bt&buff.bt_rake.up)&!variable.cc_capped - if cast.able.rake(var.rakeRefreshUnit) and talent.doubleclawedRake - and not (var.needBt and var.btGen.rake) and not var.ccCapped - then - if cast.rake(var.rakeRefreshUnit) then - ui.debug("Casting Rake - Double Clawed Rake [Aoe Builder]") + -- Pool Energy for Ferocious Bite + -- # Pool to near-full energy before casting Ferocious Bite. + -- pool_resource,if=combo_points>=5&!(energy.time_to_max<=1|(buff.berserk.up&energy>=25))&dot.rip.ticking + if comboPoints() >= 5 + and not (energy.ttm() <= 1 or (buff.berserk.exists() and energy() >= 25)) and debuff.rip.exists(units.dyn5) + then + -- ui.debug("Pooling to near-full energy for Ferocious Bite [Combat]") return true end - end - -- Swipe Cat - -- swipe_cat,if=talent.wild_slashes&spell_targets.swipe_cat>2&!(variable.need_bt&buff.bt_swipe.up) - if not talent.brutalSlash and cast.able.swipeCat("player", "aoe", 1, 8) and talent.wildSlashes and #enemies.yards8 > 2 - and not (var.needBt and var.btGen.swipe) - then - if cast.swipeCat("player", "aoe", 1, 8) then - ui.debug("Casting Swipe Cat - Wild Slashes [Aoe Builder]") - return true + -- Ferocious Bite + -- # Ferocious Bite if we reached near-full energy without spending our CP on something else. + -- ferocious_bite,if=combo_points>=5&dot.rip.ticking + if cast.able.ferociousBite() and comboPoints() >= 5 and debuff.rip.exists(units.dyn5) then + if cast.ferociousBite(units.dyn5) then + ui.debug("Casting Ferocious Bite - Max Combo [Combat]") + return true + end end - end - -- Moonfire Cat - -- moonfire_cat,target_if=refreshable,if=!(variable.need_bt&buff.bt_moonfire.up)&!variable.cc_capped - if cast.able.moonfireCat(var.moonfireRefreshUnit) and not (var.needBt and var.btGen.moonfireFeral) and not var.ccCapped then - if cast.moonfireCat(var.moonfireRefreshUnit) then - ui.debug("Casting Moonfire Cat - Refresh [Aoe Builder]") - return true + -- Call Action List - Filler + -- # Conditions under which we should execute a CP generator. + -- run_action_list,name=filler,if=buff.omen_of_clarity.react + if buff.clearcasting.exists() then + if actionList.Filler() then return true end end - end - -- Rake - -- rake,target_if=refreshable,if=!(variable.need_bt&buff.bt_rake.up)&!variable.cc_capped - if cast.able.rake(var.rakeRefreshUnit) and not (var.needBt and var.btGen.rake) and not var.ccCapped then - if cast.rake(var.rakeRefreshUnit) then - ui.debug("Casting Rake - Refresh [Aoe Builder]") - return true + -- run_action_list,name=filler,if=(combo_points<5&dot.rip.remains<3.0)|(combo_points=0&buff.savage_roar.remains<2) + if (comboPoints() < 5 and debuff.rip.remains(units.dyn5) < 3) or (comboPoints() == 0 and buff.savageRoar.remains() < 2) then + if actionList.Filler() then return true end end - end - -- Brutal Slash - -- brutal_slash,if=!(variable.need_bt&buff.bt_swipe.up) - if talent.brutalSlash and cast.able.brutalSlash() and not (var.needBt and var.btGen.swipe) then - if cast.brutalSlash() then - ui.debug("Casting Brutal Slash [Aoe Builder]") - return true + -- run_action_list,name=filler,if=target.time_to_die<=8.5 + if unit.ttd(units.dyn5) <= 8.5 then + if actionList.Filler() then return true end end - end - -- Swipe Cat - -- swipe_cat,if=!(variable.need_bt&buff.bt_swipe.up) - if not talent.brutalSlash and cast.able.swipeCat() and not (var.needBt and var.btGen.swipe) then - if cast.swipeCat() then - ui.debug("Casting Swipe Cat [Aoe Builder]") - return true + -- run_action_list,name=filler,if=buff.tigers_fury.up|buff.berserk.up + if buff.tigersFury.exists() or buff.berserk.exists() then + if actionList.Filler() then return true end end - end - -- Shred - -- shred,if=!buff.sudden_ambush.up&!variable.easy_swipe&!(variable.need_bt&buff.bt_shred.up) - if cast.able.shred() and not buff.suddenAmbush.exists() and not var.easySwipe and not (var.needBt and var.btGen.shred) then - if cast.shred(var.maxTTDUnit) then - ui.debug("Casting Shred [Aoe Builder]") - return true + -- run_action_list,name=filler,if=cooldown.tigers_fury.remains<=3 + if cd.tigersFury.remains() <= 3 then + if actionList.Filler() then return true end end - end - -- Thrash Cat - -- thrash_cat,if=!talent.thrashing_claws&!(variable.need_bt&buff.bt_thrash.up) - if cast.able.thrashCat("player", "aoe", 1, 8) and not talent.thrashingClaws and not (var.needBt and var.btGen.thrash) then - if cast.thrashCat("player", "aoe", 1, 8) then - ui.debug("Casting Thrash Cat [Aoe Builder]") - return true + -- run_action_list,name=filler,if=energy.time_to_max<=1.0 + if energy.ttm() <= 1.0 then + if actionList.Filler() then return true end end end - -- Rake - -- rake,target_if=max:ticks_gained_on_refresh,if=talent.doubleclawed_rake&buff.sudden_ambush.up&variable.need_bt&buff.bt_rake.down - if cast.able.rake(var.maxRakePandemicUnit) and talent.doubleclawedRake and buff.suddenAmbush.exists() and var.needBt and not var.btGen.rake then - if cast.rake(var.maxRakePandemicUnit) then - ui.debug("Casting Rake - BT Build Double Clawed Rake [Aoe Builder]") - var.btGen.rake = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true - end +end -- End Action List - Combat + +-- Action List - AoE +actionList.AoE = function() + -- Call Action List + -- swap_action_list,name=default,if=active_enemies<5 + if ui.useST(8, 5, "player") then + actionList.Combat() end - -- Moonfire Cat - -- moonfire_cat,target_if=max:ticks_gained_on_refresh,if=variable.need_bt&buff.bt_moonfire.down - if cast.able.moonfireCat(var.maxMoonFirePandemicUnit) and var.needBt and not var.btGen.moonfireFeral then - if cast.moonfireCat(var.maxMoonFirePandemicUnit) then - ui.debug("Casting Moonfire Cat - BT Build [Aoe Builder]") - var.btGen.moonfireFeral = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Faerie Fire + -- faerie_fire,cycle_targets=1,if=debuff.weakened_armor.stack<3 + for i = 1, #enemies.yards35 do + local thisUnit = enemies.yards35[i] + if cast.able.faerieFire(thisUnit) then + if debuff.weakenedArmor.stack(thisUnit) < 3 then + if cast.faerieFire(thisUnit) then + ui.debug("Casting Faerie Fire on " .. unit.name(thisUnit) .. " [AoE]") + return true + end + end end end - -- Rake - -- rake,target_if=max:ticks_gained_on_refresh,if=buff.sudden_ambush.up&variable.need_bt&buff.bt_rake.down - if cast.able.rake(var.maxRakePandemicUnit) and buff.suddenAmbush.exists() and var.needBt and not var.btGen.rake then - if cast.rake(var.maxRakePandemicUnit) then - ui.debug("Casting Rake - BT Build Sudden Ambush [Aoe Builder]") - var.btGen.rake = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Savage Roar + -- savage_roar,if=buff.savage_roar.down|(buff.savage_roar.remains<3&combo_points>0) + if cast.able.savageRoar() then + if buff.savageRoar.down() or (buff.savageRoar.remains() < 3 and comboPoints() > 0) then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - No Exist / Expire Soon [AoE]") + return true + end end end - -- Shred - -- shred,if=variable.need_bt&buff.bt_shred.down&!variable.easy_swipe - if cast.able.shred() and var.needBt and not var.btGen.shred and not var.easySwipe then - if cast.shred() then - ui.debug("Casting Shred - BT Build [Aoe Builder]") - var.btGen.shred = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Use Item Slot - Hands + -- use_item,slot=hands,if=buff.tigers_fury.up + + -- Racial + -- blood_fury,if=buff.tigers_fury.up + -- berserking,if=buff.tigers_fury.up + -- arcane_torrent,if=buff.tigers_fury.up + + -- Tiger's Fury + -- tigers_fury,if=energy<=35&!buff.omen_of_clarity.react + if cast.able.tigersFury() then + if energy.current() <= 35 and not buff.clearcasting.exists() then + if cast.tigersFury() then + ui.debug("Casting Tiger's Fury [AoE]") + return true + end end end - -- Rake - -- rake,target_if=dot.rake.pmultiplier<1.6,if=variable.need_bt&buff.bt_rake.down - if cast.able.rake(var.lowRakeMultiUnit) and var.needBt and not var.btGen.rake then - if cast.rake(var.lowRakeMultiUnit) then - ui.debug("Casting Rake - BT Build Low Multiplier [Aoe Builder]") - var.btGen.rake = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Berserk + -- berserk,if=buff.tigers_fury.up + if cast.able.berserk() then + if buff.tigersFury.exists() then + if cast.berserk() then + ui.debug("Casting Berserk [AoE]") + return true + end end end - -- Thrash Cat - -- thrash_cat,if=variable.need_bt&buff.bt_shred.down - if cast.able.thrashCat("player", "aoe", 1, 8) and var.needBt and not var.btGen.thrash then - if cast.thrashCat("player", "aoe", 1, 8) then - ui.debug("Casting Thrash Cat - BT Build [Aoe Builder]") - var.btGen.thrash = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Pool Resource + -- pool_resource,wait=0.1,for_next=1 + + -- Thrash + -- thrash_cat,if=dot.thrash_cat.remains<3|(buff.tigers_fury.up&dot.thrash_cat.remains<9) + if cast.able.thrash() then + if debuff.thrash.remains() < 3 or (buff.tigersFury.exists() and debuff.thrash.remains() < 9) then + if energy() < 50 and not buff.clearcasting.exists() then + return true + end + if cast.thrash() then + ui.debug("Casting Thrash [AoE]") + return true + end end end -end -- End Action List - AoE --- Action List - Builder -actionList.Builder = function() - -- Prowl - -- prowl,if=gcd.remains=0&energy>=35&!buff.sudden_ambush.up&(dot.rake.refreshable|dot.rake.pmultiplier<1.4)*!(variable.need_bt&buff.bt_rake.up)&buff.tigers_fury.up&!buff.shadowmeld.up - if cast.able.prowl("player") and unit.gcd() == 0 and energy() >= 35 and not buff.suddenAmbush.exists() - and ((debuff.rake.refresh(units.dyn5) or debuff.rake.pmultiplier(units.dyn5) < 1.4) and not (var.needBt and var.btGen.rake)) - and buff.tigersFury.exists() and not buff.shadowmeld.exists() and buff.incarnationAvatarOfAshamane.exists() - then - if cast.prowl("player") then - ui.debug("Casting Prowl [Builder]") - return true + -- Savage Roar + -- savage_roar,if=buff.savage_roar.remains<9&combo_points>=5 + if cast.able.savageRoar() then + if buff.savageRoar.remains() < 9 and comboPoints() >= 5 then + if cast.savageRoar() then + ui.debug("Casting Savage Roar - Max Combo [AoE]") + return true + end end end - -- Shadowmeld - -- shadowmeld,if=gcd=0&energy>=35&!buff.sudden_ambush.up&(dot.rake.refreshable|dot.rake.pmultiplier<1.4)*!(variable.need_bt&buff.bt_rake.up)&buff.tigers_fury.up&!buff.prowl.up - if ui.checked("Racial") and race == "NightElf" and cast.able.racial() and ui.useCDs() and not unit.moving() - and unit.distance(units.dyn5) < 5 and not var.solo and var.friendsInRange - then - if unit.gcd() == 0 and energy() >= 35 and not buff.suddenAmbush.exists() - and ((debuff.rake.refresh(units.dyn5) or debuff.rake.pmultiplier(units.dyn5) < 1.4) and not (var.needBt and var.btGen.rake)) - and buff.tigersFury.exists() and not buff.prowl.exists() - then - if cast.racial() then - ui.debug("Casting Shadowmeld [Builder]") + + -- Rip + -- rip,if=combo_points>=5 + if cast.able.rip() then + if comboPoints() >= 5 then + if cast.rip() then + ui.debug("Casting Rip [AoE]") return true end end end + -- Rake - -- rake,if=((refreshable&persistent_multiplier>=dot.rake.pmultiplier|dot.rake.remains<3.5)|buff.sudden_ambush.up&persistent_multiplier>dot.rake.pmultiplier)&!(variable.need_bt&buff.bt_rake.up) - if cast.able.rake() and (((debuff.rake.refresh(units.dyn5) and debuff.rake.applied(units.dyn5) >= debuff.rake.pmultiplier(units.dyn5) - or debuff.rake.remains(units.dyn5) < 3.5) or buff.suddenAmbush.exists() and debuff.rake.applied(units.dyn5) > debuff.rake.pmultiplier(units.dyn5)) - and not (var.needBt and var.btGen.rake)) - then - if cast.rake() then - ui.debug("Casting Rake - Better Rake [Builder]") - return true - end - end - -- Brutal Slash - -- brutal_slash,if=cooldown.brutal_slash.full_recharge_time<4&!(variable.need_bt&buff.bt_swipe.up) - if talent.brutalSlash and cast.able.brutalSlash("player", "aoe", 1, 8) and charges.brutalSlash.timeTillFull() < 4 and not (var.needBt and var.btGen.swipe) then - if cast.brutalSlash("player", "aoe", 1, 8) then - ui.debug("Casting Brutal Slash - Max Charges [Builder]") - return true + -- rake,cycle_targets=1,if=active_enemies<8&dot.rake.remains<3&target.time_to_die>=15 + for i = 1, #enemies.yards5f do + local thisUnit = enemies.yards5f[i] + if cast.able.rake(thisUnit) then + if #enemies.yards5f < 8 and debuff.rake.remains(thisUnit) < 3 and unit.ttd(thisUnit) >= 15 then + if cast.rake(thisUnit) then + ui.debug("Casting Rake on " .. unit.name(thisUnit) .. " [AoE]") + return true + end + end end end - -- Moonfire Cat - -- moonfire_cat,if=refreshable - if talent.lunarInspiration and cast.able.moonfireCat(units.dyn40AOE) and debuff.moonfireCat.refresh(units.dyn40AOE) then - if cast.moonfireCat(units.dyn40AOE) then - ui.debug("Casting Moonfire Cat - Refresh [Builder]") + + -- Swipe + -- swipe_cat,if=buff.savage_roar.remains<=5 + if cast.able.swipe() and buff.savageRoar.remains() <= 5 then + if cast.swipe() then + ui.debug("Casting Swipe - Savage Roar [AoE]") return true end end - -- Thrash Cat - -- thrash_cat,if=refreshable&!talent.thrashing_claws - if cast.able.thrashCat("player", "aoe", 1, 8) and debuff.thrashCat.refresh(units.dyn8AOE) and not talent.thrashingClaws then - if cast.thrashCat("player", "aoe", 1, 8) then - ui.debug("Casting Thrash Cat - Refresh [Builder]") + -- swipe_cat,if=buff.tigers_fury.up|buff.berserk.up + if cast.able.swipe() and (buff.tigersFury.exists() or buff.berserk.exists()) then + if cast.swipe() then + ui.debug("Casting Swipe - Tiger's Fury/Berserk [AoE]") return true end end - -- Shred - -- shred,if=buff.clearcasting.react&!(variable.need_bt&buff.bt_shred.up) - if cast.able.shred() and buff.clearcasting.exists() and not (var.needBt and var.btGen.shred) then - if cast.shred() then - ui.debug("Casting Shred - Clearcast [Builder]") + -- swipe_cat,if=cooldown.tigers_fury.remains<3 + if cast.able.swipe() and cd.tigersFury.remains() < 3 then + if cast.swipe() then + ui.debug("Casting Swipe - Tiger's Fury [AoE]") return true end end - -- Pool Resource - -- pool_resource,wait=0.2,if=variable.dot_refresh_soon&energy.deficit>70&!variable.need_bt&!buff.bs_inc.up&cooldown.tigers_fury.remains>3 - -- if ui.delay("Pool Resource",0.2) and var.dotRefreshSoon and energy.deficit() > 70 and not var.needBt and not buff.bsInc.exists() and cd.tigersFury.remains() > 3 then - -- if ui.delay("Message",unit.gcd(true)) then ui.debug("Pooling Resource [Builder]") end - -- return true - -- end - -- Brutal Slash - -- brutal_slash,if=!(variable.need_bt&buff.bt_swipe.up) - if talent.brutalSlash and cast.able.brutalSlash("player", "aoe", ui.value("Brutal Slash Targets"), 8) - and not (var.needBt and var.btGen.brutalSlash) - then - if cast.brutalSlash("player", "aoe", ui.value("Brutal Slash Targets"), 8) then - ui.debug("Casting Brutal Slash [Builder]") + -- swipe_cat,if=buff.omen_of_clarity.react + if cast.able.swipe() and buff.clearcasting.exists() then + if cast.swipe() then + ui.debug("Casting Swipe - Clearcasting [AoE]") return true end end - -- Shred - -- shred,if=!(variable.need_bt&buff.bt_shred.up) - if cast.able.shred() and not (var.needBt and var.btGen.shred) then - if cast.shred() then - ui.debug("Casting Shred [Builder]") + -- swipe_cat,if=energy.time_to_max<=1 + if cast.able.swipe() and energy.ttm() <= 1 then + if cast.swipe() then + ui.debug("Casting Swipe - Energy Time to Max [AoE]") return true end end - -- Swipe Cat - -- swipe_cat,if=variable.need_bt&buff.bt_swipe.down - if not talent.brutalSlash and cast.able.swipeCat("player", "aoe", 1, 8) and var.needBt and not var.btGen.swipe then - if cast.swipeCat("player", "aoe", 1, 8) then - ui.debug("Casting Swipe Cat - BT Build [Builder]") - var.btGen.swipe = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end +end -- End Action List - AoE + +-- Action List - Filler +actionList.Filler = function() + -- Ravage + -- ravage + if cast.able.ravage() then + if cast.ravage(units.dyn5) then + ui.debug("Casting Ravage [Filler]") return true end end + -- Rake - -- rake,if=variable.need_bt&buff.bt_rake.down&persistent_multiplier>=dot.rake.pmultiplier - if cast.able.rake() and var.needBt and not var.btGen.rake and debuff.rake.applied(units.dyn5) >= debuff.rake.pmultiplier(units.dyn5) then - if cast.rake() then - ui.debug("Casting Rake - BT Build [Builder]") - var.btGen.rake = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + -- # Rake if it hits harder than Mangle and we won't apply a weaker bleed to the target. + -- rake,if=target.time_to_die-dot.rake.remains>3&action.rake.tick_damage*(dot.rake.ticks_remain+1)-dot.rake.tick_dmg*dot.rake.ticks_remain>action.mangle_cat.hit_damage + for i = 1, #enemies.yards5f do + local thisUnit = enemies.yards5f[i] + if cast.able.rake(thisUnit) then + if unit.ttd(thisUnit) - debuff.rake.remains(thisUnit) > 3 + and (debuff.rake.calc() * (debuff.rake.ticksRemain(thisUnit) + 1) + - debuff.rake.applied(thisUnit) * debuff.rake.ticksRemain(thisUnit) + > getMangleDamage()) + then + if cast.rake(thisUnit) then + ui.debug("Casting Rake on " .. unit.name(thisUnit) .. " [Filler]") + return true + end + end end end - -- Moonfire Cat - -- moonfire_cat,if=variable.need_bt&buff.bt_moonfire.down - if talent.lunarInspiration and cast.able.moonfireCat() and var.needBt and not var.btGen.moonfire then - if cast.moonfireCat() then - ui.debug("Casting Moonfire Cat - BT Build [Builder]") - var.btGen.moonfireFeral = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Shred + -- shred,if=(buff.omen_of_clarity.react|buff.berserk.up|energy.regen>=15)&buff.king_of_the_jungle.down + if cast.able.shred(units.dyn5) then + if (buff.clearcasting.exists() or buff.berserk.exists() or energy.regen() >= 15) and buff.incarnation.down() then + if cast.shred(units.dyn5) then + ui.debug("Casting Shred on " .. unit.name(units.dyn5) .. " [Filler]") + return true + end end end - -- Thrash Cat - -- thrash_cat,if=variable.need_bt&buff.bt_thrash.down - if cast.able.thrashCat("player", "aoe", 1, 8) and var.needBt and not var.btGen.thrash then - if cast.thrashCat("player", "aoe", 1, 8) then - ui.debug("Casting Thrash Cat - BT Build [Builder]") - var.btGen.thrash = true - if var.btGen.timer - var.getTime <= 0 then var.btGen.timer = var.getTime + 4 end - return true + + -- Mangle + -- mangle_cat,if=buff.king_of_the_jungle.down + if cast.able.mangle(units.dyn5) then + if buff.incarnation.down() then + if cast.mangle(units.dyn5) then + ui.debug("Casting Mangle on " .. unit.name(units.dyn5) .. " [Filler]") + return true + end end end -end -- End Action List - Builder +end -- End Action List - Filler -- Action List - Cooldown actionList.Cooldown = function() if unit.distance(units.dyn5) < 5 then - -- Use Item - Imperfect Ascendancy Serum - -- use_item,name=imperfect_ascendancy_serum,if=cooldown.bs_inc.remains<=1 - if use.able.imperfectAscendancySerum() and cd.bsInc.remains()<=1 then - if use.imperfectAscendancySerum() then ui.debug("Using Imperfect Ascendancy Serum [Cooldown]") return true end - end if ui.alwaysCdNever("Berserk/Incarnation") and ui.useCDs() then -- Incarnation -- incarnation,if=target.time_to_die>17|target.time_to_die=fight_remains @@ -1418,133 +1425,9 @@ actionList.Cooldown = function() -- Module- Basic Trinkets -- use_items module.BasicTrinkets() - -- Do Treacherous Transmitter Task - -- do_treacherous_transmitter_task,if=buff.tigers_fury.up|fight_remains<22 - if ui.useTrinkets(items.treacherousTransmitter) and use.able.treacherousTransmitter() and ((buff.tigersFury.exists() or unit.ttdGroup(40) < 22)) then - if use.treacherousTransmitter() then - ui.debug("Casting Treacherous Transmitter [Cooldown]") - return true - end - end - -- Feral Frenzy - -- feral_frenzy,if=combo_points<=1|buff.bs_inc.up&combo_points<=2 - if cast.able.feralFrenzy() and ((comboPoints() <= 1 or buff.bsInc.exists() and comboPoints() <= 2)) then - if cast.feralFrenzy() then - ui.debug("Casting Feral Frenzy [Cooldown]") - return true - end - end - -- Convoke The Spirits - -- convoke_the_spirits,if=fight_remains<5|(cooldown.bs_inc.remains>45|buff.bs_inc.up|!talent.berserk_heart_of_the_lion)&(buff.tigers_fury.up&(combo_points<=4|buff.bs_inc.up&combo_points<=3)&(target.time_to_die>5-talent.ashamanes_guidance.enabled|target.time_to_die=fight_remains)) - if ui.alwaysCdNever("Convoke The Spirits") and cast.able.convokeTheSpirits() and (unit.ttdGroup(40) < 5 - or (cd.bsInc.remains() > 45 or buff.bsInc.exists() or not talent.berserkHeartOfTheLion) - and (buff.tigersFury.exists() and (comboPoints() <= 4 or buff.bsInc.exists() and comboPoints() <= 3) - and (unit.ttd(units.dyn5) > 5 - var.ashamanesGuidance or unit.ttd(units.dyn5) == unit.ttdGroup(40)))) - then - if cast.convokeTheSpirits() then - ui.debug("Casting Convoke The Spirits [Cooldown]") - return true - end - end end -- End useCooldowns check end -- End Action List - Cooldowns --- Action List - Finisher -actionList.Finisher = function() - -- Primal Wrath - -- primal_wrath,target_if=max:dot.bloodseeker_vines.ticking,if=spell_targets.primal_wrath>1&((dot.primal_wrath.remains<6.5&!buff.bs_inc.up|dot.primal_wrath.refreshable)|(!talent.rampant_ferocity.enabled&(spell_targets.primal_wrath>1&!dot.bloodseeker_vines.ticking&!buff.ravage.up|spell_targets.primal_wrath>6+talent.ravage))) - if cast.able.primalWrath("player", "aoe", 1, 8) and ui.useAOE(8, 2) and ((debuff.rip.remains(var.maxBloodseekerVinesUnit) < 6.5 - and not buff.bsInc.exists() or debuff.rip.refresh(var.maxBloodseekerVinesUnit)) - or (not talent.rampantFerocity and (ui.useAOE(8, 2) and not debuff.bloodseekerVines.exists(units.dyn8AOE) - and not buff.ravage.exists() or ui.useAOE(8, 7 + var.ravage)))) - then - if cast.primalWrath("player", "aoe", 1, 8) then - ui.debug("Casting Primal Wrath [Finisher]") - return true - end - end - -- Rip - -- rip,target_if=refreshable,if=(!talent.primal_wrath|spell_targets=1)&(buff.bloodtalons.up|!talent.bloodtalons)&(buff.tigers_fury.up|dot.rip.remains= 50 and not buff.bsInc.exists() then - if not cast.able.tigersFury() and not buff.apexPredatorsCraving.exists() then - if cast.pool.ferociousBite() then return true end - end - if cast.ferociousBite(var.maxBloodseekerVinesUnit) then - ui.debug("Casting Ferocious Bite - Max Energy [Finisher]") - return true - end - end - -- Ferocious Bite - -- ferocious_bite,target_if=max:dot.bloodseeker_vines.ticking - if cast.able.ferociousBite(var.maxBloodseekerVinesUnit) then - if cast.ferociousBite(var.maxBloodseekerVinesUnit) then - ui.debug("Casting Ferocious Bite [Finisher]") - return true - end - end -end -- End Action List - Finisher - --- Action List - Variables -actionList.Variables = function() - -- Variable - Effective Energy,Op=Set - -- variable,name=effective_energy,op=set,value=energy+(40*buff.clearcasting.stack)+(3*energy.regen)+(50*(cooldown.tigers_fury.remains<3.5)) - var.effectiveEnergy = energy() + (40 * buff.clearcasting.stack()) + (3 * energy.regen()) + (50 * var.tigersFury) - -- Variable - Time To Pool,Op=Set - -- variable,name=time_to_pool,op=set,value=((115-variable.effective_energy-(23*buff.incarnation.up))%energy.regen) - var.timeToPool = ((115 - var.effectiveEnergy - (23 * var.incarnation)) / energy.regen()) - -- Variable - Dot Refresh Soon - -- variable,name=dot_refresh_soon,value=(!talent.thrashing_claws&(dot.thrash_cat.remains-dot.thrash_cat.duration*0.3<=2))|(talent.lunar_inspiration&(dot.moonfire_cat.remains-dot.moonfire_cat.duration*0.3<=2))|((dot.rake.pmultiplier<1.6|buff.sudden_ambush.up)&(dot.rake.remains-dot.rake.duration*0.3<=2)) - var.dotRefreshSoon = (not talent.thrashingClaws and (debuff.thrashCat.remains() - debuff.thrashCat.duration() * 0.3 <= 2)) - or (talent.lunarInspiration and (debuff.moonfireCat.remains() - debuff.moonfireCat.duration() * 0.3 <= 2)) - or ((debuff.rake.pmultiplier(units.dyn5) < 1.6 or buff.suddenAmbush.exists()) and (debuff.rake.remains(units.dyn5) - debuff.rake.duration(units.dyn5) * 0.3 <= 2)) - -- Variable - Need Bt - -- variable,name=need_bt,value=talent.bloodtalons.enabled&buff.bloodtalons.stack<=1 - var.needBt = talent.bloodtalons and buff.bloodtalons.stack() <= 1 - -- Variable - Cc Capped - -- variable,name=cc_capped,value=buff.clearcasting.stack=(1+talent.moment_of_clarity) - var.ccCapped = buff.clearcasting.stack() == (1 + var.clarity) - -- Variable - Lastconvoke - -- variable,name=lastConvoke,value=(cooldown.convoke_the_spirits.remains+cooldown.convoke_the_spirits.duration)>remains&cooldown.convoke_the_spirits.remains - buff.convokeTheSpirits.remains() and cd.convokeTheSpirits.remains() < buff.convokeTheSpirits.remains() - -- Variable - Lastzerk - -- variable,name=lastZerk,value=(cooldown.bs_inc.remains+cooldown.bs_inc.duration+5)>remains&cooldown.convoke_the_spirits.remains buff.bsInc.remains() and - cd.convokeTheSpirits.remains() < buff.bsInc.remains() - -- Variable - Lastpotion - -- variable,name=lastPotion,value=(cooldown.potions.remains+cooldown.potions.duration+15)>remains&cooldown.potions.remains+15 buff.potions.remains() and - -- cd.potions.remains() + 15 < buff.potions.remains() - -- Variable - Regrowth - -- variable,name=regrowth,op=reset - var.regrowth = ui.checked("Regrowth-SimC") - -- Variable - Easy Swipe - -- variable,name=easy_swipe,op=reset - var.easySwipe = ui.checked("Easy Swipe") - -- Variable - Moonfire Snapshotted - -- variable,name=moonfire_snapshotted,value=buff.tigers_fury.up,op=set,if=prev.lunar_inspiration - if cast.last.moonfireCat() then - var.moonfireSnapshotted = buff.tigersFury.exists() - end - if debuff.moonfireCat.count() == 0 then - var.moonfireSnapshotted = false - end - -- Variable - Proccing Bt,Op=Set - -- variable,name=proccing_bt,op=set,value=variable.need_bt - var.proccingBt = var.needBt -end -- End Action List - Variables - ---------------- --- ROTATION --- ---------------- @@ -1565,7 +1448,7 @@ local function runRotation() enemies = br.player.enemies energy = br.player.power.energy equiped = br.player.equiped - heroTree = br.player.heroTree + -- heroTree = br.player.heroTree items = br.player.items module = br.player.module race = br.player.race @@ -1591,31 +1474,31 @@ local function runRotation() var.unit5ID = 0 -- General Variables - Numeric Conversion - var.ashamanesGuidance = talent.ashamanesGuidance and 1 or 0 - var.clarity = talent.momentOfClarity and 1 or 0 - var.druidOfTheClaw = heroTree.druidOfTheClaw and 1 or 0 - var.noBtRake = not (var.needBt and var.btGen.rake) and 1 or 0 - var.ravage = talent.ravage and 1 or 0 - var.tigersFury = (cd.tigersFury.remains() < 3.5) and 1 or 0 - var.incarnation = buff.incarnationAvatarOfAshamane.exists() and 1 or 0 + -- var.ashamanesGuidance = talent.ashamanesGuidance and 1 or 0 + -- var.clarity = talent.momentOfClarity and 1 or 0 + -- var.druidOfTheClaw = heroTree.druidOfTheClaw and 1 or 0 + -- var.noBtRake = not (var.needBt and var.btGen.rake) and 1 or 0 + -- var.ravage = talent.ravage and 1 or 0 + -- var.tigersFury = (cd.tigersFury.remains() < 3.5) and 1 or 0 + -- var.incarnation = buff.incarnationAvatarOfAshamane.exists() and 1 or 0 -- Bloodtalons - Init - var.btGen = var.btGen or {} - var.btGen.brutalSlash = false - var.btGen.moonfireFeral = false - var.btGen.rake = false - var.btGen.shred = false - var.btGen.swipe = false - var.btGen.thrash = false - var.btGen.stack = 2 - var.btGen.timer = var.getTime - var.btGen.triggers = 0 + -- var.btGen = var.btGen or {} + -- var.btGen.brutalSlash = false + -- var.btGen.moonfireFeral = false + -- var.btGen.rake = false + -- var.btGen.shred = false + -- var.btGen.swipe = false + -- var.btGen.thrash = false + -- var.btGen.stack = 2 + -- var.btGen.timer = var.getTime + -- var.btGen.triggers = 0 -- Ticks Gain - Init - var.ticksGain = var.ticksGain or {} - var.ticksGain.rake = 5 - var.ticksGain.rip = 12 - var.ticksGain.thrash = 5 + -- var.ticksGain = var.ticksGain or {} + -- var.ticksGain.rake = 5 + -- var.ticksGain.rip = 12 + -- var.ticksGain.thrash = 5 br.player.initialized = true end @@ -1629,6 +1512,7 @@ local function runRotation() -- Get List of Enemies for Range -- enemies.get(range, from unit, no combat, variable) enemies.get(40) -- makes enemies.yards40 + enemies.get(35) -- makes enemies.yards35 enemies.get(20, "player", true) -- makes enemies.yards20nc enemies.get(20) enemies.get(13, "player", false, true) -- makes enemies.yards13f @@ -1646,36 +1530,36 @@ local function runRotation() if var.profileStop then var.profileStop = false end var.leftCombat = var.getTime end - var.btGen = var.btGen or {} - var.rakeRefresh = (debuff.rake.refresh(units.dyn5) or debuff.rake.pmultiplier(units.dyn5) < 1.4) and 1 or 0 - var.unit5ID = br.GetObjectID(units.dyn5) or 0 - var.noDoT = var.unit5ID == 153758 or var.unit5ID == 156857 or var.unit5ID == 156849 or var.unit5ID == 156865 or - var.unit5ID == 156869 + -- var.btGen = var.btGen or {} + -- var.rakeRefresh = (debuff.rake.refresh(units.dyn5) or debuff.rake.pmultiplier(units.dyn5) < 1.4) and 1 or 0 + -- var.unit5ID = br.GetObjectID(units.dyn5) or 0 + -- var.noDoT = var.unit5ID == 153758 or var.unit5ID == 156857 or var.unit5ID == 156849 or var.unit5ID == 156865 or + -- var.unit5ID == 156869 -- Add buff.bsInc.exists() buff.bsInc = buff.bsInc or {} if not buff.bsInc.exists then buff.bsInc.exists = function() - return buff.berserk.exists() or buff.incarnationAvatarOfAshamane.exists() + return buff.berserk.exists() or buff.incarnation.exists() end end -- Add buff.bsInc.remain() if not buff.bsInc.remains then buff.bsInc.remains = function() - return math.max(buff.berserk.remain(), buff.incarnationAvatarOfAshamane.remain()) + return math.max(buff.berserk.remain(), buff.incarnation.remain()) end end -- Add cd.bsInc.remains() cd.bsInc = cd.bsInc or {} if not cd.bsInc.remains then cd.bsInc.remains = function() - return math.max(cd.berserk.remains(), cd.incarnationAvatarOfAshamane.remains()) + return math.max(cd.berserk.remains(), cd.incarnation.remains()) end end -- Add cd.bsInc.duration() cd.bsInc = cd.bsInc or {} if not cd.bsInc.duration then cd.bsInc.duration = function() - return math.max(cd.berserk.duration(), cd.incarnationAvatarOfAshamane.duration()) + return math.max(cd.berserk.duration(), cd.incarnation.duration()) end end @@ -1691,143 +1575,6 @@ local function runRotation() end end - -- Bloodtalons - Reset - if var.btGen.timer - var.getTime <= 0 or buff.bloodtalons.exists() or not unit.inCombat() then - if var.btGen.brutalSlash then var.btGen.brutalSlash = false end - if var.btGen.moonfireFeral then var.btGen.moonfireFeral = false end - if var.btGen.rake then var.btGen.rake = false end - if var.btGen.shred then var.btGen.shred = false end - if var.btGen.swipe then var.btGen.swipe = false end - if var.btGen.thrash then var.btGen.thrash = false end - -- var.btGen.timer = var.getTime + 4 - end - -- if not buff.bloodtalons.exists() and var.btGen.timer - var.getTime > 0 then var.btGen.stack = 2 end - var.btGen.stack = 2 - buff.bloodtalons.stack() - var.btGen.triggers = 0 - if not var.btGen.brutalSlash and talent.brutalSlash then var.btGen.triggers = var.btGen.triggers + 1 end - if not var.btGen.moonfireFeral and talent.lunarInspiration then var.btGen.triggers = var.btGen.triggers + 1 end - if not var.btGen.rake then var.btGen.triggers = var.btGen.triggers + 1 end - if not var.btGen.shred then var.btGen.triggers = var.btGen.triggers + 1 end - if not var.btGen.swipe and not talent.brutalSlash then var.btGen.triggers = var.btGen.triggers + 1 end - if not var.btGen.thrash then var.btGen.triggers = var.btGen.triggers + 1 end - - -- Yards40 Target_If Variables - var.maxAdaptiveSwarmDot = 0 - var.maxAdaptiveSwarmDotUnit = "target" - var.maxMoonFirePandemic = 0 - var.maxMoonFirePandemicUnit = "target" - for i = 1, #enemies.yards40 do - local thisUnit = enemies.yards40[i] - local moonfireRefresh = debuff.moonfireCat.refresh(thisUnit) and 1 or 0 - local numAdaptiveSwarm = debuff.adaptiveSwarmDamage.exists(thisUnit) and 1 or 0 - local adaptiveSwarm = (3 * moonfireRefresh) + numAdaptiveSwarm - local moonfire = debuff.moonfire.ticksGainedOnRefresh(thisUnit) - local swarmCount = debuff.adaptiveSwarmDamage.count(thisUnit) - local toNumeric = (swarmCount < 3) and 1 or 0 - local thisCondition = (1 + swarmCount) * toNumeric * unit.ttd(thisUnit) - -- target_if=max:(3*refreshable)+dot.adaptive_swarm_damage.ticking - if adaptiveSwarm > var.maxAdaptiveSwarmDot then - var.maxAdaptiveSwarmDot = adaptiveSwarm - var.maxAdaptiveSwarmDotUnit = thisUnit - end - -- target_if=max:dot.moonfire.ticks_gained_on_refresh - if moonfire > var.maxMoonFirePandemic then - var.maxMoonFirePandemic = moonfire - var.maxMoonFirePandemicUnit = thisUnit - end - -- target_if=max:(1+dot.adaptive_swarm_damage.stack)*dot.adaptive_swarm_damage.stack<3*time_to_die - if thisCondition > var.maxAdaptiveSwarm then - var.maxAdaptiveSwarm = thisCondition - var.maxAdaptiveSwarmUnit = thisUnit - end - end - - -- Yards5f Target_If Variables - var.minTTD = 99999 - var.minTTDUnit = "target" - var.noRakeUnit = "target" - var.lowRakeMultiUnit = "target" - var.maxRakePandemic = 0 - var.maxRakePandemicUnit = "target" - var.maxRakeRefresh = 0 - var.maxRakeRefreshUnit = "target" - var.maxAdaptiveSwarm = 0 - var.maxAdaptiveSwarmUnit = "target" - var.rakeRefreshUnit = "target" - var.maxRakeTicksGain = 0 - var.maxRakeTicksGainUnit = "target" - var.minRakePandemicX20 = 999 - var.minRakePandemicX20Unit = "target" - var.maxRakePandemicX25 = 0 - var.maxRakePandemicX25Unit = "target" - var.maxBloodseekerVines = 0 - var.maxBloodseekerVinesUnit = "target" - for i = 1, #enemies.yards5f do - local thisUnit = enemies.yards5f[i] - local ttdUnit = unit.ttd(thisUnit) - local applied = debuff.rake.applied(thisUnit) - local pmulti = debuff.rake.pmultiplier(thisUnit) - local gainRefresh = debuff.rake.ticksGainedOnRefresh(thisUnit) - local remain = debuff.rake.remains(thisUnit) - local refresh = debuff.rake.refresh(thisUnit) and 1 or 0 - local pandemic = (applied > pmulti) and 1 or 0 - local rakeable = (pmulti < 1.6 or refresh) and 1 or 0 - local ticksGain = (rakeable * gainRefresh) - local rakePandemic = (pmulti < applied) and 1 or 0 - local rakeRemain = remain - (rakePandemic * 20) - local rakePandemic = (pmulti <= applied) and 1 or 0 - local rakeRefresh = (rakePandemic * 25) + gainRefresh - local bloodseeker = debuff.bloodseekerVines.remain(thisUnit) - -- target_if=min:target.time_to_die - if ttdUnit < var.minTTD then - var.minTTD = ttdUnit - var.minTTDUnit = thisUnit - end - -- target_if=!dot.rake.ticking - if not debuff.rake.exists(thisUnit) then - var.noRakeUnit = thisUnit - end - -- target_if=max:refreshable+(persistent_multiplier>dot.rake.pmultiplier) - if (refresh + pandemic) > var.maxRakePandemic then - var.maxRakePandemic = pandemic - var.maxRakePandemicUnit = thisUnit - end - -- target_if=max:refreshable+(persistent_multiplier>dot.rake.pmultiplier) - if (refresh + pandemic) > var.maxRakeRefresh then - var.maxRakeRefresh = (refresh + pandemic) - var.maxRakeRefreshUnit = thisUnit - end - -- target_if=dot.rake.refreshable|dot.rake.pmultiplier<1.4 - if refresh or debuff.rake.pmultiplier(thisUnit) < 1.4 then - var.rakeRefreshUnit = thisUnit - break - end - -- target_if=max:(dot.rake.pmultiplier<1.6|dot.rake.refreshable)*druid.rake.ticks_gained_on_refresh - if ticksGain > var.maxRakeTicksGain then - var.maxRakeTicksGain = ticksGain - var.maxRakeTicksGainUnit = thisUnit - end - -- target_if=dot.rake.pmultiplier<1.6 - if pmulti < 1.6 then - var.lowRakeMultiUnit = thisUnit - end - -- target_if=min:dot.rake.remains-20*(dot.rake.pmultiplier var.maxRakePandemicX25 then - var.maxRakePandemicX25 = rakeRefresh - var.maxRakePandemicX25Unit = thisUnit - end - -- target_if=max:dot.bloodseeker_vines.ticking - if bloodseeker > var.maxBloodseekerVines then - var.maxBloodseekerVines = bloodseeker - var.maxBloodseekerVinesUnit = thisUnit - end - end - --------------------- --- Begin Profile --- --------------------- diff --git a/Rotations/Druid/Initial/InitialDruid.lua b/Rotations/Druid/Initial/InitialDruid.lua index f68a9bad94..b6ade7250d 100644 --- a/Rotations/Druid/Initial/InitialDruid.lua +++ b/Rotations/Druid/Initial/InitialDruid.lua @@ -7,13 +7,13 @@ local function createToggles() -- Define custom toggles -- Rotation Button local RotationModes = { [1] = { mode = "Auto", value = 1, overlay = "Automatic Rotation", tip = "Swaps between Single and Multiple based on number of #enemies.yards8 in range.", highlight = 1, icon = br.player.spells.wrath }, - [2] = { mode = "Off", value = 2, overlay = "DPS Rotation Disabled", tip = "Disable DPS Rotation", highlight = 0, icon = br.player.spells.regrowth } + [2] = { mode = "Off", value = 2, overlay = "DPS Rotation Disabled", tip = "Disable DPS Rotation", highlight = 0, icon = br.player.spells.rejuvenation } }; br.ui:createToggle(RotationModes, "Rotation", 1, 0) -- Defensive Button local DefensiveModes = { - [1] = { mode = "On", value = 1, overlay = "Defensive Enabled", tip = "Includes Defensive Cooldowns.", highlight = 1, icon = br.player.spells.regrowth }, - [2] = { mode = "Off", value = 2, overlay = "Defensive Disabled", tip = "No Defensives will be used.", highlight = 0, icon = br.player.spells.regrowth } + [1] = { mode = "On", value = 1, overlay = "Defensive Enabled", tip = "Includes Defensive Cooldowns.", highlight = 1, icon = br.player.spells.rejuvenation }, + [2] = { mode = "Off", value = 2, overlay = "Defensive Disabled", tip = "No Defensives will be used.", highlight = 0, icon = br.player.spells.rejuvenation } }; br.ui:createToggle(DefensiveModes, "Defensive", 2, 0) -- Cooldown Button @@ -29,6 +29,12 @@ local function createToggles() -- Define custom toggles [3] = { mode = "Bear", value = 3, overlay = "Bear Form", tip = "Will force and use Bear Form", highlight = 0, icon = br.player.spells.bearForm } }; br.ui:createToggle(FormModes, "Forms", 4, 0) + -- Prowl Button + local ProwlModes = { + [1] = { mode = "On", value = 1, overlay = "Prowl Enabled", tip = "Rotation will use Prowl", highlight = 1, icon = br.player.spells.prowl }, + [2] = { mode = "Off", value = 2, overlay = "Prowl Disabled", tip = "Rotation will not use Prowl", highlight = 0, icon = br.player.spells.prowl } + }; + br.ui:createToggle(ProwlModes, "Prowl", 5, 0) end --------------- @@ -65,6 +71,8 @@ local function createOptions() br.player.module.BasicHealing(section) -- Regrowth br.ui:createSpinner(section, "Regrowth", 50, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At") + -- Rejuvenation + br.ui:createSpinner(section, "Rejuvenation", 50, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At") br.ui:checkSectionState(section) ---------------------- --- TOGGLE OPTIONS --- @@ -115,6 +123,24 @@ local movingTimer ----------------- --- Functions --- -- List all profile specific custom functions here ----------------- +-- AutoProwl +local function autoProwl() + if not unit.inCombat() and not buff.prowl.exists() then + if #enemies.yards20 > 0 then return true end + if #enemies.yards20nc > 0 then + for i = 1, #enemies.yards20nc do + local thisUnit = enemies.yards20nc[i] + local threatRange = math.max((20 + (unit.level(thisUnit) - unit.level())), 5) + local react = unit.reaction(thisUnit) or 10 + if unit.distance(thisUnit) < threatRange and (react < 4 or (unit.isUnit("target", thisUnit) and react == 4)) and unit.enemy(thisUnit) and unit.canAttack(thisUnit) then + return true + end + end + end + -- if unit.isDummy("target") and unit.distance("target") < 20 then return true end + end + return false +end -- Ferocious Bite Finish local function ferociousBiteFinish(thisUnit) local desc = br._G.C_Spell.GetSpellDescription(spell.ferociousBite.id()) @@ -132,7 +158,8 @@ local function ferociousBiteFinish(thisUnit) damageList = damageList:sub(1, comboEnd) damage = damageList:gsub(",", "") end - finishHim = tonumber(damage) >= unit.health(thisUnit) + local lower = tonumber(damage:match("^(%d+)%-%d+$")) + finishHim = tonumber(lower) >= unit.health(thisUnit) end return finishHim end @@ -209,17 +236,17 @@ actionList.Extra = function() return true end end - -- Mark of the Wild - if ui.checked("Mark of the Wild") then - var.markUnit = getMarkUnitOption("Mark of the Wild") - if cast.able.markOfTheWild(var.markUnit) and buff.markOfTheWild.refresh(var.markUnit) and not unit.resting() and unit.distance(var.markUnit) < 40 then - if cast.markOfTheWild(var.markUnit) then - ui.debug("Casting Mark of the Wild") - return true - end - end - end end + -- -- Mark of the Wild + -- if ui.checked("Mark of the Wild") then + -- var.markUnit = getMarkUnitOption("Mark of the Wild") + -- if cast.able.markOfTheWild(var.markUnit) and buff.markOfTheWild.refresh(var.markUnit) and not unit.resting() and unit.distance(var.markUnit) < 40 then + -- if cast.markOfTheWild(var.markUnit) then + -- ui.debug("Casting Mark of the Wild") + -- return true + -- end + -- end + -- end end -- End Action List - Extra -- Action List - Defensive @@ -227,31 +254,58 @@ actionList.Defensive = function() if ui.useDefensive() then -- Basic Healing Module module.BasicHealing() - -- Regrowth - if ui.checked("Regrowth") and cast.able.regrowth() and not cast.current.regrowth() and not unit.moving() then - if unit.friend("target") and unit.hp("target") <= ui.value("Regrowth") and br._G.UnitIsPlayer("target") then + -- Rejuvenation + if ui.checked("Rejuvenation") and not cast.current.rejuvenation() then + if cast.able.rejuvenation("target") and unit.friend("target") and unit.hp("target") <= ui.value("Rejuvenation") + and br._G.UnitIsPlayer("target") and buff.rejuvenation.refresh("target") + then if buff.catForm.exists() or buff.bearForm.exists() then -- CancelShapeshiftForm() br._G.RunMacroText("/CancelForm") else - if cast.regrowth("target") then - ui.debug("Casting Regrowth on " .. unit.name("target")) + ui.debug("Attempting to cast Rejuvenation on " .. unit.name("target")) + if cast.rejuvenation("target") then return true end end end - if not unit.friend("target") and unit.hp() <= ui.value("Regrowth") then + if cast.able.rejuvenation("player") and not unit.friend("target") and unit.hp() <= ui.value("Rejuvenation") and buff.rejuvenation.refresh("player") then if buff.catForm.exists() or buff.bearForm.exists() then -- CancelShapeshiftForm() br._G.RunMacroText("/CancelForm") else - if cast.regrowth("player") then - ui.debug("Casting Regrowth on " .. unit.name("player")) + if cast.rejuvenation("player") then + ui.debug("Casting Rejuvenation on " .. unit.name("player")) return true end end end end + -- Regrowth + -- if ui.checked("Regrowth") and cast.able.regrowth() and not cast.current.regrowth() and not unit.moving() then + -- if unit.friend("target") and unit.hp("target") <= ui.value("Regrowth") and br._G.UnitIsPlayer("target") then + -- if buff.catForm.exists() or buff.bearForm.exists() then + -- -- CancelShapeshiftForm() + -- br._G.RunMacroText("/CancelForm") + -- else + -- if cast.regrowth("target") then + -- ui.debug("Casting Regrowth on " .. unit.name("target")) + -- return true + -- end + -- end + -- end + -- if not unit.friend("target") and unit.hp() <= ui.value("Regrowth") then + -- if buff.catForm.exists() or buff.bearForm.exists() then + -- -- CancelShapeshiftForm() + -- br._G.RunMacroText("/CancelForm") + -- else + -- if cast.regrowth("player") then + -- ui.debug("Casting Regrowth on " .. unit.name("player")) + -- return true + -- end + -- end + -- end + -- end end end -- End Action List - Defensive @@ -262,7 +316,18 @@ end -- End Action List - Cooldowns -- Action List - Pre-Combat actionList.PreCombat = function() - if not unit.inCombat() then + if not unit.inCombat() and not (unit.flying() or unit.mounted()) then + if not (buff.prowl.exists() or buff.shadowmeld.exists()) then + -- Prowl + if cast.able.prowl("player") and buff.catForm.exists() and autoProwl() and ui.mode.prowl == 1 + and not buff.prowl.exists() and (not unit.resting() or unit.isDummy("target")) + then + if cast.prowl("player") then + ui.debug("Casting Prowl [Precombat]") + return true + end + end + end -- End No Stealth if unit.valid("target") then local thisDistance = unit.distance("target") or 99 -- Wrath @@ -276,15 +341,29 @@ actionList.PreCombat = function() end if thisDistance < 5 then -- Shred - if cast.able.shred() and buff.catForm.exists() then - if cast.shred() then - ui.debug("Casting Shred [Precombat]") + -- if cast.able.shred() and buff.catForm.exists() then + -- if cast.shred() then + -- ui.debug("Casting Shred [Precombat]") + -- return true + -- end + -- end + -- Mangle + if cast.able.mangleBear(units.dyn5) and buff.bearForm.exists() then + if cast.mangleBear(units.dyn5) then + ui.debug("Casting Mangle [Precombat]") + return true + end + end + -- Rake + if cast.able.rake() and buff.catForm.exists() then + if cast.rake() then + ui.debug("Casting Rake [Precombat]") return true end end -- Auto Attack - if cast.able.autoAttack() and unit.exists(units.dyn5) and unit.distance(units.dyn5) < 5 then - if cast.autoAttack() then + if cast.able.autoAttack("target") and unit.exists("target") and unit.distance("target") < 5 then + if cast.autoAttack("target") then ui.debug("Casting Auto Attack [Precombat]") return true end @@ -303,8 +382,8 @@ actionList.Combat = function() -- Melee in melee range if unit.exists(units.dyn5) and unit.distance(units.dyn5) < 5 then -- Start Attack - if cast.able.autoAttack() and unit.exists(units.dyn5) and unit.distance(units.dyn5) < 5 then - if cast.autoAttack() then + if cast.able.autoAttack("target") and unit.exists("target") and unit.distance("target") < 5 then + if cast.autoAttack("target") then ui.debug("Casting Auto Attack") return true end @@ -313,9 +392,16 @@ actionList.Combat = function() if actionList.Cooldowns() then return true end -- Bear Form if buff.bearForm.exists() then + -- Maul + if cast.able.maul(units.dyn5) then + if cast.maul(units.dyn5) then + ui.debug("Casting Maul") + return true + end + end -- Mangle - if cast.able.mangle(units.dyn5) then - if cast.mangle(units.dyn5) then + if cast.able.mangleBear(units.dyn5) then + if cast.mangleBear(units.dyn5) then ui.debug("Casting Mangle") return true end @@ -323,9 +409,9 @@ actionList.Combat = function() end -- Cat Form if buff.catForm.exists() then - local finish = ferociousBiteFinish() -- Ferocious Bite - if cast.able.ferociousBite() and ((comboPoints == 5 and fbMaxEnergy) or finish) then + local finish = ferociousBiteFinish(units.dyn5) + if cast.able.ferociousBite(units.dyn5) and ((comboPoints == 5 and fbMaxEnergy) or finish) then if finish then if cast.ferociousBite() then ui.debug("Casting Ferocious Bite [Finish]") @@ -338,10 +424,17 @@ actionList.Combat = function() end end end - -- Shred - if cast.able.shred() and (comboPoints < 5 or unit.level() < 7) then - if cast.shred() then - ui.debug("Casting Shred") + -- Rake + if cast.able.rake() and comboPoints < 5 and debuff.rake.refresh(units.dyn5) then + if cast.rake() then + ui.debug("Casting Rake") + return true + end + end + -- Mangle + if cast.able.mangle() and comboPoints < 5 and not debuff.rake.refresh(units.dyn5) then + if cast.mangle() then + ui.debug("Casting Mangle") return true end end @@ -395,6 +488,8 @@ local function runRotation() units.get(40, true) -- Makes a variable called, units.dyn40AOE -- Enemies enemies.get(5) -- Makes a varaible called, enemies.yards5 + enemies.get(20) -- Makes a varaible called, enemies.yards20 + enemies.get(20, "player", true) -- makes enemies.yards20nc enemies.get(40) -- Makes a varaible called, enemies.yards40 -- Profile Specific Locals diff --git a/System/API/CD.lua b/System/API/CD.lua index dfd0f1f890..6d37fbe51e 100644 --- a/System/API/CD.lua +++ b/System/API/CD.lua @@ -94,7 +94,7 @@ br.api.itemCD = function(self, item, id) -- @return boolean -- @within cd.item cd[item].exists = function() - return br._G.GetItemCooldown(id) > 0 + return br._G.C_Container.GetItemCooldown(id) > 0 end --- Gets the time remaining on item cooldown or 0 if not. @@ -102,8 +102,8 @@ br.api.itemCD = function(self, item, id) -- @return number -- @within cd.item cd[item].remain = function() - if br._G.GetItemCooldown(id) ~= 0 then - return (br._G.GetItemCooldown(id) + select(2, br._G.GetItemCooldown(id)) - br._G.GetTime()) + if br._G.C_Container.GetItemCooldown(id) ~= 0 then + return (br._G.C_Container.GetItemCooldown(id) + select(2, br._G.C_Container.GetItemCooldown(id)) - br._G.GetTime()) end return 0 end diff --git a/System/API/Debuff.lua b/System/API/Debuff.lua index 4c30b5df21..b1acbc070f 100644 --- a/System/API/Debuff.lua +++ b/System/API/Debuff.lua @@ -12,10 +12,10 @@ if br.api == nil then br.api = {} end -- Local function needed to facilitate debuff.calc local function getSnapshotValue(dot) -- Feral Bleeds - if br._G.GetSpecializationInfo(br._G.GetSpecialization()) == 103 then + if br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) == 103 then local multiplier = 1.00 - local Bloodtalons = 1.30 - -- local SavageRoar = 1.40 + -- local Bloodtalons = 1.30 + local SavageRoar = 1.40 local TigersFury = 1.15 local RakeMultiplier = 1 -- Tigers Fury @@ -26,10 +26,11 @@ local function getSnapshotValue(dot) return multiplier end -- Bloodtalons - if br.player.buff.bloodtalons.exists() and dot == br.player.spells.debuffs.rip then multiplier = multiplier * - Bloodtalons end + -- if br.player.buff.bloodtalons.exists() and dot == br.player.spells.debuffs.rip then + -- multiplier = multiplier * Bloodtalons + -- end -- Savage Roar - -- if self.buff.savageRoar.exists() then multiplier = multiplier*SavageRoar end + if br.player.buff.savageRoar.exists() then multiplier = multiplier * SavageRoar end -- rip if dot == br.player.spells.debuffs.rip then -- -- Versatility @@ -40,31 +41,31 @@ local function getSnapshotValue(dot) -- rake if dot == br.player.spells.debuffs.rake then -- Incarnation/Prowl/Sudden Ambush - if br.player.buff.berserk.exists() or br.player.buff.incarnationAvatarOfAshamane.exists() or br.player.buff.prowl.exists() - or br.player.buff.shadowmeld.exists() or br.player.buff.suddenAmbush.exists() + if br.player.buff.berserk.exists() --[[or br.player.buff.incarnationAvatarOfAshamane.exists()]] or br.player.buff.prowl.exists() + or br.player.buff.shadowmeld.exists() --or br.player.buff.suddenAmbush.exists() then - RakeMultiplier = 1.6 + RakeMultiplier = 2.0 end -- return rake return multiplier * RakeMultiplier end end -- Assassination Bleeds - if br._G.GetSpecializationInfo(br._G.GetSpecialization()) == 259 then - local multiplier = 1 - if br.player.buff.stealth.exists() and br.player.talent.nightstalker and (dot == br.player.spells.debuffs.rupture - or dot == br.player.spells.debuffs.garrote) then - multiplier = 1.5 - end - if (br.player.buff.stealth.exists() or br.player.buff.vanish.exists() - or (br.player.buff.subterfuge.exists() and br.player.buff.subterfuge.remain() >= 0.1 - and br.player.buff.subterfuge.remain() >= br.getSpellCD(61304))) - and dot == br.player.spells.debuffs.garrote and br.player.talent.subterfuge - then - multiplier = 1.8 - end - return multiplier - end + -- if br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) == 259 then + -- local multiplier = 1 + -- if br.player.buff.stealth.exists() and br.player.talent.nightstalker and (dot == br.player.spells.debuffs.rupture + -- or dot == br.player.spells.debuffs.garrote) then + -- multiplier = 1.5 + -- end + -- if (br.player.buff.stealth.exists() or br.player.buff.vanish.exists() + -- or (br.player.buff.subterfuge.exists() and br.player.buff.subterfuge.remain() >= 0.1 + -- and br.player.buff.subterfuge.remain() >= br.getSpellCD(61304))) + -- and dot == br.player.spells.debuffs.garrote and br.player.talent.subterfuge + -- then + -- multiplier = 1.8 + -- end + -- return multiplier + -- end return 0 end @@ -78,7 +79,7 @@ local baseTickTimes = { } br.api.debuffs = function(debuff, k, v) - local spec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local spec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) --- Checks if a debuff exists on a unit. -- @function debuff.spell.exists @@ -276,6 +277,29 @@ br.api.debuffs = function(debuff, k, v) return (spec == 103 or spec == 259) and debuff.bleed[thisUnit] or 0 end + --- Gets the number of debuff ticks remaining until it expores on the specified unit. + -- @function debuff.spell.ticksRemain + -- string[opt="target"] thisUnit The unit to check the remaining ticks on. + -- @treturn number + debuff.ticksRemain = function(thisUnit) + local haste = br._G.UnitSpellHaste("player") + local hasteMultiplier = 1 + (haste / 100) + local baseTickTime = baseTickTimes[v] or 3 + local hastedTickTime = baseTickTime / hasteMultiplier + local auraInfo = br.UnitDebuffID(thisUnit, v, nil, "PLAYER") + if auraInfo then + local expirationTime = auraInfo.expirationTime + -- local duration = auraInfo.duration + local remainingDuration = expirationTime - br._G.GetTime() + local remainingTicks = math.floor(remainingDuration / hastedTickTime) + + return remainingTicks -- The additional ticks gained by refreshing + else + -- Duration amount here shouldn't matter, since no DoT exists + return math.floor(99 / hastedTickTime) -- Return the max possible ticks for a fresh DoT + end + end + --- Gets the number of debuff ticks that will be gained by reapplying the debuff to the specified unit. -- @function debuff.spell.ticksGainedOnRefresh -- string[opt="target"] thisUnit The unit to check the ticks gained by reapplying the debuff on. diff --git a/System/API/Item.lua b/System/API/Item.lua index f00826cc5c..7389d5e734 100644 --- a/System/API/Item.lua +++ b/System/API/Item.lua @@ -20,7 +20,7 @@ br.api.items = function(item,k,v,subtable) -- -- @treturn boolean -- cd[k].exists = function(itemID) -- if itemID == nil then itemID = v end - -- return br._G.GetItemCooldown(itemID) > 0 + -- return br._G.C_Container.GetItemCooldown(itemID) > 0 -- end -- --- Gets the time remaining on item cooldown or 0 if not. @@ -29,8 +29,8 @@ br.api.items = function(item,k,v,subtable) -- -- @treturn number -- cd[k].remain = function(itemID) -- if itemID == nil then itemID = v end - -- if br._G.GetItemCooldown(itemID) ~= 0 then - -- return (br._G.GetItemCooldown(itemID) + select(2,br._G.GetItemCooldown(itemID)) - br._G.GetTime()) + -- if br._G.C_Container.GetItemCooldown(itemID) ~= 0 then + -- return (br._G.C_Container.GetItemCooldown(itemID) + select(2,br._G.C_Container.GetItemCooldown(itemID)) - br._G.GetTime()) -- end -- return 0 -- end diff --git a/System/API/Module.lua b/System/API/Module.lua index 045b22ed66..4099217677 100644 --- a/System/API/Module.lua +++ b/System/API/Module.lua @@ -130,11 +130,11 @@ br.api.module = function(self) br.ui:createSpinner(section, "Healthstone/Potion", 60, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At") -- Heirloom Neck br.ui:createSpinner(section, "Heirloom Neck", 80, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At") - -- Music of Bastion - br.ui:createCheckbox(section, "Music of Bastion", "|cffFFFFFFCheck to use.") - -- Phial of Serenity - br.ui:createSpinner(section, "Phial of Serenity", 30, 0, 80, 5, "|cffFFFFFFHealth Percent to Cast At") - br.ui:createCheckbox(section, "Auto Summon Steward") + -- -- Music of Bastion + -- br.ui:createCheckbox(section, "Music of Bastion", "|cffFFFFFFCheck to use.") + -- -- Phial of Serenity + -- br.ui:createSpinner(section, "Phial of Serenity", 30, 0, 80, 5, "|cffFFFFFFHealth Percent to Cast At") + -- br.ui:createCheckbox(section, "Auto Summon Steward") end -- Abilities - Call, module.BasicHealing(), in your rotation to use these @@ -157,12 +157,12 @@ br.api.module = function(self) end end --Legion Healthstone - if use.able.legionHealthstone() and has.legionHealthstone() then - if use.legionHealthstone() then - ui.debug("Using Legion Healthstone") - return true - end - end + -- if use.able.legionHealthstone() and has.legionHealthstone() then + -- if use.legionHealthstone() then + -- ui.debug("Using Legion Healthstone") + -- return true + -- end + -- end end -- Heirloom Neck if getOption("Heirloom Neck", "Check") and unit.hp() <= getOption("Heirloom Neck", "Value") and not unit.inCombat() then @@ -182,54 +182,54 @@ br.api.module = function(self) return true end end - -- Music of Bastion - if getOption("Music of Bastion", "Check") and (br.isInArdenweald() or br.isInBastion() or br.isInMaldraxxus() or br.isInRevendreth()) then - if use.able.ascendedFlute() and has.ascendedFlute() then - if use.ascendedFlute() then - ui.debug("Using Ascended Flute") - return true - end - end - if use.able.benevolentGong() and has.benevolentGong() then - if use.benevolentGong() then - ui.debug("Using Benevolent Gong") - return true - end - end - if use.able.heavenlyDrum() and has.heavenlyDrum() then - if use.heavenlyDrum() then - ui.debug("Using Heavenly Drum") - return true - end - end - if use.able.kyrianBell() and has.kyrianBell() then - if use.kyrianBell() then - ui.debug("Using Kyrian Bell") - return true - end - end - if use.able.unearthlyChime() and has.unearthlyChime() then - if use.unearthlyChime() then - ui.debug("Using Unearthly Chime") - return true - end - end - end - -- Phial of Serenity - if getOption("Phial of Serenity", "Check") then - if getOption("Auto Summon Steward", "Check") and not unit.inCombat() and not has.phialOfSerenity() and cast.able.summonSteward() then - if cast.summonSteward() then - ui.debug("Casting Call Steward") - return true - end - end - if unit.inCombat() and use.able.phialOfSerenity() and unit.hp() < getOption("Phial of Serenity", "Value") then - if use.phialOfSerenity() then - ui.debug("Using Phial of Serenity") - return true - end - end - end + -- -- Music of Bastion + -- if getOption("Music of Bastion", "Check") and (br.isInArdenweald() or br.isInBastion() or br.isInMaldraxxus() or br.isInRevendreth()) then + -- if use.able.ascendedFlute() and has.ascendedFlute() then + -- if use.ascendedFlute() then + -- ui.debug("Using Ascended Flute") + -- return true + -- end + -- end + -- if use.able.benevolentGong() and has.benevolentGong() then + -- if use.benevolentGong() then + -- ui.debug("Using Benevolent Gong") + -- return true + -- end + -- end + -- if use.able.heavenlyDrum() and has.heavenlyDrum() then + -- if use.heavenlyDrum() then + -- ui.debug("Using Heavenly Drum") + -- return true + -- end + -- end + -- if use.able.kyrianBell() and has.kyrianBell() then + -- if use.kyrianBell() then + -- ui.debug("Using Kyrian Bell") + -- return true + -- end + -- end + -- if use.able.unearthlyChime() and has.unearthlyChime() then + -- if use.unearthlyChime() then + -- ui.debug("Using Unearthly Chime") + -- return true + -- end + -- end + -- end + -- -- Phial of Serenity + -- if getOption("Phial of Serenity", "Check") then + -- if getOption("Auto Summon Steward", "Check") and not unit.inCombat() and not has.phialOfSerenity() and cast.able.summonSteward() then + -- if cast.summonSteward() then + -- ui.debug("Casting Call Steward") + -- return true + -- end + -- end + -- if unit.inCombat() and use.able.phialOfSerenity() and unit.hp() < getOption("Phial of Serenity", "Value") then + -- if use.phialOfSerenity() then + -- ui.debug("Using Phial of Serenity") + -- return true + -- end + -- end + -- end end end @@ -313,32 +313,32 @@ br.api.module = function(self) if buff.phialOfTepidVersatility.exists() then buff.phialOfTepidVersatility.cancel() end; end if section == nil then - local opValue = getOption("Use DF Phial", "Value") - if opValue == 1 and not buff.icedPhialOfCorruptingRage.exists() and use.isOneOfUsable(br.lists.items.icedPhialOfCorruptingRageQualities) then - cancelBuffs() - if use.bestItem(br.lists.items.icedPhialOfCorruptingRageQualities) then - ui.debug("Using Best Phial: Iced Phial of Corrupting Rage") - return true; - end - end - if opValue == 2 and not buff.phialOfGlacialFury.exists() and use.isOneOfUsable(br.lists.items.phialOfGlacialFuryQualities) then - cancelBuffs() - if use.bestItem(br.lists.items.phialOfGlacialFuryQualities) then - ui.debug("Using Best Phial: Phial of Glacial Fury") - return true; - end - end - if opValue == 3 then - if not buff.phialOfTepidVersatility.exists() then - if use.isOneOfUsable(br.lists.items.phialOfTepidVersatilityQualities) then - cancelBuffs() - if use.bestItem(br.lists.items.phialOfTepidVersatilityQualities) then - ui.debug("Using Best Phial: Phial of Tepid Versatility") - return true; - end; - end - end - end + -- local opValue = getOption("Use DF Phial", "Value") + -- if opValue == 1 and not buff.icedPhialOfCorruptingRage.exists() and use.isOneOfUsable(br.lists.items.icedPhialOfCorruptingRageQualities) then + -- cancelBuffs() + -- if use.bestItem(br.lists.items.icedPhialOfCorruptingRageQualities) then + -- ui.debug("Using Best Phial: Iced Phial of Corrupting Rage") + -- return true; + -- end + -- end + -- if opValue == 2 and not buff.phialOfGlacialFury.exists() and use.isOneOfUsable(br.lists.items.phialOfGlacialFuryQualities) then + -- cancelBuffs() + -- if use.bestItem(br.lists.items.phialOfGlacialFuryQualities) then + -- ui.debug("Using Best Phial: Phial of Glacial Fury") + -- return true; + -- end + -- end + -- if opValue == 3 then + -- if not buff.phialOfTepidVersatility.exists() then + -- if use.isOneOfUsable(br.lists.items.phialOfTepidVersatilityQualities) then + -- cancelBuffs() + -- if use.bestItem(br.lists.items.phialOfTepidVersatilityQualities) then + -- ui.debug("Using Best Phial: Phial of Tepid Versatility") + -- return true; + -- end; + -- end + -- end + -- end end end @@ -354,16 +354,16 @@ br.api.module = function(self) if getOption("Weapon Imbuement", "Check") then local selValue = getOption("Weapon Imbuement", "Value") local auras = {} - if selValue == 1 then auras = br.lists.spells.Shared.Shared.itemEnchantments.buzzingRune end - if selValue == 2 then auras = br.lists.spells.Shared.Shared.itemEnchantments.chirpingRune end - if selValue == 3 then auras = br.lists.spells.Shared.Shared.itemEnchantments.howlingRune end - if selValue == 4 then auras = br.lists.spells.Shared.Shared.itemEnchantments.hissingRune end - if not unit.weaponImbue.exists(auras) then - if selValue == 1 then return use.bestItem(br.lists.items.buzzingRuneQualities) end - if selValue == 2 then return use.bestItem(br.lists.items.chirpingRuneQualities) end - if selValue == 3 then return use.bestItem(br.lists.items.howlingRuneQualities) end - if selValue == 4 then return use.bestItem(br.lists.items.hissingRuneQualities) end - end + -- if selValue == 1 then auras = br.lists.spells.Shared.Shared.itemEnchantments.buzzingRune end + -- if selValue == 2 then auras = br.lists.spells.Shared.Shared.itemEnchantments.chirpingRune end + -- if selValue == 3 then auras = br.lists.spells.Shared.Shared.itemEnchantments.howlingRune end + -- if selValue == 4 then auras = br.lists.spells.Shared.Shared.itemEnchantments.hissingRune end + -- if not unit.weaponImbue.exists(auras) then + -- if selValue == 1 then return use.bestItem(br.lists.items.buzzingRuneQualities) end + -- if selValue == 2 then return use.bestItem(br.lists.items.chirpingRuneQualities) end + -- if selValue == 3 then return use.bestItem(br.lists.items.howlingRuneQualities) end + -- if selValue == 4 then return use.bestItem(br.lists.items.hissingRuneQualities) end + -- end end end end @@ -397,36 +397,36 @@ br.api.module = function(self) local function hasFlaskBuff() local flask = getOption("Flask", "Value") - if flask == 2 then -- Greater Flask - return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or - buff.greaterFlaskOfTheVastHorizon.exists() or buff.greaterFlaskOfTheUndertow.exists() - end - if flask == 3 then - if isDH then -- Greater FLask or Gaze of the Legion - return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or - buff.greaterFlaskOfTheVastHorizon.exists() - or buff.greaterFlaskOfTheUndertow.exists() or buff.gazeOfTheLegion.exists() - else -- Greater Flask or Fel Focus - return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or - buff.greaterFlaskOfTheVastHorizon.exists() - or buff.greaterFlaskOfTheUndertow.exists() or buff.felFocus.exists() - end - end - if flask == 4 and isDH then -- DH - Greater Flask or Gaze of the Legion or Fel Focus - return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or - buff.greaterFlaskOfTheVastHorizon.exists() - or buff.greaterFlaskOfTheUndertow.exists() or buff.gazeOfTheLegion.exists() or buff.felFocus.exists() - end + -- if flask == 2 then -- Greater Flask + -- return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or + -- buff.greaterFlaskOfTheVastHorizon.exists() or buff.greaterFlaskOfTheUndertow.exists() + -- end + -- if flask == 3 then + -- if isDH then -- Greater FLask or Gaze of the Legion + -- return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or + -- buff.greaterFlaskOfTheVastHorizon.exists() + -- or buff.greaterFlaskOfTheUndertow.exists() or buff.gazeOfTheLegion.exists() + -- else -- Greater Flask or Fel Focus + -- return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or + -- buff.greaterFlaskOfTheVastHorizon.exists() + -- or buff.greaterFlaskOfTheUndertow.exists() or buff.felFocus.exists() + -- end + -- end + -- if flask == 4 and isDH then -- DH - Greater Flask or Gaze of the Legion or Fel Focus + -- return buff.greaterFlaskOfTheCurrents.exists() or buff.greaterFlaskOfEndlessFathoms.exists() or + -- buff.greaterFlaskOfTheVastHorizon.exists() + -- or buff.greaterFlaskOfTheUndertow.exists() or buff.gazeOfTheLegion.exists() or buff.felFocus.exists() + -- end end local function cancelFlaskBuff() - if buff.greaterFlaskOfTheCurrents.exists() then buff.greaterFlaskOfTheCurrents.cancel() end - if buff.greaterFlaskOfEndlessFathoms.exists() then buff.greaterFlaskOfEndlessFathoms.cancel() end - if buff.greaterFlaskOfTheVastHorizon.exists() then buff.greaterFlaskOfTheVastHorizon.cancel() end - if buff.greaterFlaskOfTheUndertow.exists() then buff.greaterFlaskOfTheUndertow.cancel() end - if (isDH and buff.gazeOfTheLegion.exists()) then buff.gazeOfTheLegion.cancel() end - if buff.felFocus.exists() then buff.felFocus.cancel() end - if buff.whispersOfInsanity.exists() then buff.whispersOfInsanity.cancel() end + -- if buff.greaterFlaskOfTheCurrents.exists() then buff.greaterFlaskOfTheCurrents.cancel() end + -- if buff.greaterFlaskOfEndlessFathoms.exists() then buff.greaterFlaskOfEndlessFathoms.cancel() end + -- if buff.greaterFlaskOfTheVastHorizon.exists() then buff.greaterFlaskOfTheVastHorizon.cancel() end + -- if buff.greaterFlaskOfTheUndertow.exists() then buff.greaterFlaskOfTheUndertow.cancel() end + -- if (isDH and buff.gazeOfTheLegion.exists()) then buff.gazeOfTheLegion.cancel() end + -- if buff.felFocus.exists() then buff.felFocus.cancel() end + -- if buff.whispersOfInsanity.exists() then buff.whispersOfInsanity.cancel() end end @@ -437,75 +437,75 @@ br.api.module = function(self) local opValue = getOption("Flask", "Value") local thisFlask = getFlaskByType(buffType) if opValue == 1 and unit.instance("raid") then - if thisFlask == "Greater Flask of the Currents" and use.able.greaterFlaskOfTheCurrents() and not buff.greaterFlaskOfTheCurrents.exists() then - cancelFlaskBuff() - if use.greaterFlaskOfTheCurrents() then - ui.debug("Using Greater Flask of the Currents") - return true - end - end - if thisFlask == "Greater Flask of Endless Fathoms" and use.able.greaterFlaskOfEndlessFathoms() and not buff.greaterFlaskOfEndlessFathoms.exists() then - cancelFlaskBuff() - if use.greaterFlaskOfEndlessFathoms() then - ui.debug("Using Greater Flask of Endless Fathoms") - return true - end - end - if thisFlask == "Greater Flask of the Vast Horizon" and use.able.greaterFlaskOfTheVastHorizon() and not buff.greaterFlaskOfTheVastHorizon.exists() then - cancelFlaskBuff() - if use.greaterFlaskOfTheVastHorizon() then - ui.debug("Using Greater Flask of the Vast Horizon") - return true - end - end - if thisFlask == "Greater Flask of the Undertow" and use.able.greaterFlaskOfTheUndertow() and not buff.greaterFlaskOfTheUndertow.exists() then - cancelFlaskBuff() - if use.greaterFlaskOfTheUndertow() then - ui.debug("Using Greater Flask of the Undertow") - return true - end - end + -- if thisFlask == "Greater Flask of the Currents" and use.able.greaterFlaskOfTheCurrents() and not buff.greaterFlaskOfTheCurrents.exists() then + -- cancelFlaskBuff() + -- if use.greaterFlaskOfTheCurrents() then + -- ui.debug("Using Greater Flask of the Currents") + -- return true + -- end + -- end + -- if thisFlask == "Greater Flask of Endless Fathoms" and use.able.greaterFlaskOfEndlessFathoms() and not buff.greaterFlaskOfEndlessFathoms.exists() then + -- cancelFlaskBuff() + -- if use.greaterFlaskOfEndlessFathoms() then + -- ui.debug("Using Greater Flask of Endless Fathoms") + -- return true + -- end + -- end + -- if thisFlask == "Greater Flask of the Vast Horizon" and use.able.greaterFlaskOfTheVastHorizon() and not buff.greaterFlaskOfTheVastHorizon.exists() then + -- cancelFlaskBuff() + -- if use.greaterFlaskOfTheVastHorizon() then + -- ui.debug("Using Greater Flask of the Vast Horizon") + -- return true + -- end + -- end + -- if thisFlask == "Greater Flask of the Undertow" and use.able.greaterFlaskOfTheUndertow() and not buff.greaterFlaskOfTheUndertow.exists() then + -- cancelFlaskBuff() + -- if use.greaterFlaskOfTheUndertow() then + -- ui.debug("Using Greater Flask of the Undertow") + -- return true + -- end + -- end end if opValue == 2 and (not unit.instance("raid") or (unit.instance("raid") and not hasFlaskBuff())) then - if isDH and use.able.inquisitorsMenacingEye() and not buff.gazeOfTheLegion.exists() then - cancelFlaskBuff() - if use.inquisitorsMenacingEye() then - ui.debug("Using Inquisitor's Menacing Eye") - return true - end - elseif use.able.repurposedFelFocuser() and not buff.felFocus.exists() then - cancelFlaskBuff() - if use.repurposedFelFocuser() then - ui.debug("Using Repurposed Fel Focuser") - return true - end - end + -- if isDH and use.able.inquisitorsMenacingEye() and not buff.gazeOfTheLegion.exists() then + -- cancelFlaskBuff() + -- if use.inquisitorsMenacingEye() then + -- ui.debug("Using Inquisitor's Menacing Eye") + -- return true + -- end + -- elseif use.able.repurposedFelFocuser() and not buff.felFocus.exists() then + -- cancelFlaskBuff() + -- if use.repurposedFelFocuser() then + -- ui.debug("Using Repurposed Fel Focuser") + -- return true + -- end + -- end end if opValue == 3 and (not unit.instance("raid") or (unit.instance("raid") and not hasFlaskBuff())) then - if isDH and use.able.repurposedFelFocuser() and not buff.felFocus.exists() then - cancelFlaskBuff() - if use.repurposedFelFocuser() then - ui.debug("Using Repurposed Fel Focuser") - return true - end - elseif use.able.oraliusWhisperingCrystal() and not buff.whispersOfInsanity.exists() then - cancelFlaskBuff() - if use.oraliusWhisperingCrystal() then - ui.debug("Using Oralius's Whispering Crystal") - return true - end - end + -- if isDH and use.able.repurposedFelFocuser() and not buff.felFocus.exists() then + -- cancelFlaskBuff() + -- if use.repurposedFelFocuser() then + -- ui.debug("Using Repurposed Fel Focuser") + -- return true + -- end + -- elseif use.able.oraliusWhisperingCrystal() and not buff.whispersOfInsanity.exists() then + -- cancelFlaskBuff() + -- if use.oraliusWhisperingCrystal() then + -- ui.debug("Using Oralius's Whispering Crystal") + -- return true + -- end + -- end end if opValue == 4 then - if isDH and (not unit.instance("raid") or (unit.instance("raid") and not hasFlaskBuff())) - and use.able.oraliusWhisperingCrystal() and not buff.whispersOfInsanity.exists() - then - cancelFlaskBuff() - if use.oraliusWhisperingCrystal() then - ui.debug("Using Oralius's Whispering Crystal") - return true - end - end + -- if isDH and (not unit.instance("raid") or (unit.instance("raid") and not hasFlaskBuff())) + -- and use.able.oraliusWhisperingCrystal() and not buff.whispersOfInsanity.exists() + -- then + -- cancelFlaskBuff() + -- if use.oraliusWhisperingCrystal() then + -- ui.debug("Using Oralius's Whispering Crystal") + -- return true + -- end + -- end end end end diff --git a/System/API/Power.lua b/System/API/Power.lua index 42debbb153..dd70de2044 100644 --- a/System/API/Power.lua +++ b/System/API/Power.lua @@ -31,7 +31,7 @@ if br.api == nil then br.api = {} end br.api.power = function(power,powerType,powerIndex) local isDKRunes = select(2,br._G.UnitClass("player")) == "DEATHKNIGHT" and powerIndex == 5 - local isDestruction = br._G.GetSpecializationInfo(br._G.GetSpecialization()) == 267 and powerIndex == 7 + local isDestruction = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) == 267 and powerIndex == 7 --- Gets the amount of specified power until max is reached -- @function power.powerType.deficit diff --git a/System/Core.lua b/System/Core.lua index c347584a96..f7707f0ca5 100644 --- a/System/Core.lua +++ b/System/Core.lua @@ -82,8 +82,8 @@ local function updateRotationOnSpecChange() br.ui:closeWindow("all") br:saveSettings(nil, nil, br.selectedSpec, br.selectedProfileName) -- Update Selected Spec/Profile - br.selectedSpec = select(2, br._G.GetSpecializationInfo(br._G.GetSpecialization())) - br.selectedSpecID = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + br.selectedSpec = select(2, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization())) + br.selectedSpecID = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) br.loader.loadProfiles() br.loadLastProfileTracker() br.data.loadedSettings = false @@ -159,7 +159,7 @@ function br.BadRotationsUpdate(self) br._G.CastSpellByID(br.botSpell, br.botUnit) br.castID = false end - local playerSpec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local playerSpec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if playerSpec == "" then playerSpec = "Initial" end @@ -232,7 +232,7 @@ function br.BadRotationsUpdate(self) -- Auto Loot br.autoLoot() -- Close windows and swap br.selectedSpec on Spec Change - local thisSpec = select(2, br._G.GetSpecializationInfo(br._G.GetSpecialization())) + local thisSpec = select(2, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization())) if thisSpec ~= "" and thisSpec ~= br.selectedSpec then updateRotationOnSpecChange() end diff --git a/System/Functions/Aura.lua b/System/Functions/Aura.lua index 3fa74c9369..4fea07a5a5 100644 --- a/System/Functions/Aura.lua +++ b/System/Functions/Aura.lua @@ -93,8 +93,7 @@ function br.UnitDebuffID(unit, spellID, filter) for i = 1, 40 do -- local buffName, _, _, _, _, _, _, _, _, buffSpellID = br._G.UnitDebuff(unit, i, "player") local auraInfo = C_UnitAuras.GetDebuffDataByIndex(unit, i, "PLAYER") - if auraInfo == nil then return nil end - if auraInfo.spellId == spellID then + if auraInfo and auraInfo.spellId == spellID then return auraInfo --br._G.UnitDebuff(unit, i, "player") end end @@ -276,7 +275,7 @@ function br.canDispel(Unit, spellID) return typeCheck end local i = 1 - if not br._G.UnitPhaseReason(Unit) then + if br._G.UnitInPhase(Unit) then if br.GetUnitIsFriend("player", Unit) then while br._G.UnitDebuff(Unit, i) do local _, _, stacks, debuffType, debuffDuration, debuffExpire, _, _, _, debuffid = br._G.UnitDebuff(Unit, diff --git a/System/Functions/Cast.lua b/System/Functions/Cast.lua index 4b23743b8b..7bb4e34c47 100644 --- a/System/Functions/Cast.lua +++ b/System/Functions/Cast.lua @@ -701,8 +701,7 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, br.botSpell = spellID -- Used by old Queue Cast -- Condemn Patch (Blizz is an small indie developer!) if spellID == br.player.spells.condemn or spellID == br.player.spells.condemnMassacre then - spellName = br._G - .GetSpellInfo(br.player.spells.execute) + spellName = br._G.GetSpellInfo(br.player.spells.execute) end -- br._G.print("Spell: "..tostring(spellName).." - UnitName: "..tostring(br._G.UnitName(thisUnit)).." - Unit: "..tostring(thisUnit)) br._G.CastSpellByName(spellName, thisUnit) @@ -728,18 +727,18 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, end return true end - -- Essence Check - BfA - local function hasEssence() - local essence = br.player.essence - if essence[index] == nil then return true end - if essence[index].id == nil then return true end - return essence[index].active - end - -- Queen's Court - BfA - local function queensCourtCastCheck(spellID) - local queensCourtEncounter = br.UnitDebuffID("player", 304409) -- EJ_GetEncounterInfo(2311) - return queensCourtEncounter == nil or (queensCourtEncounter ~= nil and br.lastCastTable.tracker[1] ~= spellID) - end + -- -- Essence Check - BfA + -- local function hasEssence() + -- local essence = br.player.essence + -- if essence[index] == nil then return true end + -- if essence[index].id == nil then return true end + -- return essence[index].active + -- end + -- -- Queen's Court - BfA + -- local function queensCourtCastCheck(spellID) + -- local queensCourtEncounter = br.UnitDebuffID("player", 304409) -- EJ_GetEncounterInfo(2311) + -- return queensCourtEncounter == nil or (queensCourtEncounter ~= nil and br.lastCastTable.tracker[1] ~= spellID) + -- end -- Base Spell Availablility Check if br.lastCastTable.castTime[spellID] == nil then br.lastCastTable.castTime[spellID] = br._G.GetTime() - @@ -755,7 +754,7 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, and (br.getSpellCD(61304) <= 0 or select(2, br._G.GetSpellBaseCooldown(spellID)) <= 0 or (br.getCastTime(spellID) > 0 and br.getCastTimeRemain("player") <= br:getUpdateRate())) -- Cooldown Checks and (br.isKnown(spellID) or castType == "known" or spellID == br.player.spells.condemn or spellID == br.player.spells.condemnMassacre) -- Known/Current Checks - and hasTalent(spellID) and hasEssence() and not br.isIncapacitated(spellID) and queensCourtCastCheck(spellID) + and hasTalent(spellID) --[[and hasEssence()]] and not br.isIncapacitated(spellID) --and queensCourtCastCheck(spellID) and (not (br._G.C_Spell.IsAutoRepeatSpell(br._G.GetSpellInfo(spellID)) or (spellID == 6603 and br._G.C_Spell.IsCurrentSpell(spellID)))) --[[and not br.hasNoControl(spellID)]] -- Talent/Essence/Incapacitated/Special Checks and (thisUnit == nil or castType ~= "dead" or (thisUnit ~= nil and castType == "dead" and br._G.UnitIsDeadOrGhost(thisUnit))) -- Dead Check or spellID == br.empowerID @@ -815,7 +814,7 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, .. ", Min Range: " .. minRange .. ", Max Range: " .. maxRange .. ", Distance: " .. br.getDistance(thisUnit) - .. ", SpellRange: " .. tostring(br._G.C_Spell.IsSpellInRange(spellName, thisUnit) == 1) + .. ", SpellRange: " .. tostring(br._G.C_Spell.IsSpellInRange(spellName, thisUnit)) .. ", thisUnit: " .. tostring(thisUnit) ) end @@ -865,10 +864,10 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, -- Range Check local inRange = function(minRange, maxRange) local distance = castType == "pet" and br.getDistance(thisUnit, "pet") or br.getDistance(thisUnit) - return br._G.C_Spell.IsSpellInRange(spellName, thisUnit) == 1 or - (distance >= minRange and distance < maxRange - 1) + return br._G.C_Spell.IsSpellInRange(spellName, thisUnit) or + (distance >= minRange and distance < maxRange - 1) end - if --[[br._G.C_Spell.IsSpellInRange(spellName,thisUnit) == 1 or]] inRange(minRange, maxRange) then + if --[[br._G.C_Spell.IsSpellInRange(spellName,thisUnit) or]] inRange(minRange, maxRange) then -- Dead Friend if castType == "dead" then if br._G.UnitIsPlayer(thisUnit) and br.GetUnitIsDeadOrGhost(thisUnit) and br.GetUnitIsFriend(thisUnit, "player") then diff --git a/System/Functions/Custom.lua b/System/Functions/Custom.lua index 0eb8d6e4c3..b141abd501 100644 --- a/System/Functions/Custom.lua +++ b/System/Functions/Custom.lua @@ -642,7 +642,7 @@ end function br.mergeIdTables(idTable) local class = select(2, br._G.UnitClass("player")) - local spec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local spec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if idTable ~= nil then idTable = {} end if br.lists.spells.Shared ~= nil then idTable = br.mergeTables(idTable, br.lists.spells.Shared) diff --git a/System/Functions/Item.lua b/System/Functions/Item.lua index 9d86ef6d9d..e5828464ef 100644 --- a/System/Functions/Item.lua +++ b/System/Functions/Item.lua @@ -19,14 +19,14 @@ function br.canUseItem(itemID) return false end if br._G.GetItemSpell(slotItemID) ~= nil then - if br._G.GetItemCooldown(slotItemID) == 0 and br._G.IsUsableItem(slotItemID) then + if br._G.C_Container.GetItemCooldown(slotItemID) == 0 and br._G.IsUsableItem(slotItemID) then return true end end elseif (br._G.GetItemCount(itemID, false, false) > 0 or br._G.PlayerHasToy(itemID)) and ((br._G.IsEquippableItem(itemID) and br._G.IsEquippedItem(itemID)) or (not br._G.IsEquippableItem(itemID) and br.hasItem(itemID))) then - if itemID > 19 and br._G.GetItemCooldown(itemID) == 0 and (br._G.IsUsableItem(itemID) or br._G.C_Spell.IsSpellUsable(select(2, br._G.GetItemSpell(itemID)))) then + if itemID > 19 and br._G.C_Container.GetItemCooldown(itemID) == 0 and (br._G.IsUsableItem(itemID) or br._G.C_Spell.IsSpellUsable(select(2, br._G.GetItemSpell(itemID)))) then return true end end @@ -73,7 +73,7 @@ function br.useItem(itemID, thisUnit) if itemID <= 19 then if br._G.GetItemSpell(br._G.GetInventoryItemID("player", itemID)) ~= nil then local slotItemID = br._G.GetInventoryItemID("player", itemID) - if br._G.GetItemCooldown(slotItemID) == 0 then + if br._G.C_Container.GetItemCooldown(slotItemID) == 0 then if not br.itemSpamDelay or br._G.GetTime() > br.itemSpamDelay then -- br._G.RunMacroText("/use " .. select(1, GetItemInfo(slotItemID))) br._G.UseItemByName(select(1, br._G.GetItemInfo(slotItemID)), thisUnit); @@ -83,7 +83,7 @@ function br.useItem(itemID, thisUnit) end end elseif itemID > 19 and (br._G.GetItemCount(itemID) > 0 or br._G.PlayerHasToy(itemID)) then - if br._G.GetItemCooldown(itemID) == 0 then + if br._G.C_Container.GetItemCooldown(itemID) == 0 then if not br.itemSpamDelay or br._G.GetTime() > br.itemSpamDelay then -- br._G.RunMacroText("/use " .. select(1, GetItemInfo(itemID))) br._G.UseItemByName(select(1, br._G.GetItemInfo(itemID)), thisUnit); diff --git a/System/Functions/LastCast.lua b/System/Functions/LastCast.lua index 9e1a148206..e5a0fb20d7 100644 --- a/System/Functions/LastCast.lua +++ b/System/Functions/LastCast.lua @@ -39,7 +39,7 @@ local function eventTracker(_, event, ...) local spellName = br._G.GetSpellInfo(spellID) if sourceUnit == "player" and br.player and not ignoreList[spellID] then if event == "UNIT_SPELLCAST_SENT" or event == "UNIT_SPELLCAST_START" - or event == "UNIT_SPELLCAST_CHANNEL_START" or event == "UNIT_SPELLCAST_EMPOWER_START" + or event == "UNIT_SPELLCAST_CHANNEL_START" --or event == "UNIT_SPELLCAST_EMPOWER_START" then -- if event == "UNIT_SPELLCAST_SENT" then br._G.print("Sent Cast Spell: " .. spellName) end -- if event == "UNIT_SPELLCAST_START" then br._G.print("Start Cast Spell: " .. spellName) end @@ -58,7 +58,7 @@ local function eventTracker(_, event, ...) addCastTime(spellID) end end - if event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP" or event == "UNIT_SPELLCAST_EMPOWER_STOP" + if event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP" --or event == "UNIT_SPELLCAST_EMPOWER_STOP" or event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_FAILED_QUIET" or event == "UNIT_SPELLCAST_INTERRUPTED" then -- if event == "UNIT_SPELLCAST_STOP" then br._G.print("Stop Cast Spell: " .. spellName) end @@ -80,11 +80,11 @@ end lastCastFrame:RegisterEvent("UNIT_SPELLCAST_SENT") -- Fired when a unit attempts to cast a spell regardless of the success of the cast. lastCastFrame:RegisterEvent("UNIT_SPELLCAST_START") -- Fired when a unit begins casting a non-instant cast spell. lastCastFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") -- Fired when a unit begins channeling in the course of casting a spell. -lastCastFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_START") +-- lastCastFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_START") -- Stop Cast Events lastCastFrame:RegisterEvent("UNIT_SPELLCAST_STOP") -- Fired when a unit stops casting. lastCastFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP") -- Fired when a unit stops channeling. -lastCastFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_STOP") +-- lastCastFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_STOP") lastCastFrame:RegisterEvent("UNIT_SPELLCAST_FAILED") -- Fired when a unit's spellcast fails. lastCastFrame:RegisterEvent("UNIT_SPELLCAST_FAILED_QUIET") lastCastFrame:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED") -- Fired when a unit's spellcast is interrupted diff --git a/System/Functions/Misc.lua b/System/Functions/Misc.lua index a4cd6bd56e..aa99f10722 100644 --- a/System/Functions/Misc.lua +++ b/System/Functions/Misc.lua @@ -291,7 +291,7 @@ end -- if getTalent(8) == true then function br.getTalent(Row, Column, specGroup) if specGroup == nil then - specGroup = br._G.GetActiveSpecGroup() + specGroup = br._G.C_SpecializationInfo.GetActiveSpecGroup() end local _, _, _, selected = br._G.GetTalentInfo(Row, Column, specGroup) return selected or false @@ -574,23 +574,23 @@ function br.enemyListCheck(Unit) if targetBuff ~= playerBuff then return false end - local phaseReason = br._G.UnitPhaseReason(Unit) + local phaseReason = br._G.UnitInPhase(Unit)--br._G.UnitPhaseReason(Unit) local distance = br.getDistance(Unit, "player") local mcCheck = (br.isChecked("Attack MC Targets") and (not br.GetUnitIsFriend(Unit, "player") or br._G.UnitIsCharmed(Unit))) or not br.GetUnitIsFriend(Unit, "player") - local inPhase = not phaseReason or phaseReason == 2 or phaseReason == 3 + local inPhase = phaseReason--not phaseReason or phaseReason == 2 or phaseReason == 3 if (br.UnitDebuffID("player", 320102) or br.UnitDebuffID(Unit, 424495)) and br._G.UnitIsPlayer(Unit) then return true end - return br.GetObjectExists(Unit) and not br.GetUnitIsDeadOrGhost(Unit) and inPhase and - br._G.UnitCanAttack("player", Unit) and br._G.UnitHealth(Unit) > 0 and distance < 50 and - not br.isCritter(Unit) and - mcCheck and - not br.GetUnitIsUnit(Unit, "pet") and - br._G.UnitCreator(Unit) ~= br._G.ObjectPointer("player") and - br.GetObjectID(Unit) ~= 11492 and - br.getLineOfSight("player", Unit) and - ((Unit ~= 131824 and Unit ~= 131823 and Unit ~= 131825) or + return br.GetObjectExists(Unit) and not br.GetUnitIsDeadOrGhost(Unit) --and inPhase + and br._G.UnitCanAttack("player", Unit) and br._G.UnitHealth(Unit) > 0 and distance < 50 + and not br.isCritter(Unit) + and mcCheck + and not br.GetUnitIsUnit(Unit, "pet") + and br._G.UnitCreator(Unit) ~= br._G.ObjectPointer("player") + and br.GetObjectID(Unit) ~= 11492 + and br.getLineOfSight("player", Unit) + and ((Unit ~= 131824 and Unit ~= 131823 and Unit ~= 131825) or ((br.UnitBuffID(Unit, 260805) or br.GetUnitIsUnit(Unit, "target")) and (Unit == 131824 or Unit == 131823 or Unit == 131825))) end @@ -716,11 +716,11 @@ function br.pause(skipCastingCheck) br.pauseCast = br._G.GetTime() + br.getCastTime(295258) + (br.getCastTime(295261) * hasted) end -- Cyclotronic Blast - if lastCast == 293491 and br._G.GetItemCooldown(167555) == 0 then + if lastCast == 293491 and br._G.C_Container.GetItemCooldown(167555) == 0 then br.pauseCast = br._G.GetTime() + br.getCastTime(293491) + (2.5 * hasted) + br.getGlobalCD(true) end -- Azshara's Font of Power - Latent Arcana - if lastCast == 296962 and br._G.GetItemCooldown(169314) == 0 then + if lastCast == 296962 and br._G.C_Container.GetItemCooldown(169314) == 0 then br.pauseCast = br._G.GetTime() + br.getCastTime(296962) + (2.5 * hasted) end end diff --git a/System/Functions/Power.lua b/System/Functions/Power.lua index d777124886..4c705e0905 100644 --- a/System/Functions/Power.lua +++ b/System/Functions/Power.lua @@ -60,7 +60,7 @@ end function br.getPowerAlt(Unit) local value = 0 local class = select(2, br._G.UnitClass(Unit)) - local spec = br._G.GetSpecialization() + local spec = br._G.C_SpecializationInfo.GetSpecialization() local power = br._G.UnitPower if (class == "DRUID" and spec == 2) or class == "ROGUE" then value = power(Unit, 4) @@ -246,7 +246,7 @@ function br.getTimeToMax(Unit, Limit) local curr = br._G.UnitPower(Unit) local curr2 = curr local _, regen = br._G.GetPowerRegen(Unit) - if select(3, br._G.UnitClass("player")) == 11 and br._G.GetSpecialization() == 2 and br.isKnown(114107) then + if select(3, br._G.UnitClass("player")) == 11 and br._G.C_SpecializationInfo.GetSpecialization() == 2 and br.isKnown(114107) then curr2 = curr + 4 * br.getCombo() end timeTill = (curr2 > max) and 0 or (max - curr2) * (1.0 / regen) diff --git a/System/Functions/Range.lua b/System/Functions/Range.lua index 04af4cccc6..77a5d8e1b6 100644 --- a/System/Functions/Range.lua +++ b/System/Functions/Range.lua @@ -37,7 +37,7 @@ function br.getDistanceCalc(Unit1, Unit2, option) local currentDist = 100 local meleeSpell = nil local playerClass = select(2, br._G.UnitClass("player")) - local playerSpec = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local playerSpec = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if testSpell[playerClass] ~= nil then meleeSpell = testSpell[playerClass] elseif playerClass == "DRUID" and br.UnitBuffID("player", 768) then diff --git a/System/Functions/Spell.lua b/System/Functions/Spell.lua index 6b9a538f2b..d1f4b872a4 100644 --- a/System/Functions/Spell.lua +++ b/System/Functions/Spell.lua @@ -263,7 +263,7 @@ function br.getSpellCD(SpellID) end function br.getGlobalCD(max) - local currentSpecName = select(2, br._G.GetSpecializationInfo(br._G.GetSpecialization())) + local currentSpecName = select(2, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization())) if currentSpecName == "" then currentSpecName = "Initial" end if max == true then if currentSpecName == "Feral" or currentSpecName == "Brewmaster" or currentSpecName == "Windwalker" or br._G.UnitClass("player") == "Rogue" then @@ -339,13 +339,13 @@ function br.isSpellInSpellbook(spellID, spellType) end function br.getSpellInSpellBook(spellID, spellType) - for i = 1, br._G.C_SpellBook.GetNumSpellBookSkillLines() do - local skillLineInfo = br._G.C_SpellBook.GetSpellBookSkillLineInfo(i) - local offset, numSlots = skillLineInfo.itemIndexOffset, skillLineInfo.numSpellBookItems + for i = 1, br._G.GetNumSpellTabs() do + local name, texture, offset, numSlots, isGuild, offspecID = br._G.GetSpellTabInfo(i) + -- local offset, numSlots = skillLineInfo.itemIndexOffset, skillLineInfo.numSpellBookItems for j = offset + 1, offset + numSlots do - local spellBookItemInfo = br._G.C_SpellBook.GetSpellBookItemInfo(j, + local spellType, id = br._G.GetSpellBookItemInfo(j, (spellType == "pet" and Enum.SpellBookSpellBank.Pet or Enum.SpellBookSpellBank.Player)) - local spellType, id = spellBookItemInfo.itemType, spellBookItemInfo.actionID + -- local spellType, id = spellBookItemInfo.itemType, spellBookItemInfo.actionID local spellName if spellType == Enum.SpellBookItemType.Spell then spellName = br._G.C_Spell.GetSpellName(id) @@ -366,12 +366,27 @@ function br.getSpellInSpellBook(spellID, spellType) end -- if br.isKnown(106832) then +-- function br.isKnown(spellID) +-- local baseSpellID = br._G.FindBaseSpellByID(spellID) +-- local _, _, spellInBookType = br.getSpellInSpellBook(spellID) +-- return spellID ~= nil and spellInBookType ~= "Future Spell" and +-- ( --[[spellInBookType ~= nil or]] br._G.IsPlayerSpell(tonumber(spellID)) +-- or br._G.IsSpellKnown(spellID) or br._G.IsPlayerSpell(tonumber(baseSpellID) or br._G.IsSpellKnown(baseSpellID))) -- or spellInBookType == "Spell") +-- end + function br.isKnown(spellID) - local baseSpellID = br._G.FindBaseSpellByID(spellID) - local _, _, spellInBookType = br.getSpellInSpellBook(spellID) - return spellID ~= nil and spellInBookType ~= "Future Spell" and - ( --[[spellInBookType ~= nil or]] br._G.IsPlayerSpell(tonumber(spellID)) - or br._G.IsSpellKnown(spellID) or br._G.IsPlayerSpell(tonumber(baseSpellID) or br._G.IsSpellKnown(baseSpellID))) -- or spellInBookType == "Spell") + local spellName = br._G.GetSpellInfo(spellID) + -- if GetSpellBookItemInfo(tostring(spellName)) ~= nil then + -- return true + -- elseif IsPlayerSpell(tonumber(spellID)) == true then + -- return true + -- elseif IsSpellKnown(spellID) == true then + -- return true + -- elseif hasPerk(spellID) == true then + -- return true + -- end + -- return false + return spellID ~= nil and (br._G.GetSpellBookItemInfo(tostring(spellName)) ~= nil or br._G.IsPlayerSpell(tonumber(spellID)) or br._G.IsSpellKnown(spellID) or br.isSpellInSpellbook(spellID,"spell")) end function br.isActiveEssence(spellID) diff --git a/System/Lists/Spells.lua b/System/Lists/Spells.lua index b43e76cb25..5a940304e5 100644 --- a/System/Lists/Spells.lua +++ b/System/Lists/Spells.lua @@ -1020,130 +1020,41 @@ br.lists.spells = { -- Feral [103] = { abilities = { - adaptiveSwarmDamage = 391889, -- Not Castable but needed for In-Flight - adaptiveSwarmHeal = 391891, -- Not Castable but needed for In-Flight - moonfireCat = 155625, + -- adaptiveSwarmDamage = 391889, -- Not Castable but needed for In-Flight + -- adaptiveSwarmHeal = 391891, -- Not Castable but needed for In-Flight + berserk = 106952, + maim = 22570, + -- moonfireCat = 155625, + naturesSwiftness = 16974, + pounce = 9005, + ravage = 6785, + removeCorruption = 2782, + rip = 1079, + savageRoar = 52610, + shred = 5221, + skullBash = 106839, + survivalInstincts = 61336, + swipe = 62078, + thrash = 106830, }, buffs = { - adaptiveSwarmDamage = 391889, - adaptiveSwarmHeal = 391891, - apexPredator = 255984, - apexPredatorsCraving = 391882, --339140, - berserk = 106951, - bloodtalons = 145152, + berserk = 106952, clearcasting = 135700, - elunesGuidance = 202060, - fieryRedMaimers = 236757, - incarnationAvatarOfAshamane = 102543, - ironJaws = 276021, - jungleStalker = 252071, - overflowingPower = 405189, - predatorRevealed = 408468, + dreamOfCenarius = 145152, + incarnation = 102543, + naturesSwiftness = 16974, predatorySwiftness = 69369, - ravage = 441585, - sabertooth = 391722, savageRoar = 52610, - scentOfBlood = 285646, - smolderingFrenzy = 422751, - stampedingRoar = 77764, - suddenAmbush = 391974, survivalInstincts = 61336, - tigersFury = 5217, }, debuffs = { - adaptiveSwarmDamage = 391889, - adaptiveSwarmHeal = 391891, - bloodseekerVines = 439531, - direFixation = 417713, - feralFrenzy = 274838, - moonfireCat = 155625, - primalWrath = 1079, - rakeStun = 163505, - thrashCat = 405233, + pounce = 9005, + rip = 1079, + thrash = 106830, }, items = { - algetharPuzzleBox = 193701, - ashesOfTheEmbersoul = 207167, - augmentation = 201325, -- Generic, place item id of desired augmentation - bandolierOfTwistedBlades = 207165, - fyrakksTaintedRageheart = 207164, - manicGrieftorch = 194308, - mirrorOfFracturedTomorrows = 207581, - mydasTalisman = 158319, - potion = 191383, -- Generic, place item id of desired potion - witherbarksBranch = 109999, }, talents = { - adaptiveSwarm = 391888, - aggravateWounds = 441829, - apexPredatorsCraving = 391881, - ashamanesGuidance = 391548, - berserk = 106951, - berserkFrenzy = 384668, - berserkHeartOfTheLion = 391174, - bestialStrength = 441841, - bloodtalons = 319439, - bondWithNature = 439929, - brutalSlash = 202028, - carnivorousInstinct = 390902, - circleOfLifeAndDeath = 400320, - clawRampage = 441835, - coiledToSpring = 449537, - convokeTheSpirits = 391528, - doubleclawedRake = 391700, - dreadfulBleeding = 391045, - dreadfulWound = 441809, - empoweredShapeshifting = 441689, - entanglingVortex = 439895, - feralFrenzy = 274837, - flowerWalk = 439901, - fountOfStrength = 441675, - franticMomentum = 391875, - harmoniousConstitution = 440116, - huntBeneathTheOpenSkies = 439868, - implant = 440118, - incarnationAvatarOfAshamane = 102543, - infectedWounds = 48484, - killingStrikes = 441824, - lethalPreservation = 455461, - lionsStrength = 391972, - lunarInspiration = 155580, - mercilessClaws = 231063, - momentOfClarity = 236068, - omenOfClarity = 16864, - packsEndurance = 441844, - pouncingStrikes = 390772, - predator = 202021, - predatorySwiftness = 16974, - primalWrath = 285381, - ragingFury = 391078, - rampantFerocity = 391709, - ravage = 441583, - ripAndTear = 391347, - ruthlessAggression = 441814, - saberJaws = 421432, - sabertooth = 202031, - savageFury = 449645, - soulOfTheForest = 158476, - strategicInfusion = 439890, - strikeForTheHeart = 441845, - suddenAmbush = 384667, - survivalInstincts = 61336, - tasteForBlood = 384665, - tearDownTheMighty = 441846, - thrashingClaws = 405300, - thrivingGrowth = 439528, - tigersFury = 5217, - tigersTenacity = 391872, - tirelessEnergy = 383352, - twinSprouts = 440117, - unbridledSwarm = 391951, - veinripper = 391978, - vigorousCreepers = 440119, - wildSlashes = 390864, - wildpowerSurge = 441691, - wildshapeMastery = 441678, - wildstalkersPower = 439926, }, }, -- Guardian @@ -1366,203 +1277,217 @@ br.lists.spells = { -- All Shared = { abilities = { + aquaticForm = 1066, barkskin = 22812, bearForm = 5487, catForm = 768, charmWoodlandCreature = 127757, -- Tome of the Wilds cyclone = 33786, dash = 1850, - dreamwalk = 193753, + -- dreamwalk = 193753, entanglingRoots = 339, + faerieFire = 770, ferociousBite = 22568, - flap = 164862, - flightForm = 165962, + -- flap = 164862, + flightForm = 33943, growl = 6795, + healingTouch = 5185, + innervate = 29166, mangle = 33917, + mangleBear = 33878, + maul = 6807, markOfTheWild = 1126, moonfire = 8921, - mountForm = 210053, + -- mountForm = 210053, prowl = 5215, + rake = 1822, rebirth = 20484, regrowth = 8936, + rejuvenation = 774, revive = 50769, shred = 5221, - sunfire = 164815, - swipe = 213764, - swipeBear = 213771, - swipeCat = 106785, + soothe = 2908, + -- sunfire = 164815, + symbiosis = 110309, + swiftFlightForm = 40120, + -- swipe = 213764, + -- swipeBear = 213771, + -- swipeCat = 106785, teleportMoonglade = 18960, thrashBear = 77758, - thrashCat = 106830, - trackBeasts = 210065, + tigersFury = 5217, + -- trackBeasts = 210065, trackHumanoids = 5225, travelForm = 783, wrath = 5176, }, animas = { - lycarasBargin = 329960, - lycarasTwig = 330666, + -- lycarasBargin = 329960, + -- lycarasTwig = 330666, }, artifacts = { }, buffs = { - adaptiveSwarm = 325748, + -- adaptiveSwarm = 325748, barkskin = 22812, bearForm = 5487, burningEssence = 138927, catForm = 768, - convokeTheSpirits = 391528, + -- convokeTheSpirits = 391528, dash = 1850, - tigerDash = 252216, - flightForm = 165962, + faerieFire = 770, + flightForm = 33943, frenziedRegeneration = 22842, - heartOfTheWild = 319454, - ironfur = 192081, - kindredEmpowerment = 327139, - kindredSpiritsBuff = 326967, --This is buff on ourselves...at least as dps - kindredEmpowermentEnergize = 327022, --/kindred-empowerment this is when someone else cast it on you - loneSpirit = 338041, - lycarasTwig = 330668, -- Anima Power Torghast + -- heartOfTheWild = 319454, + innervate = 29166, + -- ironfur = 192081, + -- kindredEmpowerment = 327139, + -- kindredSpiritsBuff = 326967, --This is buff on ourselves...at least as dps + -- kindredEmpowermentEnergize = 327022, --/kindred-empowerment this is when someone else cast it on you + -- loneSpirit = 338041, + -- lycarasTwig = 330668, -- Anima Power Torghast markOfTheWild = 1126, - moonkinForm = 197625, - onethsPerception = 339800, + -- moonkinForm = 197625, + -- onethsPerception = 339800, prowl = 5215, rejuvenation = 774, regrowth = 8936, shadowmeld = 58984, - soulshape = 310143, - stagForm = 210053, + -- soulshape = 310143, + -- stagForm = 210053, stampedingRoar = 106898, stampedingRoarCat = 77764, - suddenAmbush = 340698, + -- suddenAmbush = 340698, + -- tigerDash = 252216, + tigersFury = 5217, travelForm = 783, treantForm = 114282, wildGrowth = 48438, }, conduits = { - deepAllegiance = 341378, - tasteForBlood = 340682, + -- deepAllegiance = 341378, + -- tasteForBlood = 340682, }, covenants = { - adaptiveSwarm = 325727, - adaptiveSwarmHeal = 325748, - convokeTheSpiritsCovenant = 323764, - kindredSpirits = 326434, - ravenousFrenzy = 323546, + -- adaptiveSwarm = 325727, + -- adaptiveSwarmHeal = 325748, + -- convokeTheSpiritsCovenant = 323764, + -- kindredSpirits = 326434, + -- ravenousFrenzy = 323546, }, debuffs = { - adaptiveSwarm = 325733, + -- adaptiveSwarm = 325733, cyclone = 33786, entanglingRoots = 339, growl = 6795, hibernate = 2637, - lycarasBargin = 329961, - moonfire = 164812, --8921, - rake = 155722, - rip = 1079, - thrashBear = 192090, - thrashCat = 106830, + -- lycarasBargin = 329961, massEntanglement = 102359, + moonfire = 8921, + rake = 1822, + rip = 1079, + -- thrashBear = 192090, + weakenedArmor = 113746, }, glyphs = { - glyphOfTheCheetah = 131113, - glyphOfTheDoe = 224122, - glyphOfTheFeralChameleon = 210333, - glyphOfTheOrca = 114333, - glyphOfTheSentinel = 219062, - glyphOfTheUrsolChameleon = 107059, + -- glyphOfTheCheetah = 131113, + -- glyphOfTheDoe = 224122, + -- glyphOfTheFeralChameleon = 210333, + -- glyphOfTheOrca = 114333, + -- glyphOfTheSentinel = 219062, + -- glyphOfTheUrsolChameleon = 107059, }, runeforges = { - apexPredatorsCraving = 339139, - eyeOfFearfullSymmetry = 339141, - frenzyband = 340053, + -- apexPredatorsCraving = 339139, + -- eyeOfFearfullSymmetry = 339141, + -- frenzyband = 340053, }, talents = { - aessinasRenewal = 474678, - astralInfluence = 197524, - circleOfTheHeavens = 474541, - circleOfTheWild = 474530, - cyclone = 33786, - felineSwiftness = 131768, - fluidForm = 449193, - forestwalk = 400129, - frenziedRegeneration = 22842, - galeWinds = 400142, - grievousWounds = 474526, - heartOfTheWild = 319454, - hibernate = 2637, - improvedBarkskin = 327993, - improvedRejuvenation = 231040, - improvedStampedingRoar = 288826, - incapacitatingRoar = 99, - incessantTempest = 400140, - innervate = 29166, - instinctsOfTheClaw = 449184, - ironfur = 192081, - killerInstinct = 108299, - lingeringHealing = 231040, - loreOfTheGrove = 449185, - lycarasMeditation = 474728, - lycarasTeachings = 378988, - maim = 22570, - massEntanglement = 102359, - mattedFur = 385786, - moonkinForm = 24858, - mightyBash = 5211, - naturalRecovery = 377796, - naturesVigil = 124974, - nurturingInstinct = 33873, - oakskin = 449191, - perfectlyhonedInstincts = 1213597, - primalFury = 159286, - rake = 1822, - rejuvenation = 774, - removeCorruption = 2782, - renewal = 108238, - rip = 1079, - skullBash = 106839, - soothe = 2908, - stampedingRoar = 106898, - starfire = 197628, - starlightConduit = 451211, - starsurge = 197626, - sunfire = 93402, - symbioticRelationship = 474750, - thickHide = 16931, - thrash = 106832, - tigerDash = 252216, - typhoon = 132469, - ursineVigor = 377842, - ursocsSpirit = 449182, - ursolsVortex = 102793, - verdantHeart = 301768, - wellhonedInstincts = 377847, - wildCharge = 102401, - wildGrowth = 48438, + -- aessinasRenewal = 474678, + -- astralInfluence = 197524, + -- circleOfTheHeavens = 474541, + -- circleOfTheWild = 474530, + -- cyclone = 33786, + -- felineSwiftness = 131768, + -- fluidForm = 449193, + -- forestwalk = 400129, + -- frenziedRegeneration = 22842, + -- galeWinds = 400142, + -- grievousWounds = 474526, + -- heartOfTheWild = 319454, + -- hibernate = 2637, + -- improvedBarkskin = 327993, + -- improvedRejuvenation = 231040, + -- improvedStampedingRoar = 288826, + -- incapacitatingRoar = 99, + -- incessantTempest = 400140, + -- innervate = 29166, + -- instinctsOfTheClaw = 449184, + -- ironfur = 192081, + -- killerInstinct = 108299, + -- lingeringHealing = 231040, + -- loreOfTheGrove = 449185, + -- lycarasMeditation = 474728, + -- lycarasTeachings = 378988, + -- maim = 22570, + -- massEntanglement = 102359, + -- mattedFur = 385786, + -- moonkinForm = 24858, + -- mightyBash = 5211, + -- naturalRecovery = 377796, + -- naturesVigil = 124974, + -- nurturingInstinct = 33873, + -- oakskin = 449191, + -- perfectlyhonedInstincts = 1213597, + -- primalFury = 159286, + -- rake = 1822, + -- rejuvenation = 774, + -- removeCorruption = 2782, + -- renewal = 108238, + -- rip = 1079, + -- skullBash = 106839, + -- soothe = 2908, + -- stampedingRoar = 106898, + -- starfire = 197628, + -- starlightConduit = 451211, + -- starsurge = 197626, + -- sunfire = 93402, + -- symbioticRelationship = 474750, + -- thickHide = 16931, + -- thrash = 106832, + -- tigerDash = 252216, + -- typhoon = 132469, + -- ursineVigor = 377842, + -- ursocsSpirit = 449182, + -- ursolsVortex = 102793, + -- verdantHeart = 301768, + -- wellhonedInstincts = 377847, + -- wildCharge = 102401, + -- wildGrowth = 48438, }, talentsHeroic = { - bloomingInfusion = 429433, - bounteousBloom = 429215, - burstingGrowth = 440120, - cenariusMight = 455797, - controlOfTheDream = 434249, - dreamSurge = 433831, - durabilityOfNature = 429227, - earlySpring = 428937, - expansiveness = 429399, - grovesInspiration = 429402, - harmonyOfTheGrove = 428731, - potentEnchantments = 429420, - powerOfNature = 428859, - powerOfTheDream = 434220, - protectiveGrowth = 433748, - resilientFlourishing = 439880, - rootNetwork = 439882, - treantsOfTheMoon = 428544, + -- bloomingInfusion = 429433, + -- bounteousBloom = 429215, + -- burstingGrowth = 440120, + -- cenariusMight = 455797, + -- controlOfTheDream = 434249, + -- dreamSurge = 433831, + -- durabilityOfNature = 429227, + -- earlySpring = 428937, + -- expansiveness = 429399, + -- grovesInspiration = 429402, + -- harmonyOfTheGrove = 428731, + -- potentEnchantments = 429420, + -- powerOfNature = 428859, + -- powerOfTheDream = 434220, + -- protectiveGrowth = 433748, + -- resilientFlourishing = 439880, + -- rootNetwork = 439882, + -- treantsOfTheMoon = 428544, }, traits = { - livelySpirit = 279642, + -- livelySpirit = 279642, }, }, }, @@ -5500,137 +5425,137 @@ br.lists.spells = { autoShot = 75, giftOfTheNaaru = br.getRacial("Draenei"), --select(7, GetSpellInfo(GetSpellInfo(28880))), global = 61304, - latentArcana = 296971, - lightsJudgment = 255647, + -- latentArcana = 296971, + -- lightsJudgment = 255647, quakingPalm = 107079, racial = br.getRacial(), shadowmeld = 58984, }, animas = { - scrollOfElchaver = 305006, + -- scrollOfElchaver = 305006, }, artifacts = { - artificialDamage = 226829, - artificialStamina = 211309, - concordanceOfTheLegionfall = 239042, + -- artificialDamage = 226829, + -- artificialStamina = 211309, + -- concordanceOfTheLegionfall = 239042, }, buffs = { ancientHysteria = 90355, - battlePotionOfAgility = 279152, - battlePotionOfIntellect = 279151, - battlePotionOfStrength = 279153, - superiorBattlePotionOfAgility = 298146, - potionOfUnbridledFury = 300714, + -- battlePotionOfAgility = 279152, + -- battlePotionOfIntellect = 279151, + -- battlePotionOfStrength = 279153, + -- superiorBattlePotionOfAgility = 298146, + -- potionOfUnbridledFury = 300714, blessingOfSacrifice = 6940, - greaterBlessingOfKings = 203538, - greaterBlessingOfWisdom = 203539, - battleScarredAugmentation = 270058, -- BfA Augment Rune Buff + -- greaterBlessingOfKings = 203538, + -- greaterBlessingOfWisdom = 203539, + -- battleScarredAugmentation = 270058, -- BfA Augment Rune Buff blessingOfFreedom = 1044, blessingOfProtection = 1022, bloodLust = { ancientHysteria = 90355, bloodlust = 2825, drumsOfRage = 146555, - drumsOfTheMaelstrom = 256740, - drumsOfTheMountain = 230935, + -- drumsOfTheMaelstrom = 256740, + -- drumsOfTheMountain = 230935, heroism = 32182, - netherwinds = 160452, - primalRage = 264667, + -- netherwinds = 160452, + -- primalRage = 264667, timewarp = 80353, }, - concordanceOfTheLegionfall = 239042, - defiledAugmentation = 224001, -- Lightforged Augment Rune buff - felFocus = 242551, - flaskOfTenThousandScars = 188035, - flaskOfTheCountlessArmies = 188034, - flaskOfTheSeventhDemon = 188033, - flaskOfTheWhisperedPact = 188031, - flaskOfTheCurrents = 251836, - flaskOfEndlessFathoms = 251837, - flaskOfTheVastHorizon = 251838, - flaskOfTheUndertow = 251839, - flayedWingToxin = 345546, - fruitfulMachinatins = 242623, -- Absorb Shield from Deceiver's Grand Design - mistcallerOcarina = 330067, -- SL Trinket with group buff - greaterFlaskOfEndlessFathoms = 298837, - greaterFlaskOfTheCurrents = 298836, - greaterFlaskOfTheUndertow = 298841, - greaterFlaskOfTheVastHorizon = 298839, - guidingHand = 242622, -- from The Deceiver's Grand Design + -- concordanceOfTheLegionfall = 239042, + -- defiledAugmentation = 224001, -- Lightforged Augment Rune buff + -- felFocus = 242551, + -- flaskOfTenThousandScars = 188035, + -- flaskOfTheCountlessArmies = 188034, + -- flaskOfTheSeventhDemon = 188033, + -- flaskOfTheWhisperedPact = 188031, + -- flaskOfTheCurrents = 251836, + -- flaskOfEndlessFathoms = 251837, + -- flaskOfTheVastHorizon = 251838, + -- flaskOfTheUndertow = 251839, + -- flayedWingToxin = 345546, + -- fruitfulMachinatins = 242623, -- Absorb Shield from Deceiver's Grand Design + -- mistcallerOcarina = 330067, -- SL Trinket with group buff + -- greaterFlaskOfEndlessFathoms = 298837, + -- greaterFlaskOfTheCurrents = 298836, + -- greaterFlaskOfTheUndertow = 298841, + -- greaterFlaskOfTheVastHorizon = 298839, + -- guidingHand = 242622, -- from The Deceiver's Grand Design heroism = 32182, - ineffableTruth = 316801, - latentArcana = 296962, - netherwinds = 160452, - norgannonsForesight = 236373, - overchargeMana = 299624, - potionOfBurstingBlood = 265514, - potionOfFocusedResolve = 298317, - prolongedPower = 229206, + -- ineffableTruth = 316801, + -- latentArcana = 296962, + -- netherwinds = 160452, + -- norgannonsForesight = 236373, + -- overchargeMana = 299624, + -- potionOfBurstingBlood = 265514, + -- potionOfFocusedResolve = 298317, + -- prolongedPower = 229206, racial = br.getRacial(), - razorCoral = 303570, -- Crit Buff from Ashvane's Razor Coral - sephuz1 = 208051, -- the fulltime 10% movement, 2% haste buff - sephuz2 = 208052, -- the proc, 70% movement, 25% haste buff - sephuzCooldown = 226262, -- CD (30 seconds) for the proc + -- razorCoral = 303570, -- Crit Buff from Ashvane's Razor Coral + -- sephuz1 = 208051, -- the fulltime 10% movement, 2% haste buff + -- sephuz2 = 208052, -- the proc, 70% movement, 25% haste buff + -- sephuzCooldown = 226262, -- CD (30 seconds) for the proc shadowmeld = 58984, symbolOfHope = 64901, timeWarp = 80353, - whispersOfInsanity = 176151, - cracklingTourmaline = 290372, - saphireofBrilliance = 290365, - vigorEngaged = 287916, - soulshape = 310143, - soulIgnition = 345251, - spectralFlaskOfPower = 307185, - elementalPotionOfPower = 371024, - elementalPotionOfUltimatePower = 371028, - phialOfGlacialFury = 373257, - phialOfTepidVersatility = 371172, - icedPhialOfCorruptingRage = 374000, - domineeringArrogance = 411661, + -- whispersOfInsanity = 176151, + -- cracklingTourmaline = 290372, + -- saphireofBrilliance = 290365, + -- vigorEngaged = 287916, + -- soulshape = 310143, + -- soulIgnition = 345251, + -- spectralFlaskOfPower = 307185, + -- elementalPotionOfPower = 371024, + -- elementalPotionOfUltimatePower = 371028, + -- phialOfGlacialFury = 373257, + -- phialOfTepidVersatility = 371172, + -- icedPhialOfCorruptingRage = 374000, + -- domineeringArrogance = 411661, }, --TODO Add to API itemEnchantments = { --Dragonflight weapon Imbue's from inscription enchantments --Quality of aura should always be GOLD,SILVER,COPPER - buzzingRune = { 6514, 6513, 6512 }, - chirpingRune = { 6695, 6694, 6515 }, - howlingRune = { 6518, 6517, 6516 }, - hissingRune = { 6839, 6837, 6838 }, + -- buzzingRune = { 6514, 6513, 6512 }, + -- chirpingRune = { 6695, 6694, 6515 }, + -- howlingRune = { 6518, 6517, 6516 }, + -- hissingRune = { 6839, 6837, 6838 }, }, conduits = { }, covenants = { - covenantAbility = 313347, - doorOfShadows = 300728, - fleshcraft = 324631, - soulshape = 310143, - flicker = 324701, - summonSteward = 324739, + -- covenantAbility = 313347, + -- doorOfShadows = 300728, + -- fleshcraft = 324631, + -- soulshape = 310143, + -- flicker = 324701, + -- summonSteward = 324739, }, debuffs = { - bloodOfTheEnemy = 297108, - concentratedFlame = 295368, - conductiveInk = 302565, + -- bloodOfTheEnemy = 297108, + -- concentratedFlame = 295368, + -- conductiveInk = 302565, dampening = 110310, - eyeOfLeotheras = 206649, - necroticWound = 209858, - razorCoral = 303568, --304877, - repeatPerformance = 304409, - shiverVenom = 301624, - temptation = 234143, - eyeOfCorruption = 315161, - grandDelusions = 319695, - graspingTendrils = 315176, - creepingMadness = 313255, - fixate = 318078, - thirstForBlood = 266107, + -- eyeOfLeotheras = 206649, + -- necroticWound = 209858, + -- razorCoral = 303568, --304877, + -- repeatPerformance = 304409, + -- shiverVenom = 301624, + -- temptation = 234143, + -- eyeOfCorruption = 315161, + -- grandDelusions = 319695, + -- graspingTendrils = 315176, + -- creepingMadness = 313255, + -- fixate = 318078, + -- thirstForBlood = 266107, mightyBash = 5211, - defiledGround = 314565, - vileCorruption = 314392, - timeToFeed = 162415, -- Oshir Iron Docks - cascadingTerror = 314478, + -- defiledGround = 314565, + -- vileCorruption = 314392, + -- timeToFeed = 162415, -- Oshir Iron Docks + -- cascadingTerror = 314478, }, essences = { }, diff --git a/System/Loader/cBuilder.lua b/System/Loader/cBuilder.lua index 0904ccc15d..493ed1e73a 100644 --- a/System/Loader/cBuilder.lua +++ b/System/Loader/cBuilder.lua @@ -46,7 +46,7 @@ end function br.loader.loadProfiles() -- Search each Profile in the Spec Folder br._G.wipe(br.rotations) - local specID = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local specID = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) local IDLength = math.floor(math.log10(specID) + 1) local folderSpec = getFolderSpecName(class, specID) local path = getFilesLocation() .. sep .. 'Rotations' .. sep .. getFolderClassName(class) .. sep .. folderSpec .. sep @@ -139,6 +139,29 @@ function br.loader:new(spec, specName) self.items = self.items or {} self.items[spellRef] = spellID else + -- Check if br._G.GetSpellInfo returns a valid spell name + local name, _, _, _, _, _, gsiSpellID = br._G.GetSpellInfo(spellID) + if type(spellID) ~= "table" then + if (not name or gsiSpellID ~= spellID) then + br._G.print("SpellID not valid: " .. tostring(spellID)) + br._G.print("|cffff0000"..spellType..": |r" .. + spellRef .. + "|cffff0000 with ID: |r" .. + spellID .. "|cffff0000 is not a valid in the list of "..spellType.." Spell List.") + end + else + -- If spellID is a table, then it is a list of spellIDs, so we need to check each one + for spellRef, id in pairs(spellID) do + local name, _, _, _, _, _, gsiSpellID = br._G.GetSpellInfo(id) + if (not name or gsiSpellID ~= id) then + br._G.print("SpellID not valid: " .. tostring(id)) + br._G.print("|cffff0000"..spellType..": |r" .. + spellRef .. + "|cffff0000 with ID: |r" .. + id .. "|cffff0000 is not a valid in the list of "..spellType.." Spell List.") + end + end + end -- Assign spell to br.player.spells for the spell type self.spells[spellType][spellRef] = spellID -- Assign active spells to Abilities Subtable and base br.player.spells @@ -254,33 +277,65 @@ function br.loader:new(spec, specName) return talents end + -- Update Talent Info + -- local function getTalentInfo() + -- for specName, specID in pairs(br.lists.spec[class]) do + -- if specID == spec and specName ~= "Initial" then + -- return getAllTalents() + -- end + -- end + -- end -- Update Talent Info local function getTalentInfo() - for specName, specID in pairs(br.lists.spec[class]) do - if specID == spec and specName ~= "Initial" then - return getAllTalents() + local talentFound + br.activeSpecGroup = br._G.C_SpecializationInfo.GetActiveSpecGroup() + if self.talent == nil then self.talent = {} end + if spec > 1400 then return end + for k,v in pairs(self.spells.talents) do + talentFound = false + for r = 1, 7 do --search each talent row + for c = 1, 3 do -- search each talent column + local _,_,_,selected,_,talentID = br._G.GetTalentInfo(r,c,br.activeSpecGroup) + if v == talentID then + talentFound = true + -- Add All Matches to Talent List for Boolean Checks + self.talent[k] = selected + -- Add All Active Ability Matches to Ability/Spell List for Use Checks + if not br._G.IsPassiveSpell(v) then + self.spells['abilities'][k] = v + self.spells[k] = v + end + break; + end + end + -- If we found the talent, then stop looking for it. + if talentFound then break end + end + -- No matching talent for listed talent id, report to + if not talentFound then + br._G.print("|cffff0000No talent found for: |r"..k.." ("..v..") |cffff0000in the talent spell list, please notify profile developer to remove from the list.") end end end -- Check if Hero Spec if Active - local function getHeroTreeInfo() - local playerClass = select(2, br._G.UnitClass('player')) - -- Retrieve the active hero talent spec ID - local activeSpecID = C_ClassTalents.GetActiveHeroTalentSpec() - -- Check if the specName exists in the br.lists.heroSpec table - for class, specs in pairs(br.lists.heroSpec) do - -- print("Class: "..tostring(class).." Specs: "..tostring(specs)) - for spec, specID in pairs(specs) do - -- print("Spec: "..tostring(spec).." SpecID: "..tostring(specID)) - if class == playerClass then - if self.heroTree == nil then self.heroTree = {} end - if self.heroTree[spec] == nil then self.heroTree[spec] = false end - self.heroTree[spec] = specID == activeSpecID or false - end - end - end - end + -- local function getHeroTreeInfo() + -- local playerClass = select(2, br._G.UnitClass('player')) + -- -- Retrieve the active hero talent spec ID + -- local activeSpecID = C_ClassTalents.GetActiveHeroTalentSpec() + -- -- Check if the specName exists in the br.lists.heroSpec table + -- for class, specs in pairs(br.lists.heroSpec) do + -- -- print("Class: "..tostring(class).." Specs: "..tostring(specs)) + -- for spec, specID in pairs(specs) do + -- -- print("Spec: "..tostring(spec).." SpecID: "..tostring(specID)) + -- if class == playerClass then + -- if self.heroTree == nil then self.heroTree = {} end + -- if self.heroTree[spec] == nil then self.heroTree[spec] = false end + -- self.heroTree[spec] = specID == activeSpecID or false + -- end + -- end + -- end + -- end local function getFunctions() @@ -304,7 +359,7 @@ function br.loader:new(spec, specName) end -- Build Hero Tree Info - getHeroTreeInfo() + -- getHeroTreeInfo() -- Parse Holding Table for k, v in pairs(spellListTalents) do @@ -496,7 +551,7 @@ function br.loader:new(spec, specName) end end - if spec == br._G.GetSpecializationInfo(br._G.GetSpecialization()) and (self.talent == nil or self.cast == nil) then + if spec == br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) and (self.talent == nil or self.cast == nil) then getSpellsForSpec(spec); --[[getTalentInfo(); getAzeriteTraitInfo();]] getFunctions(); br.updatePlayerInfo = false end ------------------ @@ -513,7 +568,7 @@ function br.loader:new(spec, specName) -------------- function self.update() - if spec == br._G.GetSpecializationInfo(br._G.GetSpecialization()) then + if spec == br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) then -- Call baseUpdate() if not br._G.UnitAffectingCombat("player") then self.updateOOC() end self.baseUpdate() diff --git a/System/Loader/cCharacter.lua b/System/Loader/cCharacter.lua index f264dc311e..3a772db430 100644 --- a/System/Loader/cCharacter.lua +++ b/System/Loader/cCharacter.lua @@ -133,7 +133,7 @@ function br.cCharacter:new(class) self.health = br.getHP("player") self.instance = select(2, br._G.IsInInstance()) self.level = br._G.UnitLevel("player") -- TODO: EVENT - UNIT_LEVEL - self.spec = select(2, br._G.GetSpecializationInfo(br._G.GetSpecialization())) or "None" + self.spec = select(2, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization())) or "None" self.currentPet = br._G.UnitCreatureFamily("pet") or "None" if self.currentPet ~= "None" then self.petId = tonumber(br._G.UnitGUID("pet"):match("-(%d+)-%x+$"), 10) @@ -391,7 +391,7 @@ function br.cCharacter:new(class) local itemInfo = { --Collect Item Data itemID = itemID, - itemCD = br._G.GetItemCooldown(itemID), + itemCD = br._G.C_Container.GetItemCooldown(itemID), itemName = br._G.GetItemInfo(itemID), minLevel = select(5, br._G.GetItemInfo(itemID)), itemType = select(7, br._G.GetItemInfo(itemID)), diff --git a/System/Misc/foodflaskpot.lua b/System/Misc/foodflaskpot.lua index 4a3da4f56d..173946bd27 100644 --- a/System/Misc/foodflaskpot.lua +++ b/System/Misc/foodflaskpot.lua @@ -75,7 +75,7 @@ end function br.getClassType() local classType = "nil" local myClass = br.getClass() - local mySpec = br._G.GetSpecialization() + local mySpec = br._G.C_SpecializationInfo.GetSpecialization() --Agility if myClass == "Hunter" or myClass == "Rogue" @@ -130,7 +130,7 @@ end function br.playerCanUseItem(itemID) if itemID == nil then return false end if br.playerHasItem(itemID) then - if br._G.GetItemCooldown(itemID) == 0 then + if br._G.C_Container.GetItemCooldown(itemID) == 0 then return true end end diff --git a/System/UI/SettingsManagement.lua b/System/UI/SettingsManagement.lua index 0ff5e65864..0ec01ed6aa 100644 --- a/System/UI/SettingsManagement.lua +++ b/System/UI/SettingsManagement.lua @@ -229,7 +229,7 @@ function br:loadLastProfileTracker() local selectedProfile = br.selectedSpec if br:findFileInFolder("lastProfileTracker.lua", loadDir) then local tracker = br.tableLoad(loadDir .. "lastProfileTracker.lua") - local specID = br._G.GetSpecializationInfo(br._G.GetSpecialization()) + local specID = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) if br.data == nil then br.data = {} end @@ -279,7 +279,7 @@ end function br:saveLastProfileTracker() local saveDir = br:checkDirectories(nil, nil, nil, "Tracker") - local specID = br._G.GetSpecializationInfo(br._G.GetSpecialization()) or br.selectedSpecID + local specID = br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) or br.selectedSpecID if br.data ~= nil and br.data.settings ~= nil and br.data.settings[br.selectedSpec] ~= nil then if br.data.tracker ~= nil then if br.data.tracker[br.selectedSpec] == nil then diff --git a/System/engines/EnemiesEngineFunctions.lua b/System/engines/EnemiesEngineFunctions.lua index f68509e4a1..8d21a7ddab 100644 --- a/System/engines/EnemiesEngineFunctions.lua +++ b/System/engines/EnemiesEngineFunctions.lua @@ -330,7 +330,7 @@ local function getUnitCoeficient(unit) -- if threat is checked, add 100 points of prio if we lost aggro on that target if br.getOptionCheck("Tank Threat") then local threat = br._G.UnitThreatSituation("player", unit) or -1 - if select(6, br._G.GetSpecializationInfo(br._G.GetSpecialization())) == "TANK" and threat < 3 and unitHP > 10 then + if select(6, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization())) == "TANK" and threat < 3 and unitHP > 10 then coef = coef + 100 - threat end end @@ -346,7 +346,7 @@ local function getUnitCoeficient(unit) coef = coef + isShieldedTarget(unit) end -- Outlaw - Blind Shot 10% dmg increase all sources - if select(2, br._G.UnitClass('player')) == "ROGUE" and br._G.GetSpecializationInfo(br._G.GetSpecialization()) == 260 then + if select(2, br._G.UnitClass('player')) == "ROGUE" and br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) == 260 then -- Between the eyes if br.getDebuffRemain(unit, 315341) > 0 then coef = coef + 75 diff --git a/System/engines/HealingEngine.lua b/System/engines/HealingEngine.lua index 0e850875e8..b811568807 100644 --- a/System/engines/HealingEngine.lua +++ b/System/engines/HealingEngine.lua @@ -4,7 +4,7 @@ local _, br = ... -----------------------------------------Bubba's Healing Engine--------------------------------------]] -local LGIST = br._G.LibStub("LibGroupInSpecT-1.1") +-- local LGIST = br._G.LibStub("LibGroupInSpecT-1.1") if not br.metaTable1 then -- localizing the commonly used functions while inside loops local getDistance, tinsert, tremove, UnitClass, GetUnitIsUnit = br.getDistance, br._G.tinsert, br._G.tremove, br._G.UnitClass, br.GetUnitIsUnit @@ -311,10 +311,11 @@ if not br.metaTable1 then return br.novaEngineTables.roleTable[br._G.UnitName(o.unit)].role else ---@diagnostic disable-next-line: undefined-field - local info = LGIST:GetCachedInfo(br.getGUID(o.unit)) - if info and info.spec_role then - return info.spec_role - end + -- local info = LGIST:GetCachedInfo(br.getGUID(o.unit)) + -- if info and info.spec_role then + -- return info.spec_role + -- end + return "" end else return br._G.UnitGroupRolesAssigned(o.unit) diff --git a/System/engines/QuestTracker.lua b/System/engines/QuestTracker.lua index 93868d9e99..7d99e5faba 100644 --- a/System/engines/QuestTracker.lua +++ b/System/engines/QuestTracker.lua @@ -98,7 +98,7 @@ local QuestCacheUpdate = function() local mapId = br._G.C_Map.GetBestMapForUnit("player") if (mapId) then - local worldQuests = br._G.C_TaskQuest.GetQuestsForPlayerByMapID(mapId) + local worldQuests = br._G.C_TaskQuest.GetQuestsOnMap(mapId) if (type(worldQuests) == "table") then for _, questTable in ipairs(worldQuests) do local questId = questTable.questId diff --git a/System/readers/combatlog.lua b/System/readers/combatlog.lua index 2d377807b7..fa335fb4aa 100644 --- a/System/readers/combatlog.lua +++ b/System/readers/combatlog.lua @@ -597,7 +597,7 @@ function cl:Druid(...) ----------- -- Kitty --------------- --[[ Bleed Recorder --]] - if br._G.GetSpecialization() == 2 then + if br._G.C_SpecializationInfo.GetSpecialization() == 2 then if source == br._G.UnitGUID("player") then if destination ~= nil and destination ~= "" then local thisUnit = "target" @@ -665,7 +665,7 @@ function cl:Druid(...) then br.shroomsTable[1] = {} end - if source == br.guid and br.class == 11 and br._G.GetSpecialization() == 1 then + if source == br.guid and br.class == 11 and br._G.C_SpecializationInfo.GetSpecialization() == 1 then -- Starsurge Casted if spell == 78674 and param == "SPELL_CAST_SUCCESS" then if br.core then @@ -800,7 +800,7 @@ function cl:Monk(...) _, spellType = br._G.CombatLogGetCurrentEventInfo() -- if prevCombo == nil or not UnitAffectingCombat("player") then prevCombo = 6603 end - if br.player ~= nil and br._G.GetSpecialization() == 3 and br.player.spells.fistsOfFury ~= nil then + if br.player ~= nil and br._G.C_SpecializationInfo.GetSpecialization() == 3 and br.player.spells.fistsOfFury ~= nil then local myspell = br.player.spells local var = br.player.variables local comboSpells = { @@ -856,7 +856,7 @@ function cl:Priest(...) spellName, _, spellType = br._G.CombatLogGetCurrentEventInfo() - if br._G.GetSpecialization() == 3 then + if br._G.C_SpecializationInfo.GetSpecialization() == 3 then -- Periodic Damage Events if param == "SPELL_PERIODIC_DAMAGE" then if br.mfTicks == nil then @@ -1002,7 +1002,7 @@ function cl:Rogue(...) br.pickPocketing = false end --[[ Bleed Recorder --]] - if br._G.GetSpecialization() == 1 then + if br._G.C_SpecializationInfo.GetSpecialization() == 1 then if source == br._G.UnitGUID("player") then if destination ~= nil and destination ~= "" then local thisUnit = "target" @@ -1064,7 +1064,7 @@ function cl:Rogue(...) end end -- OUTLAW - if br._G.GetSpecialization() == 2 then + if br._G.C_SpecializationInfo.GetSpecialization() == 2 then if source == br._G.UnitGUID("player") then if spell == 287916 then br.vigorstacks = br.getBuffStacks("player", 287916) or 0 @@ -1102,7 +1102,7 @@ function cl:Shaman(...) -- 7 end ------------- --[[ Lightning Bolt ]] - if br.player ~= nil and br._G.GetSpecialization() == 2 then + if br.player ~= nil and br._G.C_SpecializationInfo.GetSpecialization() == 2 then if sourceName ~= nil then if br.isInCombat("player") and br.GetUnitIsUnit(sourceName, "player") then -- Chain Lightning / Lightning Bolt @@ -1148,7 +1148,7 @@ function cl:Warlock(...) -- 9 spellName, _, spellType = br._G.CombatLogGetCurrentEventInfo() - if br._G.GetSpecialization() == 1 then + if br._G.C_SpecializationInfo.GetSpecialization() == 1 then if source == br.guid and param == "UNIT_SPELLCAST_CHANNEL_START" then -- Drain Soul counter if br._G.UnitChannelInfo("player") == br._G.GetSpellInfo(198590) then @@ -1213,7 +1213,7 @@ function cl:Warlock(...) -- 9 end end end - if br._G.GetSpecialization() == 2 then + if br._G.C_SpecializationInfo.GetSpecialization() == 2 then -- if source == br.guid and param == "SPELL_CAST_SUCCESS" then -- -- Hand of Guldan -- if == 105174 then @@ -1239,7 +1239,7 @@ function cl:Warlock(...) -- 9 -- print("Demon SUMMON") -- end end - if br._G.GetSpecialization() == 3 then + if br._G.C_SpecializationInfo.GetSpecialization() == 3 then -- last Immolate if param == "SPELL_CAST_SUCCESS" and spell == 348 then br.lastImmolateTarget = destination @@ -1295,7 +1295,7 @@ function cl:Warrior(...) elseif br.timer:useTimer("reflect reset", 0.8) then br.reflectPlayer = false end - if br._G.GetSpecialization("player") == 1 then + if br._G.C_SpecializationInfo.GetSpecialization("player") == 1 then -- snapshot on spellcast if source == br.guid and param == "SPELL_CAST_SUCCESS" then -- but only record the snapshot if it successfully applied diff --git a/System/readers/common.lua b/System/readers/common.lua index 61d820059f..6a00dd1c88 100644 --- a/System/readers/common.lua +++ b/System/readers/common.lua @@ -196,16 +196,16 @@ function br.read.commonReaders() end end Frame:SetScript("OnEvent", UiErrorMessages) - ------------------------ - --[[ Spells Changed --]] - Frame = br._G.CreateFrame("Frame") - Frame:RegisterEvent("LEARNED_SPELL_IN_SKILL_LINE") - local function SpellsChanged(_, _, _) - if not br.configReloadTimer or br.configReloadTimer <= br._G.GetTime() - 1 then - br.currentConfig, br.configReloadTimer = nil, br._G.GetTime() - end - end - Frame:SetScript("OnEvent", SpellsChanged) + -- ------------------------ + -- --[[ Spells Changed --]] + -- Frame = br._G.CreateFrame("Frame") + -- Frame:RegisterEvent("LEARNED_SPELL_IN_SKILL_LINE") + -- local function SpellsChanged(_, _, _) + -- if not br.configReloadTimer or br.configReloadTimer <= br._G.GetTime() - 1 then + -- br.currentConfig, br.configReloadTimer = nil, br._G.GetTime() + -- end + -- end + -- Frame:SetScript("OnEvent", SpellsChanged) --- under devlopment not working as of now --[[ Addon reader ]] -- local Frame = CreateFrame('Frame') @@ -321,14 +321,14 @@ function br.read.commonReaders() superReaderFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP") superReaderFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") superReaderFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE") - superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_START") - superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_STOP") - superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_UPDATE") + -- superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_START") + -- superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_STOP") + -- superReaderFrame:RegisterEvent("UNIT_SPELLCAST_EMPOWER_UPDATE") superReaderFrame:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED") superReaderFrame:RegisterEvent("UNIT_POWER_UPDATE") superReaderFrame:RegisterEvent("ENCOUNTER_START") superReaderFrame:RegisterEvent("ENCOUNTER_END") - superReaderFrame:RegisterUnitEvent("AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED") + -- superReaderFrame:RegisterUnitEvent("AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED") superReaderFrame:RegisterUnitEvent("AZERITE_ESSENCE_ACTIVATED") superReaderFrame:RegisterUnitEvent("PLAYER_EQUIPMENT_CHANGED") superReaderFrame:RegisterUnitEvent("PLAYER_LEVEL_UP") @@ -373,7 +373,7 @@ function br.read.commonReaders() -- if event == "PLAYER_TALENT_UPDATE" and select(2, GetSpecializationInfo(GetSpecialization())) == br.selectedSpec then -- br.rotationChanged = true -- end - if event == "PLAYER_TALENT_UPDATE" or event == "PLAYER_LEVEL_UP" or event == "PLAYER_EQUIPMENT_CHANGED" or event == "AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED" or event == "TRAIT_CONFIG_UPDATED" then + if event == "PLAYER_TALENT_UPDATE" or event == "PLAYER_LEVEL_UP" or event == "PLAYER_EQUIPMENT_CHANGED" --[[or event == "AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED"]] or event == "TRAIT_CONFIG_UPDATED" then br.updatePlayerInfo = true end ------------------------------------------------- @@ -541,29 +541,29 @@ function br.read.commonReaders() --Print("Channel Update") end end - if event == "UNIT_SPELLCAST_EMPOWER_START" then - local SourceUnit = select(1, ...) - local SpellID = select(3, ...) - if SourceUnit == "player" then - --Print("Channel Start") - br.empowerID = SpellID - end - end - if event == "UNIT_SPELLCAST_EMPOWER_STOP" then - local SourceUnit = select(1, ...) - local SpellID = select(3, ...) - if SourceUnit == "player" then - --Print("Channel STOP") - br.empowerID = 0 - end - end - if event == "UNIT_SPELLCAST_EMPOWER_UPDATE" then - local SourceUnit = select(1, ...) - -- local SpellID = select(3, ...) - if SourceUnit == "player" then - --Print("Channel Update") - end - end + -- if event == "UNIT_SPELLCAST_EMPOWER_START" then + -- local SourceUnit = select(1, ...) + -- local SpellID = select(3, ...) + -- if SourceUnit == "player" then + -- --Print("Channel Start") + -- br.empowerID = SpellID + -- end + -- end + -- if event == "UNIT_SPELLCAST_EMPOWER_STOP" then + -- local SourceUnit = select(1, ...) + -- local SpellID = select(3, ...) + -- if SourceUnit == "player" then + -- --Print("Channel STOP") + -- br.empowerID = 0 + -- end + -- end + -- if event == "UNIT_SPELLCAST_EMPOWER_UPDATE" then + -- local SourceUnit = select(1, ...) + -- -- local SpellID = select(3, ...) + -- if SourceUnit == "player" then + -- --Print("Channel Update") + -- end + -- end if event == "UI_ERROR_MESSAGE" then local errorMsg = select(1, ...) local messageErr = select(2, ...) diff --git a/Unlockers/nn.lua b/Unlockers/nn.lua index 98c0ae5d8f..e4947ccd6d 100644 --- a/Unlockers/nn.lua +++ b/Unlockers/nn.lua @@ -205,7 +205,8 @@ local globalCacheList = "UnitLevel", "UnitName", "UnitOnTaxi", - "UnitPhaseReason", + -- "UnitPhaseReason", + "UnitInPhase", "UnitPlayerControlled", "UnitPlayerOrPetInParty", "UnitPlayerOrPetInRaid", diff --git a/unusedFunctions.lua b/unusedFunctions.lua index 93e3881ea4..59f00c1c53 100644 --- a/unusedFunctions.lua +++ b/unusedFunctions.lua @@ -164,7 +164,7 @@ end -- br.useItem(12345) function br.useItem_old(itemID) if br._G.GetItemCount(itemID) > 0 then - if select(2, br._G.GetItemCooldown(itemID)) == 0 then + if select(2, br._G.C_Container.GetItemCooldown(itemID)) == 0 then local itemName = br._G.GetItemInfo(itemID) br._G.RunMacroText("/use " .. itemName) return true From ecb6b42648acd8417f37c8ff8a3a9a0cbe44f95f Mon Sep 17 00:00:00 2001 From: "Ashley (CuteOne)" Date: Mon, 18 Aug 2025 09:29:29 -0400 Subject: [PATCH 02/65] Feral - Bug Fixes --- .../LibGroupInSpecT-1.1.lua | 1037 ----------------- .../LibGroupInSpecT-1.1.toc | 9 - Libs/LibGroupInSpecT-1.1/lib.xml | 6 - Rotations/Druid/Feral/FeralCuteOne.lua | 184 ++- 4 files changed, 66 insertions(+), 1170 deletions(-) delete mode 100644 Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.lua delete mode 100644 Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.toc delete mode 100644 Libs/LibGroupInSpecT-1.1/lib.xml diff --git a/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.lua b/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.lua deleted file mode 100644 index 439255ae05..0000000000 --- a/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.lua +++ /dev/null @@ -1,1037 +0,0 @@ --- vim: ts=2 sw=2 ai et fenc=utf8 - ---[[ --- These events can be registered for using the regular CallbackHandler ways. --- --- "GroupInSpecT_Update", guid, unit, info --- "GroupInSpecT_Remove, guid --- "GroupInSpecT_InspectReady", guid, unit --- --- Where is a table containing some or all of the following: --- .guid --- .name --- .realm --- .race --- .race_localized --- .class --- .class_localized --- .class_id --- .gender -- 2 = male, 3 = female --- .global_spec_id --- .spec_index --- .spec_name_localized --- .spec_description --- .spec_icon --- .spec_background --- .spec_role --- .spec_role_detailed --- .spec_group -- active spec group (1/2/nil) --- .talents = { --- [] = { --- .tier --- .column --- .name_localized --- .icon --- .talent_id --- .spell_id --- } --- ... --- } --- .pvp_talents = { --- [] = { --- .name_localized --- .icon --- .talent_id --- .spell_id --- } --- ... --- } --- .lku -- last known unit id --- .not_visible --- --- Functions for external use: --- --- lib:Rescan (guid or nil) --- Force a rescan of the given group member GUID, or of all current group members if nil. --- --- lib:QueuedInspections () --- Returns an array of GUIDs of outstanding inspects. --- --- lib:StaleInspections () --- Returns an array of GUIDs for which the data has become stale and is --- awaiting an update (no action required, the refresh happens internally). --- Due to Blizzard exposing no events on (re/un)talent, there will be --- frequent marking of inspect data as being stale. --- --- lib:GetCachedInfo (guid) --- Returns the cached info for the given GUID, if available, nil otherwise. --- Information is cached for current group members only. --- --- lib:GroupUnits () --- Returns an array with the set of unit ids for the current group. ---]] -local MAJOR, MINOR = "LibGroupInSpecT-1.1", 91 - -if not LibStub then - error(MAJOR .. " requires LibStub") -end -local lib = LibStub:NewLibrary(MAJOR, MINOR) -if not lib then - return -end - -lib.events = lib.events or LibStub("CallbackHandler-1.0"):New(lib) -if not lib.events then - error(MAJOR .. " requires CallbackHandler") -end - -local UPDATE_EVENT = "GroupInSpecT_Update" -local REMOVE_EVENT = "GroupInSpecT_Remove" -local INSPECT_READY_EVENT = "GroupInSpecT_InspectReady" -local QUEUE_EVENT = "GroupInSpecT_QueueChanged" - -local COMMS_PREFIX = "LGIST11" -local COMMS_FMT = "1" -local COMMS_DELIM = "\a" - -local INSPECT_DELAY = 1.5 -local INSPECT_TIMEOUT = 10 -- If we get no notification within 10s, give up on unit - -local MAX_ATTEMPTS = 2 - ---[===[@debug@ -lib.debug = false -local function debug (...) - if lib.debug then -- allow programmatic override of debug output by client addons - print (...) - end -end ---@end-debug@]===] - -function lib.events:OnUsed(target, eventname) - if eventname == INSPECT_READY_EVENT then - target.inspect_ready_used = true - end -end - -function lib.events:OnUnused(target, eventname) - if eventname == INSPECT_READY_EVENT then - target.inspect_ready_used = nil - end -end - --- Frame for events -local frame = _G[MAJOR .. "_Frame"] or CreateFrame("Frame", MAJOR .. "_Frame") -lib.frame = frame -frame:Hide() -frame:UnregisterAllEvents() -frame:RegisterEvent("PLAYER_LOGIN") -frame:RegisterEvent("PLAYER_LOGOUT") -if not frame.OnEvent then - frame.OnEvent = function(this, event, ...) - local eventhandler = lib[event] - return eventhandler and eventhandler(lib, ...) - end - frame:SetScript("OnEvent", frame.OnEvent) -end - --- Hide our run-state in an easy-to-dump object -lib.state = { - mainq = {}, - staleq = {}, -- inspect queues - t = 0, - last_inspect = 0, - current_guid = nil, - throttle = 0, - tt = 0, - debounce_send_update = 0 -} -lib.cache = {} -lib.static_cache = {} - --- Note: if we cache NotifyInspect, we have to hook before we cache it! -if not lib.hooked then - hooksecurefunc( - "NotifyInspect", - function(...) - return lib:NotifyInspect(...) - end - ) - lib.hooked = true -end -function lib:NotifyInspect(unit) - self.state.last_inspect = GetTime() -end - --- Get local handles on the key API functions -local CanInspect = _G.CanInspect -local ClearInspectPlayer = _G.ClearInspectPlayer -local GetClassInfo = _G.GetClassInfo -local GetNumSubgroupMembers = _G.GetNumSubgroupMembers -local GetNumSpecializationsForClassID = _G.GetNumSpecializationsForClassID -local GetPlayerInfoByGUID = _G.GetPlayerInfoByGUID -local GetInspectSelectedPvpTalent = _G.C_SpecializationInfo.GetInspectSelectedPvpTalent -local GetInspectSpecialization = _G.GetInspectSpecialization -local GetSpecialization = _G.GetSpecialization -local GetSpecializationInfo = _G.GetSpecializationInfo -local GetSpecializationInfoForClassID = _G.GetSpecializationInfoForClassID -local GetSpecializationRoleByID = _G.GetSpecializationRoleByID -local GetSpellInfo = _G.GetSpellInfo -local GetPvpTalentInfoByID = _G.GetPvpTalentInfoByID -local GetPvpTalentSlotInfo = _G.C_SpecializationInfo.GetPvpTalentSlotInfo -local GetTalentInfo = _G.GetTalentInfo -local GetTalentInfoByID = _G.GetTalentInfoByID -local IsInRaid = _G.IsInRaid ---local NotifyInspect = _G.NotifyInspect -- Don't cache, as to avoid missing future hooks -local GetNumClasses = _G.GetNumClasses -local UnitExists = _G.UnitExists -local UnitGUID = _G.UnitGUID -local UnitInParty = _G.UnitInParty -local UnitInRaid = _G.UnitInRaid -local UnitIsConnected = _G.UnitIsConnected -local UnitIsPlayer = _G.UnitIsPlayer -local UnitIsUnit = _G.UnitIsUnit -local UnitName = _G.UnitName -local SendAddonMessage = _G.C_ChatInfo.SendAddonMessage -local RegisterAddonMessagePrefix = _G.C_ChatInfo.RegisterAddonMessagePrefix - -local MAX_TALENT_TIERS = _G.MAX_TALENT_TIERS -local NUM_TALENT_COLUMNS = _G.NUM_TALENT_COLUMNS -local NUM_PVP_TALENT_SLOTS = 4 - -local global_spec_id_roles_detailed = { - -- Death Knight - [250] = "tank", -- Blood - [251] = "melee", -- Frost - [252] = "melee", -- Unholy - -- Demon Hunter - [577] = "melee", -- Havoc - [581] = "tank", -- Vengeance - -- Druid - [102] = "ranged", -- Balance - [103] = "melee", -- Feral - [104] = "tank", -- Guardian - [105] = "healer", -- Restoration - -- Hunter - [253] = "ranged", -- Beast Mastery - [254] = "ranged", -- Marksmanship - [255] = "melee", -- Survival - -- Mage - [62] = "ranged", -- Arcane - [63] = "ranged", -- Fire - [64] = "ranged", -- Frost - -- Monk - [268] = "tank", -- Brewmaster - [269] = "melee", -- Windwalker - [270] = "healer", -- Mistweaver - -- Paladin - [65] = "healer", -- Holy - [66] = "tank", -- Protection - [70] = "melee", -- Retribution - -- Priest - [256] = "healer", -- Discipline - [257] = "healer", -- Holy - [258] = "ranged", -- Shadow - -- Rogue - [259] = "melee", -- Assassination - [260] = "melee", -- Combat - [261] = "melee", -- Subtlety - -- Shaman - [262] = "ranged", -- Elemental - [263] = "melee", -- Enhancement - [264] = "healer", -- Restoration - -- Warlock - [265] = "ranged", -- Affliction - [266] = "ranged", -- Demonology - [267] = "ranged", -- Destruction - -- Warrior - [71] = "melee", -- Arms - [72] = "melee", -- Fury - [73] = "tank" -- Protection -} - -local class_fixed_roles = { - HUNTER = "DAMAGER", - MAGE = "DAMAGER", - ROGUE = "DAMAGER", - WARLOCK = "DAMAGER" -} - -local class_fixed_roles_detailed = { - MAGE = "ranged", - ROGUE = "melee", - WARLOCK = "ranged" -} - --- Inspects only work after being fully logged in, so track that -function lib:PLAYER_LOGIN() - self.state.logged_in = true - - self:CacheGameData() - - frame:RegisterEvent("INSPECT_READY") - frame:RegisterEvent("GROUP_ROSTER_UPDATE") - frame:RegisterEvent("PLAYER_ENTERING_WORLD") - frame:RegisterEvent("UNIT_LEVEL") - frame:RegisterEvent("PLAYER_TALENT_UPDATE") - frame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - frame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") - frame:RegisterEvent("UNIT_NAME_UPDATE") - frame:RegisterEvent("UNIT_AURA") - frame:RegisterEvent("CHAT_MSG_ADDON") - RegisterAddonMessagePrefix(COMMS_PREFIX) - - local guid = UnitGUID("player") - local info = self:BuildInfo("player") - self.events:Fire(UPDATE_EVENT, guid, "player", info) -end - -function lib:PLAYER_LOGOUT() - self.state.logged_in = false -end - --- Simple timer -do - lib.state.t = 0 - if not frame.OnUpdate then -- ticket #4 if the OnUpdate code every changes we should stop borrowing the existing handler - frame.OnUpdate = function(this, elapsed) - lib.state.t = lib.state.t + elapsed - lib.state.tt = lib.state.tt + elapsed - if lib.state.t > INSPECT_DELAY then - lib:ProcessQueues() - lib.state.t = 0 - end - -- Unthrottle, essentially allowing 1 msg every 3 seconds, but with substantial burst capacity - if lib.state.tt > 3 and lib.state.throttle > 0 then - lib.state.throttle = lib.state.throttle - 1 - lib.state.tt = 0 - end - if lib.state.debounce_send_update > 0 then - local debounce = lib.state.debounce_send_update - elapsed - lib.state.debounce_send_update = debounce - if debounce <= 0 then - lib:SendLatestSpecData() - end - end - end - frame:SetScript("OnUpdate", frame.OnUpdate) -- this is good regardless of the handler check above because otherwise a new anonymous function is created every time the OnUpdate code runs - end -end - --- Internal library functions - --- Caches to deal with API shortcomings as well as performance -lib.static_cache.global_specs = {} -- [gspec] -> { .idx, .name_localized, .description, .icon, .background, .role } -lib.static_cache.class_to_class_id = {} -- [CLASS] -> class_id - --- The talents cache can no longer be pre-fetched on login, but is now constructed class-by-class as we inspect people. --- This probably means we want to only ever access it through the GetCachedTalentInfo() helper function below. -lib.static_cache.talents = {} -- [talent_id] -> { .spell_id, .talent_id, .name_localized, .icon, .tier, .column } -lib.static_cache.pvp_talents = {} -- [talent_id] -> { .spell_id, .talent_id, .name_localized, .icon } - -function lib:GetCachedTalentInfo(class_id, tier, col, group, is_inspect, unit) - local talent_id, name, icon, sel, _, spell_id = GetTalentInfo(tier, col, group, is_inspect, unit) - if not talent_id then - --[===[@debug@ - debug ("GetCachedTalentInfo("..tostring(class_id)..","..tier..","..col..","..group..","..tostring(is_inspect)..","..tostring(unit)..") returned nil") --@end-debug@]===] - return {} - end - local class_talents = self.static_cache.talents - if not class_talents[talent_id] then - class_talents[talent_id] = { - spell_id = spell_id, - talent_id = talent_id, - name_localized = name, - icon = icon, - tier = tier, - column = col - } - end - return class_talents[talent_id], sel -end - -function lib:GetCachedTalentInfoByID(talent_id) - local class_talents = self.static_cache.talents - if talent_id and not class_talents[talent_id] then - local _, name, icon, _, _, spell_id, _, row, col = GetTalentInfoByID(talent_id) - if not name then - --[===[@debug@ - debug ("GetCachedTalentInfoByID("..tostring(talent_id)..") returned nil") --@end-debug@]===] - return nil - end - class_talents[talent_id] = { - spell_id = spell_id, - talent_id = talent_id, - name_localized = name, - icon = icon, - tier = row, - column = col - } - end - return class_talents[talent_id] -end - -function lib:GetCachedPvpTalentInfoByID(talent_id) - local pvp_talents = self.static_cache.pvp_talents - if talent_id and not pvp_talents[talent_id] then - local _, name, icon, _, _, spell_id = GetPvpTalentInfoByID(talent_id) - if not name then - --[===[@debug@ - debug ("GetCachedPvpTalentInfo("..tostring(talent_id)..") returned nil") --@end-debug@]===] - return nil - end - pvp_talents[talent_id] = { - spell_id = spell_id, - talent_id = talent_id, - name_localized = name, - icon = icon - } - end - return pvp_talents[talent_id] -end - -function lib:CacheGameData() - local gspecs = self.static_cache.global_specs - gspecs[0] = {} -- Handle no-specialization case - for class_id = 1, GetNumClasses() do - for idx = 1, GetNumSpecializationsForClassID(class_id) do - local gspec_id, name, description, icon, background = GetSpecializationInfoForClassID(class_id, idx) - gspecs[gspec_id] = {} - local gspec = gspecs[gspec_id] - gspec.idx = idx - gspec.name_localized = name - gspec.description = description - gspec.icon = icon - gspec.background = background - gspec.role = GetSpecializationRoleByID(gspec_id) - end - - local _, class = GetClassInfo(class_id) - self.static_cache.class_to_class_id[class] = class_id - end -end - -function lib:GuidToUnit(guid) - local info = self.cache[guid] - if info and info.lku and UnitGUID(info.lku) == guid then - return info.lku - end - - for i, unit in ipairs(self:GroupUnits()) do - if UnitExists(unit) and UnitGUID(unit) == guid then - if info then - info.lku = unit - end - return unit - end - end -end - -function lib:Query(unit) - if not UnitIsPlayer(unit) then - return - end -- NPC - - if UnitIsUnit(unit, "player") then - self.events:Fire(UPDATE_EVENT, UnitGUID("player"), "player", self:BuildInfo("player")) - return - end - - local mainq, staleq = self.state.mainq, self.state.staleq - - local guid = UnitGUID(unit) - if not mainq[guid] then - mainq[guid] = 1 - staleq[guid] = nil - self.frame:Show() -- Start timer if not already running - self.events:Fire(QUEUE_EVENT) - end -end - -function lib:Refresh(unit) - local guid = UnitGUID(unit) - if not guid then - return - end - --[===[@debug@ - debug ("Refreshing "..unit) --@end-debug@]===] - if not self.state.mainq[guid] then - self.state.staleq[guid] = 1 - self.frame:Show() - self.events:Fire(QUEUE_EVENT) - end -end - -function lib:ProcessQueues() - if not self.state.logged_in then - return - end - if InCombatLockdown() then - return - end -- Never inspect while in combat - if UnitIsDead("player") then - return - end -- You can't inspect while dead, so don't even try - if InspectFrame and InspectFrame:IsShown() then - return - end -- Don't mess with the UI's inspections - - local mainq = self.state.mainq - local staleq = self.state.staleq - - if not next(mainq) and next(staleq) then - --[===[@debug@ - debug ("Main queue empty, swapping main and stale queues") --@end-debug@]===] - self.state.mainq, self.state.staleq = self.state.staleq, self.state.mainq - mainq, staleq = staleq, mainq - end - - if (self.state.last_inspect + INSPECT_TIMEOUT) < GetTime() then - -- If there was an inspect going, it's timed out, so either retry or move it to stale queue - local guid = self.state.current_guid - if guid then - --[===[@debug@ - debug ("Inspect timed out for "..guid) --@end-debug@]===] - - local count = mainq and mainq[guid] or (MAX_ATTEMPTS + 1) - if not self:GuidToUnit(guid) then - --[===[@debug@ - debug ("No longer applicable, removing from queues") --@end-debug@]===] - mainq[guid], staleq[guid] = nil, nil - elseif count > MAX_ATTEMPTS then - --[===[@debug@ - debug ("Excessive retries, moving to stale queue") --@end-debug@]===] - mainq[guid], staleq[guid] = nil, 1 - else - mainq[guid] = count + 1 - end - self.state.current_guid = nil - end - end - - if self.state.current_guid then - return - end -- Still waiting on our inspect data - - for guid, count in pairs(mainq) do - local unit = self:GuidToUnit(guid) - if not unit then - --[===[@debug@ - debug ("No longer applicable, removing from queues") --@end-debug@]===] - mainq[guid], staleq[guid] = nil, nil - elseif not CanInspect(unit) or not UnitIsConnected(unit) then - --[===[@debug@ - debug ("Cannot inspect "..unit..", aka "..(UnitName(unit) or "nil")..", moving to stale queue") --@end-debug@]===] - mainq[guid], staleq[guid] = nil, 1 - else - --[===[@debug@ - debug ("Inspecting "..unit..", aka "..(UnitName(unit) or "nil")) --@end-debug@]===] - mainq[guid] = count + 1 - self.state.current_guid = guid - NotifyInspect(unit) - break - end - end - - if not next(mainq) and not next(staleq) and self.state.throttle == 0 and self.state.debounce_send_update <= 0 then - frame:Hide() -- Cancel timer, nothing queued and no unthrottling to be done - end - self.events:Fire(QUEUE_EVENT) -end - -function lib:UpdatePlayerInfo(guid, unit, info) - info.class_localized, info.class, info.race_localized, info.race, info.gender, info.name, info.realm = GetPlayerInfoByGUID(guid) - local class = info.class - if info.realm and info.realm == "" then - info.realm = nil - end - info.class_id = class and self.static_cache.class_to_class_id[class] - if not info.spec_role then - info.spec_role = class and class_fixed_roles[class] - end - if not info.spec_role_detailed then - info.spec_role_detailed = class and class_fixed_roles_detailed[class] - end - info.lku = unit -end - -function lib:BuildInfo(unit) - local guid = UnitGUID(unit) - if not guid then - return - end - - local cache = self.cache - local info = cache[guid] or {} - cache[guid] = info - info.guid = guid - - self:UpdatePlayerInfo(guid, unit, info) - -- On a cold login, GetPlayerInfoByGUID() doesn't seem to be usable, so mark as stale - local class = info.class - if not class and not self.state.mainq[guid] then - self.state.staleq[guid] = 1 - self.frame:Show() - self.events:Fire(QUEUE_EVENT) - end - - local is_inspect = not UnitIsUnit(unit, "player") - local spec = GetSpecialization() - local gspec_id = is_inspect and GetInspectSpecialization(unit) or spec and GetSpecializationInfo(spec) - - local gspecs = self.static_cache.global_specs - if not gspec_id or not gspecs[gspec_id] then -- not a valid spec_id - info.global_spec_id = nil - else - info.global_spec_id = gspec_id - local spec_info = gspecs[gspec_id] - info.spec_index = spec_info.idx - info.spec_name_localized = spec_info.name_localized - info.spec_description = spec_info.description - info.spec_icon = spec_info.icon - info.spec_background = spec_info.background - info.spec_role = spec_info.role - info.spec_role_detailed = global_spec_id_roles_detailed[gspec_id] - end - - if not info.spec_role then - info.spec_role = class and class_fixed_roles[class] - end - if not info.spec_role_detailed then - info.spec_role_detailed = class and class_fixed_roles_detailed[class] - end - - info.talents = info.talents or {} - info.pvp_talents = info.pvp_talents or {} - - -- Only scan talents when we have player data - if info.spec_index then - info.spec_group = GetActiveSpecGroup(is_inspect) - wipe(info.talents) - for tier = 1, MAX_TALENT_TIERS do - for col = 1, NUM_TALENT_COLUMNS do - local talent, sel = self:GetCachedTalentInfo(info.class_id, tier, col, info.spec_group, is_inspect, unit) - if sel then - info.talents[talent.talent_id] = talent - end - end - end - - wipe(info.pvp_talents) - if is_inspect then - for index = 1, NUM_PVP_TALENT_SLOTS do - local talent_id = GetInspectSelectedPvpTalent(unit, index) - if talent_id then - info.pvp_talents[talent_id] = self:GetCachedPvpTalentInfoByID(talent_id) - end - end - else - -- C_SpecializationInfo.GetAllSelectedPvpTalentIDs will sometimes return a lot of extra talents - for index = 1, NUM_PVP_TALENT_SLOTS do - local slot_info = GetPvpTalentSlotInfo(index) - local talent_id = slot_info and slot_info.selectedTalentID - if talent_id then - info.pvp_talents[talent_id] = self:GetCachedPvpTalentInfoByID(talent_id) - end - end - end - end - - info.glyphs = info.glyphs or {} -- kept for addons that still refer to this - - if is_inspect and not UnitIsVisible(unit) and UnitIsConnected(unit) then - info.not_visible = true - end - - return info -end - -function lib:INSPECT_READY(guid) - local unit = self:GuidToUnit(guid) - local finalize = false - if unit then - if guid == self.state.current_guid then - self.state.current_guid = nil -- Got what we asked for - finalize = true - --[===[@debug@ - debug ("Got inspection data for requested guid "..guid) --@end-debug@]===] - end - - local mainq, staleq = self.state.mainq, self.state.staleq - mainq[guid], staleq[guid] = nil, nil - - local gspec_id = GetInspectSpecialization(unit) - if not self.static_cache.global_specs[gspec_id] then -- Bah, got garbage, flag as stale and try again - staleq[guid] = 1 - return - end - - self.events:Fire(UPDATE_EVENT, guid, unit, self:BuildInfo(unit)) - self.events:Fire(INSPECT_READY_EVENT, guid, unit) - end - if finalize then - ClearInspectPlayer() - end - self.events:Fire(QUEUE_EVENT) -end - -function lib:PLAYER_ENTERING_WORLD() - if self.commScope == "INSTANCE_CHAT" then - -- Handle moving directly from one LFG to another - self.commScope = nil - self:UpdateCommScope() - end -end - --- Group handling parts - -local members = {} -function lib:GROUP_ROSTER_UPDATE() - local group = self.cache - local units = self:GroupUnits() - -- Find new members - for i, unit in ipairs(self:GroupUnits()) do - local guid = UnitGUID(unit) - if guid then - members[guid] = true - if not group[guid] then - self:Query(unit) - -- Update with what we have so far (guid, unit, name/class/race?) - self.events:Fire(UPDATE_EVENT, guid, unit, self:BuildInfo(unit)) - end - end - end - -- Find removed members - for guid in pairs(group) do - if not members[guid] then - group[guid] = nil - self.events:Fire(REMOVE_EVENT, guid, nil) - end - end - wipe(members) - self:UpdateCommScope() -end - -function lib:DoPlayerUpdate() - self:Query("player") - self.state.debounce_send_update = 2.5 -- Hold off 2.5sec before sending update - self.frame:Show() -end - -function lib:SendLatestSpecData() - local scope = self.commScope - if not scope then - return - end - - local guid = UnitGUID("player") - local info = self.cache[guid] - if not info then - return - end - - -- fmt, guid, global_spec_id, talent1 -> MAX_TALENT_TIERS, pvptalent1 -> NUM_PVP_TALENT_SLOTS - -- sequentially, allow no gaps for missing talents we decode by index on the receiving end. - local datastr = COMMS_FMT .. COMMS_DELIM .. guid .. COMMS_DELIM .. (info.global_spec_id or 0) - local talentCount = 1 - for k in pairs(info.talents) do - datastr = datastr .. COMMS_DELIM .. k - talentCount = talentCount + 1 - end - for i = talentCount, MAX_TALENT_TIERS do - datastr = datastr .. COMMS_DELIM .. 0 - end - talentCount = 1 - for k in pairs(info.pvp_talents) do - datastr = datastr .. COMMS_DELIM .. k - talentCount = talentCount + 1 - end - for i = talentCount, NUM_PVP_TALENT_SLOTS do - datastr = datastr .. COMMS_DELIM .. 0 - end - - --[===[@debug@ - debug ("Sending LGIST update to "..scope) --@end-debug@]===] - SendAddonMessage(COMMS_PREFIX, datastr, scope) -end - -function lib:UpdateCommScope() - local scope = (IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT") or (IsInRaid() and "RAID") or (IsInGroup(LE_PARTY_CATEGORY_HOME) and "PARTY") - if self.commScope ~= scope then - self.commScope = scope - self:DoPlayerUpdate() - end -end - --- Indicies for various parts of the split data msg -local msg_idx = {} -msg_idx.fmt = 1 -msg_idx.guid = msg_idx.fmt + 1 -msg_idx.global_spec_id = msg_idx.guid + 1 -msg_idx.talents = msg_idx.global_spec_id + 1 -msg_idx.end_talents = msg_idx.talents + MAX_TALENT_TIERS -msg_idx.pvp_talents = msg_idx.end_talents + 1 -msg_idx.end_pvp_talents = msg_idx.pvp_talents + NUM_PVP_TALENT_SLOTS - 1 - -function lib:CHAT_MSG_ADDON(prefix, datastr, scope, sender) - if prefix ~= COMMS_PREFIX or scope ~= self.commScope then - return - end - --[===[@debug@ - debug ("Incoming LGIST update from "..(scope or "nil").."/"..(sender or "nil")..": "..(datastr:gsub(COMMS_DELIM,";") or "nil")) --@end-debug@]===] - - local data = {strsplit(COMMS_DELIM, datastr)} - local fmt = data[msg_idx.fmt] - if fmt ~= COMMS_FMT then - return - end -- Unknown format, ignore - - local guid = data[msg_idx.guid] - - local senderguid = UnitGUID(sender) - if senderguid and senderguid ~= guid then - return - end - - local info = guid and self.cache[guid] - if not info then - return - end -- Never allow random message to create new group member entries! - - local unit = self:GuidToUnit(guid) - if not unit then - return - end - if UnitIsUnit(unit, "player") then - return - end -- we're already up-to-date, comment out for solo debugging - - self.state.throttle = self.state.throttle + 1 - self.frame:Show() -- Ensure we're unthrottling - if self.state.throttle > 40 then - return - end -- If we ever hit this, someone's being "funny" - - info.class_localized, info.class, info.race_localized, info.race, info.gender, info.name, info.realm = GetPlayerInfoByGUID(guid) - if info.realm and info.realm == "" then - info.realm = nil - end - info.class_id = self.static_cache.class_to_class_id[info.class] - - local gspecs = self.static_cache.global_specs - - local gspec_id = data[msg_idx.global_spec_id] and tonumber(data[msg_idx.global_spec_id]) - if not gspec_id or not gspecs[gspec_id] then - return - end -- Malformed message, avoid throwing errors by using this nil - - info.global_spec_id = gspec_id - info.spec_index = gspecs[gspec_id].idx - info.spec_name_localized = gspecs[gspec_id].name_localized - info.spec_description = gspecs[gspec_id].description - info.spec_icon = gspecs[gspec_id].icon - info.spec_background = gspecs[gspec_id].background - info.spec_role = gspecs[gspec_id].role - info.spec_role_detailed = global_spec_id_roles_detailed[gspec_id] - - local need_inspect = nil -- shouldn't be needed, but just in case - info.talents = wipe(info.talents or {}) - for i = msg_idx.talents, msg_idx.end_talents do - local talent_id = tonumber(data[i]) or 0 - if talent_id > 0 then - local talent = self:GetCachedTalentInfoByID(talent_id) - if talent then - info.talents[talent_id] = talent - else - need_inspect = 1 - end - end - end - - info.pvp_talents = wipe(info.pvp_talents or {}) - for i = msg_idx.pvp_talents, msg_idx.end_pvp_talents do - local talent_id = tonumber(data[i]) or 0 - if talent_id > 0 then - local talent = self:GetCachedPvpTalentInfoByID(talent_id) - if talent then - info.pvp_talents[talent_id] = talent - else - need_inspect = 1 - end - end - end - - info.glyphs = info.glyphs or {} -- kept for addons that still refer to this - - local mainq, staleq = self.state.mainq, self.state.staleq - local want_inspect = not need_inspect and self.inspect_ready_used and (mainq[guid] or staleq[guid]) and 1 or nil - mainq[guid], staleq[guid] = need_inspect, want_inspect - if need_inspect or want_inspect then - self.frame:Show() - end - - --[===[@debug@ - debug ("Firing LGIST update event for unit "..unit..", GUID "..guid..", inspect "..tostring(not not need_inspect)) --@end-debug@]===] - self.events:Fire(UPDATE_EVENT, guid, unit, info) - self.events:Fire(QUEUE_EVENT) -end - -function lib:UNIT_LEVEL(unit) - if UnitInRaid(unit) or UnitInParty(unit) then - self:Refresh(unit) - end - if UnitIsUnit(unit, "player") then - self:DoPlayerUpdate() - end -end - -function lib:PLAYER_TALENT_UPDATE() - self:DoPlayerUpdate() -end - -function lib:PLAYER_SPECIALIZATION_CHANGED(unit) - -- This event seems to fire a lot, and for no particular reason *sigh* - -- if UnitInRaid (unit) or UnitInParty (unit) then - -- self:Refresh (unit) - -- end - if unit and UnitIsUnit(unit, "player") then - self:DoPlayerUpdate() - end -end - -function lib:UNIT_NAME_UPDATE(unit) - local group = self.cache - local guid = UnitGUID(unit) - local info = guid and group[guid] - if info then - self:UpdatePlayerInfo(guid, unit, info) - if info.name ~= UNKNOWN then - self.events:Fire(UPDATE_EVENT, guid, unit, info) - end - end -end - --- Always get a UNIT_AURA when a unit's UnitIsVisible() changes -function lib:UNIT_AURA(unit) - local group = self.cache - local guid = UnitGUID(unit) - local info = guid and group[guid] - if info then - if not UnitIsUnit(unit, "player") then - if UnitIsVisible(unit) then - if info.not_visible then - info.not_visible = nil - --[===[@debug@ - debug (unit..", aka "..(UnitName(unit) or "nil")..", is now visible") --@end-debug@]===] - if not self.state.mainq[guid] then - self.state.staleq[guid] = 1 - self.frame:Show() - self.events:Fire(QUEUE_EVENT) - end - end - elseif UnitIsConnected(unit) then - --[===[@debug@ - if not info.not_visible then - debug (unit..", aka "..(UnitName(unit) or "nil")..", is no longer visible") - end - --@end-debug@]===] - info.not_visible = true - end - end - end -end - -function lib:UNIT_SPELLCAST_SUCCEEDED(unit, _, spell_id) - if spell_id == 200749 then -- Activating Specialization - self:Query(unit) -- Definitely changed, so high prio refresh - end -end - --- External library functions - -function lib:QueuedInspections() - local q = {} - for guid in pairs(self.state.mainq) do - table.insert(q, guid) - end - return q -end - -function lib:StaleInspections() - local q = {} - for guid in pairs(self.state.staleq) do - table.insert(q, guid) - end - return q -end - -function lib:IsInspectQueued(guid) - return guid and ((self.state.mainq[guid] or self.state.staleq[guid]) and true) -end - -function lib:GetCachedInfo(guid) - local group = self.cache - return guid and group[guid] -end - -function lib:Rescan(guid) - local mainq, staleq = self.state.mainq, self.state.staleq - if guid then - local unit = self:GuidToUnit(guid) - if unit then - if UnitIsUnit(unit, "player") then - self.events:Fire(UPDATE_EVENT, guid, "player", self:BuildInfo("player")) - elseif not mainq[guid] then - staleq[guid] = 1 - end - end - else - for i, unit in ipairs(self:GroupUnits()) do - if UnitExists(unit) then - if UnitIsUnit(unit, "player") then - self.events:Fire(UPDATE_EVENT, UnitGUID("player"), "player", self:BuildInfo("player")) - else - local guid = UnitGUID(unit) - if guid and not mainq[guid] then - staleq[guid] = 1 - end - end - end - end - end - self.frame:Show() -- Start timer if not already running - - -- Evict any stale entries - self:GROUP_ROSTER_UPDATE() - self.events:Fire(QUEUE_EVENT) -end - -local unitstrings = { - raid = {"player"}, -- This seems to be needed under certain circumstances. Odd. - party = {"player"}, -- Player not part of partyN - player = {"player"} -} -for i = 1, 40 do - table.insert(unitstrings.raid, "raid" .. i) -end -for i = 1, 4 do - table.insert(unitstrings.party, "party" .. i) -end - --- Returns an array with the set of unit ids for the current group -function lib:GroupUnits() - local units - if IsInRaid() then - units = unitstrings.raid - elseif GetNumSubgroupMembers() > 0 then - units = unitstrings.party - else - units = unitstrings.player - end - return units -end - --- If demand-loaded, we need to synthesize a login event -if IsLoggedIn() then - lib:PLAYER_LOGIN() -end diff --git a/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.toc b/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.toc deleted file mode 100644 index cfc0476d89..0000000000 --- a/Libs/LibGroupInSpecT-1.1/LibGroupInSpecT-1.1.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 80300 -## Title: Lib: GroupInSpecT-1.1 -## Notes: Keeps track of group members and keeps an up-to-date cache of their specialization and talents. -## Version: 1.4.0 -## Author: Anyia of HordeYakka (Jubei'Thos) -## X-Category: Library - -embeds.xml -lib.xml diff --git a/Libs/LibGroupInSpecT-1.1/lib.xml b/Libs/LibGroupInSpecT-1.1/lib.xml deleted file mode 100644 index f1138e686a..0000000000 --- a/Libs/LibGroupInSpecT-1.1/lib.xml +++ /dev/null @@ -1,6 +0,0 @@ - - -