全站通知:
模块:NPCShop
刷
历
编
跳到导航
跳到搜索
|||1||× 150 × 200 ||100||每日04:00||无
|-
|||1||× 150 ||10||每日04:00||无|-
|||1||× 150 ||10||每日04:00||无|-
|||1||× 150 ||5||每日04:00||无|-
|||1||× 150 ||5||每日04:00||无
{{#invoke:NPCShop|expand |str=土豆*1,摩拉*150、摩拉*200,100,每日04:00,无+ 糖*1,摩拉*150,10,每日04:00,无+ 奶酪*1,摩拉*150,10,每日04:00,无+ 石珀*1,摩拉*150,5,每日04:00,无+ 电气水晶*1,摩拉*150,5,每日04:00,无 }}
local p={}
function p.expand(frame)
local args = (frame == mw.getCurrentFrame() and frame.args) or frame
local str = args['str'] or ''
if (str=='') then
return ''
end
local output = {}
local result = ''
local strrow = mw.text.split(str, '+\n')
for i=1, #strrow do
local irow = mw.text.split(strrow[i], ',')
local shopitem = mw.text.split(irow[1], '*')
local tablerow = '|'..frame:expandTemplate{title='NPC图标', args={shopitem[1], type='商店'}}..'||'..shopitem[2]..'||'
local priceitem = mw.text.split(irow[2], '、')
for ipt=1, #priceitem do
local price = mw.text.split(priceitem[ipt], '*')
tablerow = tablerow..frame:expandTemplate{title='NPC图标', args={price[1], price[2]}}
end
tablerow = tablerow..'||'..irow[3]..'||'..irow[4]..'||'..irow[5]
output[i] = tablerow
end
result = table.concat(output, '\n\n|-\n\n')
mw.log(result)
return result
end
return p