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