Module:Monsters: Difference between revisions

Change to fit new format for getting spells by id
(Fixed chest drop table quantity sorting issue.)
(Change to fit new format for getting spells by id)
Line 272: Line 272:
   elseif monster.attackType == Constants.attackType.Magic then
   elseif monster.attackType == Constants.attackType.Magic then
     local mSpell = nil
     local mSpell = nil
     if monster.selectedSpell ~= nil then mSpell = Magic.getSpellByID(monster.selectedSpell) end
     if monster.selectedSpell ~= nil then mSpell = Magic.getSpellByID('Spells', monster.selectedSpell) end
     if mSpell == nil then
     if mSpell == nil then
       return math.floor(10 * (monster.setMaxHit + (monster.setMaxHit * monster.damageBonusMagic / 100)))
       return math.floor(10 * (monster.setMaxHit + (monster.setMaxHit * monster.damageBonusMagic / 100)))
Line 325: Line 325:
   end
   end
   if normalAttackChance == 100 then
   if normalAttackChance == 100 then
     result = iconText..'1-'..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'
     result = iconText..'1 - '..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'
   elseif normalAttackChance > 0 then
   elseif normalAttackChance > 0 then
     result = '* '..normalAttackChance..'% '..iconText..'1-'..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'..result
     result = '* '..normalAttackChance..'% '..iconText..'1-'..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'..result