CombineServerCondition.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ConditionHandler:register(ConditionId.combineServer["合服天数>"], "合服天数>", function(actor, param)
  2. local combineTime = getbaseinfo("combinetime")
  3. if string.isNullOrEmpty(combineTime) then
  4. return false
  5. end
  6. local combineSec = TimeUtil.getDawnSec(combineTime)
  7. local nowSec = getbaseinfo("nowsec")
  8. return nowSec > combineSec + (tonumber(param)) * 60 * 60 * 24
  9. end)
  10. ConditionHandler:register(ConditionId.combineServer["合服天数>="], "合服天数>=", function(actor, param)
  11. local combineTime = getbaseinfo("combinetime")
  12. if string.isNullOrEmpty(combineTime) then
  13. return false
  14. end
  15. local combineSec = TimeUtil.getDawnSec(combineTime)
  16. local nowSec= getbaseinfo("nowsec")
  17. return nowSec >= combineSec + (tonumber(param) - 1) * 60 * 60 * 24
  18. end)
  19. ConditionHandler:register(ConditionId.combineServer["合服天数=="], "合服天数==", function(actor, param)
  20. local combineTime = getbaseinfo("combinetime")
  21. if string.isNullOrEmpty(combineTime) then
  22. return false
  23. end
  24. local combineSec = TimeUtil.getDawnSec(combineTime)
  25. local resultTime = combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  26. local nowSec= getbaseinfo("nowsec")
  27. return TimeUtil.isSameDay(resultTime, nowSec)
  28. end)
  29. ConditionHandler:register(ConditionId.combineServer["合服天数<="], "合服天数<=", function(actor, param)
  30. local combineTime = getbaseinfo("combinetime")
  31. if string.isNullOrEmpty(combineTime) then
  32. return false
  33. end
  34. local combineSec = TimeUtil.getDawnSec(combineTime)
  35. local nowSec= getbaseinfo("nowsec")
  36. return nowSec <= combineSec + (tonumber(param)) * 60 * 60 * 24
  37. end)
  38. ConditionHandler:register(ConditionId.combineServer["合服天数<"], "合服天数<", function(actor, param)
  39. local combineTime = getbaseinfo("combinetime")
  40. if string.isNullOrEmpty(combineTime) then
  41. return false
  42. end
  43. local combineSec = TimeUtil.getDawnSec(combineTime)
  44. local nowSec= getbaseinfo("nowsec")
  45. return nowSec < combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  46. end)
  47. ConditionHandler:register(ConditionId.combineServer["合服天数~="], "合服天数~=", function(actor, param)
  48. local combineTime = getbaseinfo("combinetime")
  49. if string.isNullOrEmpty(combineTime) then
  50. return false
  51. end
  52. local combineSec = TimeUtil.getDawnSec(combineTime)
  53. local nowSec= getbaseinfo("nowsec")
  54. local resultTime = combineSec + (tonumber(param) - 1) * 60 * 60 * 24 + 1
  55. return not TimeUtil.isSameDay(resultTime, nowSec)
  56. end)