Commit e8f3af2a0e56fe4f7f679235a1c398f68fae9539
Merge branch 'cn/develop-mysql' of 120.26.43.151:wasteland/server into cn/develop-mysql
Showing
2 changed files
with
7 additions
and
6 deletions
Show diff stats
src/GlobalVar.lua
@@ -143,6 +143,7 @@ ItemId = { | @@ -143,6 +143,7 @@ ItemId = { | ||
143 | PvpKey = 22, -- pvp钥匙 | 143 | PvpKey = 22, -- pvp钥匙 |
144 | LunchFragment = 23, | 144 | LunchFragment = 23, |
145 | RuneFragment = 24, | 145 | RuneFragment = 24, |
146 | + RecruitmentCard = 70, -- 招募券 | ||
146 | HeroFC = {700, 701, 702, 703}, --通用角色碎片 | 147 | HeroFC = {700, 701, 702, 703}, --通用角色碎片 |
147 | AdvKey = 80, -- 冒险钥匙 | 148 | AdvKey = 80, -- 冒险钥匙 |
148 | AdvPower = 4701, -- 拾荒体力 | 149 | AdvPower = 4701, -- 拾荒体力 |
src/actions/RoleAction.lua
@@ -1408,21 +1408,21 @@ function _M.diamondConvertRpc(agent, data) | @@ -1408,21 +1408,21 @@ function _M.diamondConvertRpc(agent, data) | ||
1408 | if role:getAllDiamond() < cost then return 2 end | 1408 | if role:getAllDiamond() < cost then return 2 end |
1409 | 1409 | ||
1410 | local get = globalCsv.legal_tender_cost * cost | 1410 | local get = globalCsv.legal_tender_cost * cost |
1411 | - role:costDiamond({count = cost, log = {desc = "convert", int1 = ItemType.Jade, int2 = get}}) | 1411 | + role:costDiamond({count = cost, log = {desc = "convert", int1 = ItemId.Jade, int2 = get}}) |
1412 | local reward, change | 1412 | local reward, change |
1413 | if oper == 1 then -- 钻石兑换成虹光玉 | 1413 | if oper == 1 then -- 钻石兑换成虹光玉 |
1414 | reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert"}}) | 1414 | reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert"}}) |
1415 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 | 1415 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 |
1416 | local allReward = {[ItemId.Jade] = get} | 1416 | local allReward = {[ItemId.Jade] = get} |
1417 | local quan = math.floor(get/globalCsv.recruit_cost) | 1417 | local quan = math.floor(get/globalCsv.recruit_cost) |
1418 | - allReward[ItemType.Jade] = allReward[ItemType.Jade] - quan * globalCsv.recruit_cost | ||
1419 | - if allReward[ItemType.Jade] == 0 then | ||
1420 | - allReward[ItemType.Jade] = nil | 1418 | + allReward[ItemId.Jade] = allReward[ItemId.Jade] - quan * globalCsv.recruit_cost |
1419 | + if allReward[ItemId.Jade] == 0 then | ||
1420 | + allReward[ItemId.Jade] = nil | ||
1421 | end | 1421 | end |
1422 | if quan > 0 then | 1422 | if quan > 0 then |
1423 | - allReward[70] = quan | ||
1424 | - reward, change = role:award(allReward, {log = {desc = "convert"}}) | 1423 | + allReward[ItemId.RecruitmentCard] = quan |
1425 | end | 1424 | end |
1425 | + reward, change = role:award(allReward, {log = {desc = "convert"}}) | ||
1426 | end | 1426 | end |
1427 | 1427 | ||
1428 | SendPacket(actionCodes.Role_diamondConvertRpc, MsgPack.pack(role:packReward(reward, change))) | 1428 | SendPacket(actionCodes.Role_diamondConvertRpc, MsgPack.pack(role:packReward(reward, change))) |