Module:Items/SourceTables: Difference between revisions

Added handling for Earth Golem (AoD) being a different thing
mNo edit summary
(Added handling for Earth Golem (AoD) being a different thing)
Line 11: Line 11:
local Monsters = require('Module:Monsters')
local Monsters = require('Module:Monsters')
local Skills = require('Module:Skills')
local Skills = require('Module:Skills')
local SourceOverrides = {
['melvorAoD:EarthGolem'] = 'Earth Golem (AoD)'
}


function p._getCreationTable(item)
function p._getCreationTable(item)
Line 317: Line 321:
if isDrop then
if isDrop then
-- Item drops when the monster is killed
-- Item drops when the monster is killed
table.insert(killStrPart, Icons.Icon({monster.name, type='monster', notext=true}))
local iconName = monster.name
if SourceOverrides[monster.id] ~= nil then
iconName = SourceOverrides[monster.id]
end
table.insert(killStrPart, Icons.Icon({iconName, type='monster', notext=true}))
end
end
end
end
Line 821: Line 829:
for i, drop in ipairs(p._getItemMonsterSources(item)) do
for i, drop in ipairs(p._getItemMonsterSources(item)) do
local monster = GameData.getEntityByID('monsters', drop.id)
local monster = GameData.getEntityByID('monsters', drop.id)
local iconName = monster.name
if SourceOverrides[drop.id] ~= nil then
iconName = SourceOverrides[drop.id]
end
if monster ~= nil then
if monster ~= nil then
table.insert(dropRows, {source = Icons.Icon({monster.name, 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