314bc5df
zhengshouren
提交服务器初始代码
|
1
2
3
4
5
6
7
|
local _M = {}
local redisproxy = redisproxy
function _M.clientRequest(agent, data)
local msg = MsgPack.unpack(data)
local role = agent.role
local action = _M[msg.cmd]
local bin = MsgPack.pack({ cmd = "指令失败" })
|
17fae2ce
liuzujun
正式服屏蔽gm指令
|
8
9
10
11
|
if true then
SendPacket(actionCodes.Gm_receiveResponse, bin)
return true
end
|
314bc5df
zhengshouren
提交服务器初始代码
|
12
13
14
15
|
if not action then
SendPacket(actionCodes.Gm_receiveResponse, bin)
return true
end
|
6304b5ad
zhangqijia
feat: 一番赏 增加重置扭蛋机指令
|
16
|
local ret = action(role, msg, agent.capsule_serv)
|
314bc5df
zhengshouren
提交服务器初始代码
|
17
18
19
20
21
|
bin = MsgPack.pack({ cmd = ret })
SendPacket(actionCodes.Gm_receiveResponse, bin)
return true
end
|
5e5d7680
zhouhaihai
热更新 优化
|
22
|
function _M.testhotfix(role, pms)
|
a5486ede
zhouhaihai
csvdata 修改为 share...
|
23
|
return csvdb["itemCsv"][1]["name"] .. " -=- " .. globalCsv["codeVersion"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue()
|
5e5d7680
zhouhaihai
热更新 优化
|
24
|
end
|
0a07bdd9
zhouahaihai
角色升级 。gm
|
25
|
|
3133cb76
zhouhaihai
日志
|
26
27
28
|
function _M.ignoreout(role, pms)
pms = pms or {}
local status = tonum(pms.pm1, 1)
|
300ee7a1
zhouhaihai
一键升级
|
29
30
31
32
33
|
if status == 1 then -- 忽视
role:updateProperty({field = "ignoreMt", value = 1})
else -- 解除
role:updateProperty({field = "ignoreMt", value = 0})
end
|
d02f7904
zhouhaihai
遗失的log
|
34
|
role:mylog("gm_action", {desc = "ignoreout", key1 = pms.sender})
|
300ee7a1
zhouhaihai
一键升级
|
35
36
37
38
39
40
41
42
|
return "指令生效"
end
function _M.ban(role, pms)
local now = skynet.timex()
local time = tonum(pms.pm1, 1)
local ctype = tonum(pms.pm2, 0)
|
300ee7a1
zhouhaihai
一键升级
|
43
|
role:setBan(time, ctype)
|
d02f7904
zhouhaihai
遗失的log
|
44
|
role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender})
|
e84a1beb
liuzujun
gm后台查询日志,公告相关协议
|
45
|
|
edf2ee12
zhouhaihai
防作弊
|
46
|
return "封杀成功"
|
300ee7a1
zhouhaihai
一键升级
|
47
48
|
end
|
edf2ee12
zhouhaihai
防作弊
|
49
|
|
300ee7a1
zhouhaihai
一键升级
|
50
51
|
function _M.unban(role, pms)
role:setBan(0, 0)
|
edf2ee12
zhouhaihai
防作弊
|
52
|
role:setProperty("cheatCount", 0) -- 清除作弊次数
|
d02f7904
zhouhaihai
遗失的log
|
53
54
|
role:mylog("gm_action", {desc = "unban", key1 = pms.sender})
|
300ee7a1
zhouhaihai
一键升级
|
55
56
57
58
59
|
return "解封杀成功"
end
function _M.gmmsg(role, pms)
role:sendGmMsg(pms.pm1, true)
|
d02f7904
zhouhaihai
遗失的log
|
60
|
role:mylog("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender})
|
300ee7a1
zhouhaihai
一键升级
|
61
62
63
|
return "指令成功"
end
|
edf2ee12
zhouhaihai
防作弊
|
64
65
66
67
68
69
70
|
function _M.reset_rank(role, pms)
role:resetRank()
role:mylog("gm_action", {desc = "reset_rank", key1 = pms.sender})
return "封杀成功"
end
|
300ee7a1
zhouhaihai
一键升级
|
71
|
function _M.silent(role, pms)
|
e84a1beb
liuzujun
gm后台查询日志,公告相关协议
|
72
|
local pm1 = tonum(pms.pm1, 0)
|
9729f4f0
liuzujun
修改邮件默认长度,私聊禁言
|
73
|
--dump(pms, pm1)
|
300ee7a1
zhouhaihai
一键升级
|
74
75
|
if pm1 < 1 then
role:updateProperty({field = "silent", value = 0})
|
e84a1beb
liuzujun
gm后台查询日志,公告相关协议
|
76
|
role:setProperty("silentType", 0)
|
300ee7a1
zhouhaihai
一键升级
|
77
78
79
|
return "解禁言成功"
end
role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400})
|
e84a1beb
liuzujun
gm后台查询日志,公告相关协议
|
80
81
|
role:setProperty("silentType", pms.pm2 or 0)
role:mylog("gm_action", {desc = "silent", int1 = pm1, key1 = pms.sender})
|
300ee7a1
zhouhaihai
一键升级
|
82
83
84
|
return "禁言成功"
end
|
bd4fb541
zhouhaihai
增加物品过期系统
|
85
86
87
88
89
|
function _M.pvp_cross_head(role, pms)
role:awardExpireItem(tonum(pms.expire), pms.reward, {log = {desc = "pvpCHead"}})
return "成功"
end
|
920e75af
zhouhaihai
获取有效期物品
|
90
|
function _M.expire_item(role, pms)
|
217e1f0c
zhouhaihai
gm 奖励
|
91
|
role:awardExpireItem(tonum(pms.pm1), pms.pm2, {log = {desc = "gm"}})
|
6f343dd5
zhouhaihai
增加gm 方法
|
92
93
|
return "成功"
end
|
300ee7a1
zhouhaihai
一键升级
|
94
|
|
58f3a42c
zhouhaihai
gm帮助
|
95
96
97
|
local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}}
table.insert(helpDes, {"获得角色" , "hero", "角色类型"})
|
0a07bdd9
zhouahaihai
角色升级 。gm
|
98
99
|
function _M.hero(role, pms)
local heroType = tonum(pms.pm1)
|
3133cb76
zhouhaihai
日志
|
100
|
if not role:addHero({type = heroType, log = {desc = "gm"}}) then
|
056c01a0
zhouhaihai
简化装备
|
101
102
|
return "失败"
end
|
d02f7904
zhouhaihai
遗失的log
|
103
104
|
role:mylog("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender})
|
0a07bdd9
zhouahaihai
角色升级 。gm
|
105
106
107
|
return "成功"
end
|
faabdf3c
suhongyang
Gm加hero add level
|
108
109
110
111
|
table.insert(helpDes, {"角色升级" , "herol", "角色类型", "增加等级"})
function _M.herol(role, pms)
local heroType = tonum(pms.pm1)
local addLevel = tonum(pms.pm2)
|
300ee7a1
zhouhaihai
一键升级
|
112
113
114
115
116
117
118
119
120
|
local hero = role:isHaveHero(heroType)
local MaxLv = 200
if not hero then
return "不存在的英雄类型"
end
if hero:getProperty("breakL") >= #csvdb["unit_breakCsv"] and hero:getProperty("level") >= MaxLv then
return "等级已满"
|
faabdf3c
suhongyang
Gm加hero add level
|
121
|
end
|
300ee7a1
zhouhaihai
一键升级
|
122
|
local nextLevel = math.min(addLevel + hero:getProperty("level"), MaxLv)
|
923162ce
zhouhaihai
优化
|
123
|
for i = 0, #csvdb["unit_breakCsv"] do
|
fd4e0f4f
suhongyang
不能直接突破满
|
124
125
126
127
128
129
130
131
|
local upLimit = csvdb["unit_breakCsv"][i].levelLimit
local lowLimit = csvdb["unit_breakCsv"][i - 1] and csvdb["unit_breakCsv"][i - 1].levelLimit or 0
if upLimit > nextLevel and lowLimit <= nextLevel then
local addbl = i - hero:getProperty("breakL")
if addbl > 0 then
hero:updateProperty({field = "breakL", delta = addbl})
end
end
|
d8c07167
suhongyang
防止突破满了还突破
|
132
|
end
|
b640afba
suhongyang
Gm升级直接突破
|
133
|
addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel)
|
faabdf3c
suhongyang
Gm加hero add level
|
134
135
|
hero:updateProperty({field = "level", delta = addLevel})
role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")})
|
3133cb76
zhouhaihai
日志
|
136
|
|
d02f7904
zhouhaihai
遗失的log
|
137
138
|
role:mylog("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender})
|
faabdf3c
suhongyang
Gm加hero add level
|
139
140
141
|
return "成功"
end
|
300ee7a1
zhouhaihai
一键升级
|
142
143
144
145
146
147
148
|
table.insert(helpDes, {"全部角色升级" , "herola", "增加等级"})
function _M.herola(role, pms)
local addLevel = tonum(pms.pm1)
for _, hero in pairs(role.heros) do
_M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel})
end
|
3133cb76
zhouhaihai
日志
|
149
|
|
d02f7904
zhouhaihai
遗失的log
|
150
151
|
role:mylog("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender})
|
300ee7a1
zhouhaihai
一键升级
|
152
153
154
155
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
156
|
table.insert(helpDes, {"获得装备" , "equip", "装备类型" , "装备等级", "装备个数"})
|
43cc5f51
gaofengduan
调整 equip 数据结构
|
157
158
159
160
|
function _M.equip(role, pms)
local typ = tonum(pms.pm1)
local level = tonum(pms.pm2)
local count = tonum(pms.pm3)
|
3133cb76
zhouhaihai
日志
|
161
|
role:addEquip(typ, level, count, {log = {desc = "gm"}})
|
d02f7904
zhouhaihai
遗失的log
|
162
|
role:mylog("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender})
|
43cc5f51
gaofengduan
调整 equip 数据结构
|
163
164
165
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
166
|
table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"})
|
ad484303
gaofengduan
add rune
|
167
168
169
|
function _M.rune(role, pms)
local typ = tonum(pms.pm1)
local id = tonum(pms.pm2)
|
3133cb76
zhouhaihai
日志
|
170
|
local result = role:addRune({type = typ,id = id, log = {desc = "gm"}})
|
d02f7904
zhouhaihai
遗失的log
|
171
|
role:mylog("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender})
|
3133cb76
zhouhaihai
日志
|
172
|
|
ad484303
gaofengduan
add rune
|
173
174
175
|
return result
end
|
3d8468b2
liuzujun
火花系统
|
176
177
178
179
180
181
182
183
184
|
table.insert(helpDes, {"获得火花" , "spark", "零件id"})
function _M.spark(role, pms)
local id = tonum(pms.pm1)
local result = role:addSpark({id = id, log = {desc = "gm"}})
role:mylog("gm_action", {desc = "spark", int1 = id, key1 = pms.sender})
return result == 0 and "成功" or "失败"
end
|
58f3a42c
zhouhaihai
gm帮助
|
185
|
table.insert(helpDes, {"通关挂机副本", "fb", "挂卡id"})
|
cb85faac
zhouhaihai
增加gm命令
|
186
187
188
|
function _M.fb(role, pms) -- 直接通关
local carbonId = tonum(pms.pm1)
if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end
|
cb85faac
zhouhaihai
增加gm命令
|
189
190
191
|
local addPre
addPre = function(carbonId)
local carbonData = csvdb["idle_battleCsv"][carbonId]
|
f2b3aacd
chenyueqi
fb和fbc命令增加剧情的解锁
|
192
193
194
|
if carbonData.story_unlock ~= 0 then
role:changeUpdates({{type = "storyB", field = carbonData.story_unlock, value = {s = -1}}})
end
|
cb85faac
zhouhaihai
增加gm命令
|
195
|
for _, pre in ipairs(carbonData.prepose:toArray(true, "=")) do
|
33be3111
zhouhaihai
修改hangPass 结构
|
196
|
role:hangFinish(pre)
|
03a6166a
zhouhaihai
餐厅优化
|
197
|
role:checkTaskEnter("HangPass", {id = pre})
|
cb85faac
zhouhaihai
增加gm命令
|
198
199
200
|
addPre(pre)
end
end
|
15e1f084
zhouhaihai
挂机gm
|
201
|
role:hangFinish(carbonId)
|
cb85faac
zhouhaihai
增加gm命令
|
202
|
addPre(carbonId)
|
3133cb76
zhouhaihai
日志
|
203
|
|
d02f7904
zhouhaihai
遗失的log
|
204
205
|
role:mylog("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender})
|
03a6166a
zhouhaihai
餐厅优化
|
206
|
role:checkTaskEnter("HangPass", {id = carbonId})
|
cb85faac
zhouhaihai
增加gm命令
|
207
208
209
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
210
|
table.insert(helpDes, {"抵达挂机副本", "fbc", "副本id"})
|
6433fe76
zhouhaihai
到某一关
|
211
212
213
214
215
216
217
|
function _M.fbc(role, pms) -- 直接通关
local carbonId = tonum(pms.pm1)
if not csvdb["idle_battleCsv"][carbonId] then return "不存在的carbon" end
local passCarbon = {}
local addPre
addPre = function(carbonId)
local carbonData = csvdb["idle_battleCsv"][carbonId]
|
f2b3aacd
chenyueqi
fb和fbc命令增加剧情的解锁
|
218
219
220
|
if carbonData.story_unlock ~= 0 then
role:changeUpdates({{type = "storyB", field = carbonData.story_unlock, value = {s = -1}}})
end
|
6433fe76
zhouhaihai
到某一关
|
221
|
for _, pre in ipairs(carbonData.prepose:toArray(true, "=")) do
|
33be3111
zhouhaihai
修改hangPass 结构
|
222
|
role:hangFinish(pre)
|
03a6166a
zhouhaihai
餐厅优化
|
223
|
role:checkTaskEnter("HangPass", {id = pre})
|
6433fe76
zhouhaihai
到某一关
|
224
225
226
|
addPre(pre)
end
end
|
00298f6a
zhouhaihai
gm action
|
227
|
role:updateProperty({field = "hangPass", value = {}})
|
6433fe76
zhouhaihai
到某一关
|
228
|
addPre(carbonId)
|
d02f7904
zhouhaihai
遗失的log
|
229
230
|
role:mylog("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender})
|
3133cb76
zhouhaihai
日志
|
231
|
|
6433fe76
zhouhaihai
到某一关
|
232
233
234
|
return "成功"
end
|
14f1591b
zhouhaihai
删除好感度相关
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
|
-- table.insert(helpDes, {"好感度", "love", "角色类型", "好感度等级", "好感度经验"})
-- function _M.love(role, pms)
-- local heroType = tonum(pms.pm1)
-- local level = tonum(pms.pm2)
-- local exp = tonum(pms.pm3)
-- local curPlus = csvdb["unit_love_plusCsv"][heroType]
-- if not curPlus then return "参数错误" end
-- level = math.max(math.min(curPlus.limit, level), 0)
-- local curEffect = csvdb["unit_love_effectCsv"][level]
-- exp = math.max(math.min(curEffect.loveValue, exp) , 0)
-- for _, hero in pairs(role.heros) do
-- if hero:getProperty("type") == heroType then
-- hero:updateProperty({field = "loveL", value = level})
-- hero:updateProperty({field = "loveExp", value = exp})
-- if role:getProperty("loveStatus"):getv(heroType, 0) < level then
-- role:changeUpdates({{type = "loveStatus", field = heroType, value = level}}) -- 总的
-- end
-- role:checkTaskEnter("LoveBreak", {heroType = heroType, loveL = level})
-- end
-- end
-- return "成功"
-- end
|
cb85faac
zhouhaihai
增加gm命令
|
257
|
|
58f3a42c
zhouhaihai
gm帮助
|
258
|
table.insert(helpDes, {"玩家经验", "exp", "经验"})
|
cb85faac
zhouhaihai
增加gm命令
|
259
260
261
|
function _M.exp(role, pms)
local exp = tonum(pms.pm1)
exp = math.floor(math.max(exp, 0))
|
3133cb76
zhouhaihai
日志
|
262
263
|
role:addPlayExp(exp, {log = {desc = "gm"}})
|
d02f7904
zhouhaihai
遗失的log
|
264
265
|
role:mylog("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender})
|
cb85faac
zhouhaihai
增加gm命令
|
266
267
268
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
269
270
271
272
273
274
275
|
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"})
|
6e2961fa
liuzujun
获得所有SSR 且满级 满觉醒 同...
|
276
|
table.insert(helpDes, {"获得满级满觉醒角色,满级满精进铭文", "get", "MAXHERO"})
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
277
|
function _M.get(role, pms)
|
747f05a1
gaofengduan
add gm get all
|
278
|
if pms.pm1 == "ALL" then
|
58559948
zhouhaihai
getall gm
|
279
280
281
282
|
local reward = {}
for id, data in pairs(csvdb["gm_getallCsv"]) do
if csvdb["itemCsv"][id] then
reward[id] = data.number
|
747f05a1
gaofengduan
add gm get all
|
283
284
|
end
end
|
3133cb76
zhouhaihai
日志
|
285
|
role:award(reward, {log = {desc = "gm"}})
|
3c8a6b8a
zhouhaihai
get equip
|
286
287
288
|
elseif pms.pm1 == "EQUIP" then
for itemId = 7000 , 8000 do
if csvdb["itemCsv"][itemId] then
|
3133cb76
zhouhaihai
日志
|
289
|
role:award({[itemId] = 100}, {log = {desc = "gm"}})
|
3c8a6b8a
zhouhaihai
get equip
|
290
291
|
end
end
|
966034ca
zhouhaihai
获取碎片零件gm
|
292
|
elseif pms.pm1 == "RUNE" then
|
6e2961fa
liuzujun
获得所有SSR 且满级 满觉醒 同...
|
293
|
for itemId = 10000 , 20000 do
|
966034ca
zhouhaihai
获取碎片零件gm
|
294
|
if csvdb["itemCsv"][itemId] then
|
3133cb76
zhouhaihai
日志
|
295
|
role:award({[itemId] = 1}, {log = {desc = "gm"}})
|
966034ca
zhouhaihai
获取碎片零件gm
|
296
297
298
299
300
|
end
end
elseif pms.pm1 == "FRAG" then
for itemId = 100 , 400 do
if csvdb["itemCsv"][itemId] then
|
3133cb76
zhouhaihai
日志
|
301
|
role:award({[itemId] = 100}, {log = {desc = "gm"}})
|
966034ca
zhouhaihai
获取碎片零件gm
|
302
303
|
end
end
|
3b069d52
zhouhaihai
增加获取 food 后台
|
304
305
306
|
elseif pms.pm1 == "FOOD" then
for itemId = 4000 , 5000 do
if csvdb["itemCsv"][itemId] then
|
3133cb76
zhouhaihai
日志
|
307
|
role:award({[itemId] = 100}, {log = {desc = "gm"}})
|
3b069d52
zhouhaihai
增加获取 food 后台
|
308
309
|
end
end
|
cb85faac
zhouhaihai
增加gm命令
|
310
|
elseif pms.pm1 == "HERO" then
|
99712f36
chenyueqi
gm get hero 不能获取未...
|
311
312
|
local unitCsv = csvdb["unitCsv"]
for itemId = 400 , 800 do
|
cb85faac
zhouhaihai
增加gm命令
|
313
|
if csvdb["itemCsv"][itemId] then
|
99712f36
chenyueqi
gm get hero 不能获取未...
|
314
315
316
317
|
local heroUnit = unitCsv[itemId - 300]
if heroUnit.open == 1 then
role:award({[itemId] = 1}, {log = {desc = "gm"}})
end
|
cb85faac
zhouhaihai
增加gm命令
|
318
319
|
end
end
|
6e2961fa
liuzujun
获得所有SSR 且满级 满觉醒 同...
|
320
321
|
elseif pms.pm1 == "MAXHERO" then
-- 给英雄
|
75acc595
liuzujun
修改gm添加满级英雄指令,开启特权...
|
322
323
324
325
|
for heroId = 100, 500 do
local heroCfg = csvdb["unitCsv"][heroId]
if heroCfg and heroCfg.open == 1 then
role:award({[heroId + 300] = 1}, {log = {desc = "gm"}})
|
6e2961fa
liuzujun
获得所有SSR 且满级 满觉醒 同...
|
326
327
328
329
|
end
end
-- 升满级
for _, hero in ipairs(role.heros) do
|
75acc595
liuzujun
修改gm添加满级英雄指令,开启特权...
|
330
|
_M.herol(role, {pm1 = hero:getProperty("type"), pm2 = 130})
|
6e2961fa
liuzujun
获得所有SSR 且满级 满觉醒 同...
|
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
|
hero:updateProperty({field = "wakeL", value = #csvdb["unit_wakeCsv"]})
end
-- 添加铭文
for itemId = 10000 , 20000 do
if csvdb["itemCsv"][itemId] then
role:award({[itemId] = 1}, {log = {desc = "gm"}})
end
end
for _, rune in ipairs(role.runeBag) do
local typ = rune:getProperty("type")
local id = rune:getProperty("id")
local runeSet = csvdb["runeCsv"][typ]
if not runeSet then break end
local runeData = runeSet[id]
if not runeData then break end
rune:updateProperty({field = "level",value = runeData.lvLimit})
end
|
747f05a1
gaofengduan
add gm get all
|
351
352
353
354
355
|
else
local itemId = tonum(pms.pm1)
if not csvdb["itemCsv"][itemId] then
return "物品不存在"
end
|
ee999bde
zhouhaihai
零件优化
|
356
|
local count = tonum(pms.pm2, 1)
|
3133cb76
zhouhaihai
日志
|
357
|
role:award({[itemId] = count}, {log = {desc = "gm"}})
|
d02f7904
zhouhaihai
遗失的log
|
358
|
role:mylog("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender})
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
359
|
end
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
360
361
362
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
363
|
table.insert(helpDes, {"冒险清除" , "advc"})
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
364
|
function _M.advc(role, pms)
|
badeee4e
zhouhaihai
优化gm 冒险清除
|
365
366
367
368
369
370
371
|
local advTeam = role:getProperty("advTeam")
advTeam.player = nil
local reward = role:getProperty("advItems"):toNumMap()
for itemId, count in pairs(reward) do
reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败
end
|
3133cb76
zhouhaihai
日志
|
372
|
role:award(reward, {log = {desc = "gm"}})
|
badeee4e
zhouhaihai
优化gm 冒险清除
|
373
374
375
376
377
378
379
380
381
|
role:updateProperties({
advInfo = {},
advTeam = advTeam,
advItems = "",
advAFGet = {},
advAFWear = {},
}, notNotify)
role.advData = nil
|
d02f7904
zhouhaihai
遗失的log
|
382
383
384
|
role:mylog("gm_action", {desc = "advc", key1 = pms.sender})
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
385
386
387
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
388
|
table.insert(helpDes, {"冒险次数恢复", "advf"})
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
389
|
function _M.advf(role, pms)
|
fc316d1f
zhouhaihai
冒险体力优化
|
390
|
role:updateProperty({field = "advC", value = 0})
|
a230673a
zhouhaihai
回复体力
|
391
|
role.dailyData:updateProperty({field = "advElC", value = 0})
|
3133cb76
zhouhaihai
日志
|
392
|
|
d02f7904
zhouhaihai
遗失的log
|
393
394
|
role:mylog("gm_action", {desc = "advf", key1 = pms.sender})
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
395
396
397
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
398
|
table.insert(helpDes, {"冒险通关", "adv", "章节id", "层数"})
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
399
400
401
402
|
function _M.adv(role, pms)
local chapterId = tonum(pms.pm1)
local layer = tonum(pms.pm2)
|
150e01af
zhouhaihai
gmbug
|
403
|
local advCsv = csvdb["adv_chapterCsv"][chapterId]
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
404
|
if not advCsv then return "不存在的章节" end
|
7cd50d19
zhouhaihai
gm
|
405
|
if math.floor(chapterId / 100) ~= 2 then
|
150e01af
zhouhaihai
gmbug
|
406
|
layer = math.min(layer, advCsv.limitlevel)
|
7cd50d19
zhouhaihai
gm
|
407
|
end
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
408
|
local advPass = role:getProperty("advPass")
|
33be3111
zhouhaihai
修改hangPass 结构
|
409
|
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
410
411
|
if (advPass[chapterId] or 0) < layer then
advPass[chapterId] = layer
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
412
413
|
role:updateProperty({field = "advPass", value = advPass})
end
|
d02f7904
zhouhaihai
遗失的log
|
414
|
role:mylog("gm_action", {desc = "adv", int1 = chapterId, int2 = layer, key1 = pms.sender})
|
4faef572
zhouhaihai
冒险任务,冒险扫荡, 冒险中继
|
415
416
417
418
|
return "成功"
end
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
419
|
table.insert(helpDes, {"冒险到达指定层", "advt", "章节id", "层数", "地图id(选)"})
|
4d943586
zhouhaihai
直通 advt gm
|
420
421
422
|
function _M.advt(role, pms)
local chapterId = tonum(pms.pm1)
local layer = tonum(pms.pm2)
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
423
|
local mapId = tonum(pms.pm3)
|
fa8de8ea
liuzujun
将军令一键领取bug
|
424
|
local actid = tonum(pms.pm4)
|
150e01af
zhouhaihai
gmbug
|
425
426
|
local advCsv = csvdb["adv_chapterCsv"][chapterId]
if not advCsv then return "不存在的章节" end
|
4d943586
zhouhaihai
直通 advt gm
|
427
|
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
428
429
430
|
local status = _M.adv(role, {pm1 = chapterId, pm2 = layer - 1})
if status ~= "成功" then return status end
|
7cd50d19
zhouhaihai
gm
|
431
|
local advData = role:getAdvData()
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
432
433
|
if advData:isRunning() then
advData:forceOver()
|
7cd50d19
zhouhaihai
gm
|
434
|
end
|
4d943586
zhouhaihai
直通 advt gm
|
435
|
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
436
437
438
439
440
|
advData:initByChapter({
chapterId = chapterId,
level = layer,
isEnter = true,
debugMapId = mapId,
|
fa8de8ea
liuzujun
将军令一键领取bug
|
441
|
actid = actid,
|
35e2e3c4
zhouhaihai
优化 gm advt 增加感知b...
|
442
|
})
|
d02f7904
zhouhaihai
遗失的log
|
443
|
role:mylog("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender})
|
4d943586
zhouhaihai
直通 advt gm
|
444
445
446
|
return "成功"
end
|
300ee7a1
zhouhaihai
一键升级
|
447
|
table.insert(helpDes, {"冒险队等级增加", "advl", "经验"})
|
f60b89b1
zhouhaihai
奖励副本
|
448
|
function _M.advl(role, pms)
|
300ee7a1
zhouhaihai
一键升级
|
449
450
|
local exp = tonum(pms.pm1)
role:addAdvLvExp(math.max(0, exp))
|
3133cb76
zhouhaihai
日志
|
451
|
|
d02f7904
zhouhaihai
遗失的log
|
452
453
|
role:mylog("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender})
|
f60b89b1
zhouhaihai
奖励副本
|
454
455
456
|
return "成功"
end
|
a95b35ce
zhouhaihai
删除等级
|
457
458
459
460
|
-- table.insert(helpDes, {"冒险内等级增加", "advcl", "经验值"})
-- function _M.advcl(role, pms)
-- local exp = tonum(pms.pm1)
-- local advData = role:getAdvData()
|
68d3fbaf
zhouhaihai
冒险内加经验
|
461
|
|
a95b35ce
zhouhaihai
删除等级
|
462
463
464
465
466
467
|
-- if not advData.chapterId then
-- return "先随便开启一关"
-- end
-- advData.battle.player:addExp(exp)
-- advData:saveDB()
-- role:mylog("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender})
|
3133cb76
zhouhaihai
日志
|
468
|
|
a95b35ce
zhouhaihai
删除等级
|
469
470
|
-- return "成功"
-- end
|
68d3fbaf
zhouhaihai
冒险内加经验
|
471
|
|
58f3a42c
zhouhaihai
gm帮助
|
472
|
table.insert(helpDes, {"挂机清除" , "idlec"})
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
473
|
function _M.idlec(role, pms)
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
474
475
|
role:updateProperty({field = "hangInfo", value = {}})
role:updateProperty({field = "hangBag", value = {}})
|
d02f7904
zhouhaihai
遗失的log
|
476
|
role:mylog("gm_action", {desc = "idlec", key1 = pms.sender})
|
3133cb76
zhouhaihai
日志
|
477
|
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
478
479
480
481
|
role.advData = nil
return "成功"
end
|
d3da3368
zhouhaihai
冒险地图被动技, buff 神器
|
482
483
|
table.insert(helpDes, {"冒险内可使用道具", "advit", "ALL"})
table.insert(helpDes, {"冒险内消耗道具", "advit", "itemId", "count"})
|
db3c56ad
zhouhaihai
冒险相关
|
484
|
function _M.advit(role, pms)
|
98761edc
zhouhaihai
buff 补充
|
485
|
local reward = {}
|
d3da3368
zhouhaihai
冒险地图被动技, buff 神器
|
486
487
488
489
490
|
if pms.pm1 == "ALL" then
for k, v in pairs(csvdb["adv_itemCsv"]) do
if csvdb["itemCsv"][k] and v.effect ~= 0 then
reward[k] = 1
end
|
db3c56ad
zhouhaihai
冒险相关
|
491
|
end
|
d3da3368
zhouhaihai
冒险地图被动技, buff 神器
|
492
|
for k , v in pairs(csvdb["adv_artifactCsv"]) do
|
6afea142
zhouhaihai
gmBUG
|
493
|
if v[1].unlock == 0 then
|
d3da3368
zhouhaihai
冒险地图被动技, buff 神器
|
494
495
496
497
498
499
500
|
reward[k] = 1
end
end
else
local itemId = tonum(pms.pm1)
local count = tonum(pms.pm2)
reward[itemId] = count
|
d02f7904
zhouhaihai
遗失的log
|
501
502
|
role:mylog("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender})
|
db3c56ad
zhouhaihai
冒险相关
|
503
|
end
|
d3da3368
zhouhaihai
冒险地图被动技, buff 神器
|
504
505
|
|
98761edc
zhouhaihai
buff 补充
|
506
|
local adv = role:getAdvData()
|
3133cb76
zhouhaihai
日志
|
507
|
adv:award(reward, {log = {desc = "gm"}})
|
db3c56ad
zhouhaihai
冒险相关
|
508
509
510
511
|
return "成功"
end
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
512
|
table.insert(helpDes, {"爬塔到指定层", "tower", "塔id", "层数"})
|
4af997e0
zhouhaihai
到达指定层
|
513
|
function _M.tower(role, pms)
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
514
515
516
|
local tType = tonum(pms.pm1, 1)
local level = tonum(pms.pm2, 1)
local layer = (tType - 1) * 10000 + level
|
4af997e0
zhouhaihai
到达指定层
|
517
|
if not csvdb["tower_battleCsv"][level] then return "不存在" end
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
518
519
|
local values = role:getProperty("towerInfo")
if tType == 1 then
|
04da65df
chenyueqi
tower GM参数值修正
|
520
|
values.l = layer
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
521
|
elseif tType == 2 then
|
04da65df
chenyueqi
tower GM参数值修正
|
522
|
values.l1 = layer
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
523
|
elseif tType == 3 then
|
04da65df
chenyueqi
tower GM参数值修正
|
524
|
values.l2 = layer
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
525
|
elseif tType == 4 then
|
04da65df
chenyueqi
tower GM参数值修正
|
526
|
values.l3 = layer
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
527
528
|
end
role:updateProperty({field = "towerInfo", value = values})
|
3133cb76
zhouhaihai
日志
|
529
|
|
e50d0cae
chenyueqi
计算电波塔层数的加成效果
|
530
|
role:mylog("gm_action", {desc = "tower", int1 = tType, int2 = layer, key1 = pms.sender})
|
d02f7904
zhouhaihai
遗失的log
|
531
|
|
4af997e0
zhouhaihai
到达指定层
|
532
533
534
|
return "成功"
end
|
147ef2ce
zhouhaihai
邮件 Gm
|
535
536
537
538
|
table.insert(helpDes, {"发送邮件", "email", "id", "奖励"})
function _M.email(role, pms)
local id = tonum(pms.pm1, 0)
local reward = pms.pm2
|
2ca93972
liuzujun
添加邮件表
|
539
|
mysqlproxy:insertEmail({
|
147ef2ce
zhouhaihai
邮件 Gm
|
540
541
542
543
544
545
546
547
548
|
roleId = role:getProperty("id"),
emailId = id,
createtime = skynet.timex(),
title = id == 0 and "来自GM的邮件!" or nil,
stitle = id == 0 and "GM测试" or nil,
content = id == 0 and "测试内容测试内容!!!\n\t 巴拉巴拉!" or nil,
attachments = id == 0 and reward or nil,
rewardPms = id ~= 0 and reward or nil,
})
|
3133cb76
zhouhaihai
日志
|
549
|
|
d02f7904
zhouhaihai
遗失的log
|
550
551
|
role:mylog("gm_action", {desc = "email", int1 = id, key1 = pms.sender})
|
147ef2ce
zhouhaihai
邮件 Gm
|
552
553
|
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
554
|
|
c3f578ac
chenyueqi
gm增加跳过引导的命令 guide...
|
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
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
|
a7de05c2
chenyueqi
清除引导功能顺便也清除关卡解锁触发...
|
569
570
571
572
573
|
for _, data in pairs(csvdb["guide_unlockCsv"]) do
if data.type == 0 or data.type == 3 then
str = str:setv(data.id,1)
end
end
|
c3f578ac
chenyueqi
gm增加跳过引导的命令 guide...
|
574
|
role:updateProperty({field = "funcGuide", value = str})
|
d02f7904
zhouhaihai
遗失的log
|
575
576
|
role:mylog("gm_action", {desc = "sguide", key1 = pms.sender})
|
c3f578ac
chenyueqi
gm增加跳过引导的命令 guide...
|
577
578
579
580
581
582
583
584
585
586
587
588
|
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
|
d02f7904
zhouhaihai
遗失的log
|
589
590
|
role:mylog("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender})
|
59701355
chenyueqi
增加清除引导记录的命令
|
591
|
end
|
3133cb76
zhouhaihai
日志
|
592
|
|
4f8dfe80
chenyueqi
补充gm帮助描述
|
593
|
return "成功"
|
59701355
chenyueqi
增加清除引导记录的命令
|
594
595
|
end
|
686d4fd6
liuzujun
兑换活动支持兑换多个, 新增卡池
|
596
597
598
599
600
601
602
603
604
605
|
table.insert(helpDes, {"挑战关卡次数", "actbattle"})
function _M.actbattle(role, pms)
if not role.activity:isOpen("ChallengeLevel") then return end
local actData = role.activity:getActData("ChallengeLevel")
actData["ticket"] = 100
role.activity:updateActData("ChallengeLevel", actData)
return "成功"
end
|
08af0de6
liuzujun
清空背包gm
|
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
|
table.insert(helpDes, {"清空背包", "clearbag"})
function _M.clearbag(role, pms)
-- 装备
role:updateProperty({field="equips", value = {}})
-- 道具
local items = role:getProperty("items"):toNumMap()
for k, v in pairs(items) do
role:addItem({itemId = k, count = -v, log = {desc = "gm"}})
end
-- 铭文
local uids = {}
for uid, _ in pairs(role.runeBag) do
table.insert(uids, uid)
end
role:delRunes(uids, {log = {desc = "gm"}})
|
3d8468b2
liuzujun
火花系统
|
623
624
625
626
627
628
629
|
-- 火花
uids = {}
for uid, _ in pairs(role.sparkBag) do
table.insert(uids, uid)
end
role:delSparks(uids, {log = {desc = "gm"}})
|
08af0de6
liuzujun
清空背包gm
|
630
631
632
|
return "成功"
end
|
702a3769
liuzujun
跑马灯gm指令, 突破时候检测星级要求
|
633
634
635
636
637
638
639
640
|
table.insert(helpDes, {"发送跑马灯", "notice"})
function _M.notice(role, pms)
local msg = pms.pm1
SendPacket(actionCodes.Sys_commonNotice, MsgPack.pack({body = msg}))
return "成功"
end
|
1a20d90b
liuzujun
添加活动关卡gm指令, 活动代理拾...
|
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
|
table.insert(helpDes, {"活动关卡", "actbp", "id", "actid"})
function _M.actbp(role, pms)
local id = tonum(pms.pm1, 0)
local actid = tonum(pms.pm2, 0)
if not role.activity:isOpenById(actid, "ChallengeLevel") then return end
local actData = role.activity:getActData("ChallengeLevel") or {}
local actCfg = csvdb["activity_battleCsv"][actid]
if not actCfg then return end
for k, v in pairs(actCfg) do
if k <= id then
local bpInfo = actData[i] or {}
bpInfo["star"] = 1
actData[k] = bpInfo
end
end
role.activity:updateActData("ChallengeLevel", actData)
return "成功"
end
table.insert(helpDes, {"活动拾荒", "actadv", "id", "actid"})
function _M.actadv(role, pms)
local id = tonum(pms.pm1, 0)
local actid = tonum(pms.pm2, 0)
if not role.activity:isOpenById(actid, "AdvLevel") then return end
local actData = role.activity:getActData("AdvLevel") or {}
local advInfo = actData[id]
advInfo["pass"] = 1
actData[id] = advInfo
role.activity:updateActData("AdvLevel", actData)
return "成功"
end
|
58f3a42c
zhouhaihai
gm帮助
|
677
678
679
680
681
|
function _M.helpRpc(agent, data)
SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes}))
return true
end
|
e0d725cc
saicom
东银河安卓sdk
|
682
683
684
685
686
687
688
|
function _M.clientUploadLuaResult(agent, data)
local role = agent.role
local msg = MsgPack.unpack(data)
role:mylog("gm_action", {desc = "upload_lua", int1 = id, key1 = msg.result})
return true
end
|
3e20f499
saicom
完善商城相关协议
|
689
690
|
function _M.test(role, pms)
local id = tonum(pms.pm1, 0)
|
f76d63e1
liuzujun
联动任务活动
|
691
692
693
694
|
local actid = nil
if id > 100 then
actid = tonum(pms.pm2, 0)
end
|
1a0b3c56
liuzujun
抽卡保底,切换定向卡池
|
695
696
|
--local hero = require ("actions.HeroAction")
--hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id}))
|
847f9a7b
liuzujun
兑换活动,邮件内容修改
|
697
|
|
b8b1c164
liuzujun
扭蛋活动,万能碎片bug
|
698
|
--role:sendMail(13, nil, "1=2", {111})
|
f76d63e1
liuzujun
联动任务活动
|
699
700
701
702
703
704
705
706
707
|
local file = io.open("draw_hero_"..id..".csv", "a")
for i=1, 10000 do
local heroIds = _M.drawHero(role, id, actid)
for k, v in ipairs(heroIds) do
print((i - 1)* 10 + k, v)
file:write(v.."\n")
end
end
io.close(file)
|
3e20f499
saicom
完善商城相关协议
|
708
709
710
|
return "成功"
end
|
192b96d3
zhouhaihai
重置
|
711
712
|
-- 充值回调
function _M.ayncPurchase(role, params)
|
ec8caae5
zhouhaihai
多一点输出
|
713
|
return role:handlePurchase(params) or ""
|
192b96d3
zhouhaihai
重置
|
714
|
end
|
58f3a42c
zhouhaihai
gm帮助
|
715
|
|
2bf99d62
zhouhaihai
充值mycard
|
716
717
718
719
720
721
|
-- 获取订单号
function _M.getPurchaseOrder(role, params)
return role:getPurchaseOrderByPlatform(params) or ""
end
|
c888fcc3
zhouhaihai
充值 gm
|
722
723
|
function _M.cz(role, pms)
local id = tonum(pms.pm1)
|
4f40cc1a
chenyueqi
付费钻区分ios钻和android钻
|
724
|
local sid = tonum(pms.pm2) or 0
|
c888fcc3
zhouhaihai
充值 gm
|
725
726
727
728
729
730
731
732
733
|
local csvData = csvdb["shop_rechargeCsv"][id]
if not csvData then
return "充值id错误, 查看shop_recharge.csv"
end
role:recharge({
id = id,
transactionId = "GM",
order = "GM",
pay_time = skynet.timex(),
|
4f40cc1a
chenyueqi
付费钻区分ios钻和android钻
|
734
|
sid = sid == 1 and IOS_SID or 0,
|
c888fcc3
zhouhaihai
充值 gm
|
735
|
})
|
f2c7c6fa
saicom
添加补发充值邮件
|
736
737
|
-- 补发邮件
role:sendMail(MailId.RechargeBack)
|
c888fcc3
zhouhaihai
充值 gm
|
738
739
740
741
|
role:mylog("gm_action", {desc = "recharge", int1 = id, key1 = pms.sender})
return "指令成功"
end
|
f76d63e1
liuzujun
联动任务活动
|
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
|
function _M.drawHero(role, t, act)
local btype = t -- 1 2 3 4 5 卡池类型 4新手卡池 5心愿卡池
local subType = 1-- 定向卡池需要传 子类型
local drawType = 2 -- 1 单抽 2 十连
if btype ~= 1 then
subType = 1
end
local actid = act
-- 另开活动卡池
if actid then
--if not role.activity:isOpenById(actid, "ActHeroPool") then return end
local cfg = csvdb["activity_ctrlCsv"][actid]
if not cfg then return end
btype = cfg.condition
end
local buildTypeData = csvdb["build_typeCsv"][btype]
if not buildTypeData then return 2 end
local drawCount = {1, 10} -- 抽取次数
if not drawCount[drawType] then return 3 end
local draw_floor_back_counts = globalCsv.draw_floor_back_counts[btype]
local floorHeroCount = role:getProperty("floorHero")[btype] or 0
-- 抽取的池子
local poolMap = buildTypeData["pool"]:toNumMap()
local poolId = poolMap[subType]
if not poolId then return 5 end
--TODO 活动覆盖
local actPoolId = role.activity:getActivityPool(btype, subType)
if actPoolId ~= 0 then
poolId = actPoolId
end
local unitPool = csvdb["build_unitCsv"][poolId]
if not unitPool then return 7 end
-- 开始抽
local resultPool = {}
local function fillDrawPool(isFloorBack)
local condition = {"rare"}
local values = {}
for idx, field in ipairs(condition) do
if not values[idx] then
local lpool = {}
local curIdx = 1
while unitPool[field .. "_" .. curIdx] do
lpool[curIdx] = {unitPool[field .. "_" .. curIdx]}
curIdx = curIdx + 1
end
if next(lpool) then
values[idx] = math.randWeight(lpool, 1)
end
end
end
local weight = 0
local up_pool = nil
local rand_v = math.randomInt(1, 100)
if values[1] == HeroQuality.SR then
weight = unitPool["up_sr_weight"]
up_pool = unitPool["up_sr_id"]
elseif values[1] == HeroQuality.SSR then
weight = unitPool["up_ssr_weight"]
up_pool = unitPool["up_ssr_id"]
|
c756d4df
liuzujun
新年将军令活动
|
814
815
816
|
if btype == 5 then
weight = 3 * weight
end
|
f76d63e1
liuzujun
联动任务活动
|
817
818
819
820
821
822
|
end
--print(poolId, rand_v, weight, up_pool, values[1])
if rand_v < weight and up_pool then
up_pool = up_pool:toArray(true, "=")
if btype == 5 then -- 爱心卡池,使用玩家设置的备选池子
up_pool = role:getProperty("wishPool")
|
c756d4df
liuzujun
新年将军令活动
|
823
824
825
|
up_pool[1] = 408
up_pool[2] = 409
up_pool[3] = 410
|
f76d63e1
liuzujun
联动任务活动
|
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
|
end
for k, v in ipairs(up_pool) do
resultPool[v] = {1}
end
else
for itemId, oneData in pairs(isFloorBack and csvdb["build_floorCsv"] or csvdb["build_poolCsv"]) do
local pool_str = "pool_" .. poolId
if oneData[pool_str] and oneData[pool_str] ~= "" then
local itemData = csvdb["itemCsv"][itemId]
while itemData do
if itemData.type ~= ItemType.Hero then break end
local heroData = csvdb["unitCsv"][itemData.id - ItemStartId.Hero]
if not heroData then break end
local ok = true
-- 保底是全随机,不用比较类型
if not isFloorBack then
for idx, field in ipairs(condition) do
if heroData[field] ~= values[idx] then ok = false break end
end
end
|
c756d4df
liuzujun
新年将军令活动
|
846
847
848
849
850
851
852
853
|
if up_pool then
for k, v in ipairs(up_pool) do
if v == itemData.id then
ok = false
break
end
end
end
|
f76d63e1
liuzujun
联动任务活动
|
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
|
if not ok then break end
if oneData[pool_str] > 0 then
resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率
end
break
end
end
end
end
end
local guideHero = nil
if role:getProperty("newerGuide") == "8=1" then
guideHero = globalCsv.newdraw_hero_item_id or 503
end
local ssrCount = 0
local reward = {}
local logReward = {}
local result = {}
for i = 1, drawCount[drawType] do
floorHeroCount = floorHeroCount + 1
local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts
resultPool = {}
fillDrawPool(isFloorBack)
if not next(resultPool) then
skynet.error("random pool error, poolId:" .. poolId, isFloorBack)
return 8
end
local itemId = math.randWeight(resultPool, 1)
if guideHero then
itemId = guideHero
end
local itemData = csvdb["itemCsv"][itemId]
if itemData.quality == HeroQuality.SSR then
ssrCount = ssrCount + 1
if not guideHero then
-- 广播获得ssr英雄
local ntf = {heroId = itemData.id - ItemStartId.Hero, nick = role:getProperty("name")}
--mcast_util.pub_world(actionCodes.Role_broadGetSSR, MsgPack.pack(ntf))
end
end
if btype == 4 and role:getProperty("newerDraw") == 0 then -- 新手卡池
if itemData.quality == HeroQuality.SSR then
floorHeroCount = 0
end
else
if itemData.quality >= HeroQuality.SR then
floorHeroCount = 0
end
end
if role:isHaveHero(itemData.id - ItemStartId.Hero) then
local fragId = itemData.id - ItemStartId.Hero
local heroData = csvdb["unitCsv"][fragId]
local count = globalCsv.draw_unit_tofragment[heroData.rare]
role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
logReward[fragId] = (logReward[fragId] or 0) + count
table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1})
else
role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
logReward[itemId] = (logReward[itemId] or 0) + 1
table.insert(reward, {id = itemId, count = 1})
end
end
if draw_floor_back_counts then
local floorHero = role:getProperty("floorHero")
floorHero[btype] = floorHeroCount
role:setProperty("floorHero", floorHero)
end
if btype == 4 then
local newCount = role:getProperty("newerDraw")
role:updateProperty({field="newerDraw", value = newCount + drawCount[drawType]})
end
--SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
for k, v in pairs(reward) do
local hero = v
if hero["from"] then
result[#result+1] = hero["from"]
else
result[#result+1] = hero["id"]
end
end
local feedbackId = buildTypeData["can_feedback"] or 0
if feedbackId ~= 0 then
-- 达到一定次数,给响应奖励
local oldVal = role:getProperty("repayHero") or 0
if actid then
local actData = role.activity:getActData("ActHeroPool")
oldVal = actData[btype] or 0
end
local newVal = oldVal + drawCount[drawType]
local drawCardReward, val = role:getDrawCardExtraReward(feedbackId, oldVal, newVal)
-- 空字符穿代表直接给英雄 走以前repayHeroRpc
if drawCardReward == "" then
local repayHeroMaxCount = role:getProperty("repayMaxC") or 0
repayHeroMaxCount = repayHeroMaxCount + 1
role:updateProperty({field = "repayMaxC", value = repayHeroMaxCount})
local even = repayHeroMaxCount % 2
local id = 0
if even == 1 then
id = math.randWeight(csvdb["build_giftCsv"], "pool_"..feedbackId)
else
local giftHeroSet = {}
for gid, cfg in pairs(csvdb["build_giftCsv"]) do
if cfg["pool_"..feedbackId] ~= 0 and not role:isHaveHero(gid - ItemStartId.Hero) then
giftHeroSet[gid] = {1}
end
end
if next(giftHeroSet) then
id = math.randWeight(giftHeroSet, 1)
end
end
if id == 0 then
id = math.randWeight(csvdb["build_giftCsv"], "pool_"..feedbackId)
end
local r,change = {}
local itemData = csvdb["itemCsv"][id]
--if itemData.type == ItemType.Hero and role:isHaveHero(itemData.id - ItemStartId.Hero) then
-- local fragId = itemData.id - ItemStartId.Hero
-- local heroData = csvdb["unitCsv"][fragId]
-- local count = globalCsv.draw_unit_tofragment[heroData.rare]
-- r, change = role:award({[fragId] = count}, {log = {desc = "drawHeroExtraReward"}})
-- --r = {id = fragId, count = count, from = id, fcount = 1}
--else
r, change = role:award({[id] = 1}, {log = {desc = "drawHeroExtraReward"}})
--end
SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change)))
elseif drawCardReward and drawCardReward ~= "" then
local r,change = {}
r, change = role:award(drawCardReward, {log = {desc = "drawHeroExtraReward", int1 = oldVal, int2 = newVal}})
SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change)))
end
if not actid then
role:updateProperty({field = "repayHero", value = val})
else
local actData = role.activity:getActData("ActHeroPool")
actData[btype] = val
role.activity:updateActData("ActHeroPool", actData)
end
end
return result
end
|
a85b344f
zhangqijia
feat: 挂机图鉴
|
1007
1008
1009
1010
|
table.insert(helpDes, {"宝藏图鉴", "treasure", "list"} )
function _M.treasure(role, pms)
local pm1 = pms.pm1
if pm1 == "LIST" then
|
251d8e5e
zhangqijia
fix: 挂机宝鉴,宝藏CD的bug
|
1011
1012
|
local treasureList= role.dailyData:getProperty("treasureList")
dump(treasureList)
|
a85b344f
zhangqijia
feat: 挂机图鉴
|
1013
|
return "宝藏图鉴"
|
251d8e5e
zhangqijia
fix: 挂机宝鉴,宝藏CD的bug
|
1014
1015
1016
1017
|
elseif pm1 == "FLUSH" then
local treasureList= role.dailyData:getTreasrueList(role)
dump(treasureList)
return "宝藏图鉴"
|
a85b344f
zhangqijia
feat: 挂机图鉴
|
1018
1019
|
elseif pm1 == "CHECK" then
local treasureList = role.dailyData:checkTreasureList(role)
|
251d8e5e
zhangqijia
fix: 挂机宝鉴,宝藏CD的bug
|
1020
1021
|
if treasureList == nil then
return "未挖到宝藏"
|
a85b344f
zhangqijia
feat: 挂机图鉴
|
1022
|
end
|
251d8e5e
zhangqijia
fix: 挂机宝鉴,宝藏CD的bug
|
1023
|
dump(treasureList)
|
a85b344f
zhangqijia
feat: 挂机图鉴
|
1024
1025
1026
1027
1028
1029
1030
1031
|
return "挖宝成功"
elseif pm1 == "RESET" then
role.dailyData:resetTreasureList()
return "重置宝藏图鉴"
else
return "暂无指令: ".. pm1
end
end
|
c888fcc3
zhouhaihai
充值 gm
|
1032
|
|
659fe200
zhangqijia
feat: 天赋点
|
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
|
table.insert(helpDes, {"天赋点设置", "savegenius", "heroId", "wakeL", "awake"})
function _M.savegenius(role, pms)
local heroId = pms.pm1
local wakeL = pms.pm2
local awake = pms.pm3
local hero = role.heros[tonumber(heroId)]
if not hero then return "英雄不存在" end
local genius = hero:saveGeniusTree(wakeL, awake)
print(genius)
return "天赋点设置成功"
end
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1046
1047
|
table.insert(helpDes, {"清讨伐电台", "clear_radio", "id"})
function _M.clear_radio(role, pms)
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1048
|
local id = tonumber(pms.pm1)
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1049
|
local radioTask = role:getProperty("radioTask")
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1050
|
if id ~= 0 then
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
|
radioTask[id] = nil
else
radioTask = {}
end
role:updateProperty({field = "radioTask", value = radioTask})
return "成功"
end
table.insert(helpDes, {"清代理拾荒", "clear_adv_hang", "id"})
function _M.clear_adv_hang(role, pms)
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1063
|
local id = tonumber(pms.pm1)
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1064
|
local task = role:getProperty("advHang")
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1065
|
if id ~= 0 then
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
|
task[id] = nil
else
task = {}
end
role:updateProperty({field = "advHang", value = task})
return "成功"
end
table.insert(helpDes, {"清海港贸易", "clear_sea", "id"})
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1077
1078
|
function _M.clear_sea(role, pms)
local id = tonumber(pms.pm1)
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1079
|
local task = role:getProperty("seaport")
|
81ca3a6f
liuzujun
清理电台,代理拾荒,海港贸易机gm
|
1080
|
if id ~= 0 then
|
ae0d3358
liuzujun
重置单一玩家 讨伐电台、代理拾荒、...
|
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
|
task.collect[id] = nil
else
task.collect = {}
end
role:updateProperty({field = "seaport", value = task})
return "成功"
end
|
6304b5ad
zhangqijia
feat: 一番赏 增加重置扭蛋机指令
|
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
|
table.insert(helpDes, {"重置扭蛋机", "reset_capsule", "typ"})
function _M.reset_capsule(role, pms, capsule_serv)
local typ = tonumber(pms.pm1)
if typ == 1 then
skynet.call(capsule_serv, "lua", "reset")
else
role:resetCapsule()
end
return "成功"
end
|
e0d725cc
saicom
东银河安卓sdk
|
1102
1103
1104
1105
1106
1107
|
function _M.do_lua(role, pms)
local luaStr = pms.pm1
SendPacket(actionCodes.Gm_clientLuaCommandNtf, MsgPack.pack({lua = luaStr}))
return "成功"
end
|
012f7893
liuzujun
添加 拉满日活跃度 gm指令
|
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
|
table.insert(helpDes, {"每日活跃度拉满", "full_active"})
function _M.full_active(role, pms)
local taskStatus = role:getProperty("dTask")
taskStatus["a"] = 200
role:updateProperty({field="dTask", value=taskStatus})
role:checkTaskEnter("DailyTask", {pre = 0, cur = 200})
return "成功"
end
|
54bd82e3
zhangqijia
fix: 修复 查询抽奖ssr记录...
|
1118
1119
|
table.insert(helpDes, {"抽英雄", "get_draw_hero_pro"})
function _M.get_draw_hero_pro(role, pms)
|
850c54f5
liuzujun
抽卡概率明示相关
|
1120
1121
1122
1123
1124
1125
1126
|
-- 普池 10 up池 207 心愿单 20
local poolDict = {
[10] = "普通卡池",
[207] = "UP卡池",
[20] = "心愿单",
}
local result = {}
|
54bd82e3
zhangqijia
fix: 修复 查询抽奖ssr记录...
|
1127
1128
|
for k,v in pairs(poolDict) do
local unit = csvdb["build_unitCsv"][k]
|
850c54f5
liuzujun
抽卡概率明示相关
|
1129
|
if unit then
|
54bd82e3
zhangqijia
fix: 修复 查询抽奖ssr记录...
|
1130
1131
1132
|
local w1 = unit["rare_1"] or 0
local w2 = unit["rare_2"] or 0
local w3 = unit["rare_3"] or 0
|
850c54f5
liuzujun
抽卡概率明示相关
|
1133
1134
1135
|
local up = unit["up_ssr_weight"] or 0
local total = w1 + w2 + w3
if total > 0 then
|
54bd82e3
zhangqijia
fix: 修复 查询抽奖ssr记录...
|
1136
1137
1138
|
local p1 = string.format("%.2f", w1 / total)
local p2 = string.format("%.2f",w2 / total)
local p3 = string.format("%.2f",w3 / total)
|
850c54f5
liuzujun
抽卡概率明示相关
|
1139
1140
1141
1142
1143
1144
1145
1146
1147
|
local tmp = {}
tmp["p1"] = p1
tmp["p2"] = p2
tmp["p3"] = p3
tmp["up"] = up
result[v] = tmp
end
end
end
|
54bd82e3
zhangqijia
fix: 修复 查询抽奖ssr记录...
|
1148
1149
1150
1151
1152
1153
|
result["history"] = {}
local ret = redisproxy:lrange("drawHeroRecord", 0, 300)
for _, v in ipairs(ret) do
table.insert(result["history"], MsgPack.unpack(v))
end
return json.encode(result)
|
850c54f5
liuzujun
抽卡概率明示相关
|
1154
1155
|
end
|
cfae632e
liuzujun
玩家商品购买次数减一
|
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
|
function _M.decrePayR(role, pms)
local id = tonumber(pms.pm1)
local payR = role.storeData:getProperty("payR")
if payR[id] > 0 then
payR[id] = payR[id] - 1
if payR[id] == 0 then
payR[id] = nil
end
end
role.storeData:updateProperty({field = "payR", value = payR})
return "指令成功"
end
|
7a515b60
zhangqijia
feat: 增加一个礼包码的接口
|
1169
1170
1171
1172
1173
|
function _M.draw_code(role, pms)
local code = pms.pm1
if type(code) ~= "string" then return -2 end
if code:find("[^0-9a-zA-Z]") then return -3 end
|
6ad7e803
zhangqijia
fix: 礼包兑换码奖励通过邮件发送
|
1174
|
local ret, _= role:getCodeGift(code)
|
7a515b60
zhangqijia
feat: 增加一个礼包码的接口
|
1175
1176
1177
1178
|
return ret
end
|
314bc5df
zhengshouren
提交服务器初始代码
|
1179
|
return _M
|