Module:GenerateVoiceLines

local p = {} local class = '' local gFrame

function p.classToId(c) --local classinfo = require('Module:ClassInfo')	return classinfo.getId(c)-- return 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 .. gFrame:preprocess(' ' .. 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 .. gFrame:preprocess(' ' .. 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]--) gFrame = frame 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('Weapon', ' Finding a Weapon (Unused) ') text = text .. p.sound('ForgingWeapon', ' Forging a weapon ') text = text .. p.sound('ClassWeapon', ' Equipping a class weapon ') text = text .. ' Ability ' text = text .. p.sound('Ability', ' Finding an Ability (Unused) ') text = text .. p.sound('ForgingAbility', ' Forging an Ability ') text = text .. p.sound('AttemptingToUseAbilityOnCooldown', ' Attempting to use an Abillity on Cooldown ') text = text .. ' Potions ' text = text .. p.sound('HealthPotion', ' Finding a Health Potion (Unused) ') text = text .. p.sound('ArmorPotion', ' Finding an Armor Potion (Unused) ') text = text .. p.sound('ForgingHealthPotions', ' Forging Health Potions ') text = text .. p.sound('ForgingArmorPotions', ' Forging Armor Potions ') text = text .. p.sound('UsingHealingPotion', ' Using a Health Potion ') text = text .. p.sound('UsingArmorPotion', ' Using an Armor Potion ') text = text .. ' Fight ' text = text .. p.sound('TakingDamage', ' Taking Damage ') text = text .. p.sound('BehindUs', ' Enemies behind ') text = text .. p.sound('Sniper', ' Enemy sniper ') text = text .. p.sound('Flying', ' Enemy above ') text = text .. p.sound('Kill Taunt', ' ') text = text .. p.sound('Killtaunt', ' ') text = text .. p.sound('DeadTeammate', ' Death of a Teammate ') text = text .. p.sound('ForgeActive', ' Active Forge ') text = text .. p.sound('LastManStanding', ' Only one enemy left ') return text end

return p