From 58f3a42c0697a124eac228dff035d98e4f16213c Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Thu, 17 Oct 2019 11:25:59 +0800 Subject: [PATCH] gm帮助 --- src/ProtocolCode.lua | 1 + src/actions/GmAction.lua | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index 618cd62..4762971 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -10,6 +10,7 @@ actionCodes = { Gm_clientRequest = 20, Gm_receiveResponse = 21, + Gm_helpRpc = 22, Role_notifyNewEvent = 100, Role_queryLoginRpc = 101, diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index fb886f6..a419316 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -19,6 +19,10 @@ function _M.testhotfix(role, pms) return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() end +local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} + +table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) + function _M.hero(role, pms) local heroType = tonum(pms.pm1) if not role:addHero({type = heroType}) then @@ -27,6 +31,7 @@ function _M.hero(role, pms) return "成功" end +table.insert(helpDes, {"获得装备" , "equip", "装备类型" , "装备等级", "装备个数"}) function _M.equip(role, pms) local typ = tonum(pms.pm1) local level = tonum(pms.pm2) @@ -35,6 +40,7 @@ function _M.equip(role, pms) return "成功" end +table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"}) function _M.rune(role, pms) local typ = tonum(pms.pm1) local id = tonum(pms.pm2) @@ -42,6 +48,7 @@ function _M.rune(role, pms) return result end +table.insert(helpDes, {"通关挂机副本", "fb", "挂卡id"}) function _M.fb(role, pms) -- 直接通关 local carbonId = tonum(pms.pm1) if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end @@ -62,6 +69,7 @@ function _M.fb(role, pms) -- 直接通关 return "成功" end +table.insert(helpDes, {"抵达挂机副本", "fbc", "副本id"}) function _M.fbc(role, pms) -- 直接通关 local carbonId = tonum(pms.pm1) if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end @@ -82,6 +90,7 @@ function _M.fbc(role, pms) -- 直接通关 return "成功" end +table.insert(helpDes, {"好感度", "love", "角色类型", "好感度等级", "好感度经验"}) function _M.love(role, pms) local heroType = tonum(pms.pm1) local level = tonum(pms.pm2) @@ -104,6 +113,7 @@ function _M.love(role, pms) return "成功" end +table.insert(helpDes, {"玩家经验", "exp", "经验"}) function _M.exp(role, pms) local exp = tonum(pms.pm1) exp = math.floor(math.max(exp, 0)) @@ -111,6 +121,13 @@ function _M.exp(role, pms) return "成功" end +table.insert(helpDes, {"获得物品", "get", "物品ID", "个数"}) +table.insert(helpDes, {"获得所有物品", "get", "ALL"}) +table.insert(helpDes, {"获得所有装备", "get", "EQUIP"}) +table.insert(helpDes, {"获得所有零件", "get", "RUNE"}) +table.insert(helpDes, {"获得所有碎片", "get", "FRAG"}) +table.insert(helpDes, {"获得所有食物", "get", "FOOD"}) +table.insert(helpDes, {"获得所有角色", "get", "HERO"}) function _M.get(role, pms) if pms.pm1 == "ALL" then local reward = {} @@ -161,6 +178,7 @@ function _M.get(role, pms) return "成功" end +table.insert(helpDes, {"冒险清除" , "advc"}) function _M.advc(role, pms) role:updateProperty({field = "advInfo", value = {}}) role:updateProperty({field = "advTask", value = {}}) @@ -170,11 +188,13 @@ function _M.advc(role, pms) return "成功" end +table.insert(helpDes, {"冒险次数恢复", "advf"}) function _M.advf(role, pms) role.dailyData:updateProperty({field = "advC", value = 0}) return "成功" end +table.insert(helpDes, {"冒险通关", "adv", "章节id", "层数"}) function _M.adv(role, pms) local chapterId = tonum(pms.pm1) local layer = tonum(pms.pm2) @@ -202,6 +222,7 @@ function _M.adv(role, pms) return "成功" end +table.insert(helpDes, {"冒险到达指定层", "advt", "章节id", "层数"}) function _M.advt(role, pms) local chapterId = tonum(pms.pm1) local layer = tonum(pms.pm2) @@ -225,6 +246,7 @@ function _M.advt(role, pms) return "成功" end +table.insert(helpDes, {"挂机清除" , "idlec"}) function _M.idlec(role, pms) role:updateProperty({field = "hangTeam", value = {}}) role:updateProperty({field = "hangInfo", value = {}}) @@ -233,6 +255,7 @@ function _M.idlec(role, pms) return "成功" end +table.insert(helpDes, {"爬塔到指定层", "tower", "层数"}) function _M.tower(role, pms) local level = tonum(pms.pm1, 1) if not csvdb["tower_battleCsv"][level] then return "不存在" end @@ -240,4 +263,11 @@ function _M.tower(role, pms) return "成功" end + +function _M.helpRpc(agent, data) + SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) + return true +end + + return _M \ No newline at end of file -- libgit2 0.21.2