Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Showing only one AR for Bnae
(added some handling to random style to fix issues caused by Bane, who is a jerk.)
(Showing only one AR for Bnae)
Line 225: Line 225:
     bonus = p.getEquipmentStat(monster, 'magicAttackBonus')
     bonus = p.getEquipmentStat(monster, 'magicAttackBonus')
   elseif monster.attackType == 'random' then
   elseif monster.attackType == 'random' then
   local arArray = {}
   --Bane has the same AR with every attack type so being lazy and just showing the one.
  local iconText = Icons.Icon({'Melee', notext=true})
     baseLevel = p._getMonsterLevel(monster, 'Attack')
     baseLevel = p._getMonsterLevel(monster, 'Attack')
     bonus = p.getEquipmentStat(monster, 'stabAttackBonus')
     bonus = p.getEquipmentStat(monster, 'stabAttackBonus')
    table.insert(arArray, iconText..' '..p.calculateStandardStat(baseLevel, bonus))
    iconText = Icons.Icon({'Ranged', type='skill', notext=true})
    baseLevel = p._getMonsterLevel(monster, 'Ranged')
    bonus = p.getEquipmentStat(monster, 'rangedAttackBonus')
    table.insert(arArray, iconText..' '..p.calculateStandardStat(baseLevel, bonus))
    iconText = Icons.Icon({'Magic', type='skill', notext=true})
    baseLevel = p._getMonsterLevel(monster, 'Magic')
    bonus = p.getEquipmentStat(monster, 'magicAttackBonus')
    table.insert(arArray, iconText..' '..p.calculateStandardStat(baseLevel, bonus))
    return table.concat(arArray, '<br/>')
   else
   else
     return "ERROR: This monster has an invalid attack type somehow[[Category:Pages with script errors]]"
     return "ERROR: This monster has an invalid attack type somehow[[Category:Pages with script errors]]"