12,790
edits
mNo edit summary |
(Use game data for list of ITM afflicted monsters) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 50: | Line 50: | ||
local monster = Monsters.getMonsterByID(monsterID) | local monster = Monsters.getMonsterByID(monsterID) | ||
if monster == nil and monsterID == -1 then | if monster == nil and monsterID == -1 then | ||
for _, id in Shared.skpairs( | for _, id in Shared.skpairs(AreaData.itm.monsters) do | ||
local monster = Monsters.getMonsterByID(id) | local monster = Monsters.getMonsterByID(id) | ||
local styleName = Constants.getCombatStyleName(monster.attackType) | local styleName = Constants.getCombatStyleName(monster.attackType) | ||
Line 124: | Line 124: | ||
local ae = 0.4 | local ae = 0.4 | ||
return p._getDungeonTotalHP(dung, true) | --return p._getDungeonTotalHP(dung, true) | ||
return p._getDungeonMinDR(dung, maxHp, ae) | |||
end | end | ||
Line 151: | Line 151: | ||
function p._getStrongestAfflicted() | function p._getStrongestAfflicted() | ||
local | local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 } | ||
for _, id in Shared.skpairs( | for _, id in Shared.skpairs(AreaData.itm.monsters) 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 | ||
function p._getAfflictedAverageHP() | function p._getAfflictedAverageHP() | ||
local totalHp = 0 | local totalHp = 0 | ||
local afflicted = | local afflicted = AreaData.itm.monsters | ||
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) | totalHp = totalHp + Monsters._getMonsterHP(monster) | ||
end | end | ||
return math.ceil(totalHp / | return math.ceil(totalHp / Shared.tableCount(afflicted)) | ||
end | end | ||