Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Fix RandomSpiderLair handling
(Amend further in case sale value is zero)
(Fix RandomSpiderLair handling)
Line 83: Line 83:
iconText = Icons.Icon({'Magic', type='skill', notext=notext, nolink=nolink})
iconText = Icons.Icon({'Magic', type='skill', notext=notext, nolink=nolink})
elseif monster.attackType == 'random' then
elseif monster.attackType == 'random' then
iconText = Icons.Icon({'Bane', notext=notext, nolink=nolink, img='Question'})
iconText = Icons.Icon({monster.name, notext=notext, nolink=nolink, img='Question'})
end
end


Line 965: Line 965:
elseif specialType == 'Spider' then
elseif specialType == 'Spider' then
local iconQ = Icons.Icon({'', notext=true, nolink=true, img='Question'})
local iconQ = Icons.Icon({'', notext=true, nolink=true, img='Question'})
local monIconPart = { 'Any of the following:' }
for i, monsterID in ipairs(GameData.rawData.spiderLairMonsters) do
local monster = p.getMonsterByID(monsterID)
if monster ~= nil then
table.insert(monIconPart, Icons.Icon({monster.name, type='monster'}))
end
end
monIcon = table.concat(monIconPart, '<br/>')
monLevel, monHP, monMaxHit, monStyle, monCount = iconQ, iconQ, iconQ, iconQ, monsterCount
monLevel, monHP, monMaxHit, monStyle, monCount = iconQ, iconQ, iconQ, iconQ, monsterCount
elseif specialType == 'SlayerArea' then
elseif specialType == 'SlayerArea' then
Line 1,109: Line 1,117:
table.insert(monsterList, Icons.Icon({'Affliction', 'Afflicted Monster', img='Question', qty=monster.count}))
table.insert(monsterList, Icons.Icon({'Affliction', 'Afflicted Monster', img='Question', qty=monster.count}))
elseif monster.id == 'melvorTotH:RandomSpiderLair' then
elseif monster.id == 'melvorTotH:RandomSpiderLair' then
table.insert(monsterList, Icons.Icon({'Spider', img='Question', nolink=true, qty=monster.count}))
local monIconPart = { Shared.formatnum(monster.count) .. ' Spiders:' }
for i, monsterID in ipairs(GameData.rawData.spiderLairMonsters) do
local monster = p.getMonsterByID(monsterID)
if monster ~= nil then
table.insert(monIconPart, '&nbsp;&nbsp;&nbsp;' .. Icons.Icon({monster.name, type='monster'}))
end
end
table.insert(monsterList, table.concat(monIconPart, '<br/>'))
else
else
local monsterObj = p.getMonsterByID(monster.id)
local monsterObj = p.getMonsterByID(monster.id)