CombineServerCondition.lua 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ConditionHandler:register(ConditionId.combineServer["合服天数>"], "合服天数>", function(actor, param)
  2. local combineTime = getbaseinfo("combinetime")
  3. -- local combineTime = "2025-05-05 01:00:00"
  4. if string.isNullOrEmpty(combineTime) then
  5. return false
  6. end
  7. local combineSecTime = TimeUtil.getSec(combineTime)
  8. local nowSec = getbaseinfo("nowsec")
  9. if nowSec > combineSecTime then
  10. local combineSec = TimeUtil.getDawnSec(combineTime)
  11. return nowSec > combineSec + (tonumber(param)) * 60 * 60 * 24
  12. end
  13. return false
  14. end)
  15. ConditionHandler:register(ConditionId.combineServer["合服天数>="], "合服天数>=", function(actor, param)
  16. local combineTime = getbaseinfo("combinetime")
  17. -- local combineTime = "2025-05-05 01:00:00"
  18. if string.isNullOrEmpty(combineTime) then
  19. return false
  20. end
  21. local combineSecTime = TimeUtil.getSec(combineTime)
  22. local nowSec= getbaseinfo("nowsec")
  23. if nowSec > combineSecTime then
  24. local combineSec = TimeUtil.getDawnSec(combineTime)
  25. return nowSec > combineSec + (tonumber(param) - 1) * 60 * 60 * 24
  26. end
  27. return false
  28. end)
  29. ConditionHandler:register(ConditionId.combineServer["合服天数=="], "合服天数==", function(actor, param)
  30. local combineTime = getbaseinfo("combinetime")
  31. -- local combineTime = "2025-05-05 01:00:00"
  32. if string.isNullOrEmpty(combineTime) then
  33. return false
  34. end
  35. local combineSecTime = TimeUtil.getSec(combineTime)
  36. local nowSec= getbaseinfo("nowsec")
  37. if nowSec > combineSecTime then
  38. local combineSec = TimeUtil.getDawnSec(combineTime)
  39. local resultTime = combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  40. return TimeUtil.isSameDay(resultTime, nowSec)
  41. end
  42. return false
  43. end)
  44. ConditionHandler:register(ConditionId.combineServer["合服天数<="], "合服天数<=", function(actor, param)
  45. local combineTime = getbaseinfo("combinetime")
  46. -- local combineTime = "2025-05-05 01:00:00"
  47. if string.isNullOrEmpty(combineTime) then
  48. return false
  49. end
  50. local nowSec= getbaseinfo("nowsec")
  51. local combineSecTime = TimeUtil.getSec(combineTime)
  52. if nowSec > combineSecTime then
  53. local combineSec = TimeUtil.getDawnSec(combineTime)
  54. return nowSec <= combineSec + (tonumber(param)) * 60 * 60 * 24
  55. end
  56. return false
  57. end)
  58. ConditionHandler:register(ConditionId.combineServer["合服天数<"], "合服天数<", function(actor, param)
  59. local combineTime = getbaseinfo("combinetime")
  60. -- local combineTime = "2025-05-05 01:00:00"
  61. if string.isNullOrEmpty(combineTime) then
  62. return false
  63. end
  64. local nowSec= getbaseinfo("nowsec")
  65. local combineSecTime = TimeUtil.getSec(combineTime)
  66. if nowSec > combineSecTime then
  67. local combineSec = TimeUtil.getDawnSec(combineTime)
  68. return nowSec < combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  69. end
  70. return false
  71. end)
  72. ConditionHandler:register(ConditionId.combineServer["合服天数~="], "合服天数~=", function(actor, param)
  73. local combineTime = getbaseinfo("combinetime")
  74. -- local combineTime = "2025-05-05 01:00:00"
  75. if string.isNullOrEmpty(combineTime) then
  76. return false
  77. end
  78. local nowSec= getbaseinfo("nowsec")
  79. local combineSecTime = TimeUtil.getSec(combineTime)
  80. if nowSec > combineSecTime then
  81. local combineSec = TimeUtil.getDawnSec(combineTime)
  82. local resultTime = combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  83. return not TimeUtil.isSameDay(resultTime, nowSec)
  84. end
  85. return false
  86. end)