better optimized db and function for QuestItemStarterDB

Thanks @Loaal
This commit is contained in:
Crum
2018-12-07 16:17:19 -06:00
parent bff0f4dc9a
commit 6088b69440
2 changed files with 253 additions and 258 deletions
+11 -16
View File
@@ -560,32 +560,27 @@ function GetThreatStatus(currentThreat, maxThreat)
end
end
function GetQuestItemStarterInfo(link)
function GetQuestItemStarterInfo(itemLink)
local isQuestItem, isQuestStarter, invalidQuestItem = false, false, false
if link then
local itemType = select(6, GetItemInfo(match(link, "item:(%d+)")))
if itemLink then
local _, _, itemID = find(itemLink, "(%d+):")
if itemType and itemType == "Quest" then
if QIS.QuestItemKeyIDs[itemID] then
isQuestItem = true
end
for _, info in pairs(QIS.QuestItemKeyIDs) do
if match(link, "item:(%d+):") == info then
else
local _, _, _, _, _, itemType = GetItemInfo(itemID)
if itemType == "Quest" then
isQuestItem = true
end
end
for _, info in pairs(QIS.QuestItemStarterIDs) do
if (match(link, "item:(%d+):") == info) then
isQuestStarter = true
end
if QIS.QuestItemStarterIDs[itemID] then
isQuestStarter = true
end
for _, info in pairs(QIS.InvalidQuestItemIDs) do
if match(link, "item:(%d+):") == info then
invalidQuestItem = true
end
if QIS.InvalidQuestItemIDs[itemID] then
invalidQuestItem = true
end
end