From c3f578aced5db3eff9dc41c30405b76ac5370f81 Mon Sep 17 00:00:00 2001 From: chenyueqi <1056825054@qq.com> Date: Tue, 8 Sep 2020 16:20:51 +0800 Subject: [PATCH] gm增加跳过引导的命令 guide skip --- src/actions/GmAction.lua | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index 7b706e8..c359400 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -446,18 +446,33 @@ function _M.email(role, pms) return "成功" end -table.insert(helpDes, {"清除引导", "cguide", "0全/1强/2弱"}) -function _M.cguide(role, pms) - local id = tonum(pms.pm1, 0) - if id == 0 then - role:updateProperties({ - newerGuide = "1=1", - funcGuide = "", - }, notNotify) - elseif id == 1 then - role:updateProperty({field = "newerGuide", value = "1=1"}) - elseif id == 2 then - role:updateProperty({field = "funcGuide", value = ""}) +table.insert(helpDes, {"引导", "guide", "skip/reset"}) +function _M.guide(role, pms) + local cmd = pms.pm1 or "un" + if cmd == "SKIP" then + role:updateProperty({field = "newerGuide", value = "9999=1"}) + local str = "" + for _, set in pairs(csvdb["guide_mainCsv"]) do + str = str:setv(set[1].major * 1000,1) + for _,data in ipairs(set) do + if data["break"] ~= 0 then + str = str:setv(data.major * 1000 + data.minor,1) + end + end + end + role:updateProperty({field = "funcGuide", value = str}) + elseif cmd == "RESET" then + local id = tonum(pms.pm2, 0) + if id == 0 then + role:updateProperties({ + newerGuide = "1=1", + funcGuide = "", + }, notNotify) + elseif id == 1 then + role:updateProperty({field = "newerGuide", value = "1=1"}) + elseif id == 2 then + role:updateProperty({field = "funcGuide", value = ""}) + end end return "成功" -- libgit2 0.21.2