Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- achievement_tbl = {
- [230100] = {
- UI_Type = 0,
- group = "GOAL_LEVEL",
- major = 3,
- minor = 0,
- title = "Killing Leisure",
- content = {
- summary = "Complete all objective tasks.",
- details = "You're awakened with the idea of killing to become a true Killing Machine!"
- },
- resource = {
- [1] = { text = "Complete 'Blood for Blood (1)' challenge", shortcut = 120001 },
- [2] = { text = "Complete 'Blood for Blood (2)' challenge", shortcut = 120002 },
- [3] = { text = "Complete 'Blood for Blood (3)' challenge", shortcut = 120003 }
- },
- reward = { title = 1025, buff = 12 },
- score = 10
- },
- [230101] = {
- UI_Type = 1,
- group = "BATTLE",
- major = 3,
- minor = 0,
- title = "Blood for Blood (1)",
- content = {
- summary = "Eliminate a certain amount of players.",
- details = "Accumulate 5x Kills in PvP!"
- },
- resource = { [1] = { text = "Kill 5 Player", count = 5 } },
- reward = { item = 909 },
- score = 10
- },
- [230102] = {
- UI_Type = 1,
- group = "BATTLE",
- major = 3,
- minor = 0,
- title = "Blood for Blood (2)",
- content = {
- summary = "Eliminate a certain amount of players.",
- details = "Accumulate 10x Kills in PvP!"
- },
- resource = { [1] = { text = "Kill 10 Player", count = 10 } },
- reward = { item = 909 },
- score = 10
- },
- [230103] = {
- UI_Type = 1,
- group = "BATTLE",
- major = 3,
- minor = 0,
- title = "Blood for Blood (3)",
- content = {
- summary = "Eliminate a certain amount of players.",
- details = "Accumulate 15x Kills in PvP!"
- },
- resource = { [1] = { text = "Kill 15 Player", count = 15 } },
- reward = { item = 909 },
- score = 10
- }
- }
- function main()
- for achieveID, achieveInfo in pairs(achievement_tbl) do
- result, msg = InsertAchieveInfo(achieveID, achieveInfo.title, achieveInfo.content.summary, achieveInfo.content.details, achieveInfo.score)
- if not result then
- return false, msg
- end
- if nil ~= achieveInfo.resource then
- for index, resource in ipairs(achieveInfo.resource) do
- if nil ~= resource.shortcut then
- shortcut = resource.shortcut
- else
- shortcut = -1
- end
- if 0 == achieveInfo.UI_Type then
- result, msg = InsertAchieveResource(achieveID, resource.text, 0, shortcut)
- elseif 1 == achieveInfo.UI_Type then
- result, msg = InsertAchieveResource(achieveID, resource.text, resource.count, shortcut)
- end
- if not result then
- return false, msg
- end
- end
- end
- if nil ~= achieveInfo.reward then
- if nil ~= achieveInfo.reward.item then
- result, msg = InsertAchieveRewardItem(achieveID, achieveInfo.reward.item)
- end
- if nil ~= achieveInfo.reward.title then
- result, msg = InsertAchieveRewardTitle(achieveID, achieveInfo.reward.title)
- if not result then
- return false, msg
- end
- end
- if nil ~= achieveInfo.reward.buff then
- result, msg = InsertAchieveRewardBuff(achieveID, achieveInfo.reward.buff)
- if not result then
- return false, msg
- end
- end
- end
- result, msg = InsertAchieveUIType(achieveID, achieveInfo.UI_Type, achieveInfo.group)
- if not result then
- return false, msg
- end
- result, msg = SetAchieveIDByTab(achieveID, achieveInfo.major, achieveInfo.minor)
- if not result then
- return false, msg
- end
- end
- return true, "good"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement