Add boe filter

This commit is contained in:
M. David
2022-08-23 18:32:11 +02:00
parent b23ed6cd31
commit b48cb28cb5
2 changed files with 39 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -71,6 +71,13 @@ local function getItemIcon(slot)
if (itemLink == nil) then return nil end
return select(10, GetItemInfo(itemLink))
end
local function getBindType(slot)
aura_env.debugLog("getBindType " .. tostring(slot))
if (slot == nil) then return nil end
local itemLink = getItemLink(slot)
if (itemLink == nil) then return nil end
return select(14, GetItemInfo(itemLink)) or 0
end
local doLoot = function(slot)
@@ -250,7 +257,7 @@ local classGearFilter = {
qualityThreshold = 2,
filter = function(self, slot)
if (self.enabled) then
aura_env.debugLog("Class gear filter; slot: " .. tostring(slot))
aura_env.debugLog("BoE filter; slot: " .. tostring(slot))
local itemType = getItemType(slot)
local itemEquipLoc = getItemEquipLocation(slot)
if (itemType == "Armor"
@@ -349,6 +356,34 @@ local bloodOfSargerasFilter = {
end
end
}
local boeFilter = {
enabled = true,
ilvlThreshold = 800,
qualityThreshold = 1,
filter = function(self, slot)
if (self.enabled) then
aura_env.debugLog("BoE filter; slot: " .. tostring(slot))
local itemType = getItemType(slot)
local itemEquipLoc = getItemEquipLocation(slot)
if (itemType == "Armor"
or itemType == "Weapon"
or itemEquipLoc == "INVTYPE_FINGER"
or itemEquipLoc == "INVTYPE_TRINKET"
or itemEquipLoc == "INVTYPE_CLOAK"
or itemEquipLoc == "INVTYPE_NECK") then
local itemLevel = getItemLevel(slot)
local itemQuality = getItemQuality(slot)
local bindType = getBindType(slot)
if (itemLevel and itemQuality and bindType and itemLevel > self.ilvlThreshold and itemQuality > self.qualityThreshold and bindType == 1) then
aura_env.debugLog("BoE filter pass")
return true
end
end
aura_env.debugLog("BoE filter fais " .. tostring(itemType) .. " " .. tostring(itemEquipLoc))
end
end
}
aura_env.filterService = {
filters = {
@@ -365,7 +400,8 @@ aura_env.filterService = {
arguniteFilter,
ancientManaFilter,
reicpeFilter,
bloodOfSargerasFilter
bloodOfSargerasFilter,
boeFilter
},
slotsToLoot = {},
run = function(self, lootInfo)