diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index ce88dac..f32c532 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -558,6 +558,26 @@ function _M.actbattle(role, pms) return "成功" end +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"}}) + + return "成功" +end + function _M.helpRpc(agent, data) SendPacket(actionCodes.Gm_helpRpc, MsgPack.pack({help = helpDes})) return true -- libgit2 0.21.2