mirror of
https://github.com/parnic/breakables.git
synced 2025-06-17 01:41:51 -05:00
Add detection of profession gear
This commit is contained in:
@ -199,6 +199,7 @@ local OreCombineItems = {
|
|||||||
|
|
||||||
local DisenchantId = 13262
|
local DisenchantId = 13262
|
||||||
local DisenchantTypes = {babbleInv["Armor"], babbleInv["Weapon"]}
|
local DisenchantTypes = {babbleInv["Armor"], babbleInv["Weapon"]}
|
||||||
|
local DisenchantEquipSlots = {"INVTYPE_PROFESSION_GEAR"}
|
||||||
local CanDisenchant = false
|
local CanDisenchant = false
|
||||||
local EnchantingProfessionId = 333
|
local EnchantingProfessionId = 333
|
||||||
|
|
||||||
@ -274,6 +275,7 @@ local IDX_BREAKABLETYPE = 9
|
|||||||
local IDX_SOULBOUND = 10
|
local IDX_SOULBOUND = 10
|
||||||
local IDX_NAME = 11
|
local IDX_NAME = 11
|
||||||
local IDX_RARITY = 12
|
local IDX_RARITY = 12
|
||||||
|
local IDX_EQUIPSLOT = 13
|
||||||
|
|
||||||
local BREAKABLE_HERB = 1
|
local BREAKABLE_HERB = 1
|
||||||
local BREAKABLE_ORE = 2
|
local BREAKABLE_ORE = 2
|
||||||
@ -1193,7 +1195,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (foundBreakables[i][IDX_BREAKABLETYPE] == self.buttonFrame[j].type or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_COMBINE and foundBreakables[i][IDX_COUNT] >= 10)) and numBreakableStacks[j] < self.settings.maxBreakablesToShow then
|
if (foundBreakables[i][IDX_BREAKABLETYPE] == self.buttonFrame[j].type or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_COMBINE and foundBreakables[i][IDX_COUNT] >= 10)) and numBreakableStacks[j] < self.settings.maxBreakablesToShow then
|
||||||
local isDisenchantable = self:BreakableIsDisenchantable(foundBreakables[i][IDX_TYPE], foundBreakables[i][IDX_LEVEL], foundBreakables[i][IDX_RARITY], foundBreakables[i][IDX_LINK])
|
local isDisenchantable = self:BreakableIsDisenchantable(foundBreakables[i][IDX_TYPE], foundBreakables[i][IDX_LEVEL], foundBreakables[i][IDX_RARITY], foundBreakables[i][IDX_LINK], nil, foundBreakables[i][IDX_EQUIPSLOT])
|
||||||
local isLockedItem = foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_PICK
|
local isLockedItem = foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_PICK
|
||||||
|
|
||||||
if (CanDisenchant and isDisenchantable) or (CanPickLock and isLockedItem) or (foundBreakables[i][IDX_COUNT] >= 5) then
|
if (CanDisenchant and isDisenchantable) or (CanPickLock and isLockedItem) or (foundBreakables[i][IDX_COUNT] >= 5) then
|
||||||
@ -1471,7 +1473,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if CanDisenchant and itemRarity and itemRarity >= RARITY_UNCOMMON and itemRarity < RARITY_HEIRLOOM
|
if CanDisenchant and itemRarity and itemRarity >= RARITY_UNCOMMON and itemRarity < RARITY_HEIRLOOM
|
||||||
and self:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId) then
|
and self:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId, equipSlot) then
|
||||||
local soulbound = self:ScanForTooltipLine(tooltipData, ITEM_SOULBOUND, ITEM_ACCOUNTBOUND, ITEM_BNETACCOUNTBOUND)
|
local soulbound = self:ScanForTooltipLine(tooltipData, ITEM_SOULBOUND, ITEM_ACCOUNTBOUND, ITEM_BNETACCOUNTBOUND)
|
||||||
|
|
||||||
local isInEquipmentSet = false
|
local isInEquipmentSet = false
|
||||||
@ -1488,7 +1490,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|||||||
or equipSlot == nil or (equipSlot == "" and not IsArtifactRelicItem(itemLink))
|
or equipSlot == nil or (equipSlot == "" and not IsArtifactRelicItem(itemLink))
|
||||||
|
|
||||||
if self:IsForcedDisenchantable(itemId) or ((not soulbound or self.settings.showSoulbound) and not shouldHideThisItem) then
|
if self:IsForcedDisenchantable(itemId) or ((not soulbound or self.settings.showSoulbound) and not shouldHideThisItem) then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_DE, soulbound, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_DE, soulbound, itemName, itemRarity, equipSlot}
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@ -1525,11 +1527,11 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|||||||
|
|
||||||
if CanMill --[[and (itemSubType == MillingItemSubType or itemSubType == MillingItemSecondarySubType)]] then
|
if CanMill --[[and (itemSubType == MillingItemSubType or itemSubType == MillingItemSecondarySubType)]] then
|
||||||
if millable then
|
if millable then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_HERB, false, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_HERB, false, itemName, itemRarity, equipSlot}
|
||||||
else
|
else
|
||||||
for i=1,#HerbCombineItems do
|
for i=1,#HerbCombineItems do
|
||||||
if HerbCombineItems[i] == itemId then
|
if HerbCombineItems[i] == itemId then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_COMBINE, false, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_COMBINE, false, itemName, itemRarity, equipSlot}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1537,18 +1539,18 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|||||||
|
|
||||||
if CanProspect --[[and itemSubType == ProspectingItemSubType]] then
|
if CanProspect --[[and itemSubType == ProspectingItemSubType]] then
|
||||||
if prospectable then
|
if prospectable then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_ORE, false, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_ORE, false, itemName, itemRarity, equipSlot}
|
||||||
else
|
else
|
||||||
for i=1,#OreCombineItems do
|
for i=1,#OreCombineItems do
|
||||||
if OreCombineItems[i] == itemId then
|
if OreCombineItems[i] == itemId then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_COMBINE, false, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_COMBINE, false, itemName, itemRarity, equipSlot}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if CanPickLock and self:ItemIsPickable(itemId) and self:ItemIsLocked(bagId, slotId) and self:PlayerHasSkillToPickItem(bagId, slotId) then
|
if CanPickLock and self:ItemIsPickable(itemId) and self:ItemIsLocked(bagId, slotId) and self:PlayerHasSkillToPickItem(bagId, slotId) then
|
||||||
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_PICK, false, itemName, itemRarity}
|
return {itemLink, itemCount, itemType, itemTexture, bagId, slotId, itemSubType, itemLevel, BREAKABLE_PICK, false, itemName, itemRarity, equipSlot}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1682,13 +1684,12 @@ function Breakables:SortBreakables(foundBreakables)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId)
|
function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId, equipSlot)
|
||||||
if not itemId and itemLink then
|
if not itemId and itemLink then
|
||||||
itemId = self:GetItemIdFromLink(itemLink)
|
itemId = self:GetItemIdFromLink(itemLink)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i=1,#DisenchantTypes do
|
if self:IsDisenchantableItemType(itemType) or IsArtifactRelicItem(itemLink) or self:IsDisenchantableEquipSlot(equipSlot) then
|
||||||
if DisenchantTypes[i] == itemType or IsArtifactRelicItem(itemLink) then
|
|
||||||
-- bfa+ no longer has skill level requirements for disenchanting
|
-- bfa+ no longer has skill level requirements for disenchanting
|
||||||
if IgnoreEnchantingSkillLevelForDisenchant then
|
if IgnoreEnchantingSkillLevelForDisenchant then
|
||||||
return true
|
return true
|
||||||
@ -1796,7 +1797,6 @@ function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, i
|
|||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return self:IsForcedDisenchantable(itemId)
|
return self:IsForcedDisenchantable(itemId)
|
||||||
end
|
end
|
||||||
@ -1810,3 +1810,23 @@ function Breakables:IsForcedDisenchantable(itemId)
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Breakables:IsDisenchantableItemType(itemType)
|
||||||
|
for i=1,#DisenchantTypes do
|
||||||
|
if DisenchantTypes[i] == itemType then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function Breakables:IsDisenchantableEquipSlot(equipSlot)
|
||||||
|
for i=1,#DisenchantEquipSlots do
|
||||||
|
if DisenchantEquipSlots[i] == equipSlot then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
v1.9.11:
|
||||||
|
|
||||||
|
- Add detection of Dragonflight profession gear as disenchantable.
|
||||||
|
|
||||||
v1.9.10:
|
v1.9.10:
|
||||||
|
|
||||||
- Add Dragonflight Mystic disenchantable items. (Fixed)
|
- Add Dragonflight Mystic disenchantable items. (Fixed)
|
||||||
|
Reference in New Issue
Block a user