TipsLogic.lua 570 B

123456789101112131415161718
  1. local TipsExcel = require("excel.tips")
  2. local Msg = require("core.Msg")
  3. function sendTips(human)
  4. local lv = human.db.lv
  5. local tips = ""
  6. for i= 1,#TipsExcel.levelSec do
  7. if lv <= TipsExcel.levelSec[i].maxLv and lv >= TipsExcel.levelSec[i].minLv then
  8. local len = #TipsExcel.tips[i].content
  9. local random = math.random(1,len)
  10. tips = TipsExcel.tips[i].content[random]
  11. break
  12. end
  13. end
  14. local msgRet = Msg.gc.GC_TIPS_SEND
  15. msgRet.tips = tips
  16. Msg.send(msgRet,human.fd)
  17. end