Anonymous

Module:Magic: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 72: Line 72:
end
end


function p.getSpell(name, spellType)
function p.getSpell(name, spellType, namespace)
return p.getSpellByProperty(Shared.fixPagename(name), 'name', spellType)
return p.getSpellByProperty(Shared.fixPagename(name), 'name', spellType, namespace)
end
end


Line 109: Line 109:
function p.getExpansionIcon(frame)
function p.getExpansionIcon(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
Line 129: Line 130:
function p.getSpellIconType(frame)
function p.getSpellIconType(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return 'spell'
return 'spell'
Line 223: Line 225:
function p.getSpellItems(frame)
function p.getSpellItems(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
Line 245: Line 248:
function p.getSpellRunes(frame)
function p.getSpellRunes(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
Line 363: Line 367:
local spellName = frame.args ~= nil and frame.args[1] or frame[1]
local spellName = frame.args ~= nil and frame.args[1] or frame[1]
local statName = frame.args ~= nil and frame.args[2] or frame[2]
local statName = frame.args ~= nil and frame.args[2] or frame[2]
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
Line 372: Line 377:
function p.getOtherSpellBoxText(frame)
function p.getOtherSpellBoxText(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
Line 403: Line 409:
function p.getSpellCategories(frame)
function p.getSpellCategories(frame)
local spellName = frame.args ~= nil and frame.args[1] or frame
local spellName = frame.args ~= nil and frame.args[1] or frame
local spell = p.getSpell(spellName)
local namespace = frame.namespace or nil
local spell = p.getSpell(spellName, nil, namespace)
if spell == nil then
if spell == nil then
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
return Shared.printError('No spell named "' .. spellName .. '" exists in the data module')
2,875

edits