Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. achievement_tbl = {
  2. [230100] = {
  3. UI_Type = 0,
  4. group = "GOAL_LEVEL",
  5. major = 3,
  6. minor = 0,
  7. title = "Killing Leisure",
  8. content = {
  9. summary = "Complete all objective tasks.",
  10. details = "You're awakened with the idea of killing to become a true Killing Machine!"
  11. },
  12. resource = {
  13. [1] = { text = "Complete 'Blood for Blood (1)' challenge", shortcut = 120001 },
  14. [2] = { text = "Complete 'Blood for Blood (2)' challenge", shortcut = 120002 },
  15. [3] = { text = "Complete 'Blood for Blood (3)' challenge", shortcut = 120003 }
  16. },
  17. reward = { title = 1025, buff = 12 },
  18. score = 10
  19. },
  20. [230101] = {
  21. UI_Type = 1,
  22. group = "BATTLE",
  23. major = 3,
  24. minor = 0,
  25. title = "Blood for Blood (1)",
  26. content = {
  27. summary = "Eliminate a certain amount of players.",
  28. details = "Accumulate 5x Kills in PvP!"
  29. },
  30. resource = { [1] = { text = "Kill 5 Player", count = 5 } },
  31. reward = { item = 909 },
  32. score = 10
  33. },
  34. [230102] = {
  35. UI_Type = 1,
  36. group = "BATTLE",
  37. major = 3,
  38. minor = 0,
  39. title = "Blood for Blood (2)",
  40. content = {
  41. summary = "Eliminate a certain amount of players.",
  42. details = "Accumulate 10x Kills in PvP!"
  43. },
  44. resource = { [1] = { text = "Kill 10 Player", count = 10 } },
  45. reward = { item = 909 },
  46. score = 10
  47. },
  48. [230103] = {
  49. UI_Type = 1,
  50. group = "BATTLE",
  51. major = 3,
  52. minor = 0,
  53. title = "Blood for Blood (3)",
  54. content = {
  55. summary = "Eliminate a certain amount of players.",
  56. details = "Accumulate 15x Kills in PvP!"
  57. },
  58. resource = { [1] = { text = "Kill 15 Player", count = 15 } },
  59. reward = { item = 909 },
  60. score = 10
  61. }
  62. }
  63.  
  64. function main()
  65. for achieveID, achieveInfo in pairs(achievement_tbl) do
  66. result, msg = InsertAchieveInfo(achieveID, achieveInfo.title, achieveInfo.content.summary, achieveInfo.content.details, achieveInfo.score)
  67. if not result then
  68. return false, msg
  69. end
  70. if nil ~= achieveInfo.resource then
  71. for index, resource in ipairs(achieveInfo.resource) do
  72. if nil ~= resource.shortcut then
  73. shortcut = resource.shortcut
  74. else
  75. shortcut = -1
  76. end
  77. if 0 == achieveInfo.UI_Type then
  78. result, msg = InsertAchieveResource(achieveID, resource.text, 0, shortcut)
  79. elseif 1 == achieveInfo.UI_Type then
  80. result, msg = InsertAchieveResource(achieveID, resource.text, resource.count, shortcut)
  81. end
  82. if not result then
  83. return false, msg
  84. end
  85. end
  86. end
  87. if nil ~= achieveInfo.reward then
  88. if nil ~= achieveInfo.reward.item then
  89. result, msg = InsertAchieveRewardItem(achieveID, achieveInfo.reward.item)
  90. end
  91. if nil ~= achieveInfo.reward.title then
  92. result, msg = InsertAchieveRewardTitle(achieveID, achieveInfo.reward.title)
  93. if not result then
  94. return false, msg
  95. end
  96. end
  97. if nil ~= achieveInfo.reward.buff then
  98. result, msg = InsertAchieveRewardBuff(achieveID, achieveInfo.reward.buff)
  99. if not result then
  100. return false, msg
  101. end
  102. end
  103. end
  104. result, msg = InsertAchieveUIType(achieveID, achieveInfo.UI_Type, achieveInfo.group)
  105. if not result then
  106. return false, msg
  107. end
  108. result, msg = SetAchieveIDByTab(achieveID, achieveInfo.major, achieveInfo.minor)
  109. if not result then
  110. return false, msg
  111. end
  112. end
  113. return true, "good"
  114. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement