Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Added support for abyssal resistance in effective monster HP
(Added normal damage just in case)
(Added support for abyssal resistance in effective monster HP)
Line 142: Line 142:
local monster = p.getMonster(MonsterName)
local monster = p.getMonster(MonsterName)
if monster ~= nil then
if monster ~= nil then
return math.floor((p._getMonsterHP(monster)/(1 - p._getMonsterStat(monster, 'damageReduction')/100)) + 0.5)
if monster.damageType == 'melvorD:Normal' then
return math.floor((p._getMonsterHP(monster)/(1 - p._getMonsterStat(monster, 'damageReduction')/100)) + 0.5)
elseif monster.damageType == 'melvorItA:Abyssal' then
return math.floor((p._getMonsterHP(monster)/(1 - p._getMonsterStat(monster, 'resistance')/100)) + 0.5)
else
return Shared.printError('Monster with damage type: ' .. monster.damageType .. ' is not supported')
end
else
else
return Shared.printError('No monster with that name found')
return Shared.printError('No monster with that name found')