Module:GenerateVoiceLines

local p = {} local class = ''

function p.classToId(c) local classinfo = require('Module:ClassInfo') return classinfo.getId(c) end

function p.generateNotice(note) if #note>0 then note = note else note = '?' end return '"' .. note .. '"' end

function p.getNote(delimiter) local data = mw.loadData('Module:GenerateVoiceLines/data') for i, tnote in ipairs(data) do		if tnote.file == delimiter then return tnote.note end end return '' end

function p.sound(sc, header) local currentSection = sc	local note = '' local text = '' local delimiter = '' local exited = false local exited1 = false for i = 1, 100 do		if not exited then delimiter = class .. ' ' .. currentSection .. ' ' .. i if mw.title.new(delimiter .. '.ogg', 'File').exists then text = text .. ' ' .. delimiter .. '.ogg' .. ' '				text = text .. ' ' .. p.generateNotice(p.getNote(delimiter)) .. '\n\n' for i1 = 1, 100 do					if not exited1 then delimiter = class .. ' ' .. currentSection .. ' ' .. i .. ' ' .. i1 if mw.title.new(delimiter .. '.ogg', 'File').exists then text = text .. ' ' .. delimiter .. '.ogg' .. ' '							text = text .. ' ' .. p.generateNotice(p.getNote(delimiter)) .. '\n\n' else exited1 = true end end end else exited = true end end end if #text>0 then text = header .. '\n' .. text end return text end

function p.main(frame) local text = '' --text to display class = p.classToId(frame:getParent.args[1]) text = text .. ' General \n' text = text .. class .. '\n' text = text .. p.sound('Skydive', ' Skydive ') text = text .. p.sound('Mount', ' Mounting up ') text = text .. ' Weapon ' text = text .. p.sound('ForgingWeapon', ' Forging a weapon ') text = text .. p.sound('ClassWeapon', ' Equipping a class weapon ') return text end

return p