Anonymous

Module:Items: Difference between revisions

From Melvor Idle
Bolding category names from getOtherItemBoxText
(Added double loot chance items category)
(Bolding category names from getOtherItemBoxText)
(One intermediate revision by the same user not shown)
Line 130: Line 130:
     result = item.description
     result = item.description
     if result == nil or result == '' then result = 'No Description' end
     if result == nil or result == '' then result = 'No Description' end
  elseif StatName == 'completionReq' then
    if item.ignoreCompletion == nil or not item.ignoreCompletion then
      return 'Yes'
    else
      return 'No'
    end
   end
   end
   if result == nil and ZeroIfNil then result = 0 end
   if result == nil and ZeroIfNil then result = 0 end
Line 208: Line 214:
   --For equipment, show the slot they go in
   --For equipment, show the slot they go in
   if item.equipmentSlot ~= nil then
   if item.equipmentSlot ~= nil then
     result = result..'\r\n|-\r\n|Equipment Slot: '..p.getEquipmentSlotName(item.equipmentSlot)
     result = result.."\r\n|-\r\n|'''Equipment Slot:''' "..p.getEquipmentSlotName(item.equipmentSlot)
   end
   end
   --For weapons with a special attack, show the details
   --For weapons with a special attack, show the details
   if item.hasSpecialAttack then
   if item.hasSpecialAttack then
     local spAtt = p.getSpecialAttackByID(item.specialAttackID)
     local spAtt = p.getSpecialAttackByID(item.specialAttackID)
     result = result..'\r\n|-\r\n|Special Attack:'
     result = result.."\r\n|-\r\n|'''Special Attack:'''"
     result = result..'\r\n* '..spAtt.chance..'% chance for '..spAtt.name..':'
     result = result..'\r\n* '..spAtt.chance..'% chance for '..spAtt.name..':'
     result = result..'\r\n** '..spAtt.description
     result = result..'\r\n** '..spAtt.description
Line 219: Line 225:
   --For potions, show the number of charges
   --For potions, show the number of charges
   if item.potionCharges ~= nil then
   if item.potionCharges ~= nil then
     result = result..'\r\n|-\r\n|Charges: '..item.potionCharges
     result = result.."\r\n|-\r\n|'''Charges:''' "..item.potionCharges
   end
   end
   --For food, show how much it heals for
   --For food, show how much it heals for
   if item.healsFor ~= nil then
   if item.healsFor ~= nil then
     result = result..'\r\n|-\r\n|Heals for: '..Icons.Icon({"Hitpoints", type="skill", notext="true"})..' '..(item.healsFor * 10)
     result = result.."\r\n|-\r\n|'''Heals for:''' "..Icons.Icon({"Hitpoints", type="skill", notext="true"})..' '..(item.healsFor * 10)
   end
   end
   --For Prayer Points, show how many you get
   --For Prayer Points, show how many you get
   if item.prayerPoints ~= nil then
   if item.prayerPoints ~= nil then
     result = result..'\r\n|-\r\n|'..Icons.Icon({'Prayer', type='skill'})..' Points: '..item.prayerPoints
     result = result.."\r\n|-\r\n|'''"..Icons.Icon({'Prayer', type='skill'}).." Points:''' "..item.prayerPoints
   end
   end
   return result
   return result