Implemented Min-Max Difficulties

This commit is contained in:
merstrax
2021-10-30 05:51:48 -04:00
parent a172179a73
commit a4015ecbc3
3 changed files with 276 additions and 235 deletions
+41 -10
View File
@@ -497,7 +497,7 @@ function AtlasLoot_OnLoad()
end
AtlasLoot_Difficulty = {
-- table of difficuilitys and there itemID references
-- table of difficulties and there itemID references
["ClassicDungeon"] = { {"Normal", "" }, {"Bloodforged", 1 } };
["ClassicDungeonExt"] = { {"Normal", "" }, {"Heroic", 3 }, {"Mythic", 4 }, {"Mythic 1", 5 }, {"Mythic 2", 6 }, {"Mythic 3", 7 }, {"Mythic 4", 8 }, {"Mythic 5", 9 }, {"Mythic 6", 10 },
@@ -516,10 +516,22 @@ AtlasLoot_Difficulty = {
["WrathRaid"] = { {"Normal Flex", "" }, {"Heroic Flex", 3 }, {"Ascended", 4 }, {"Bloodforged", 1 }, };
["Crafting"] = { {"Crafting Patterns", "" }, {"Item Normal", "=s=Normal" }, {"Bloodforged", 1 }, },
["Crafting"] = { {"Crafting Patterns", "" }, {"Item Normal", "=s=Normal" }, {"Bloodforged", 1 }, };
["CraftingExt"] = { {"Crafting Pattern Uncommon", "" }, {"Crafting Patterns Rare", "Rare" }, {"Crafting Patterns Epic", "Epic" }, {"Item Uncommon", "=s=" }, {"Item Rare", "=s=Rare" }, {"Item Epic", "=s=Epic" } }
["CraftingExt"] = { {"Crafting Pattern Uncommon", "" }, {"Crafting Patterns Rare", "Rare" }, {"Crafting Patterns Epic", "Epic" }, {"Item Uncommon", "=s=" }, {"Item Rare", "=s=Rare" }, {"Item Epic", "=s=Epic" } };
--Enums for comparisons in code
Bloodforged = 1;
Normal = 2;
Heroic = 3;
Mythic = 4; --Use for Ascended as well
MythicPlus = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}; --Usage AtlasLoot_Difficulty.MythicPlus[1-20];
DUPLICATE = 17;
MIN_DIF = 18;
MAX_DIF = 19;
}
--[[
@@ -636,15 +648,34 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
if (dataID == "SearchResult") or (dataID == "WishList") or (AtlasLoot_IsLootTableAvailable(dataID)) then
--Iterate through each item object and set its properties
for i = 1, 30, 1 do
--Check for a valid object (that it exists, and that it has a name)
if(dataSource[dataID][i] ~= nil and dataSource[dataID][i][4] ~= "") then
if dataSource[dataID][i][8] and tonumber(ItemindexID) then
-- Used if an item has more then 1 version with the same name eg Atiesh
IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5) .. " " .. dataSource[dataID][i][8], ItemindexID) -- Used for 8th table entery in a loottable for when we have items with the same name eg Atiesh
local toShow = true;
if(dataSource[dataID][i] ~= nil and dataSource[dataID][i][4] ~= "") then
--Checks if an item has a Minimum difficulty, this is to hide items that shouldn't show on lower difficulties
if dataSource[dataID][i][AtlasLoot_Difficulty.MIN_DIF] then
if dataSource[dataID][i][AtlasLoot_Difficulty.MIN_DIF] > ItemindexID then toShow = false end;
end
else
toShow = false;
end
if(toShow) then
--Sets ItemindexID to normal(2) if it is nil for min/max difficulties.
if not tonumber(ItemindexID) then ItemindexID = AtlasLoot_Difficulty.Normal end;
--Checks if an item has a Maximum difficulty, this is to correct some items that have an entry for higher difficulties then they really do
if dataSource[dataID][i][AtlasLoot_Difficulty.MAX_DIF] then
if tonumber(dataSource[dataID][i][AtlasLoot_Difficulty.MAX_DIF]) < ItemindexID then ItemindexID = dataSource[dataID][i][AtlasLoot_Difficulty.MAX_DIF] end;
end
if dataSource[dataID][i][AtlasLoot_Difficulty.DUPLICATE] then
--Used if an item has more then 1 version with the same name eg Atiesh
IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5) .. " " .. dataSource[dataID][i][AtlasLoot_Difficulty.DUPLICATE], ItemindexID) or dataSource[dataID][i][2];
else
-- if something was found in itemID database show that if not show default table item
IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), ItemindexID) or dataSource[dataID][i][2]
--If something was found in itemID database show that if not show default table item
IDfound = AL_FindId(string.sub(dataSource[dataID][i][4], 5), ItemindexID) or dataSource[dataID][i][2];
end
if string.sub(IDfound, 1, 1) == "s" then
+11 -1
View File
@@ -3806,7 +3806,6 @@ ItemIDsDatabase["Sandals of Faith"] = {6022516, 22516, 322516, 222516, 1004398,
ItemIDsDatabase["Gloves of Faith"] = {6022517, 22517, 322517, 222517, 1004402, 1011715, 1018362, 1024973, 1031537, 1038100, 1044663, 1051226, 1057789, 1064352, 480588, 480589, 480590, 480591, 480592, 480593, 480594, 480595, 480596, 480597};
ItemIDsDatabase["Belt of Faith"] = {6022518, 22518, 322518, 222518, 1004407, 1011716, 1018363, 1024974, 1031538, 1038101, 1044664, 1051227, 1057790, 1064353, 480598, 480599, 480600, 480601, 480602, 480603, 480604, 480605, 480606, 480607};
ItemIDsDatabase["Bindings of Faith"] = {6022519, 22519, 322519, 222519, 1004408, 1011717, 1018364, 1024975, 1031539, 1038102, 1044665, 1051228, 1057791, 1064354, 480608, 480609, 480610, 480611, 480612, 480613, 480614, 480615, 480616, 480617};
ItemIDsDatabase["Atiesh, Greatstaff of the Guardian"] = {6022589, 22589, 100174, 222589, 1004411, 1011718, 1018365, 1024976, 1031540, 1038103, 1044666, 1051229, 1057792, 1064355, 480618, 480619, 480620, 480621, 480622, 480623, 480624, 480625, 480626, 480627};
ItemIDsDatabase["Glacial Vest"] = {6022652, 22652, 261222, 261223, 261224, 261225, 261226, 261227, 261228, 261229, 261230, 261231, 261232, 261233, 480638, 480639, 480640, 480641, 480642, 480643, 480644, 480645, 480646, 480647};
ItemIDsDatabase["Glacial Gloves"] = {6022654, 22654, 261234, 261235, 261236, 261237, 261238, 261239, 261240, 261241, 261242, 261243, 261244, 261245, 480648, 480649, 480650, 480651, 480652, 480653, 480654, 480655, 480656, 480657};
ItemIDsDatabase["Glacial Wrists"] = {6022655, 22655, 261246, 261247, 261248, 261249, 261250, 261251, 261252, 261253, 261254, 261255, 261256, 261257, 480658, 480659, 480660, 480661, 480662, 480663, 480664, 480665, 480666, 480667};
@@ -4998,3 +4997,14 @@ ItemIDsDatabase["Warden's Hammer"] = {267627, 25519, 267626, 267628, 267629, 267
ItemIDsDatabase["Marshstrider's Spaulders"] = {267640, 25522, 267639, 267641, 267642, 267643, 267644, 267645, 267646, 267647, 267648, 267649, 267650, 267651, 494917, 494918, 494919, 494920, 494921, 494922, 494923, 494924, 494925, 494926};
ItemIDsDatabase["Windcaller's Gauntlets"] = {267653, 25523, 267652, 267654, 267655, 267656, 267657, 267658, 267659, 267660, 267661, 267662, 267663, 267664, 494927, 494928, 494929, 494930, 494931, 494932, 494933, 494934, 494935, 494936};
ItemIDsDatabase["Cenarion Expedition Boots"] = {267666, 25524, 267665, 267667, 267668, 267669, 267670, 267671, 267672, 267673, 267674, 267675, 267676, 267677, 494937, 494938, 494939, 494940, 494941, 494942, 494943, 494944, 494945, 494946};
--Items not added from generated file
ItemIDsDatabase["Bindings of the Windseeker (Left)"] = {18563, 18563, 318563, 218563};
ItemIDsDatabase["Bindings of the Windseeker (Right)"] = {18564, 18564, 318564, 218564};
ItemIDsDatabase["Eye of Sulfuras"] = {17204, 17204, 317204, 217204};
ItemIDsDatabase["Essence of the Firelord"] = {19017, 19017, 319017, 219017};
ItemIDsDatabase["Medallion of Binding Shard"] = {11879, 11879, 311879, 211879};
ItemIDsDatabase["Atiesh, Greatstaff of the Guardian (Mage)"] = {6022589, 22589, 100174, 222589};
ItemIDsDatabase["Atiesh, Greatstaff of the Guardian (Druid)"] = {6022632, 22632, 22632, 222632};
ItemIDsDatabase["Atiesh, Greatstaff of the Guardian (Priest)"] = {6022631, 22631, 22631, 222631};
ItemIDsDatabase["Atiesh, Greatstaff of the Guardian (Warlock)"] = {6022630, 22630, 22630, 222630};