Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
m
Correct item name error
(Moved where the TotH icon is and added it to (hopefully) all possible Loot sources)
m (Correct item name error)
(6 intermediate revisions by 3 users not shown)
Line 389: Line 389:
local thiefItems = Skills.getThievingSourcesForItem(item.id)
local thiefItems = Skills.getThievingSourcesForItem(item.id)
if type(thiefItems) == 'table' then
if type(thiefItems) == 'table' then
local includedNPCs = {}
local thiefPart = {}
local thiefPart = {}
for i, thiefRow in ipairs(thiefItems) do
for i, thiefRow in ipairs(thiefItems) do
Line 394: Line 395:
--if 'all' is the npc, this is a rare item so just say 'Thieving level 1'
--if 'all' is the npc, this is a rare item so just say 'Thieving level 1'
table.insert(lineArray, Icons._SkillReq('Thieving', 1))
table.insert(lineArray, Icons._SkillReq('Thieving', 1))
else
elseif not Shared.contains(includedNPCs, thiefRow.npc) then
table.insert(thiefPart, Icons.Icon({thiefRow.npc, type='thieving', notext=true}))
table.insert(thiefPart, Icons.Icon({thiefRow.npc, type='thieving', notext=true}))
table.insert(includedNPCs, thiefRow.npc)
end
end
end
end
Line 496: Line 498:
table.insert(lineArray, Icons.Icon({'Fishing', type='skill', notext=true}) .. ' [[Fishing#Special|Special]]')
table.insert(lineArray, Icons.Icon({'Fishing', type='skill', notext=true}) .. ' [[Fishing#Special|Special]]')
elseif item.id == SkillData.Fishing.lostChestItem then
elseif item.id == SkillData.Fishing.lostChestItem then
table.insert(lineArray, Icons._SkillReq(SkillData.Fishing.name, 1))
table.insert(lineArray, Icons._SkillReq(SkillData.Fishing.name, 100))
end
end


Line 585: Line 587:
elseif item.id == 'melvorD:Signet_Ring_Half_B' then
elseif item.id == 'melvorD:Signet_Ring_Half_B' then
table.insert(lineArray, 'Killing any monster while wearing '..Icons.Icon({'Gold Topaz Ring', type='item'}))
table.insert(lineArray, 'Killing any monster while wearing '..Icons.Icon({'Gold Topaz Ring', type='item'}))
elseif item.id == 'melvorTotH:Deadly_Toxins_Potion' then
--Adding a special override for Deadly Toxins potions
table.insert(lineArray, 'Brewing [[Lethal Toxins Potion]]s while wearing '..Icons.Icon({'Toxic Maker Gloves', type='item'}))
end
--Township Task reward
for _, task in ipairs(SkillData.Township.tasks) do
if task.rewards.items[1] ~= nil then -- Skip tasks with no items
if GameData.getEntityByID(task.rewards.items, item.id) then
table.insert(lineArray, Icons.Icon({'Tasks', type='township'}))
break
end
end
end
end


Line 720: Line 735:
sourceTxt = Icons.Icon({thiefRow.npc, type='thieving'})
sourceTxt = Icons.Icon({thiefRow.npc, type='thieving'})
end
end
table.insert(dropRows, {source = sourceTxt, type = Icons.Icon({SkillData.Thieving.name, type='skill'}), minqty = thiefRow.minQty, qty = thiefRow.maxQty, weight = thiefRow.wt, totalWeight = thiefRow.totalWt, expIcon = thiefRow.npcID})
table.insert(dropRows, {source = sourceTxt, type = Icons.Icon({SkillData.Thieving.name, type='skill'}), minqty = thiefRow.minQty, qty = thiefRow.maxQty, weight = thiefRow.wt, totalWeight = thiefRow.totalWt, expIcon = Icons.getExpansionIcon(thiefRow.npcID)})
end
end


Line 758: Line 773:
local mineType = Icons.Icon({SkillData.Mining.name, type='skill'})
local mineType = Icons.Icon({SkillData.Mining.name, type='skill'})
local expIcon = ''
local expIcon = ''
local sourceTxt
if item.type == 'Superior Gem' then
if item.type == 'Superior Gem' then
expIcon = Icons.TotH()
expIcon = Icons.TotH()
sourceTxt = '[[Mining#Superior Gems|Superior Gem]]'
else
sourceTxt = '[[Mining#Gems|Gem]]'
end
end
table.insert(dropRows, {source = '[[Mining#Gems|Gem]]', type = mineType, minqty = thisGem.minQuantity, qty = thisGem.maxQuantity, weight = thisGem.weight, totalWeight = totalGemWeight, expIcon = expIcon})
table.insert(dropRows, {source = sourceTxt, type = mineType, minqty = thisGem.minQuantity, qty = thisGem.maxQuantity, weight = thisGem.weight, totalWeight = totalGemWeight, expIcon = expIcon})
-- Check for Alt. Magic spells also
-- Check for Alt. Magic spells also
Line 1,048: Line 1,067:
'Mastery Token (Cooking)',
'Mastery Token (Cooking)',
'Gem Gloves',
'Gem Gloves',
"Thief's Moneysack"
"Thief's Moneysack",
"Golden Stardust"
}
}
local checkFuncs = {
local checkFuncs = {