4,683
edits
(Amended for gameData updates) |
(Fix lua errors caused by gameData update) |
||
Line 144: | Line 144: | ||
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._getMonsterResistance(monster)/100)) + 0.5) | |||
else | else | ||
return Shared.printError('No monster with that name found') | return Shared.printError('No monster with that name found') | ||
Line 160: | Line 154: | ||
local monster = p.getMonster(MonsterName) | local monster = p.getMonster(MonsterName) | ||
if monster ~= nil then | if monster ~= nil then | ||
return math.floor((p._getMonsterBarrier(monster)/(1 - p. | return math.floor((p._getMonsterBarrier(monster)/(1 - p._getMonsterResistance(monster)/100)) + 0.5) | ||
else | else | ||
return Shared.printError('No monster with that name found') | return Shared.printError('No monster with that name found') | ||
Line 363: | Line 357: | ||
function p._getMonsterResistance(monster) | function p._getMonsterResistance(monster) | ||
-- Currently all Eternal damage monsters have Abyssal Resistance | -- Currently all Eternal damage monsters have Abyssal Resistance | ||
-- This may change in the future. If so, uncomment the below and delete this. | -- This may change in the future. If so, uncomment the below and delete this. | ||
if monster.damageType == 'melvorItA:Abyssal' or monster.damageType == 'melvorItA:Eternal' then | if monster.damageType == 'melvorItA:Abyssal' or monster.damageType == 'melvorItA:Eternal' then | ||
return p._getMonsterStat(monster, 'resistanceAbyssal'), 'Abyssal Resistance' | |||
--elseif monster.damageType == 'melvorItA:Eternal' then | --elseif monster.damageType == 'melvorItA:Eternal' then | ||
-- | -- return p._getMonsterStat(monster, 'resistanceEternal'), 'Eternal Resistance' | ||
else | else | ||
return p._getMonsterStat(monster, 'damageReduction'), 'Damage Reduction' | |||
end | end | ||
end | end | ||
Line 468: | Line 457: | ||
local monsterDR = 0 | local monsterDR = 0 | ||
if monster ~= nil then | if monster ~= nil then | ||
monsterDR = p. | monsterDR = p._getMonsterResistance(monster) | ||
end | end | ||
thisHit = normalMaxHit * dmg.maxPercent * 0.01 * (1 + monsterDR * 0.01) | thisHit = normalMaxHit * dmg.maxPercent * 0.01 * (1 + monsterDR * 0.01) |