Commit 58f3a42c0697a124eac228dff035d98e4f16213c
1 parent
59835765
gm帮助
Showing
2 changed files
with
31 additions
and
0 deletions
Show diff stats
src/ProtocolCode.lua
@@ -10,6 +10,7 @@ actionCodes = { | @@ -10,6 +10,7 @@ actionCodes = { | ||
10 | 10 | ||
11 | Gm_clientRequest = 20, | 11 | Gm_clientRequest = 20, |
12 | Gm_receiveResponse = 21, | 12 | Gm_receiveResponse = 21, |
13 | + Gm_helpRpc = 22, | ||
13 | 14 | ||
14 | Role_notifyNewEvent = 100, | 15 | Role_notifyNewEvent = 100, |
15 | Role_queryLoginRpc = 101, | 16 | Role_queryLoginRpc = 101, |
src/actions/GmAction.lua
@@ -19,6 +19,10 @@ function _M.testhotfix(role, pms) | @@ -19,6 +19,10 @@ function _M.testhotfix(role, pms) | ||
19 | return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() | 19 | return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() |
20 | end | 20 | end |
21 | 21 | ||
22 | +local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} | ||
23 | + | ||
24 | +table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) | ||
25 | + | ||
22 | function _M.hero(role, pms) | 26 | function _M.hero(role, pms) |
23 | local heroType = tonum(pms.pm1) | 27 | local heroType = tonum(pms.pm1) |
24 | if not role:addHero({type = heroType}) then | 28 | if not role:addHero({type = heroType}) then |
@@ -27,6 +31,7 @@ function _M.hero(role, pms) | @@ -27,6 +31,7 @@ function _M.hero(role, pms) | ||
27 | return "成功" | 31 | return "成功" |
28 | end | 32 | end |
29 | 33 | ||
34 | +table.insert(helpDes, {"获得装备" , "equip", "装备类型" , "装备等级", "装备个数"}) | ||
30 | function _M.equip(role, pms) | 35 | function _M.equip(role, pms) |
31 | local typ = tonum(pms.pm1) | 36 | local typ = tonum(pms.pm1) |
32 | local level = tonum(pms.pm2) | 37 | local level = tonum(pms.pm2) |
@@ -35,6 +40,7 @@ function _M.equip(role, pms) | @@ -35,6 +40,7 @@ function _M.equip(role, pms) | ||
35 | return "成功" | 40 | return "成功" |
36 | end | 41 | end |
37 | 42 | ||
43 | +table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"}) | ||
38 | function _M.rune(role, pms) | 44 | function _M.rune(role, pms) |
39 | local typ = tonum(pms.pm1) | 45 | local typ = tonum(pms.pm1) |
40 | local id = tonum(pms.pm2) | 46 | local id = tonum(pms.pm2) |
@@ -42,6 +48,7 @@ function _M.rune(role, pms) | @@ -42,6 +48,7 @@ function _M.rune(role, pms) | ||
42 | return result | 48 | return result |
43 | end | 49 | end |
44 | 50 | ||
51 | +table.insert(helpDes, {"通关挂机副本", "fb", "挂卡id"}) | ||
45 | function _M.fb(role, pms) -- 直接通关 | 52 | function _M.fb(role, pms) -- 直接通关 |
46 | local carbonId = tonum(pms.pm1) | 53 | local carbonId = tonum(pms.pm1) |
47 | if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end | 54 | if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end |
@@ -62,6 +69,7 @@ function _M.fb(role, pms) -- 直接通关 | @@ -62,6 +69,7 @@ function _M.fb(role, pms) -- 直接通关 | ||
62 | return "成功" | 69 | return "成功" |
63 | end | 70 | end |
64 | 71 | ||
72 | +table.insert(helpDes, {"抵达挂机副本", "fbc", "副本id"}) | ||
65 | function _M.fbc(role, pms) -- 直接通关 | 73 | function _M.fbc(role, pms) -- 直接通关 |
66 | local carbonId = tonum(pms.pm1) | 74 | local carbonId = tonum(pms.pm1) |
67 | if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end | 75 | if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end |
@@ -82,6 +90,7 @@ function _M.fbc(role, pms) -- 直接通关 | @@ -82,6 +90,7 @@ function _M.fbc(role, pms) -- 直接通关 | ||
82 | return "成功" | 90 | return "成功" |
83 | end | 91 | end |
84 | 92 | ||
93 | +table.insert(helpDes, {"好感度", "love", "角色类型", "好感度等级", "好感度经验"}) | ||
85 | function _M.love(role, pms) | 94 | function _M.love(role, pms) |
86 | local heroType = tonum(pms.pm1) | 95 | local heroType = tonum(pms.pm1) |
87 | local level = tonum(pms.pm2) | 96 | local level = tonum(pms.pm2) |
@@ -104,6 +113,7 @@ function _M.love(role, pms) | @@ -104,6 +113,7 @@ function _M.love(role, pms) | ||
104 | return "成功" | 113 | return "成功" |
105 | end | 114 | end |
106 | 115 | ||
116 | +table.insert(helpDes, {"玩家经验", "exp", "经验"}) | ||
107 | function _M.exp(role, pms) | 117 | function _M.exp(role, pms) |
108 | local exp = tonum(pms.pm1) | 118 | local exp = tonum(pms.pm1) |
109 | exp = math.floor(math.max(exp, 0)) | 119 | exp = math.floor(math.max(exp, 0)) |
@@ -111,6 +121,13 @@ function _M.exp(role, pms) | @@ -111,6 +121,13 @@ function _M.exp(role, pms) | ||
111 | return "成功" | 121 | return "成功" |
112 | end | 122 | end |
113 | 123 | ||
124 | +table.insert(helpDes, {"获得物品", "get", "物品ID", "个数"}) | ||
125 | +table.insert(helpDes, {"获得所有物品", "get", "ALL"}) | ||
126 | +table.insert(helpDes, {"获得所有装备", "get", "EQUIP"}) | ||
127 | +table.insert(helpDes, {"获得所有零件", "get", "RUNE"}) | ||
128 | +table.insert(helpDes, {"获得所有碎片", "get", "FRAG"}) | ||
129 | +table.insert(helpDes, {"获得所有食物", "get", "FOOD"}) | ||
130 | +table.insert(helpDes, {"获得所有角色", "get", "HERO"}) | ||
114 | function _M.get(role, pms) | 131 | function _M.get(role, pms) |
115 | if pms.pm1 == "ALL" then | 132 | if pms.pm1 == "ALL" then |
116 | local reward = {} | 133 | local reward = {} |
@@ -161,6 +178,7 @@ function _M.get(role, pms) | @@ -161,6 +178,7 @@ function _M.get(role, pms) | ||
161 | return "成功" | 178 | return "成功" |
162 | end | 179 | end |
163 | 180 | ||
181 | +table.insert(helpDes, {"冒险清除" , "advc"}) | ||
164 | function _M.advc(role, pms) | 182 | function _M.advc(role, pms) |
165 | role:updateProperty({field = "advInfo", value = {}}) | 183 | role:updateProperty({field = "advInfo", value = {}}) |
166 | role:updateProperty({field = "advTask", value = {}}) | 184 | role:updateProperty({field = "advTask", value = {}}) |
@@ -170,11 +188,13 @@ function _M.advc(role, pms) | @@ -170,11 +188,13 @@ function _M.advc(role, pms) | ||
170 | return "成功" | 188 | return "成功" |
171 | end | 189 | end |
172 | 190 | ||
191 | +table.insert(helpDes, {"冒险次数恢复", "advf"}) | ||
173 | function _M.advf(role, pms) | 192 | function _M.advf(role, pms) |
174 | role.dailyData:updateProperty({field = "advC", value = 0}) | 193 | role.dailyData:updateProperty({field = "advC", value = 0}) |
175 | return "成功" | 194 | return "成功" |
176 | end | 195 | end |
177 | 196 | ||
197 | +table.insert(helpDes, {"冒险通关", "adv", "章节id", "层数"}) | ||
178 | function _M.adv(role, pms) | 198 | function _M.adv(role, pms) |
179 | local chapterId = tonum(pms.pm1) | 199 | local chapterId = tonum(pms.pm1) |
180 | local layer = tonum(pms.pm2) | 200 | local layer = tonum(pms.pm2) |
@@ -202,6 +222,7 @@ function _M.adv(role, pms) | @@ -202,6 +222,7 @@ function _M.adv(role, pms) | ||
202 | return "成功" | 222 | return "成功" |
203 | end | 223 | end |
204 | 224 | ||
225 | +table.insert(helpDes, {"冒险到达指定层", "advt", "章节id", "层数"}) | ||
205 | function _M.advt(role, pms) | 226 | function _M.advt(role, pms) |
206 | local chapterId = tonum(pms.pm1) | 227 | local chapterId = tonum(pms.pm1) |
207 | local layer = tonum(pms.pm2) | 228 | local layer = tonum(pms.pm2) |
@@ -225,6 +246,7 @@ function _M.advt(role, pms) | @@ -225,6 +246,7 @@ function _M.advt(role, pms) | ||
225 | return "成功" | 246 | return "成功" |
226 | end | 247 | end |
227 | 248 | ||
249 | +table.insert(helpDes, {"挂机清除" , "idlec"}) | ||
228 | function _M.idlec(role, pms) | 250 | function _M.idlec(role, pms) |
229 | role:updateProperty({field = "hangTeam", value = {}}) | 251 | role:updateProperty({field = "hangTeam", value = {}}) |
230 | role:updateProperty({field = "hangInfo", value = {}}) | 252 | role:updateProperty({field = "hangInfo", value = {}}) |
@@ -233,6 +255,7 @@ function _M.idlec(role, pms) | @@ -233,6 +255,7 @@ function _M.idlec(role, pms) | ||
233 | return "成功" | 255 | return "成功" |
234 | end | 256 | end |
235 | 257 | ||
258 | +table.insert(helpDes, {"爬塔到指定层", "tower", "层数"}) | ||
236 | function _M.tower(role, pms) | 259 | function _M.tower(role, pms) |
237 | local level = tonum(pms.pm1, 1) | 260 | local level = tonum(pms.pm1, 1) |
238 | if not csvdb["tower_battleCsv"][level] then return "不存在" end | 261 | if not csvdb["tower_battleCsv"][level] then return "不存在" end |
@@ -240,4 +263,11 @@ function _M.tower(role, pms) | @@ -240,4 +263,11 @@ function _M.tower(role, pms) | ||
240 | return "成功" | 263 | return "成功" |
241 | end | 264 | end |
242 | 265 | ||
266 | + | ||
267 | +function _M.helpRpc(agent, data) | ||
268 | + SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) | ||
269 | + return true | ||
270 | +end | ||
271 | + | ||
272 | + | ||
243 | return _M | 273 | return _M |
244 | \ No newline at end of file | 274 | \ No newline at end of file |