FANDOM


-- Do not delete yet.
------
-- LUA script replacement for wikitext template
--
------
 
local p = {}
 
local cAvatar = require ("Module:CharacterAvatar").getAvatar
 
function p.chestReward(frame)
    local tArgs
 
    if frame == mw.getCurrentFrame() then
        tArgs = frame:getParent().args
        if not tArgs[1] then tArgs = frame.args end
    else
        tArgs = frame
    end
 
    local rewardList = ""
    local charList = ""
    local tokList = ""
    local baList = ""
    local bcList = ""
    local dList = ""
 
    for k,v in pairs(tArgs) do
        rewardList = rewardList .. k .. "|" .. v .. "\n\n"
 
        if k == "c" then
            for cName in mw.text.gsplit(v, "%s*,%s*") do
                charList = charList .. cAvatar({cName}) .. "\n\n"        
            end
        end
    end
 
    rewardList = rewardList .. charList .. "\n\n"
 
    return rewardList
end
 
return p
 
-- </nowiki>
-- [[Category:Lua Modules]]
Community content is available under CC-BY-SA unless otherwise noted.