模块:Quest

此模块的文档可以在模块:Quest/doc创建

local p = {}
local getArgs = require("Module:Arguments").getArgs

function p.questRewardRow(frame)
  local args = frame.args
  local itemName = args[1]
  local itemNum = args[2]

  local numString = ""
  if #itemNum > 0 then
    numString = " ×" .. itemNum
  end

  local output = ""
  local itemTitle = mw.title.new(itemName, "物品")
  if itemTitle.exists then
    output = "<div>[[任务报酬物品::" .. tostring(itemTitle) .. "|" .. itemTitle.text .. "]]" .. numString .. "</div>"
  else
    local title = mw.title.new(itemName)
    output = "<div>[[任务报酬物品::" .. tostring(title) .. "|" .. title.text .. "]]" .. numString .. "</div>"
  end

  return output
end

return p