Documentation for this module may be created at Module:InfoboxNPC/doc

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

-- Main process
function p.main(frame)
    local args = getArgs(frame);
    local title = '';

    if args.roleset then
        title = args.role1 .. '&' .. args.role2;
    else
        title = args.role;
    end

    local infobox = require('Module:InfoboxProto').main(frame, title);
    infobox:addClass('infobox-npc');

    local fields = {
        {
            id = 'name',
            localize = 'Full Name',
            dual = true
        },
        {
            id = 'class'
        },
        {
            id = 'weapon',
            dual = true
        },
        {
            id = 'age',
            dual = true
        },
        {
            id = 'race',
            dual = true
        },
        {
            id = 'role',
            dual = true
        },
        {
            id = 'village',
            localize = 'Location',
            dual = true
        },
        {
            id = 'Height',
            dual = true
        },
        {
            id = 'Weight',
            dual = true
        },
        {
            id = 'Blood',
            localize = 'Blood Type',
            dual = true
        },
        {
            id = 'groups',
            localize = 'Affiliations',
            collapsed = true
        },
        {
            id = 'VA',
            localize = 'Voice Actors',
            dual = true,
            collapsed = true
        }
    }

    addFields(fields);
    
    return tostring(infobox);

end

return p