Module:Sandbox/Items/UseTables: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
local SkillData = mw.loadData('Module:Sandbox/Skills/data')
local SkillData = mw.loadData('Module:Sandbox/Skills/data')


local Constants = require('Module:Constants')
local Constants = require('Module:Sandbox/Constants')
local Shared = require('Module:Shared')
local Shared = require('Module:Shared')
local Magic = require('Module:Magic')
local Magic = require('Module:Sandbox/Magic')
local Areas = require('Module:Sandbox/CombatAreas')
local Areas = require('Module:Sandbox/CombatAreas')
local Items = require('Module:Sandbox/Items')
local Items = require('Module:Sandbox/Items')
Line 569: Line 569:
table.insert(resultPart, '\r\n|}')
table.insert(resultPart, '\r\n|}')
end
end
local useArray = nil
local spellUseTable = p._getSpellUseTable(item)
local spellUseTable = p._getSpellUseTable(item)
if spellUseTable ~= nil and spellUseTable ~= '' then
if spellUseTable ~= nil and spellUseTable ~= '' then
Line 592: Line 591:


function p._getSpellUseTable(item)
function p._getSpellUseTable(item)
local spellList = Magic.getSpellsForRune(item.id)
local spellList = Magic.getSpellsForItem(item.id, true)
--Bail immediately if no spells are found
--Bail immediately if no spells are found
if Shared.tableCount(spellList) == 0 then
if Shared.tableCount(spellList) == 0 then