|
|
@@ -99,7 +99,6 @@ function summon(human, itemID, itemUseCnt)
|
|
|
local outItemIDList = nil
|
|
|
local targetID = nil
|
|
|
if itemConfig.get[1] == SUMMON_TYPE_TARGET then
|
|
|
- -- 召唤数量大于剩余格子数,将真实召唤数量换成剩余格子数
|
|
|
--如果是合成英雄才这么处理
|
|
|
if itemConfig.get[2] == SUMMON_SUBTYPE_HERO then
|
|
|
local leftHeroBox = HeroLogic.getEmptyCnt(human)
|
|
|
@@ -110,9 +109,8 @@ function summon(human, itemID, itemUseCnt)
|
|
|
-- 指定目标
|
|
|
targetID = itemConfig.get[3]
|
|
|
elseif itemConfig.get[1] == SUMMON_TYPE_DROP then
|
|
|
-
|
|
|
- -- 召唤数量大于剩余格子数,将真实召唤数量换成剩余格子数
|
|
|
- if itemConfig.get[2] ~= SUMMON_SUBTYPE_EQUIP then
|
|
|
+ --如果是合成英雄才这么处理
|
|
|
+ if itemConfig.get[2] == SUMMON_SUBTYPE_HERO then
|
|
|
local leftHeroBox = HeroLogic.getEmptyCnt(human)
|
|
|
if realItemCnt > leftHeroBox then
|
|
|
realItemCnt = leftHeroBox
|
|
|
@@ -128,13 +126,13 @@ function summon(human, itemID, itemUseCnt)
|
|
|
outItemIDList[targetID] = outItemIDList[targetID] + 1
|
|
|
end
|
|
|
elseif itemConfig.get[1] == SUMMON_TYPE_HERO_SP then
|
|
|
-
|
|
|
-
|
|
|
- -- 召唤数量大于剩余格子数,将真实召唤数量换成剩余格子数
|
|
|
- local leftHeroBox = HeroLogic.getEmptyCnt(human)
|
|
|
- if realItemCnt > leftHeroBox then
|
|
|
- realItemCnt = leftHeroBox
|
|
|
- end
|
|
|
+ --如果是合成英雄才这么处理
|
|
|
+ if itemConfig.get[2] == SUMMON_SUBTYPE_HERO then
|
|
|
+ local leftHeroBox = HeroLogic.getEmptyCnt(human)
|
|
|
+ if realItemCnt > leftHeroBox then
|
|
|
+ realItemCnt = leftHeroBox
|
|
|
+ end
|
|
|
+ end
|
|
|
|
|
|
-- 英雄条件兑换
|
|
|
local dropTable = DropSpecial.getDropHeroTable(itemConfig.get[3][1], itemConfig.get[3][2], itemConfig.get[3][3])
|
|
|
@@ -638,14 +636,14 @@ function Suipan_BeginSyntheticFragments(human, nItemID, nItemNum, tMsgData)
|
|
|
local outItemIDList = nil
|
|
|
local targetID = nil
|
|
|
if itemConfig.get[1] == SUMMON_TYPE_TARGET then
|
|
|
- if realItemCnt > leftHeroBox then
|
|
|
+ if realItemCnt > leftHeroBox and itemConfig.subType == ItemDefine.ITEM_SUBTYPE_SUIPIAN then
|
|
|
realItemCnt = leftHeroBox
|
|
|
end
|
|
|
-- 指定目标
|
|
|
targetID = itemConfig.get[3]
|
|
|
- elseif itemConfig.get[1] == SUMMON_TYPE_DROP then
|
|
|
+ elseif itemConfig.get[1] == SUMMON_TYPE_DROP then
|
|
|
if itemConfig.get[2] ~= SUMMON_SUBTYPE_EQUIP then
|
|
|
- if realItemCnt > leftHeroBox then
|
|
|
+ if realItemCnt > leftHeroBox and itemConfig.subType == ItemDefine.ITEM_SUBTYPE_SUIPIAN then
|
|
|
realItemCnt = leftHeroBox
|
|
|
end
|
|
|
end
|
|
|
@@ -663,7 +661,7 @@ function Suipan_BeginSyntheticFragments(human, nItemID, nItemNum, tMsgData)
|
|
|
outItemIDList[targetID] = outItemIDList[targetID] + 1
|
|
|
end
|
|
|
elseif itemConfig.get[1] == SUMMON_TYPE_HERO_SP then
|
|
|
- if realItemCnt > leftHeroBox then
|
|
|
+ if realItemCnt > leftHeroBox and itemConfig.subType == ItemDefine.ITEM_SUBTYPE_SUIPIAN then
|
|
|
realItemCnt = leftHeroBox
|
|
|
end
|
|
|
local dropTable = DropSpecial.getDropHeroTable(itemConfig.get[3][1], itemConfig.get[3][2], itemConfig.get[3][3])
|
|
|
@@ -777,7 +775,7 @@ function SUIPIAN_SYNTHESIS(human, tCompositeTable, isHaveHero)
|
|
|
end
|
|
|
|
|
|
-- 英雄背包空余格子数
|
|
|
- local nLefeHeroNum = HeroLogic.getEmptyCnt(human)
|
|
|
+ local nLefeHeroNum = HeroLogic.getEmptyCnt(human)
|
|
|
if 0 >= nLefeHeroNum and isHaveHero then
|
|
|
Broadcast.sendErr(human, Lang.HERO_BAG_FULL)
|
|
|
print("[SUIPIAN_SYNTHESIS] 背包格子不够直接返回 nLefeHeroNum = "..nLefeHeroNum)
|
|
|
@@ -829,12 +827,14 @@ function SUIPIAN_SYNTHESIS(human, tCompositeTable, isHaveHero)
|
|
|
|
|
|
local itemConfig = ItemExcel.item[nID]
|
|
|
if itemConfig then
|
|
|
- local nCanCreateNum = math.floor(nNum / itemConfig.fullCnt)
|
|
|
- if nCanCreateNum > nLefeHeroNum and isHaveHero then
|
|
|
- nCanCreateNum = nLefeHeroNum
|
|
|
+ if isHaveHero then
|
|
|
+ local nCanCreateNum = math.floor(nNum / itemConfig.fullCnt)
|
|
|
+ if nCanCreateNum > nLefeHeroNum then
|
|
|
+ nCanCreateNum = nLefeHeroNum
|
|
|
+ end
|
|
|
+
|
|
|
+ nLefeHeroNum = nLefeHeroNum - nCanCreateNum
|
|
|
end
|
|
|
-
|
|
|
- nLefeHeroNum = nLefeHeroNum - nCanCreateNum
|
|
|
|
|
|
local bRet = Suipan_BeginSyntheticFragments(human, nID, nNum, msgRet)
|
|
|
if false == bRet then
|