892
edits
mNo edit summary |
mNo edit summary |
||
Line 152: | Line 152: | ||
function p._getStrongestAfflicted() | function p._getStrongestAfflicted() | ||
local | 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) | ||
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 | return maxHitsPerMonsterStyle | ||
end | end | ||
edits