Module:Monsters: Difference between revisions

no edit summary
(_getMonsterBaseMaxHit: Fix typo)
No edit summary
Line 132: Line 132:
function p._getMonsterHP(monster)
function p._getMonsterHP(monster)
   return 10 * p._getMonsterLevel(monster, 'Hitpoints')
   return 10 * p._getMonsterLevel(monster, 'Hitpoints')
end
function p.getMonsterEffectiveHP(frame)
  local MonsterName = frame.args ~= nil and frame.args[1] or frame
  local monster = p.getMonster(MonsterName)
  if monster ~= nil then
    return p._getMonsterHP(monster)/(100 - p._getMonsterStat(monster, 'damageReduction'))
  else
    return "ERROR: No monster with that name found[[Category:Pages with script errors]]"
  end
end
end


318

edits