Commit 58559948b6d79f4334920c24a535e8212e1e4a5a

Authored by zhouhaihai
1 parent cb85faac

getall gm

Showing 2 changed files with 6 additions and 4 deletions   Show diff stats
src/actions/GmAction.lua
@@ -90,11 +90,13 @@ end @@ -90,11 +90,13 @@ end
90 90
91 function _M.get(role, pms) 91 function _M.get(role, pms)
92 if pms.pm1 == "ALL" then 92 if pms.pm1 == "ALL" then
93 - for itemId = 1, 100 do  
94 - if csvdb["itemCsv"][itemId] then  
95 - role:award({[itemId] = 1000000}) 93 + local reward = {}
  94 + for id, data in pairs(csvdb["gm_getallCsv"]) do
  95 + if csvdb["itemCsv"][id] then
  96 + reward[id] = data.number
96 end 97 end
97 end 98 end
  99 + role:award(reward)
98 elseif pms.pm1 == "EQUIP" then 100 elseif pms.pm1 == "EQUIP" then
99 for itemId = 7000 , 8000 do 101 for itemId = 7000 , 8000 do
100 if csvdb["itemCsv"][itemId] then 102 if csvdb["itemCsv"][itemId] then
@@ -235,7 +235,7 @@ local function randomAdvMap(role, chapterId, level, notNotify) @@ -235,7 +235,7 @@ local function randomAdvMap(role, chapterId, level, notNotify)
235 -- 全地图事件 优先级高 235 -- 全地图事件 优先级高
236 for stageType, events in pairs(mapData["events"]) do 236 for stageType, events in pairs(mapData["events"]) do
237 for _, event in ipairs(events) do 237 for _, event in ipairs(events) do
238 - local lastCount = #stagePool["global"][stageType] 238 + local lastCount = stagePool["global"][stageType] and #stagePool["global"][stageType] or 0
239 if lastCount <= 0 then break end 239 if lastCount <= 0 then break end
240 if math.randomFloat(0, 1) <= (event["rate"] or 1) then 240 if math.randomFloat(0, 1) <= (event["rate"] or 1) then
241 local count = math.randomInt(math.min(lastCount, event["minc"]), math.min(lastCount, event["maxc"])) 241 local count = math.randomInt(math.min(lastCount, event["minc"]), math.min(lastCount, event["maxc"]))