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