Module:Switch

--[[ Warning This template is locked and not editable by normal users. Reason: This is protected to prevent unwanted wiki page from malfunctioning. This template could be linked to some major pages which are important. This template is monitored by Random staff members If you strongly feel that there is a need to edit this page, tell us why in the Monbattle Wiki Administrator Message Wall. jianmingyong is the primary caretaker for these templates so contact him via Message Wall with any questions. Avoid spamming Message Wall to other staff member as they are not involved in the making of this template. Usage:

--]] local p = {} function p.main(frame) local Param1 = nil local Param2 = nil local Param3 = nil local Param4 = nil local Data = nil local ReturnText = "Undefined" if frame.args[1] ~= nil then Param1 = frame.args[1] Data = mw.loadData('Module:' .. Param1) if frame.args[2] ~= nil then Param2 = frame.args[2] if Data[Param2] ~= nil then if frame.args[3] ~= nil then Param3 = frame.args[3] ReturnText = Data[Param2]:gsub("",Param3,1) end if frame.args[4] ~= nil then Param4 = frame.args[4] ReturnText = Data[Param2]:gsub("",Param3 .. "|" .. Param4,1) end end end end return frame:preprocess(ReturnText) end function p.AttackAbilityListData(frame) -- "||||" local Param1 = nil local ReturnText = "Undefined" if frame.args[1] ~= nil then Param1 = frame.args[1] if Param1 == "Name" then ReturnText = "" .. frame.args[2] .. "" elseif Param1 == "Attack Category" then ReturnText = "" .. frame.args[3] .. "" elseif Param1 == "Attack Value" then ReturnText = frame.args[4] elseif Param1 == "AP Cost" then ReturnText = frame.args[5] elseif Param1 == "Description" then ReturnText = frame.args[6] elseif Param1 == "1" then ReturnText = "" elseif Param1 == "2" then local RequiredClass = frame.args[8] for Class in string.gmatch(RequiredClass, "%a+") do               if frame.args[2] == Class or Class == "All" then ReturnText = "" end end end end

return frame:preprocess(ReturnText) end function p.SkillAbilityListData(frame) -- "||||" local Param1 = nil local ReturnText = "Undefined" if frame.args[1] ~= nil then Param1 = frame.args[1] if Param1 == "Name" then ReturnText = "" .. frame.args[2] .. "" elseif Param1 == "Skill Category" then ReturnText = "" .. frame.args[3] .. "" elseif Param1 == "Skill Value" then ReturnText = frame.args[4] elseif Param1 == "AP Cost" then ReturnText = frame.args[5] elseif Param1 == "Description" then ReturnText = frame.args[6] elseif Param1 == "1" then ReturnText = "" elseif Param1 == "2" then local RequiredClass = frame.args[8] for Class in string.gmatch(RequiredClass, "%a+") do               if frame.args[2] == Class or Class == "All" then ReturnText = "" end end end end

return frame:preprocess(ReturnText) end function p.MonguardListData(frame) -- ["Name"] = str1 .. "||||||<Base HP>|<Max HP>|<Drawn by>" .. str2, local Param1 = nil local ReturnText = "Undefined" if frame.args[1] ~= nil then Param1 = frame.args[1] if Param1 == "Name" then ReturnText = frame.args[2] elseif Param1 == "ID" then ReturnText = frame.args[3] elseif Param1 == "Rarity" then ReturnText = frame.args[4] elseif Param1 == "Class" then ReturnText = "" elseif Param1 == "Class_TextOnly" then ReturnText = frame.args[5] elseif Param1 == "Ascension" then ReturnText = frame.args[6] elseif Param1 == "Special Ability" then ReturnText = frame.args[7] elseif Param1 == "Base HP" then ReturnText = frame.args[8] elseif Param1 == "Max HP" then ReturnText = frame.args[9] elseif Param1 == "Drawn By" then ReturnText = frame.args[10] elseif Param1 == "1" then ReturnText = "" end end return frame:preprocess(ReturnText) end function p.SpecialEventsListData(frame) local Param1 = nil local Param2 = nil local Data = mw.loadData('Module:SpecialEventsListData') local ReturnText = "Undefined" if frame.args[1] ~= nil then Param1 = frame.args[1] if frame.args[2] ~= nil then Param2 = frame.args[2] if Param2 == frame.args[3] then if Data[Param1] == "" then if Data[Param1] == "" then if frame.args[4] ~= nil then ReturnText = frame.args[4] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[5] ~= nil then ReturnText = frame.args[5] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[6] ~= nil then ReturnText = frame.args[6] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[7] ~= nil then ReturnText = frame.args[7] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[8] ~= nil then ReturnText = frame.args[8] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[9] ~= nil then ReturnText = frame.args[9] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[10] ~= nil then ReturnText = frame.args[10] end end elseif Data[Param1] ~= nil then ReturnText = Data[Param1] end else ReturnText = "" end else if Data[Param1] == "" then if Data[Param1] == "" then if frame.args[4] ~= nil then ReturnText = frame.args[4] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[5] ~= nil then ReturnText = frame.args[5] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[6] ~= nil then ReturnText = frame.args[6] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[7] ~= nil then ReturnText = frame.args[7] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[8] ~= nil then ReturnText = frame.args[8] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[9] ~= nil then ReturnText = frame.args[9] end end elseif Data[Param1] == "" then if Data[Param1] == "" then if frame.args[10] ~= nil then ReturnText = frame.args[10] end end elseif Data[Param1] ~= nil then ReturnText = Data[Param1] end end end return frame:preprocess(ReturnText) end return p