Anonymous

Module:Items/SourceTables: Difference between revisions

From Melvor Idle
_getItemSources/_getItemLootSourceTable: Support Impending Darkness event rewards
(Fixed mining level reference)
(_getItemSources/_getItemLootSourceTable: Support Impending Darkness event rewards)
Line 373: Line 373:
       end
       end
     end
     end
  end
  -- Is the item dropped from a cycle of the Impending Darkness event?
  for i, eventItemID in ipairs(Areas.eventData.rewards) do
  if item.id == eventItemID then
    if string.len(dungeonStr) > 0 then
    dungeonStr = dungeonStr .. ','
    else
    dungeonStr = 'Completing: '
    end
    local dungPrefix = (i == Shared.tableCount(Areas.eventData.rewards) and '' or i .. ' ' .. (i == 1 and 'cycle' or 'cycles') .. ' of ')
    dungeonStr = dungeonStr .. dungPrefix .. Icons.Icon({'Impending Darkness Event', type='dungeon', notext=true})
    break
  end
   end
   end
   -- Special exceptions for Fire/Infernal Cape and first two lore books
   -- Special exceptions for Fire/Infernal Cape and first two lore books
Line 685: Line 698:
       if monster.isBoss and not Shared.contains(item.name, 'Shard') then
       if monster.isBoss and not Shared.contains(item.name, 'Shard') then
         local dung = Areas.getMonsterAreas(i - 1)[1]
         local dung = Areas.getMonsterAreas(i - 1)[1]
         sourceTxt = Icons.Icon({dung.name, type='dungeon', notext=true})
         sourceTxt = Icons.Icon({dung.name, type='dungeon'})
         typeTxt = '[[Dungeon]]'
         typeTxt = '[[Dungeon]]'
       else
       else
Line 693: Line 706:
       table.insert(dropRows, {source = sourceTxt, type = typeTxt, minqty = minqty, qty = qty, weight = wt * lootChance, totalWeight = totalWt * 100})
       table.insert(dropRows, {source = sourceTxt, type = typeTxt, minqty = minqty, qty = qty, weight = wt * lootChance, totalWeight = totalWt * 100})
     end
     end
  end
  -- Is the item dropped from a cycle of the Impending Darkness event?
  for i, eventItemID in ipairs(Areas.eventData.rewards) do
  if item.id == eventItemID then
    sourceTxt = Icons.Icon({'Impending Darkness Event', type='dungeon'}) .. (i == Shared.tableCount(Areas.eventData.rewards) and '' or ', Cycle ' .. i)
    table.insert(dropRows, {source = sourceTxt, type = '[[Dungeon]]', minqty = 1, qty = 1, weight = 1, totalWeight = 1})
    break
  end
   end
   end


   --Special exception for the Fire/Infernal Cape and first two lore books as bonus dungeon drops
   --Special exception for the Fire/Infernal Cape and first two lore books as bonus dungeon drops
   if sourceOverrides['Dungeon'][item.id] ~= nil then
   if sourceOverrides['Dungeon'][item.id] ~= nil then
     local sourceTxt = Icons.Icon({sourceOverrides['Dungeon'][item.id], type='dungeon', notext=true})
     local sourceTxt = Icons.Icon({sourceOverrides['Dungeon'][item.id], type='dungeon'})
     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})
   end
   end