Anonymous

Module:Mazunki/Dungeons: Difference between revisions

From Melvor Idle
m
no edit summary
mNo edit summary
mNo edit summary
Line 152: Line 152:


function p._getStrongestAfflicted()
function p._getStrongestAfflicted()
local highestMaxHit = 0
local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 }
local afflicted = Monsters._getAfflictedMonsterIdList()
local afflicted = Monsters._getAfflictedMonsterIdList()
for _, id in Shared.skpairs(afflicted) do
for _, id in Shared.skpairs(afflicted) do
local monster = Monsters.getMonsterByID(id)
local monster = Monsters.getMonsterByID(id)
totalHp = totalHp + Monsters._getMonsterHP(monster)
local styleName = Constants.getCombatStyleName(monster.attackType)
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true
if styleName == "Random" then
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do
if maxHit > value then
maxHitsPerMonsterStyle[randomStyle] = maxHit
end
end
else
if maxHit > maxHitsPerMonsterStyle[styleName] then
maxHitsPerMonsterStyle[styleName] = maxHit
end
end
end
end
return math.ceil(totalHp / #(afflicted))
return maxHitsPerMonsterStyle
end
end


892

edits