本WIKI由旅行者酒馆于2020年03月14日申请开通,内容按CC-BY-NC-SA4.0协议提供,编辑权限开放。感谢 大猫雷恩 对WIKI设计支持,期待更多能人异士加入原神WIKI中

交流群:1087445447  ·  QQ频道:i3h65u03kv

全站通知:

模块:NPCShop

来自原神WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
|||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