ActivityTaskGoal.lua 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ---
  2. --- Generated by EmmyLua(https://github.com/EmmyLua)
  3. --- Created by zhangkai.
  4. --- DateTime: 2024/8/26 下午8:03
  5. ---
  6. ActivityTaskGoal = {}
  7. ---@see 通关副本次数
  8. function ActivityTaskGoal.FlushFinishDupCount(actor, type, goal_id, goal_count, param)
  9. local needCount = ConfigDataManager.getTableValue("cfg_task_target", "goalcount", "id", goal_id)
  10. local goalParam = ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id)
  11. if needCount == nil or goalParam == nil then
  12. return goal_count
  13. end
  14. if param ~= tonumber(goalParam) or goal_count >= tonumber(needCount) then
  15. return goal_count
  16. end
  17. return goal_count + 1
  18. end
  19. ---@see 通关指定副本次数
  20. function ActivityTaskGoal.FlushFinishGoalDupCount(actor, type, goal_id, goal_count, param)
  21. local needCount = ConfigDataManager.getTableValue("cfg_task_target", "goalcount", "id", goal_id)
  22. local goalParam = ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id)
  23. if needCount == nil or goalParam == nil then
  24. return goal_count
  25. end
  26. if param ~= tonumber(goalParam) or goal_count >= tonumber(needCount) then
  27. return goal_count
  28. end
  29. return goal_count + 1
  30. end
  31. ---@see 完成勇士任务
  32. function ActivityTaskGoal.FlushFinishGoldTaskCount(actor, type, goal_id, goal_count, param)
  33. local taskCfgList = ConfigDataManager.getTable("cfg_task_gold", "id", param)
  34. if table.isNullOrEmpty(taskCfgList) then
  35. return goal_count
  36. end
  37. local needCount = ConfigDataManager.getTableValue("cfg_task_target", "goalcount", "id", goal_id)
  38. if needCount == nil or goal_count >= tonumber(needCount) then
  39. return goal_count
  40. end
  41. return goal_count + 1
  42. end
  43. ---@see 通关秘境副本
  44. function ActivityTaskGoal.FlushSecretRealmFinishTimes(_, _, goal_id, goal_count, param)
  45. local target = ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id)
  46. if target and target ~= "" then
  47. if tonumber(target) ~= tonumber(param) then
  48. return goal_count
  49. end
  50. end
  51. return goal_count + 1
  52. end
  53. ---@see 完成一次BOSS悬赏
  54. function ActivityTaskGoal.FlushBossRewardBounty(_, _, goal_id, goal_count, param)
  55. local group = string.tonumber(param)
  56. if group < 1 then
  57. return goal_count
  58. end
  59. local target = ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id)
  60. local target_group = string.tonumber(target)
  61. if target_group < 1 then
  62. return goal_count + 1
  63. end
  64. if target_group ~= group then
  65. return goal_count
  66. end
  67. return goal_count + 1
  68. end
  69. ---@see 完成第X章首饰任务
  70. function ActivityTaskGoal.JewelryTaskChapter(actor, _, goal_id, goal_count, param)
  71. local finishChapter = KingRoad.GetFinishChapter(actor)
  72. local needChapter = tonumber(ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id))
  73. if finishChapter < needChapter then
  74. return goal_count
  75. end
  76. return goal_count + 1;
  77. end
  78. ---@see 完成勇气试炼X层
  79. function ActivityTaskGoal.FlushBraveTestLv(actor, _, goal_id, goal_count, param)
  80. local needLv = tonumber(ConfigDataManager.getTableValue("cfg_task_target", "taskgoalparam", "id", goal_id))
  81. if needLv == nil then
  82. needLv = 1
  83. end
  84. local finishLv = tonumber(BraveTest.getBraveTestLv(actor))
  85. if finishLv == nil then
  86. finishLv = 0
  87. end
  88. if finishLv < needLv then
  89. return goal_count
  90. end
  91. return goal_count + 1
  92. end