diff --git a/src/actions/CarAction.lua b/src/actions/CarAction.lua index d72ec5d..c1cc56c 100644 --- a/src/actions/CarAction.lua +++ b/src/actions/CarAction.lua @@ -13,9 +13,28 @@ function _M.makePotionRpc( agent, data ) local count = msg.count if count < 1 then return 0 end local potionBag = role:getProperty("potionBag") - local potionLv = role.dinerData:getProperty("dishTree"):getv(potionId, 1) + local dishTree = role.dinerData:getProperty("dishTree") + local potionLv = dishTree:getv(potionId, 1) if potionLv < 1 then return 1 end + local talentSet = csvdb["diner_talentCsv"][potionId] + if not talentSet then + return 10 + end + + local talentData = talentSet[potionLv] + if not talentData then + return 11 + end + local limit = talentData.pointFront:toNumMap() + for k,v in pairs(limit) do + local lv = dishTree:getv(k, 0) + if lv < v then + return 12 + end + end + + local potionSet = csvdb["adv_potionCsv"][potionId] if not potionSet then return 2 end diff --git a/src/actions/DinerAction.lua b/src/actions/DinerAction.lua index bdc0061..e1b7ec8 100644 --- a/src/actions/DinerAction.lua +++ b/src/actions/DinerAction.lua @@ -709,6 +709,20 @@ function _M.addWantFoodRpc(agent , data) local foodData = csvdb["diner_materialCsv"][itemId] if not foodData then return 3 end if foodData.unlock ~= 0 then + -- 遍历adv_potion + for potionId, _ in pairs(csvdb["adv_potionCsv"]) do + local potionLv = role.dinerData:getProperty("dishTree"):getv(potionId, 0) + if potionLv < 1 then return 4 end + + local potionSet = csvdb["adv_potionCsv"][potionId] + if not potionSet then return 5 end + + local potionData = potionSet[potionLv] + if not potionData then return 6 end + + local cost = potionData.material:toNumMap() + if not cost[itemId] then return 7 end + end if not role:checkHangPass(foodData.unlock) then return 4 end -- libgit2 0.21.2