From 58559948b6d79f4334920c24a535e8212e1e4a5a Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Mon, 29 Jul 2019 19:40:33 +0800 Subject: [PATCH] getall gm --- src/actions/GmAction.lua | 8 +++++--- src/adv/Adv.lua | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index ed5ea78..8d537be 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -90,11 +90,13 @@ end function _M.get(role, pms) if pms.pm1 == "ALL" then - for itemId = 1, 100 do - if csvdb["itemCsv"][itemId] then - role:award({[itemId] = 1000000}) + local reward = {} + for id, data in pairs(csvdb["gm_getallCsv"]) do + if csvdb["itemCsv"][id] then + reward[id] = data.number end end + role:award(reward) elseif pms.pm1 == "EQUIP" then for itemId = 7000 , 8000 do if csvdb["itemCsv"][itemId] then diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index d4039fe..dc747f1 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -235,7 +235,7 @@ local function randomAdvMap(role, chapterId, level, notNotify) -- 全地图事件 优先级高 for stageType, events in pairs(mapData["events"]) do for _, event in ipairs(events) do - local lastCount = #stagePool["global"][stageType] + local lastCount = stagePool["global"][stageType] and #stagePool["global"][stageType] or 0 if lastCount <= 0 then break end if math.randomFloat(0, 1) <= (event["rate"] or 1) then local count = math.randomInt(math.min(lastCount, event["minc"]), math.min(lastCount, event["maxc"])) -- libgit2 0.21.2