Commit 1a20d90b0780eac9775c948e7d68ea06bb569d4e
1 parent
b02cd5f6
添加活动关卡gm指令, 活动代理拾荒数据清理
Showing
2 changed files
with
37 additions
and
2 deletions
Show diff stats
src/actions/GmAction.lua
| ... | ... | @@ -588,6 +588,42 @@ function _M.notice(role, pms) |
| 588 | 588 | return "成功" |
| 589 | 589 | end |
| 590 | 590 | |
| 591 | +table.insert(helpDes, {"活动关卡", "actbp", "id", "actid"}) | |
| 592 | +function _M.actbp(role, pms) | |
| 593 | + local id = tonum(pms.pm1, 0) | |
| 594 | + local actid = tonum(pms.pm2, 0) | |
| 595 | + if not role.activity:isOpenById(actid, "ChallengeLevel") then return end | |
| 596 | + local actData = role.activity:getActData("ChallengeLevel") or {} | |
| 597 | + | |
| 598 | + local actCfg = csvdb["activity_battleCsv"][actid] | |
| 599 | + if not actCfg then return end | |
| 600 | + for k, v in pairs(actCfg) do | |
| 601 | + if k <= id then | |
| 602 | + local bpInfo = actData[i] or {} | |
| 603 | + bpInfo["star"] = 1 | |
| 604 | + actData[k] = bpInfo | |
| 605 | + end | |
| 606 | + end | |
| 607 | + role.activity:updateActData("ChallengeLevel", actData) | |
| 608 | + | |
| 609 | + return "成功" | |
| 610 | +end | |
| 611 | + | |
| 612 | +table.insert(helpDes, {"活动拾荒", "actadv", "id", "actid"}) | |
| 613 | +function _M.actadv(role, pms) | |
| 614 | + local id = tonum(pms.pm1, 0) | |
| 615 | + local actid = tonum(pms.pm2, 0) | |
| 616 | + if not role.activity:isOpenById(actid, "AdvLevel") then return end | |
| 617 | + local actData = role.activity:getActData("AdvLevel") or {} | |
| 618 | + local advInfo = actData[id] | |
| 619 | + advInfo["pass"] = 1 | |
| 620 | + actData[id] = advInfo | |
| 621 | + | |
| 622 | + role.activity:updateActData("AdvLevel", actData) | |
| 623 | + | |
| 624 | + return "成功" | |
| 625 | +end | |
| 626 | + | |
| 591 | 627 | function _M.helpRpc(agent, data) |
| 592 | 628 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) |
| 593 | 629 | return true | ... | ... |
src/models/Activity.lua
| ... | ... | @@ -1146,7 +1146,6 @@ local function closeActAdvHang(role, chapterId) |
| 1146 | 1146 | end |
| 1147 | 1147 | reward, change = role:award(idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
| 1148 | 1148 | end |
| 1149 | - | |
| 1150 | 1149 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) |
| 1151 | 1150 | |
| 1152 | 1151 | role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = 2}) |
| ... | ... | @@ -1163,7 +1162,7 @@ activityFunc[Activity.ActivityType.AdvLevel] = { |
| 1163 | 1162 | ["close"] = function(self, actType, notify, actid) |
| 1164 | 1163 | local actCfg = csvdb["activity_adv_chapterCsv"][actid] |
| 1165 | 1164 | if not actCfg then return end |
| 1166 | - for chapterId, _ in ipairs(actCfg) do | |
| 1165 | + for chapterId, _ in pairs(actCfg) do | |
| 1167 | 1166 | local advPass = self.owner:getProperty("advPass") |
| 1168 | 1167 | advPass[chapterId] = nil |
| 1169 | 1168 | local advRelay = self.owner:getProperty("advRelay") | ... | ... |