diff --git a/QEGearImporter/questionablyepic_enhanced.lua b/QEGearImporter/questionablyepic_enhanced.lua index d394bce..7c46be8 100644 --- a/QEGearImporter/questionablyepic_enhanced.lua +++ b/QEGearImporter/questionablyepic_enhanced.lua @@ -83,7 +83,7 @@ function scanGear() local unique = bit.band(itemSplit[8], 65535) suffix = ",suffix=" .. suffix .. ",unique=" .. unique else suffix = "" end - + local hasBuckle = false --local _, enchantId, gem1, gem2, gem3, gem4 = string.match(itemLink, "item:(%d+):(%d+):(%d+):(%d+):(%d+):(%d+)") local enchantId = itemSplit[2] local gem1 = itemSplit[3] @@ -92,13 +92,19 @@ function scanGear() SocketInventoryItem(i) gemColors = {nil, nil, nil} for j=1, GetNumSockets() do + _, _, _, _, _, _, _, _, equipLoc = GetItemInfo(itemLink) + if (equipLoc ~= nil and equipLoc == "INVTYPE_WAIST") then + if (GetSocketTypes(j) ~= nil and GetSocketTypes(j) == "Prismatic") then + hasBuckle = true + end + end _, _, gemColors[j] = GetExistingSocketInfo(j) end CloseSocketInfo() local itemName, _, _, _, _, _, _, _, _, _, _, classID, subclassID = GetItemInfo(equipID); --print(classID) if (classID == 2 or classID == 4) then - addPrint(slotNames[i] .. "=,id=" .. equipID .. suffix .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3])) + addPrint(slotNames[i] .. "=,id=" .. equipID .. suffix .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3]) .. ",buckle=" .. tostring(hasBuckle)) --print(itemName .. "(" .. itemType .. ")"); end @@ -144,6 +150,7 @@ function scanGear() local itemLink = GetContainerItemLink(bag, bagSlots) local itemSplit = GetItemSplit(itemLink) local suffix = itemSplit[7] * -1 + local hasBuckle = false local enchantId = itemSplit[2] local gem1 = itemSplit[3] local gem2 = itemSplit[4] @@ -157,6 +164,12 @@ function scanGear() SocketContainerItem(bag, bagSlots) gemColors = {nil, nil, nil} for j=1, GetNumSockets() do + _, _, _, _, _, _, _, _, equipLoc = GetItemInfo(itemLink) + if (equipLoc ~= nil and equipLoc == "INVTYPE_WAIST") then + if (GetSocketTypes(j) ~= nil and GetSocketTypes(j) == "Prismatic") then + hasBuckle = true + end + end _, _, gemColors[j] = GetExistingSocketInfo(j) end CloseSocketInfo() @@ -168,7 +181,7 @@ function scanGear() --addPrint("# " .. convertSlot(itemEquipLoc) .. "=,id=" .. itemID .. suffix) local _, itemCount = GetContainerItemInfo(bag, bagSlots) --addPrint(itemName) - addPrint("id=" .. itemID .. suffix .. ",count=" .. itemCount .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3])) + addPrint("id=" .. itemID .. suffix .. ",count=" .. itemCount .. ",enchantId=" .. enchantId .. ",gem1=" .. gem1 ..":" .. tostring(gemColors[1]) .. ",gem2=" .. gem2 ..":" .. tostring(gemColors[2]) .. ",gem3=" .. gem3 ..":" .. tostring(gemColors[3]) .. ",buckle=" .. tostring(hasBuckle)) --print(itemName .. "(" .. itemType .. ")"); end diff --git a/src/parser.py b/src/parser.py index 0e72fd3..d70fcd9 100644 --- a/src/parser.py +++ b/src/parser.py @@ -46,7 +46,7 @@ def get_char_info(): return result - def add_to_itemlists(slot_id, item_entry, suffix, enchant, gems, bag_id=0, item_count=1): + def add_to_itemlists(slot_id, item_entry, suffix, enchant, gems, buckle, bag_id=0, item_count=1): global inventory_list, instance_list, itemguiditr socketBonus = 0 inventory_list += wornTemplate.fill( @@ -86,16 +86,28 @@ def add_to_itemlists(slot_id, item_entry, suffix, enchant, gems, bag_id=0, item_ socketBonus = itemSocketBonusMapWotlk[int(item_entry)] if str(suffix) not in suffixTable: suffix = 0 - enchantments = instanceEnchantTemplate.fill( - main_enchant=enchant, - gem1=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[0].split(":")[0])]], - gem2=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[1].split(":")[0])]], - gem3=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[2].split(":")[0])]], - socket_bonus=socketBonus, - enchant_1=suffixTable[str(suffix)][0], - enchant_2=suffixTable[str(suffix)][1], - enchant_3=suffixTable[str(suffix)][2], - ) + if buckle == "false": + enchantments = instanceEnchantTemplate.fill( + main_enchant=enchant, + gem1=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[0].split(":")[0])]], + gem2=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[1].split(":")[0])]], + gem3=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[2].split(":")[0])]], + socket_bonus=socketBonus, + enchant_1=suffixTable[str(suffix)][0], + enchant_2=suffixTable[str(suffix)][1], + enchant_3=suffixTable[str(suffix)][2], + ) + else: + enchantments = instanceEnchantTemplate.fill( + main_enchant=enchant, + gem1=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[0].split(":")[0])]], + gem2=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[1].split(":")[0])]], + gem3=gemPropertyMapWotLK[gemIDPropertyMapWotlk[int(gems[2].split(":")[0])]], + socket_bonus=socketBonus, + enchant_1=3729, + enchant_2=suffixTable[str(suffix)][1], + enchant_3=suffixTable[str(suffix)][2], + ) instance_list += instanceTemplate.fill( item_guid=itemguiditr, item_entry=item_entry, @@ -111,18 +123,21 @@ def parse_slots_base(): suffix = "0" enchant = "0" gems = [] - if len(item_info) == 8: + buckle = "false" + if len(item_info) == 9: suffix = item_info[2].split("=")[1] enchant = item_info[4].split("=")[1] gems = [item_info[5].split("=")[1], item_info[6].split("=")[1], item_info[7].split("=")[1]] - elif len(item_info) == 6: + buckle = [item_info[8].split("=")[1]] + elif len(item_info) == 7: enchant = item_info[2].split("=")[1] gems = [item_info[3].split("=")[1], item_info[4].split("=")[1], item_info[5].split("=")[1]] + buckle = [item_info[6].split("=")[1]] item_entry = ( f[i + equip_offset].split("=")[2].split(",")[0].replace("\n", "") ) - add_to_itemlists(slotMap[slot], item_entry, suffix, enchant, gems) + add_to_itemlists(slotMap[slot], item_entry, suffix, enchant, gems, buckle[0].rstrip()) slots = [ "head", @@ -217,6 +232,7 @@ def parse_bag_base(): suffix = "0" enchant = "0" gems = [] + buckle = "false" item_data = item.split(",") item_count = "" item_entry = item_data[0].split("=") @@ -224,17 +240,19 @@ def parse_bag_base(): item_entry = item_entry[1] if len(item_data) > 1: item_count = clean(item_data[1].split("=")[1]) - if len(item_data) == 8: + if len(item_data) == 9: item_count = clean(item_data[3].split("=")[1]) suffix = item_data[1].split("=")[1] enchant = item_data[4].split("=")[1] gems = [item_data[5].split("=")[1], item_data[6].split("=")[1], item_data[7].split("=")[1]] - if len(item_data) == 6: + buckle = [item_data[8].split("=")[1]] + if len(item_data) == 7: enchant = item_data[2].split("=")[1] gems = [item_data[3].split("=")[1], item_data[4].split("=")[1], item_data[5].split("=")[1]] + buckle = [item_data[6].split("=")[1]] slotID = firstSlot % 28 bagID = int(firstSlot / 28) + 216 - add_to_itemlists(slotID, item_entry, suffix, enchant, gems, bagID, item_count=item_count) + add_to_itemlists(slotID, item_entry, suffix, enchant, gems, buckle[0], bagID, item_count=item_count) firstSlot += 1 firstSlot = 23 + 14