From 747f05a1be907f7a42199452ae4152537f8dd5c1 Mon Sep 17 00:00:00 2001 From: gaofengduan <782277855@qq.com> Date: Tue, 9 Jul 2019 17:34:47 +0800 Subject: [PATCH] add gm get all --- src/actions/GmAction.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index b0abb1d..ccb1208 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -38,12 +38,20 @@ function _M.rune(role, pms) end function _M.get(role, pms) - local itemId = tonum(pms.pm1) - if not csvdb["itemCsv"][itemId] then - return "物品不存在" + if pms.pm1 == "ALL" then + for id,data in pairs(csvdb["itemCsv"]) do + if data.type ~= 4 then + role:award({[id] = 10}) + end + end + else + local itemId = tonum(pms.pm1) + if not csvdb["itemCsv"][itemId] then + return "物品不存在" + end + local count = tonum(pms.pm2) + role:award({[itemId] = count}) end - local count = tonum(pms.pm2) - role:award({[itemId] = count}) return "成功" end -- libgit2 0.21.2