Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Amend/correct handling for random ITM and random spider lair monsters
(monsters -> monsterIDs to match game data)
(Amend/correct handling for random ITM and random spider lair monsters)
Line 953: Line 953:
local monIcon, monLevel, monHP, monMaxHit, monStyle, monCount
local monIcon, monLevel, monHP, monMaxHit, monStyle, monCount
local monData = {}
local monData = {}
if specialType ~= nil and Shared.contains({'Afflicted', 'SlayerArea'}, specialType) then
if specialType ~= nil and Shared.contains({'Afflicted', 'Spider', 'SlayerArea'}, specialType) then
-- Special handling for Into the Mist
-- Special handling for Into the Mist
if specialType == 'Afflicted' then
if specialType == 'Afflicted' then
local iconQ = Icons.Icon({'Into the Mist', notext=true, nolink=true, img='Question'})
local iconQ = Icons.Icon({'Into the Mist', notext=true, nolink=true, img='Question'})
monIcon = Icons.Icon({'Into the Mist', 'Afflicted Monster', nolink=true, img='Question'})
monIcon = Icons.Icon({'Into the Mist', 'Afflicted Monster', nolink=true, img='Question'})
monLevel, monHP, monMaxHit, monStyle, monCount = iconQ, iconQ, iconQ, iconQ, monsterCount
elseif specialType == 'Spider' then
local iconQ = Icons.Icon({'', notext=true, nolink=true, img='Question'})
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,029: Line 1,032:
for i, monsterID in pairs(area.monsterIDs) do
for i, monsterID in pairs(area.monsterIDs) do
if not Shared.contains(usedMonsters, monsterID) then
if not Shared.contains(usedMonsters, monsterID) then
if monsterID >= 0 then
if monsterID == 'melvorF:RandomITM' then
table.insert(returnPart, buildRow(monsterID, monsterCounts[monsterID]))
else
--Special handling for Into the Mist
--Special handling for Into the Mist
table.insert(returnPart, buildRow(monsterID, monsterCounts[monsterID], 'Afflicted'))
table.insert(returnPart, buildRow(monsterID, monsterCounts[monsterID], 'Afflicted'))
elseif monsterID == 'melvorTotH:RandomSpiderLair' then
table.insert(returnPart, buildRow(monsterID, monsterCounts[monsterID], 'Spider'))
else
table.insert(returnPart, buildRow(monsterID, monsterCounts[monsterID]))
end
end
table.insert(usedMonsters, monsterID)
table.insert(usedMonsters, monsterID)
Line 1,082: Line 1,087:
for i, monsterID in Shared.skpairs(area.monsterIDs) do
for i, monsterID in Shared.skpairs(area.monsterIDs) do
if monsterID ~= lastID then
if monsterID ~= lastID then
local monster = nil
if monsterID == 'melvorF:RandomITM' then
if monsterID ~= -1 then monster = p.getMonsterByID(monsterID) end
--Special handling for Afflicted Monsters
if lastID ~= -2 then
table.insert(monsterList, Icons.Icon({'Affliction', 'Afflicted Monster', img='Question', qty=count}))
if lastID == -1 then
elseif monsterID == 'melvorTotH:RandomSpiderLair' then
--Special handling for Afflicted Monsters
table.insert(monsterList, Icons.Icon({'Spider', img='Question', nolink=true, qty=count}))
table.insert(monsterList, Icons.Icon({'Affliction', 'Afflicted Monster', img='Question', qty=count}))
else
else
local monster = p.getMonsterByID(monsterID)
local name = lastMonster.name
table.insert(monsterList, Icons.Icon({monster.name, type='monster', qty=count}))
table.insert(monsterList, Icons.Icon({name, type='monster', qty=count}))
end
end
end
lastMonster = monster
lastMonster = monster