Anonymous

Module:Items: Difference between revisions

From Melvor Idle
1,014 bytes added ,  16 October 2020
Added special loot source exceptions for the Fire Cape and ensured that chest source tables specify completing dungeons rather than defeating bosses.
(Automatic skillcape table)
(Added special loot source exceptions for the Fire Cape and ensured that chest source tables specify completing dungeons rather than defeating bosses.)
Line 508: Line 508:
     end
     end
   end
   end
  --Add the Fire Cape's special exception:
  if item.name == 'Fire Cape' then
    if string.len(dungeonStr) > 0 then
      dungeonStr = dungeonStr..','
    else
      dungeonStr = 'Completing: '
    end
    dungeonStr = dungeonStr..Icons.Icon({"Volcanic Cave", type="dungeon", notext=true})
  end
   if string.len(dungeonStr) > 0 then table.insert(lineArray, dungeonStr) end
   if string.len(dungeonStr) > 0 then table.insert(lineArray, dungeonStr) end
   if string.len(killStr) > 0 then table.insert(lineArray, killStr) end
   if string.len(killStr) > 0 then table.insert(lineArray, killStr) end
Line 1,298: Line 1,308:
     end
     end
     if chance > 0 then
     if chance > 0 then
       local sourceTxt = Icons.Icon({monster.name, type='monster'})
       --If we're dealing with a boss, this is a Dungeon row instead
      table.insert(dropRows, {source = sourceTxt, type = '[[Monster]]', minqty = minqty, qty = qty, chance = chance})
      if monster.isBoss and not Shared.contains(item.name, 'Shard') then
        local dung = Areas.getMonsterAreas(i - 1)[1]
        local sourceTxt = Icons.Icon({dung.name, type="dungeon", notext=true})
        table.insert(dropRows, {source = sourceTxt, type = '[[Dungeon]]', minqty = minqty, qty = qty, chance = chance})
      else
        local sourceTxt = Icons.Icon({monster.name, type='monster'})
        table.insert(dropRows, {source = sourceTxt, type = '[[Monster]]', minqty = minqty, qty = qty, chance = chance})
      end
     end
     end
  end
  --Special exception for the Fire Cape as a bonus dungeon drop
  if item.name == 'Fire Cape' then
      local sourceTxt = Icons.Icon({"Volcanic Cave", type="dungeon", notext=true})
      table.insert(dropRows, {source = sourceTxt, type = '[[Dungeon]]', minqty = 1, qty = 1, chance = 100})
   end
   end