Module:Items/SourceTables/Sandbox: Difference between revisions

m
Minor formatting
(Create sandbox page)
 
m (Minor formatting)
Line 789: Line 789:
table.insert(resultPart, '{| class="wikitable sortable stickyHeader"')
table.insert(resultPart, '{| class="wikitable sortable stickyHeader"')
table.insert(resultPart, '\r\n|- class="headerRow-0"')
table.insert(resultPart, '\r\n|- class="headerRow-0"')
table.insert(resultPart, '\r\n!Source!!Source Type!!Quantity!!colspan="2"|Chance')
table.insert(resultPart, '\r\n!Source!!Source Type!!Level!!Quantity!!colspan="2"|Chance')


--Set up function for adding rows
--Set up function for adding rows
Line 843: Line 843:
end
end
if monster ~= nil then
if monster ~= nil then
table.insert(dropRows, {source = Icons.Icon({iconName, type='monster'}), type = '[[Monster]]', minqty = drop.minQty, qty = drop.maxQty, weight = drop.dropWt, totalWeight = drop.totalWt, expIcon = Icons.getExpansionIcon(drop.id)})
table.insert(dropRows, {
source = Icons.Icon({iconName, type='monster'}),  
type = '[[Monster]]', minqty = drop.minQty,  
qty = drop.maxQty,  
weight = drop.dropWt,  
totalWeight = drop.totalWt,  
expIcon = Icons.getExpansionIcon(drop.id)})
end
end
end
end
Line 851: Line 857:
for i, drop in ipairs(p._getItemArchSources(item)) do
for i, drop in ipairs(p._getItemArchSources(item)) do
if drop.name ~= nil then
if drop.name ~= nil then
table.insert(dropRows, {source = Icons.Icon({drop.name, type='poi'}), type = '[[Archaeology|Dig Site]] ('..drop.size..')', minqty = drop.minQty, qty = drop.maxQty, weight = drop.dropWt, totalWeight = drop.totalWt, expIcon = Icons.getExpansionIcon(drop.id)})
table.insert(dropRows, {
source = Icons.Icon({drop.name, type='poi'}),  
type = '[[Archaeology|Dig Site]] ('..drop.size..')',  
minqty = drop.minQty,  
qty = drop.maxQty,  
weight = drop.dropWt,  
totalWeight = drop.totalWt,  
expIcon = Icons.getExpansionIcon(drop.id)})
end
end
end
end
Line 859: Line 872:
if (dungeon.oneTimeRewardID ~= nil and item.id == dungeon.oneTimeRewardID) or
if (dungeon.oneTimeRewardID ~= nil and item.id == dungeon.oneTimeRewardID) or
(type(dungeon.rewardItemIDs) == 'table' and Shared.contains(dungeon.rewardItemIDs, item.id)) then
(type(dungeon.rewardItemIDs) == 'table' and Shared.contains(dungeon.rewardItemIDs, item.id)) then
table.insert(dropRows, {source = Icons.Icon({dungeon.name, type='dungeon'}), type = '[[Dungeon]]', minqty = 1, qty = 1, weight = 1, totalWeight = 1, expIcon = Icons.getExpansionIcon(dungeon.id)})
table.insert(dropRows, {
source = Icons.Icon({dungeon.name, type='dungeon'}),  
type = '[[Dungeon]]',  
minqty = 1,  
qty = 1,  
weight = 1,  
totalWeight = 1,  
expIcon = Icons.getExpansionIcon(dungeon.id)})
elseif dungeon.eventID ~= nil then
elseif dungeon.eventID ~= nil then
-- Is the item dropped from a combat event (e.g. Impending Darkness event)?
-- Is the item dropped from a combat event (e.g. Impending Darkness event)?
Line 867: Line 887:
if item.id == itemRewardID then
if item.id == itemRewardID then
local sourceTxt = Icons.Icon({dungeon.name, type='dungeon'}) .. (eventCycle == Shared.tableCount(event.itemRewardIDs) and '' or ', Cycle ' .. eventCycle)
local sourceTxt = Icons.Icon({dungeon.name, type='dungeon'}) .. (eventCycle == Shared.tableCount(event.itemRewardIDs) and '' or ', Cycle ' .. eventCycle)
table.insert(dropRows, {source = sourceTxt, type = '[[Dungeon]]', minqty = 1, qty = 1, weight = 1, totalWeight = 1})
table.insert(dropRows, {
source = sourceTxt,  
type = '[[Dungeon]]',  
minqty = 1,  
qty = 1,  
weight = 1,  
totalWeight = 1})
break
break
end
end
Line 890: Line 916:
if wt > 0 then
if wt > 0 then
local sourceTxt = Icons.Icon({item2.name, type='item'})
local sourceTxt = Icons.Icon({item2.name, type='item'})
table.insert(dropRows, {source = sourceTxt, type = '[[Chest]]', minqty = minQty, qty = maxQty, weight = wt, totalWeight = totalWt, expIcon = Icons.getExpansionIcon(item2.id)})
table.insert(dropRows, {
source = sourceTxt,  
type = '[[Chest]]',  
minqty = minQty,  
qty = maxQty,  
weight = wt,  
totalWeight = totalWt,  
expIcon = Icons.getExpansionIcon(item2.id)})
end
end
end
end
Line 904: Line 937:
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 = Icons.getExpansionIcon(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 912: Line 952:
local fishType = Icons.Icon({'Fishing', type='skill'})
local fishType = Icons.Icon({'Fishing', type='skill'})
local fishTotWeight = Shared.tableCount(SkillData.Fishing.JunkItems)
local fishTotWeight = Shared.tableCount(SkillData.Fishing.JunkItems)
table.insert(dropRows, {source = fishSource, type = fishType, minqty = 1, qty = 1, weight = 1, totalWeight = fishTotWeight})
table.insert(dropRows, {
source = fishSource,  
type = fishType,  
minqty = 1,  
qty = 1,  
weight = 1,  
totalWeight = fishTotWeight})
else
else
local fishTotWeight, fishItem = 0, nil
local fishTotWeight, fishItem = 0, nil
Line 924: Line 970:
local fishSource = '[[Fishing#Special|Special]]'
local fishSource = '[[Fishing#Special|Special]]'
local fishType = Icons.Icon({SkillData.Fishing.name, type='skill'})
local fishType = Icons.Icon({SkillData.Fishing.name, type='skill'})
table.insert(dropRows, {source = fishSource, type = fishType, minqty = fishItem.minQuantity, qty = fishItem.maxQuantity, weight = fishItem.weight, totalWeight = fishTotWeight})
table.insert(dropRows, {
source = fishSource,  
type = fishType,  
minqty = fishItem.minQuantity,  
qty = fishItem.maxQuantity,  
weight = fishItem.weight,  
totalWeight = fishTotWeight})
end
end
end
end
Line 949: Line 1,001:
sourceTxt = '[[Mining#Gems|Gem]]'
sourceTxt = '[[Mining#Gems|Gem]]'
end
end
table.insert(dropRows, {source = sourceTxt, 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 956: Line 1,015:
for j, spell in ipairs(Magic.getSpellsBySpellBook('altMagic')) do
for j, spell in ipairs(Magic.getSpellsBySpellBook('altMagic')) do
if spell.produces ~= nil and spell.produces == producesKey then
if spell.produces ~= nil and spell.produces == producesKey then
table.insert(dropRows, {source = Icons.Icon({spell.name, type=Magic._getSpellIconType(spell)}), type = magicType, minqty = thisGem.minQuantity, qty = thisGem.maxQuantity, weight = thisGem.weight, totalWeight = totalGemWeight, expIcon = Icons.getExpansionIcon(spell.id)})
table.insert(dropRows, {
source = Icons.Icon({spell.name, type=Magic._getSpellIconType(spell)}),  
type = magicType,  
minqty = thisGem.minQuantity,  
qty = thisGem.maxQuantity,
weight = thisGem.weight,  
totalWeight = totalGemWeight,
expIcon = Icons.getExpansionIcon(spell.id)})
end
end
end
end
964

edits