Skip to content

Commit

Permalink
Feature Parity of CMaNGOS importer with Acore Importer
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Jan 1, 2023
1 parent bdfdee2 commit 680466e
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 70 deletions.
34 changes: 29 additions & 5 deletions QEGearImporter/questionablyepic_enhanced.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ function scanGear()
local equipID = GetInventoryItemID("player", i);
local itemLink = GetInventoryItemLink('player', i)


if (equipID ~= nil) then
local itemSplit = GetItemSplit(itemLink)
local suffix = itemSplit[7] * -1
if (suffix ~= -0) then
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]
Expand All @@ -92,21 +91,26 @@ 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
end

end


local ammoID = GetInventoryItemID("player", 0);
if (ammoID ~= nil) then
addPrint("ammo=,id=" .. ammoID)
Expand All @@ -132,6 +136,15 @@ function scanGear()
addPrint("")
addPrint("### GEAR FROM BAGS ###")

if (true) then
for i=20, 23, 1 do
local equipID = GetInventoryItemID("player", i);
if equipID ~= nil then
addPrint(i .. "," .. equipID)
end
end
end

for bag=0, (NUM_BAG_SLOTS + GetNumBankSlots()) do
if (GetContainerNumSlots(bag) ~= 0) then
for bagSlots=1, GetContainerNumSlots(bag) do
Expand All @@ -144,6 +157,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]
Expand All @@ -157,6 +171,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()
Expand All @@ -168,7 +188,11 @@ 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]))
if (true) then
addPrint("bag=" .. bag .. ",slot=" .. bagSlots ..",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))
else
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))
end
--print(itemName .. "(" .. itemType .. ")");

end
Expand Down
12 changes: 1 addition & 11 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,20 +1175,10 @@ def fill(self, **kwds: object) -> str:
$achievements
$glyphs
INSERT INTO `character_homebind` VALUES ('$char_guid', '$start_map', '3703', '$pos_x', '$pos_y', '$pos_z');
INSERT INTO `character_inventory` VALUES ('$char_guid', '0', '24', '184', '6948'); -- Hearthstone
INSERT INTO `character_inventory` VALUES ('$char_guid', '0', '19', '217', '$bag_id'); -- Large Bag
INSERT INTO `character_inventory` VALUES ('$char_guid', '0', '22', '218', '$bag_id'); -- Large Bag
INSERT INTO `character_inventory` VALUES ('$char_guid', '0', '21', '219', '$bag_id'); -- Large Bag
INSERT INTO `character_inventory` VALUES ('$char_guid', '0', '20', '220', '$bag_id'); -- Large Bag
$inventory_list$pet_list
$skills
$spells
$talents
INSERT INTO `item_instance` VALUES ('184', '$char_guid', '6948', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0'$text);
INSERT INTO `item_instance` VALUES ('217', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0'$text);
INSERT INTO `item_instance` VALUES ('218', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0'$text);
INSERT INTO `item_instance` VALUES ('219', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0'$text);
INSERT INTO `item_instance` VALUES ('220', '$char_guid', '$bag_id', '0', '0', '1', '0', '0 0 0 0 0 ', '1', '$enchantments', '0', '100', '0'$text);
$instance_list
$actions
$factions
Expand All @@ -1199,7 +1189,7 @@ def fill(self, **kwds: object) -> str:
instanceEnchantTemplateTBC = Template("$main_enchant 0 0 0 0 0 $gem1 0 0 $gem2 0 0 $gem3 0 0 $socket_bonus 0 0 $enchant_1 0 0 $enchant_2 0 0 $enchant_3 0 0 0 0 0 0 0 0 ")
instanceEnchantTemplateVan = Template("$main_enchant 0 0 0 0 0 0 0 0 $enchant_1 0 0 $enchant_2 0 0 $enchant_3 0 0 0 0 0 ")

charactersTemplateWOTLK = Template("INSERT INTO `characters` VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '0', '300000000', '0', '0', '65568', '$pos_x', '$pos_y', '$pos_z', '$start_map', '0', '4.13832', '2 0 0 8 0 0 1048576 0 0 0 0 0 0 0 ', '0', '1', '200', '175', '1669632358', '1', '0', '0', '0', '0', '0', '0', '0', '0', '8', '0', '0', '4395', '0', '', '5000', '75000', '0', '0', '0', '0', '0', '0', '0', '4294967295', '0', '$char_health', '$char_power', '0', '0', '100', '0', '0', '0', '1', '0', '0 0 0 0 0 0 1048576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4194304 256 0 0 0 0 0 0 0 0 67108864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ', NULL, '0', '0 0 0 0 0 0 ', '0', '0', '0', NULL, NULL, NULL);")
charactersTemplateWOTLK = Template("INSERT INTO `characters` VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '0', '300000000', '0', '0', '65568', '$pos_x', '$pos_y', '$pos_z', '$start_map', '0', '4.13832', '2 0 0 8 0 0 1048576 0 0 0 0 0 0 0 ', '0', '1', '200', '175', '1669632358', '1', '0', '0', '0', '0', '0', '0', '0', '0', '8', '0', '8', '4395', '0', '', '5000', '75000', '0', '0', '0', '0', '0', '0', '0', '4294967295', '0', '$char_health', '$char_power', '0', '0', '100', '0', '0', '0', '1', '0', '0 0 0 0 0 0 1048576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4194304 256 0 0 0 0 0 0 0 0 67108864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ', NULL, '0', '0 0 0 0 0 0 ', '0', '0', '0', NULL, NULL, NULL);")
charactersTemplateTBC = Template("INSERT INTO `characters` VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '0', '300000000', '0', '0', '65568', '$pos_x', '$pos_y', '$pos_z', '$start_map', '0', '1.86449', '2 0 0 8 0 0 1048576 0 0 0 0 0 0 0 0 0 ', '0', '1', '200', '175', '1642414101', '1', '0', '0', '0', '0', '0', '0', '0', '0', '10', '0', '0', '3703', '0', '', '0', '0', '0', '0', '0', '0', '0', '0', '2147483647', '0', '5594', '0', '0', '0', '100', '0', '4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 ', NULL, '0', '0 0 ', '0', '0', '0', NULL, NULL, NULL);")
charactersTemplateVan = Template("INSERT INTO `characters` VALUES ('$char_guid', '5', '$char_name', '$char_race', '$char_class', '$char_gender', '$char_level', '0', '300000000', '0', '0', '0', '$pos_x', '$pos_y', '$pos_z', '$start_map', '2.70526', '1024 0 0 0 0 0 0 0 ', '0', '1', '0', '0', '1642834034', '1', '0', '0', '0', '0', '0', '0', '0', '0', '2', '0', '32', '0', '0', '', '0', '0', '0', '0', '0', '0', '0', '63', '79', '0', '0', '100', '0', '4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 4294967295 ', NULL, '0', '0', '0', '0', NULL, NULL, NULL);")

Expand Down
Loading

0 comments on commit 680466e

Please sign in to comment.