Commit 747f05a1be907f7a42199452ae4152537f8dd5c1

Authored by gaofengduan
1 parent f5ee0efa

add gm get all

Showing 1 changed file with 13 additions and 5 deletions   Show diff stats
src/actions/GmAction.lua
... ... @@ -38,12 +38,20 @@ function _M.rune(role, pms)
38 38 end
39 39  
40 40 function _M.get(role, pms)
41   - local itemId = tonum(pms.pm1)
42   - if not csvdb["itemCsv"][itemId] then
43   - return "物品不存在"
  41 + if pms.pm1 == "ALL" then
  42 + for id,data in pairs(csvdb["itemCsv"]) do
  43 + if data.type ~= 4 then
  44 + role:award({[id] = 10})
  45 + end
  46 + end
  47 + else
  48 + local itemId = tonum(pms.pm1)
  49 + if not csvdb["itemCsv"][itemId] then
  50 + return "物品不存在"
  51 + end
  52 + local count = tonum(pms.pm2)
  53 + role:award({[itemId] = count})
44 54 end
45   - local count = tonum(pms.pm2)
46   - role:award({[itemId] = count})
47 55 return "成功"
48 56 end
49 57  
... ...