17,101
edits
mNo edit summary |
(Use game data for list of ITM afflicted monsters) |
||
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(AreaData.itm.monsters) do | |||
for _, id in Shared.skpairs( | |||
local monster = Monsters.getMonsterByID(id) | local monster = Monsters.getMonsterByID(id) | ||
local styleName = Constants.getCombatStyleName(monster.attackType) | local styleName = Constants.getCombatStyleName(monster.attackType) | ||
Line 154: | Line 153: | ||
local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 } | local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 } | ||
for _, id in Shared.skpairs(AreaData.itm.monsters) do | |||
for _, id in Shared.skpairs( | |||
local monster = Monsters.getMonsterByID(id) | local monster = Monsters.getMonsterByID(id) | ||
local styleName = Constants.getCombatStyleName(monster.attackType) | local styleName = Constants.getCombatStyleName(monster.attackType) | ||
Line 177: | Line 175: | ||
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 | ||