Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
attempting to create function to pull monster coin drops for Foxy
(Adjusted gp drops to v0.18 always dropping coins. Fixed max coins to adjust for dropCoins[2] actually being max-1)
(attempting to create function to pull monster coin drops for Foxy)
Line 747: Line 747:
     return "ERROR: "..areaName.." is not a dungeon"
     return "ERROR: "..areaName.." is not a dungeon"
   end
   end
end
function p.getFoxyTable(frame)
  local result = 'Monster,Min GP,Max GP,Average GP'
  for i, monster in Shared.skpairs(MonsterData.Monsters) do
    if ((not p._isDungeonOnlyMonster(monster) or monster.isBoss) and not monster.dropsCoins == nil) then
      local avgGp = (monster.dropCoins[1] + monster.dropCoins[2] - 1) / 2
      result = result..'\r\n'..monster.name..','..monster.dropCoins[1]..','..monster.dropCoin[2]..','..monster.avgGp
    end
  end
  return result
end
end


return p
return p