From 18478207a2a46944aac38cd712542e2d5e3987ee Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Wed, 17 Mar 2021 17:54:36 +0800 Subject: [PATCH] 贸易季委托要返回英雄的信赖值 --- src/actions/SeaportAction.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/actions/SeaportAction.lua b/src/actions/SeaportAction.lua index db232c8..e048b30 100644 --- a/src/actions/SeaportAction.lua +++ b/src/actions/SeaportAction.lua @@ -139,6 +139,7 @@ function _M.taskRpc(agent, data) if not TaskCsv[taskId] or not TaskCsv[taskId][level] then return 1 end local reward, change = {}, {} + local heroFaithMap = {} local seaport = role:getProperty("seaport") local data = TaskCsv[taskId][level] @@ -211,6 +212,7 @@ function _M.taskRpc(agent, data) if hero then totalCoef = totalCoef + getHeroCoef(hero, data.success) hero:addHeroFaith(data.trust) + heroFaithMap[heroId] = hero:getProperty("faith") end end @@ -241,7 +243,10 @@ function _M.taskRpc(agent, data) role:updateProperty({field = "seaport", value = seaport}) - SendPacket(actionCodes.Seaport_taskRpc, MsgPack.pack(role:packReward(reward, change))) + local result = role:packReward(reward, change) + result["heroFaith"] = heroFaithMap + + SendPacket(actionCodes.Seaport_taskRpc, MsgPack.pack(result)) return true end -- libgit2 0.21.2