From 67f859f64d54d82993f0a85f37b2b7070f799396 Mon Sep 17 00:00:00 2001 From: "Ashley (CuteOne)" Date: Sun, 26 May 2024 00:38:41 -0400 Subject: [PATCH] System - Fixes --- Rotations/Hunter/Support/PetCuteOne.lua | 35 +++++++++---------------- System/API/Equiped.lua | 15 ++++++----- System/Functions/Cast.lua | 8 +++--- System/Lists/Items.lua | 1 + 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/Rotations/Hunter/Support/PetCuteOne.lua b/Rotations/Hunter/Support/PetCuteOne.lua index 431077f59..39d7dbd61 100644 --- a/Rotations/Hunter/Support/PetCuteOne.lua +++ b/Rotations/Hunter/Support/PetCuteOne.lua @@ -15,6 +15,7 @@ local units local var local currentTarget local fetching = false +local lootCount local paused = false local pausekey = false local petAppearTimer = br._G.GetTime() @@ -85,16 +86,6 @@ br.rotations.support["PetCuteOne"] = { return petMode end - local function getLootableCount() - local count = 0 - for k, v in pairs(br.lootable) do - if br.lootable[k] ~= nil and unit.distance(br.lootable[k]) > 8 then - count = count + 1 - end - end - return count - end - --Set Pause Key if br.player.ui.toggle("Pause Mode") or br.player.ui.value("Pause Mode") == 6 then pausekey = br._G.IsLeftAltKeyDown() @@ -157,6 +148,9 @@ br.rotations.support["PetCuteOne"] = { enemies.get(40, "pet") enemies.yards40r = enemies.rect.get(10, 40, false) + -- Loot Count + lootCount = br.lootManager:lootCount() + -- Pet Target Modes if br.petTarget == nil then br.petTarget = "target" end if br.petTarget ~= "target" and (not unit.exists(br.petTarget) or unit.deadOrGhost(br.petTarget) or (unit.exists("pettarget") and not unit.isUnit("pettarget", br.petTarget))) then @@ -251,7 +245,7 @@ br.rotations.support["PetCuteOne"] = { ui.debug("[Pet] Pet is now Defending") br._G.PetDefensiveAssistMode() elseif petMode ~= "Passive" and ((not unit.inCombat() and #enemies.yards20pnc == 0 and not unit.valid(br.petTarget)) or var.haltPetProfile) - and (not spell.fetch.known() or getLootableCount() == 0) + and (not spell.fetch.known() or lootCount == 0) then ui.debug("[Pet] Pet is now Passive") br._G.PetPassiveMode() @@ -692,18 +686,15 @@ br.rotations.support["PetCuteOne"] = { if ui.checked("Fetch") and not unit.inCombat() and not unit.inCombat("pet") and cast.able.fetch("pet") and not cast.current.fetch("pet") and petExists and not br.deadPet and cast.timeSinceLast.fetch() > unit.gcd(true) * 2 and not buff.playDead.exists("pet") then - local lootCount = getLootableCount() or 0 - if fetching and ( --[[fetchCount ~= lootCount or]] lootCount == 0) then fetching = false end + if fetching and (lootCount == 0) then fetching = false end if not fetching then - for k, _ in pairs(br.lootable) do - if br.lootable[k] ~= nil then - local thisDistance = unit.distance(k) - if thisDistance > 8 and thisDistance < 40 then - if cast.fetch("pet") then - fetching = true - ui.debug("[Pet] Cast Fetch") - break - end + for _, v in pairs(br.lootable) do + local thisDistance = unit.distance(v.unit) + if thisDistance > 8 and thisDistance < 40 then + if cast.fetch("pet") then + fetching = true + ui.debug("[Pet] Cast Fetch") + break end end end diff --git a/System/API/Equiped.lua b/System/API/Equiped.lua index 474997941..e831e80d7 100644 --- a/System/API/Equiped.lua +++ b/System/API/Equiped.lua @@ -7,7 +7,7 @@ local _, br = ... if br.api == nil then br.api = {} end -br.api.equiped = function(self,item,id) +br.api.equiped = function(self, item, id) if self[item] == nil then self[item] = {} end local equiped = self @@ -19,7 +19,7 @@ br.api.equiped = function(self,item,id) if slotID == nil then return br.hasEquiped(id) else - return br.hasEquiped(id,slotID) + return br.hasEquiped(id, slotID) end end @@ -31,11 +31,11 @@ br.api.equiped = function(self,item,id) -- @return boolean value indicating whether the item with specific ID is equipped in the specified slot (if provided) -- @usage equipes.item(12345) -- will return true if item with ID 12345 is equipped anywhere -- @usage equipes.item(12345, 1) -- will return true if item with ID 12345 is equipped in slot 1 - equiped.item = function(itemID,slotID) + equiped.item = function(itemID, slotID) if slotID == nil then return br.hasEquiped(itemID) else - return br.hasEquiped(itemID,slotID) + return br.hasEquiped(itemID, slotID) end end @@ -53,8 +53,9 @@ br.api.equiped = function(self,item,id) -- @function equiped.tier -- @param tierLevel string|number The tier level to check for. (e.g. "T20" or 20) -- @treturn number - equiped.tier = function(tierLevel,numEquiped) - if type(tierLevel) == "number" then tierLevel = "T"..tierLevel end + equiped.tier = function(tierLevel, numEquiped) + if type(tierLevel) == "number" then tierLevel = "T" .. tierLevel end + if numEquiped == nil then return br.TierScan(tierLevel) end return br.TierScan(tierLevel) >= numEquiped end @@ -69,4 +70,4 @@ br.api.equiped = function(self,item,id) return IsEquippedItemType(itemType) end end -end \ No newline at end of file +end diff --git a/System/Functions/Cast.lua b/System/Functions/Cast.lua index 51fbacb2b..41105c131 100644 --- a/System/Functions/Cast.lua +++ b/System/Functions/Cast.lua @@ -724,7 +724,7 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, -- Talent Check local function hasTalent(spellID) for k, v in pairs(br.player.spells.talents) do - if spellID == v then return br.player.talent[k] end + if spellID == v then return br.player.talent[k] or br.isKnown(spellID) end end return true end @@ -741,8 +741,10 @@ function br.createCastFunction(thisUnit, castType, minUnits, effectRng, spellID, 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() - - (br.getGlobalCD(true) + (select(3, br._G.GetNetStats()) / 100)) end + if br.lastCastTable.castTime[spellID] == nil then + br.lastCastTable.castTime[spellID] = br._G.GetTime() - + (br.getGlobalCD(true) + (select(3, br._G.GetNetStats()) / 100)) + end if ((baseSpellID == spellID or overrideSpellID == spellID) and (br.empowerID == nil or br.empowerID == 0) and (br._G.GetTime() - br.lastCastTable.castTime[spellID] > br.getGlobalCD(true) + (select(3, br._G.GetNetStats()) / 100)) --br.getGlobalCD(true)) -- Double Casting Check and ((thisUnit ~= nil and not br._G.UnitIsUnit(thisUnit, "player") and not br._G.UnitIsFriend(thisUnit, "player") diff --git a/System/Lists/Items.lua b/System/Lists/Items.lua index 4e68a116c..4c74fedb5 100644 --- a/System/Lists/Items.lua +++ b/System/Lists/Items.lua @@ -197,6 +197,7 @@ br.lists.items = { --- Dragonflight Items Below --- algetharPuzzleBox = 193701, ashesOfTheEmbersoul = 207167, + beaconToTheBeyond = 203963, elementalPotionOfUltimatePower = 191383, integratedPrimalFire = 200868, irideusFragment = 193743,