From c152308c5afe972a006ea50aaa5f293cd9009604 Mon Sep 17 00:00:00 2001 From: Anch Date: Mon, 7 Nov 2022 02:49:03 +1300 Subject: [PATCH] bug fix's and database changes --- AtlasLoot/Core/AtlasDifficulty.lua | 14 +- AtlasLoot/Core/AtlasLoot.lua | 57 ++++---- AtlasLoot/Core/ItemIDsDatabaseFixes.lua | 137 ++++++++++++++---- .../DefaultFrame/AtlaslootDefaultFrame.lua | 8 +- AtlasLoot/Menus/DungeonRaidMenus.lua | 2 +- 5 files changed, 150 insertions(+), 68 deletions(-) diff --git a/AtlasLoot/Core/AtlasDifficulty.lua b/AtlasLoot/Core/AtlasDifficulty.lua index 0ab6711..7377ed1 100644 --- a/AtlasLoot/Core/AtlasDifficulty.lua +++ b/AtlasLoot/Core/AtlasDifficulty.lua @@ -31,8 +31,8 @@ AtlasLoot_Difficulty = { }; ["ClassicRaid"] = { - {"Normal Flex", 2}, - {"Heroic Flex", 3}, + {"Normal", 2}, + {"Heroic", 3}, {"Mythic", 5}, {"Ascended", 4}, {"Bloodforged", 1}, @@ -53,8 +53,8 @@ AtlasLoot_Difficulty = { }; ["BCRaid"] = { - {"Normal Flex", 2}, - {"Heroic Flex", 3}, + {"Normal", 2}, + {"Heroic", 3}, {"Mythic", 5}, {"Ascended", 4}, {"Bloodforged", 1}, @@ -71,8 +71,8 @@ AtlasLoot_Difficulty = { }; ["WrathRaid"] = { - {"Normal Flex", 2}, - {"Heroic Flex", 3}, + {"Normal", 2}, + {"Heroic", 3}, {"Mythic", 4}, {"Ascended", 5}, {"Bloodforged", 1}, @@ -129,7 +129,7 @@ function AtlasLoot_Difficulty:getMaxDifficulty(difficultyKey) elseif (difficultyKey == "ClassicDungeonExt" or difficultyKey == "BCDungeon" or difficultyKey == "WrathDungeon") then return 44; elseif (difficultyKey == "ClassicRaid" or difficultyKey == "BCRaid" or difficultyKey == "WrathRaid") then - return 4; + return 5; else return 0; end diff --git a/AtlasLoot/Core/AtlasLoot.lua b/AtlasLoot/Core/AtlasLoot.lua index eec86a5..d83b0f6 100644 --- a/AtlasLoot/Core/AtlasLoot.lua +++ b/AtlasLoot/Core/AtlasLoot.lua @@ -14,7 +14,6 @@ AtlasLoot_OnLoad() AtlasLoot:ShowItemsFrame() AtlasLoot:NavButton_OnClick() AtlasLoot:IsLootTableAvailable(dataID) -AtlasLoot:GetLODModule(dataSource) AtlasLoot:LoadAllModules() AtlasLoot:ShowQuickLooks(button) AtlasLoot:RefreshQuickLookButtons() @@ -333,11 +332,9 @@ function AtlasLoot:OnInitialize() end --Sets the default loot tables for the current expansion enabled on the server. - local function getExpac() - local xpaclist = {"CLASSIC", "TBC", "WRATH"}; - AtlasLoot_Expac = xpaclist[GetAccountExpansionLevel()+1]; - end - getExpac(); + local xpaclist = {"CLASSIC", "TBC", "WRATH"}; + AtlasLoot_Expac = xpaclist[GetAccountExpansionLevel()+1]; + end function AtlasLoot:CleandataID(newID, listnum) @@ -758,7 +755,8 @@ function AtlasLoot:ShowItemsFrame(dataID, dataSource_backup, tablenum) end if dataSource_backup ~= "AtlasLoot_CurrentWishList" and dataID ~= "FilterList" and dataSource[dataID].Back ~= true and dataID ~= "EmptyTable" then - AtlasLoot.db.profile.LastBoss = {dataID, dataSource_backup, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE}; + if not AtlasLoot.db.profile.LastBoss then AtlasLoot.db.profile.LastBoss = {} end; + AtlasLoot.db.profile.LastBoss[AtlasLoot_Expac] = {dataID, dataSource_backup, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE}; AtlasLoot.db.profile[ATLASLOOT_CURRENTTABLE] = {dataID, dataSource_backup, tablenum, ATLASLOOT_LASTMODULE, ATLASLOOT_CURRENTTABLE}; end @@ -868,7 +866,7 @@ dataID: Loot table dataID ]] function AtlasLoot:IsLootTableAvailable(dataSource) local moduleName = nil; - moduleName = AtlasLoot:GetLODModule(dataSource); + moduleName = AtlasLoot.ModuleName[dataSource]; if IsAddOnLoaded(moduleName) then return true; else @@ -876,24 +874,14 @@ function AtlasLoot:IsLootTableAvailable(dataSource) end end ---[[ -AtlasLoot:GetLODModule(dataSource) -Returns the name of the module that needs to be loaded -dataSource: Location of the loot table -]] -function AtlasLoot:GetLODModule(dataSource) - if (dataSource=="AtlasLootOriginalWoW") then - return "AtlasLoot_OriginalWoW"; - elseif (dataSource=="AtlasLootBurningCrusade") then - return "AtlasLoot_BurningCrusade"; - elseif (dataSource=="AtlasLootCrafting") then - return "AtlasLoot_Crafting"; - elseif (dataSource=="AtlasLootWorldEvents") then - return "AtlasLoot_WorldEvents"; - elseif (dataSource=="AtlasLootWotLK") then - return "AtlasLoot_WrathoftheLichKing"; - end -end +-- List of Moduel Names +AtlasLoot.ModuleName = { + ["AtlasLootOriginalWoW"] = "AtlasLoot_OriginalWoW"; + ["AtlasLootBurningCrusade"] = "AtlasLoot_BurningCrusade"; + ["AtlasLootCrafting"] = "AtlasLoot_Crafting"; + ["AtlasLootWorldEvents"] = "AtlasLoot_WorldEvents"; + ["AtlasLootWotLK"] = "AtlasLoot_WrathoftheLichKing" +} --[[ AtlasLoot:LoadAllModules() @@ -1098,13 +1086,23 @@ function AtlasLoot:LoadItemIDsDatabase() ItemIDsDatabase = {}; content:SetParser(function(index, data) -- run for each item in the data - if index ~= 0 and data.Normal ~= 0 then + if ItemIDsDatabaseFixs[data.Normal] then + ItemIDsDatabase[data.Normal] = {}; + for _,v in pairs(ItemIDsDatabaseFixs[data.Normal]) do + table.insert(ItemIDsDatabase[data.Normal],v); + end + if ItemIDsDatabaseFixs[data.Normal]["MythicRaid"] then + ItemIDsDatabase[data.Normal]["MythicRaid"] = ItemIDsDatabaseFixs[data.Normal]["MythicRaid"]; + else + ItemIDsDatabase[data.Normal]["MythicRaid"] = ItemIDsDatabaseFixs[data.Normal][3] + 1000000; + end + elseif index ~= 0 and data.Normal ~= 0 then ItemIDsDatabase[data.Normal] = {} - ItemIDsDatabase[data.Normal]["MythicRaid"] = data.Normal + 1300000 + ItemIDsDatabase[data.Normal]["MythicRaid"] = data.Heroic + 1000000 table.insert(ItemIDsDatabase[data.Normal],data.Bloodforged); table.insert(ItemIDsDatabase[data.Normal],data.Normal); if data.Heroic ~= 0 then table.insert(ItemIDsDatabase[data.Normal],data.Heroic) end - for i,v in ipairs(data["Mythic"]) do + for _,v in ipairs(data["Mythic"]) do if v ~= 0 then table.insert(ItemIDsDatabase[data.Normal],v) end @@ -1114,5 +1112,4 @@ function AtlasLoot:LoadItemIDsDatabase() -- This will run over time (usually about 30s for a file this size), but will maintain playable fps while running. content:ParseAsync() - AtlasLoot:ItemIdFixs() end \ No newline at end of file diff --git a/AtlasLoot/Core/ItemIDsDatabaseFixes.lua b/AtlasLoot/Core/ItemIDsDatabaseFixes.lua index 3f8fd62..c2f1002 100644 --- a/AtlasLoot/Core/ItemIDsDatabaseFixes.lua +++ b/AtlasLoot/Core/ItemIDsDatabaseFixes.lua @@ -1,37 +1,120 @@ -function AtlasLoot:ItemIdFixs() +ItemIDsDatabaseFixs = {}; --Items not added from generated file -ItemIDsDatabase[18563] = {18563, 18563, 318563, 218563}; -ItemIDsDatabase[18564] = {18564, 18564, 318564, 218564}; -ItemIDsDatabase[17204] = {17204, 17204, 317204, 217204}; -ItemIDsDatabase[19017] = {19017, 19017, 319017, 219017}; -ItemIDsDatabase[11879] = {11879, 11879, 311879, 211879}; +ItemIDsDatabaseFixs[18563] = {18563, 18563, 318563, 218563}; +ItemIDsDatabaseFixs[18564] = {18564, 18564, 318564, 218564}; +ItemIDsDatabaseFixs[17204] = {17204, 17204, 317204, 217204}; +ItemIDsDatabaseFixs[19017] = {19017, 19017, 319017, 219017}; +ItemIDsDatabaseFixs[11879] = {11879, 11879, 311879, 211879}; -ItemIDsDatabase[22589] = {6022589, 22589, 322589, 222589}; -ItemIDsDatabase[22632] = {6022632, 22632, 322632, 222632}; -ItemIDsDatabase[22631] = {6022631, 22631, 322631, 222631}; -ItemIDsDatabase[22630] = {6022630, 22630, 322630, 222630}; +ItemIDsDatabaseFixs[22589] = {6022589, 22589, 322589, 222589}; +ItemIDsDatabaseFixs[22632] = {6022632, 22632, 322632, 222632}; +ItemIDsDatabaseFixs[22631] = {6022631, 22631, 322631, 222631}; +ItemIDsDatabaseFixs[22630] = {6022630, 22630, 322630, 222630}; -ItemIDsDatabase[2032902] = {6053891, 2032902, 2232902, 2332902}; -ItemIDsDatabase[44831] = {6044831, 44831, 344831, 244831}; -ItemIDsDatabase[27896] = {6027896, 27896, 27896, 427896}; +ItemIDsDatabaseFixs[2032902] = {6053891, 2032902, 2232902, 2332902}; +ItemIDsDatabaseFixs[44831] = {6044831, 44831, 344831, 244831}; +ItemIDsDatabaseFixs[27896] = {6027896, 27896, 27896, 427896}; -ItemIDsDatabase[30007] = {6030007, 30007, 330007, 230007}; -ItemIDsDatabase[30015] = {6030015, 30015, 330015, 230015}; -ItemIDsDatabase[30017] = {6030017, 30017, 330017, 230017}; -ItemIDsDatabase[30018] = {6030018, 30018, 330018, 230018}; -ItemIDsDatabase[32837] = {6032837, 32837, 332837, 232837}; -ItemIDsDatabase[32838] = {6032838, 32838, 332838, 232838}; -ItemIDsDatabase[30104] = {6033482, 30104, 330104, 230104}; +ItemIDsDatabaseFixs[30007] = {6030007, 30007, 330007, 230007}; +ItemIDsDatabaseFixs[30015] = {6030015, 30015, 330015, 230015}; +ItemIDsDatabaseFixs[30017] = {6030017, 30017, 330017, 230017}; +ItemIDsDatabaseFixs[30018] = {6030018, 30018, 330018, 230018}; +ItemIDsDatabaseFixs[32837] = {6032837, 32837, 332837, 232837}; +ItemIDsDatabaseFixs[32838] = {6032838, 32838, 332838, 232838}; +ItemIDsDatabaseFixs[30104] = {6033482, 30104, 330104, 230104}; + +--Tier 1 Tokens + +ItemIDsDatabaseFixs[2522360] = {2522360, 2522360, 2622360, 2722360}; +ItemIDsDatabaseFixs[2522361] = {2522361, 2522361, 2622361, 2722361}; +ItemIDsDatabaseFixs[2522350] = {2522350, 2522350, 2622350, 2722350}; +ItemIDsDatabaseFixs[2522362] = {2522362, 2522362, 2622362, 2722362}; +ItemIDsDatabaseFixs[2522363] = {2522363, 2522363, 2622363, 2722363}; +ItemIDsDatabaseFixs[2522364] = {2522364, 2522364, 2622364, 2722364}; +ItemIDsDatabaseFixs[2522359] = {2522359, 2522359, 2622359, 2722359}; +ItemIDsDatabaseFixs[2522365] = {2522365, 2522365, 2622365, 2722365}; + +--Tier 2 Tokens + +ItemIDsDatabaseFixs[2522460] = {2522460, 2522460, 2622460, 2722460}; +ItemIDsDatabaseFixs[2522461] = {2522461, 2522461, 2622461, 2722461}; +ItemIDsDatabaseFixs[2522450] = {2522450, 2522450, 2622450, 2722450}; +ItemIDsDatabaseFixs[2522462] = {2522462, 2522462, 2622462, 2722462}; +ItemIDsDatabaseFixs[2522464] = {2522464, 2522464, 2622464, 2722464}; +ItemIDsDatabaseFixs[2522463] = {2522463, 2522463, 2622463, 2722463}; +ItemIDsDatabaseFixs[2522459] = {2522459, 2522459, 2622459, 2722459}; +ItemIDsDatabaseFixs[2522465] = {2522465, 2522465, 2622465, 2722465}; + +--Tier 3 Tokens + +ItemIDsDatabaseFixs[22353] = {22353, 22353, 102278, 222353}; +ItemIDsDatabaseFixs[22354] = {22354, 22354, 102286, 222354}; +ItemIDsDatabaseFixs[22349] = {22349, 22349, 102264, 222349}; +ItemIDsDatabaseFixs[22355] = {22355, 22355, 102262, 222355}; +ItemIDsDatabaseFixs[22357] = {22357, 22357, 102268, 222357}; +ItemIDsDatabaseFixs[22356] = {22356, 22356, 102300, 222356}; +ItemIDsDatabaseFixs[22352] = {22352, 22352, 102284, 222352}; +ItemIDsDatabaseFixs[22358] = {22358, 22358, 102290, 222358}; + +--Tier 4 Tokens + +ItemIDsDatabaseFixs[29761] = {29761, 29761, 329761, 229761}; +ItemIDsDatabaseFixs[29764] = {29764, 29764, 329764, 229764}; +ItemIDsDatabaseFixs[29753] = {29753, 29753, 329753, 229753}; +ItemIDsDatabaseFixs[29758] = {29758, 29758, 329758, 229758}; +ItemIDsDatabaseFixs[29767] = {29767, 29767, 329767, 229767}; + +--Tier 5 Tokens + +ItemIDsDatabaseFixs[30243] = {30243, 30243, 330243, 230243}; +ItemIDsDatabaseFixs[30249] = {30249, 30249, 330249, 230249}; +ItemIDsDatabaseFixs[30237] = {30237, 30237, 330237, 230237}; +ItemIDsDatabaseFixs[30240] = {30240, 30240, 330240, 230240}; +ItemIDsDatabaseFixs[30246] = {30246, 30246, 30246, 230246}; --Druid -ItemIDsDatabase[29098] = {6029098, 29098, 314712, 214712, ["MythicRaid"] = 1329098}; -ItemIDsDatabase[29100] = {6029100, 29100, 314714, 214714, ["MythicRaid"] = 1329100}; -ItemIDsDatabase[29096] = {6029096, 29096, 314710, 214710, ["MythicRaid"] = 1329096}; -ItemIDsDatabase[29097] = {6029097, 29097, 314711, 214711, ["MythicRaid"] = 1329097}; -ItemIDsDatabase[29099] = {6029099, 29099, 314713, 214713, ["MythicRaid"] = 1329099}; +ItemIDsDatabaseFixs[29098] = {6029098, 29098, 314712, 214712}; +ItemIDsDatabaseFixs[29100] = {6029100, 29100, 314714, 214714}; +ItemIDsDatabaseFixs[29096] = {6029096, 29096, 314710, 214710}; +ItemIDsDatabaseFixs[29097] = {6029097, 29097, 314711, 214711}; +ItemIDsDatabaseFixs[29099] = {6029099, 29099, 314713, 214713}; +--ZA New Items +ItemIDsDatabaseFixs[21824] = {6021824, 21824, 321824, 221824}; +ItemIDsDatabaseFixs[24574] = {6024574, 24574, 324574, 224574}; +ItemIDsDatabaseFixs[28354] = {6028354, 28354, 328354, 228354}; +ItemIDsDatabaseFixs[33059] = {6033059, 33059, 333059, 233059}; +ItemIDsDatabaseFixs[33983] = {6033983, 33983, 333983, 233983}; +ItemIDsDatabaseFixs[39755] = {6039755, 39755, 339755, 239755}; +ItemIDsDatabaseFixs[33533] = {6033533, 33533, 333533, 233533}; +ItemIDsDatabaseFixs[33979] = {6033979, 33979, 333979, 233979}; +ItemIDsDatabaseFixs[34071] = {6034071, 34071, 334071, 234071}; +ItemIDsDatabaseFixs[38634] = {6038634, 38634, 338634, 238634}; +ItemIDsDatabaseFixs[33500] = {6033500, 33500, 333500, 233500}; +ItemIDsDatabaseFixs[33496] = {6033496, 33496, 333496, 233496}; +ItemIDsDatabaseFixs[33498] = {6033498, 33498, 333498, 233498}; +ItemIDsDatabaseFixs[33971] = {6033971, 33971, 333971, 233971}; +ItemIDsDatabaseFixs[33495] = {6033495, 33495, 333495, 233495}; +ItemIDsDatabaseFixs[33480] = {6033480, 33480, 333480, 233480}; +ItemIDsDatabaseFixs[33591] = {6033591, 33591, 333591, 233591}; +ItemIDsDatabaseFixs[33590] = {6033590, 33590, 333590, 233590}; +ItemIDsDatabaseFixs[33481] = {6033481, 33481, 333481, 233481}; +ItemIDsDatabaseFixs[33492] = {6033492, 33492, 333492, 233492}; +ItemIDsDatabaseFixs[33499] = {6033499, 33499, 333499, 233499}; +ItemIDsDatabaseFixs[33805] = {6033805, 33805, 333805, 233805}; +ItemIDsDatabaseFixs[33491] = {6033491, 33491, 333491, 233491}; +ItemIDsDatabaseFixs[33490] = {6033490, 33490, 333490, 233490}; +ItemIDsDatabaseFixs[33489] = {6033489, 33489, 333489, 233489}; +ItemIDsDatabaseFixs[33483] = {6033483, 33483, 333483, 233483}; +ItemIDsDatabaseFixs[33493] = {6033493, 33493, 333493, 233493}; +ItemIDsDatabaseFixs[33497] = {6033497, 33497, 333497, 233497}; +ItemIDsDatabaseFixs[33494] = {6033494, 33494, 333494, 233494}; +ItemIDsDatabaseFixs[24537] = {6024537, 24537, 324537, 224537}; --ZA Bears -ItemIDsDatabase[1333809] = {1333809, 1333809, 1433809, 1233809}; -end \ No newline at end of file +ItemIDsDatabaseFixs[1333809] = {1333809, 1333809, 1433809, 1233809}; + +--intact vial of kael'thas sunstrider +ItemIDsDatabaseFixs[450001] = {450001, 450001, 450003, 450005}; +ItemIDsDatabaseFixs[450000] = {450000, 450000, 450002, 450004}; \ No newline at end of file diff --git a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua index 0a281d4..d63dbf9 100644 --- a/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua +++ b/AtlasLoot/DefaultFrame/AtlaslootDefaultFrame.lua @@ -35,11 +35,13 @@ Called whenever the loot browser is shown and sets up buttons and loot tables function AtlasLootDefaultFrame_OnShow() --Definition of where I want the loot table to be shown --Remove the selection of a loot table in Atlas - AtlasLootItemsFrame.activeBoss = nil; + AtlasLootItemsFrame.activeBoss = nil; --Set the item table to the loot table --Show the last displayed loot table - local lastboss = AtlasLoot.db.profile.LastBoss; - if AtlasLoot.db.profile.AutoCurrentInstance and AtlasLoot:ShowInstance() then elseif lastboss and lastboss[4] then + local lastboss = AtlasLoot.db.profile.LastBoss[AtlasLoot_Expac]; + if AtlasLoot.db.profile.AutoCurrentInstance and AtlasLoot:ShowInstance() then + return; + elseif lastboss and lastboss[4] then ATLASLOOT_CURRENTTABLE = lastboss[5]; ATLASLOOT_LASTMODULE = lastboss[4]; AtlasLoot:IsLootTableAvailable(lastboss[4]); diff --git a/AtlasLoot/Menus/DungeonRaidMenus.lua b/AtlasLoot/Menus/DungeonRaidMenus.lua index be4588f..98ee81f 100644 --- a/AtlasLoot/Menus/DungeonRaidMenus.lua +++ b/AtlasLoot/Menus/DungeonRaidMenus.lua @@ -11,8 +11,8 @@ local BabbleInventory = AtlasLoot_GetLocaleLibBabble("LibBabble-Inventory-3.0"); Module = "AtlasLootOriginalWoW"; SubMenu = "Dungeons and RaidsCLASSIC"; {"Raids:", "OldKeys", "Header"}; - {"", "MoltenCore", "", "Molten Core"}; {"", "ZulGurub", "", "Zul'Gurub"}; + {"", "MoltenCore", "", "Molten Core"}; {"", "Onyxia60", "", "Onyxias Hort"}; {"", "BlackwingLair", "", "Blackwing Lair"}; {"", "RuinsofAQ", "", "Ruinen von Ahn'Qiraj"};