Commit 08af0de6402bcbf7903690be3abede56cea9504e
1 parent
c32be356
清空背包gm
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
src/actions/GmAction.lua
... | ... | @@ -558,6 +558,26 @@ function _M.actbattle(role, pms) |
558 | 558 | return "成功" |
559 | 559 | end |
560 | 560 | |
561 | +table.insert(helpDes, {"清空背包", "clearbag"}) | |
562 | +function _M.clearbag(role, pms) | |
563 | + -- 装备 | |
564 | + role:updateProperty({field="equips", value = {}}) | |
565 | + -- 道具 | |
566 | + local items = role:getProperty("items"):toNumMap() | |
567 | + for k, v in pairs(items) do | |
568 | + role:addItem({itemId = k, count = -v, log = {desc = "gm"}}) | |
569 | + end | |
570 | + | |
571 | + -- 铭文 | |
572 | + local uids = {} | |
573 | + for uid, _ in pairs(role.runeBag) do | |
574 | + table.insert(uids, uid) | |
575 | + end | |
576 | + role:delRunes(uids, {log = {desc = "gm"}}) | |
577 | + | |
578 | + return "成功" | |
579 | +end | |
580 | + | |
561 | 581 | function _M.helpRpc(agent, data) |
562 | 582 | SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) |
563 | 583 | return true | ... | ... |