From a02d7379e60b7b3fe0ae8d1ada4cf86fc4d0a1be Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 11 九月 2020 14:27:11 +0800
Subject: [PATCH] 1111 媒体卡固定码支持按appid配置;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py |  250 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 210 insertions(+), 40 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
index f87e025..c2a7477 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/Operate_ItemCompound.py
@@ -93,12 +93,21 @@
         GameWorld.ErrLog("不存在该合成物品! makeItemID=%s" % makeItemID)
         return
     
+    if not ItemCommon.CheckJob(curPlayer, makeItemData):
+        if makeItemData.GetType() in [ChConfig.Def_ItemType_retPeerlessWeapon, ChConfig.Def_ItemType_retPeerlessWeapon2]:
+            PlayerControl.NotifyCode(curPlayer, "ItemCompoundJoblimit")
+            return
+        
+    packType = ChConfig.GetItemPackType(makeItemData.GetType(), IPY_GameWorld.rptItem)
+    GameWorld.DebugLog("makeItemID=%s,packType=%s" % (makeItemID, packType), playerID)
+    
     needSpace = int(math.ceil(float(compoundCnt) / makeItemData.GetPackCount()))
-    emptySpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
+    emptySpace = ItemCommon.GetItemPackSpace(curPlayer, packType, needSpace)
     #验证背包空间
     if needSpace > emptySpace:
-        PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_202580")
-        GameWorld.DebugLog("背包空间不足!needSpace=%s > emptySpace=%s" % (needSpace, emptySpace), playerID)
+        #PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_202580")
+        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packType])
+        GameWorld.DebugLog("背包空间不足!packType=%s,needSpace=%s > emptySpace=%s" % (packType, needSpace, emptySpace), playerID)
         return
     
     compoundBindCnt = 0
@@ -123,38 +132,42 @@
     canDecompound = makeItemData.GetType() in canDecompoundItemTypeList and makeItemData.GetItemColor() >= decompoundMinColor
     decompoundItemInfo = [] # 拆解返还物品列表 [装备ID,材料1ID,个数,是否绑定,材料2ID,个数,是否绑定,...]
     
-    itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+    itemPack = curPlayer.GetItemManager().GetPack(packType)
+    itemExpireTime = 0
     wingItemExpInfo = None #材料翅膀精炼信息
     dogzEquipPlusExp = 0 #神兽装备强化熟练度
+    liantaiInfo = None #莲台相关信息
     # 检查不固定消耗道具
     if unfixedItemIDList:
         unfixedItem = GameWorld.GetGameData().GetItemByTypeID(unfixedItemIDList[0])
         if not unfixedItem:
             return
-        if ItemCommon.GetIsDogzEquip(unfixedItem):
-            unfixedItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
-        else:
-            unfixedItemPack = itemPack
-        unfixedItemCostInfo = __CheckUnfixedItem(playerID, compoundID, makeItemData, unfixedItemPack, unfixedItemIndexList, 
+        unfixedItemCostInfo = __CheckUnfixedItem(curPlayer, compoundID, makeItemData, itemPack, unfixedItemIndexList, 
                                                  unfixedItemIDList, needUnfixedItemCount)
         if not unfixedItemCostInfo:
             return
-        unfixedItemCostList, wingItemExpInfo, dogzEquipPlusExp = unfixedItemCostInfo
-    
+        unfixedItemCostList, wingItemExpInfo, dogzEquipPlusExp, expireTime, liantaiInfo = unfixedItemCostInfo
+        if expireTime:
+            itemExpireTime = expireTime if not itemExpireTime else min(itemExpireTime, expireTime)
+        
     # 检查固定消耗道具
     if fixedItemIDList:
         fixedItemInfo = __CheckFixedItem(playerID, compoundID, itemPack, fixedItemIndexList, fixedItemIDList, fixedItemCountList, compoundCnt)
         if not fixedItemInfo:
             return
-        fixedItemIndexDict, fixedItemNeedCntDict, compoundBindCnt = fixedItemInfo
-    
+        fixedItemIndexDict, fixedItemNeedCntDict, compoundBindCnt, expireTime = fixedItemInfo
+        if expireTime:
+            itemExpireTime = expireTime if not itemExpireTime else min(itemExpireTime, expireTime)
+        
     # 检查附加道具增加成功率消耗
     addSuccRate, addSuccRateItemInfo = 0, []
     if addonsCountMax > 0:
         addSuccRateInfo = __CheckAddonsItem(playerID, compoundID, itemPack, addonsItemIndexList, addonsItemCountList, addonsCountMax)
         if addSuccRateInfo == None:
             return
-        addSuccRate, addSuccRateItemInfo = addSuccRateInfo
+        addSuccRate, addSuccRateItemInfo, expireTime = addSuccRateInfo
+        if expireTime:
+            itemExpireTime = expireTime if not itemExpireTime else min(itemExpireTime, expireTime)
     
     # 检查提升概率道具
     incRateItemCostList, needIncRateItemCount, incRate = [], 0, 0
@@ -163,19 +176,24 @@
         incRateItemInfo = __CheckIncRateItem(playerID, compoundID, itemPack, incRateItemIndexList, incRateItemID, needIncRateItemCount)
         if not incRateItemInfo:
             return
-        incRateItemCostList = incRateItemInfo
+        incRateItemCostList, expireTime = incRateItemInfo
+        if expireTime:
+            itemExpireTime = expireTime if not itemExpireTime else min(itemExpireTime, expireTime)
         
     # 扣铜钱
     PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, totalNeedMoney, ChConfig.Def_Cost_ItemProduce, 
                            {ChConfig.Def_Cost_Reason_SonKey:makeItemID, "CompoundCount":compoundCnt})
     
-    drDict = {"CompoundID":compoundID, "MakeItemID":makeItemID, "CompoundCount":compoundCnt}
+    drDict = {"CompoundID":compoundID, "MakeItemID":makeItemID, "CompoundCount":compoundCnt, "itemExpireTime":itemExpireTime, "PackType":packType}
+    if liantaiInfo:
+        drDict["LiantaiInfo"] = liantaiInfo
+        
     makeItemBind = False
     
     # 扣不固定消耗物品
     if unfixedItemIDList:
         bindUnfixedIndexList, unbindUnfixedIndexList = unfixedItemCostList
-        hasBind = ItemCommon.ReduceItem(curPlayer, unfixedItemPack, bindUnfixedIndexList + unbindUnfixedIndexList, needUnfixedItemCount, 
+        hasBind = ItemCommon.ReduceItem(curPlayer, itemPack, bindUnfixedIndexList + unbindUnfixedIndexList, needUnfixedItemCount, 
                                         False, ChConfig.ItemDel_ItemCompound, drDict)
         makeItemBind = True if hasBind else makeItemBind
         
@@ -241,17 +259,19 @@
     canHappen = randValue <= totalSuccRate
     GameWorld.DebugLog("canHappen=%s,randValue=%s,totalSuccRate=%s,maxRateValue=%s" 
                        % (canHappen, randValue, totalSuccRate, maxRateValue), playerID)
+    if drDict:
+        DataRecordPack.SendEventPack("ItemCompound_Liantai", drDict, curPlayer)
     # 不是百分百成功的记录合成流向
     if successRate != maxRateValue:
         drDict = {"PlayerID":curPlayer.GetPlayerID(), "AccID":curPlayer.GetAccID(), "ID":compoundID, "MakeItemID":makeItemID, "IsSuccess":canHappen,
                   "RateInfo":{"totalSuccRate":"%s(%s+%s+%s)" % (totalSuccRate, successRate, addSuccRate, incRate), "randValue":randValue, "maxRateValue":maxRateValue},
-                  "AddSuccRateItemInfo":addSuccRateItemInfo
+                  "AddSuccRateItemInfo":addSuccRateItemInfo, "PackType":packType,
                   }
         DataRecordPack.SendEventPack("ItemCompound", drDict, curPlayer)
         
     if canHappen:
-        GameWorld.DebugLog("合成成功: makeItemID=%s,compoundCnt=%s,compoundBindCnt=%s" % (makeItemID, compoundCnt, compoundBindCnt), playerID)
-        userData = GiveNewCompoundItem(curPlayer, makeItemID, compoundCnt, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo)
+        GameWorld.DebugLog("合成成功: makeItemID=%s,compoundCnt=%s,compoundBindCnt=%s,itemExpireTime=%s" % (makeItemID, compoundCnt, compoundBindCnt, itemExpireTime), playerID)
+        userData = GiveNewCompoundItem(curPlayer, packType, makeItemID, compoundCnt, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime, liantaiInfo)
         
         msgMark = ipyData.GetSysMark()
         paramType = ipyData.GetSysMarkParamType()
@@ -269,12 +289,12 @@
         ItemCommon.SyncMakeItemAnswer(curPlayer, ShareDefine.Def_mitItemCompound, ChConfig.Def_ComposeState_Sucess, makeItemID)
         #成功合成1个物品成就
         PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundItemEx, compoundCnt, [makeItemID])
-        #合成X阶X颜色X星级以上装备
-        classLV = ItemCommon.GetItemClassLV(makeItemData)
-        itemColor = makeItemData.GetItemColor()
-        itemQuality = makeItemData.GetItemQuality()
-        PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundEquip, compoundCnt, [classLV, itemColor, itemQuality])
-        EventShell.EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality)
+        #合成X阶X颜色X星级以上装备, 星级改为装备位了,暂时没有用,屏蔽
+        #classLV = ItemCommon.GetItemClassLV(makeItemData)
+        #itemColor = makeItemData.GetItemColor()
+        #itemQuality = makeItemData.GetItemQuality()
+        #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_CompoundEquip, compoundCnt, [classLV, itemColor, itemQuality])
+        #EventShell.EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality)
     # 合成失败
     else:
         GameWorld.DebugLog("合成失败!")
@@ -288,13 +308,19 @@
     return
 
 
-def __CheckUnfixedItem(playerID, compoundID, makeItemData, itemPack, unfixedItemIndexList, unfixedItemIDList, needUnfixedItemCount):
+def __CheckUnfixedItem(curPlayer, compoundID, makeItemData, itemPack, unfixedItemIndexList, unfixedItemIDList, needUnfixedItemCount):
     ## 检查不固定消耗道具, 只要客户端提交的数据有不符合要求的,则直接返回 None
+    expireTime = 0
     wingItemExpInfo = None
     dogzEquipPlusExp = 0
     unfixedItemTotalCount = 0
     unfixedItemCostList = [[], []] # [[绑定索引], [非绑定索引]]
     maxPackCount = itemPack.GetCount()
+    playerID = curPlayer.GetPlayerID()
+    makeItemID = makeItemData.GetItemTypeID()
+    liantaiDecomposeIDCount, liantaiComposeMakeID, liantaiComposeAllItemIDList, liantaiLegendAttrList, liantaiComposeSkillIDList = 0, 0, [], [], []
+    liantaiDecomposeID = IpyGameDataPY.GetFuncCfg("ComposeLiantai", 1) # 合成莲台碎片ID
+    liantaiComposePreIDList = IpyGameDataPY.GetFuncEvalCfg("ComposeLiantai", 2) # 合并莲台预览ID
     for index in unfixedItemIndexList:
         if index >= maxPackCount:
             GameWorld.Log("该物品格子索引不存在!无法合成!index=%s,maxPackCount=%s" % (index, maxPackCount), playerID)
@@ -309,6 +335,13 @@
                           % (compoundID, index, itemID, unfixedItemIDList), playerID)
             return
         
+        isExpireItem, remainingTime = ItemCommon.GetItemRemainingTime(curItem)
+        if isExpireItem:
+            if not remainingTime:
+                GameWorld.Log("不固定消耗道具时效物品已失效,无法合成! index=%s,itemID=%s" % (index, itemID), playerID)
+                return
+            expireTime = remainingTime if not expireTime else min(expireTime, remainingTime)
+            
         isBind = curItem.GetIsBind()
         itemCount = curItem.GetCount()
         unfixedItemTotalCount += itemCount
@@ -324,13 +357,95 @@
             dogzEquipPlusExp += (baseExp + plusExp)
             GameWorld.DebugLog("    神兽合成材料: index=%s,itemID=%s,baseExp=%s,plusExp=%s" % (index, itemID, baseExp, plusExp))
             
+        #合成莲台碎片
+        if makeItemID == liantaiDecomposeID:
+            liantaiDecomposeIDCount += __GetLiantaiDecomposeIDCount(curItem)
+        #合并莲台
+        elif makeItemID in liantaiComposePreIDList:
+            itemSkillIDList = ItemCommon.GetItemSkillIDList(curItem)
+            for skillID in itemSkillIDList:
+                if skillID in liantaiComposeSkillIDList:
+                    GameWorld.Log("合成莲台技能ID重复,无法合成! skillID=%s" % (skillID), playerID)
+                    PlayerControl.NotifyCode(curPlayer, "CompoundLiantaiSkillRep", [skillID])
+                    return
+                liantaiComposeSkillIDList.append(skillID)
+                
+            liantaiComposeMakeID, liantaiLegendAttrList = __GetLiantaiComposeInfo(liantaiComposeMakeID, liantaiComposeAllItemIDList, curItem)
+            
     if unfixedItemTotalCount < needUnfixedItemCount:
         GameWorld.Log("不固定消耗道具不足,无法合成!ID=%s,unfixedItemIDList=%s,needUnfixedItemCount=%s > unfixedItemTotalCount=%s" 
                       % (compoundID, unfixedItemIDList, needUnfixedItemCount, unfixedItemTotalCount), playerID)
         return
     
-    return unfixedItemCostList, wingItemExpInfo, dogzEquipPlusExp
+    liantaiInfo = [liantaiDecomposeIDCount, liantaiComposeMakeID, liantaiComposeAllItemIDList, liantaiLegendAttrList, liantaiComposeSkillIDList]
+    return unfixedItemCostList, wingItemExpInfo, dogzEquipPlusExp, expireTime, liantaiInfo
 
+def __GetLiantaiDecomposeIDCount(curItem):
+    ## 获取合成莲台碎片个数
+    decCountTotal = 0
+    decItemIDList = [curItem.GetItemTypeID()]
+    for i in xrange(curItem.GetUserAttrCount(ShareDefine.Def_IudetLiantaiItemID)):
+        itemID = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLiantaiItemID, i)
+        if itemID not in decItemIDList:
+            decItemIDList.append(itemID)
+    liantaiDecomposeIDCountDict = IpyGameDataPY.GetFuncEvalCfg("ComposeLiantai", 3, {})
+    for itemID in decItemIDList:
+        for itemIDTuple, decCount in liantaiDecomposeIDCountDict.items():
+            if itemID in itemIDTuple:
+                decCountTotal += decCount
+    return decCountTotal
+
+def __GetLiantaiComposeInfo(liantaiComposeMakeID, liantaiComposeAllItemIDList, curItem):
+    ## 获取合成莲台的目标物品ID
+    curItemID = curItem.GetItemTypeID()
+    gameData = GameWorld.GetGameData()
+    
+    # 所有合成的莲台ID
+    if curItemID not in liantaiComposeAllItemIDList:
+        liantaiComposeAllItemIDList.append(curItemID)
+    for i in xrange(curItem.GetUserAttrCount(ShareDefine.Def_IudetLiantaiItemID)):
+        itemID = curItem.GetUserAttrByIndex(ShareDefine.Def_IudetLiantaiItemID, i)
+        if itemID not in liantaiComposeAllItemIDList:
+            liantaiComposeAllItemIDList.append(itemID)
+            
+    # 获取合成目标莲台ID
+    if not liantaiComposeMakeID:
+        liantaiComposeMakeID = curItemID
+    else:
+        makeLiantaiItemData = gameData.GetItemByTypeID(liantaiComposeMakeID)
+        if makeLiantaiItemData:
+            makeName = makeLiantaiItemData.GetName()
+            curName = curItem.GetName()
+            makeNameIndex, curNameIndex = 0, 0
+            namePriorityList = IpyGameDataPY.GetFuncEvalCfg("ComposeLiantai", 4)
+            for i, nameP in enumerate(namePriorityList):
+                if nameP in makeName:
+                    makeNameIndex = i
+                if nameP in curName:
+                    curNameIndex = i
+            if curNameIndex > makeNameIndex:
+                liantaiComposeMakeID = curItemID
+                
+    # 额外莲台传奇属性
+    liantaiLegendAttrList = []
+    for itemID in liantaiComposeAllItemIDList:
+        if itemID == liantaiComposeMakeID:
+            # 目标莲台不加入额外传奇属性
+            continue
+        itemData = gameData.GetItemByTypeID(itemID)
+        if not itemData:
+            continue
+        
+        for effIndex in xrange(itemData.GetEffectCount()):
+            curEff = itemData.GetEffectByIndex(effIndex)
+            effID = curEff.GetEffectID()
+            if effID == 0:
+                break
+            liantaiLegendAttrList.append([effID, curEff.GetEffectValue(0)])
+    # 支持多属性,按属性ID、数值排序
+    if liantaiLegendAttrList:
+        liantaiLegendAttrList.sort(reverse=True)
+    return liantaiComposeMakeID, liantaiLegendAttrList
 
 def __CheckFixedItem(playerID, compoundID, itemPack, fixedItemIndexList, fixedItemIDList, fixedItemCountList, compoundCnt):
     ## 检查固定消耗道具, 只要客户端提交的数据有不符合要求的,则直接返回 None
@@ -343,6 +458,7 @@
                       % (fixedItemIDList, fixedItemCountList), playerID)
         return
     
+    expireTime = 0
     for index in fixedItemIndexList:
         if index >= maxPackCount:
             GameWorld.Log("该物品格子索引不存在!无法合成!index=%s,maxPackCount=%s" % (index, maxPackCount), playerID)
@@ -357,6 +473,13 @@
                           % (compoundID, index, fixedItemID, fixedItemIDList), playerID)
             return
         
+        isExpireItem, remainingTime = ItemCommon.GetItemRemainingTime(curItem)
+        if isExpireItem:
+            if not remainingTime:
+                GameWorld.Log("固定消耗道具时效物品已失效,无法合成! index=%s,fixedItemID=%s" % (index, fixedItemID), playerID)
+                return
+            expireTime = remainingTime if not expireTime else min(expireTime, remainingTime)
+            
         isBind = curItem.GetIsBind()
         itemCount = curItem.GetCount()
         bindIndex = 0 if isBind else 1
@@ -440,7 +563,7 @@
             return
         
     GameWorld.DebugLog("最终消耗材料个数: %s" % (fixedItemNeedCntDict))
-    return fixedItemIndexDict, fixedItemNeedCntDict, compoundBindCnt
+    return fixedItemIndexDict, fixedItemNeedCntDict, compoundBindCnt, expireTime
 
 
 def __CheckAddonsItem(playerID, compoundID, itemPack, addonsItemIndexList, addonsItemCountList, addonsCountMax):
@@ -461,6 +584,7 @@
                       % (addonsItemIndexList, addonsItemCountList), playerID)
         return
     
+    expireTime = 0
     useCount = 0
     addTotalSuccRate = 0
     for i, index in enumerate(addonsItemIndexList):
@@ -500,14 +624,22 @@
             GameWorld.Log("附加物品总个数超出限制,无法合成! useCount=%s > addonsCountMax=%s" % (useCount, addonsCountMax), playerID)
             return
         
+        isExpireItem, remainingTime = ItemCommon.GetItemRemainingTime(curItem)
+        if isExpireItem:
+            if not remainingTime:
+                GameWorld.Log("附加材料时效物品已失效,无法合成! index=%s,itemID=%s" % (index, itemID), playerID)
+                return
+            expireTime = remainingTime if not expireTime else min(expireTime, remainingTime)
+            
         addSuccRate = eval(FormulaControl.GetCompileFormula("ComposeAddonsFormula", ComposeAddonsFormula))
         addTotalSuccRate += (addSuccRate*costCount)
         addSuccRateItemInfo.append({"ItemID":itemID, "ItemColor":itemColor, "ItemClassLV":itemClassLV, "addSuccRate":addSuccRate, "costCount":costCount})
         
-    return int(addTotalSuccRate), addSuccRateItemInfo
+    return int(addTotalSuccRate), addSuccRateItemInfo, expireTime
 
 def __CheckIncRateItem(playerID, compoundID, itemPack, incRateItemIndexList, incRateItemID, needIncRateItemCount):
     ## 检查提升概率道具, 只要客户端提交的数据有不符合要求的,则直接返回 None
+    expireTime = 0
     incRateItemTotalCount = 0
     incRateItemCostList = [[], []] # [[绑定索引], [非绑定索引]]
     maxPackCount = itemPack.GetCount()
@@ -524,7 +656,13 @@
             GameWorld.Log("该物品不可用于提升合成目标物品概率!ID=%s,index=%s,itemID=%s != incRateItemID=%s" 
                           % (compoundID, index, itemID, incRateItemID), playerID)
             return
-        
+        isExpireItem, remainingTime = ItemCommon.GetItemRemainingTime(curItem)
+        if isExpireItem:
+            if not remainingTime:
+                GameWorld.Log("提升概率时效物品已失效,无法合成! index=%s,itemID=%s" % (index, itemID), playerID)
+                return
+            expireTime = remainingTime if not expireTime else min(expireTime, remainingTime)
+            
         isBind = curItem.GetIsBind()
         itemCount = curItem.GetCount()
         incRateItemTotalCount += itemCount
@@ -535,7 +673,7 @@
                       % (compoundID, incRateItemID, needIncRateItemCount, incRateItemTotalCount), playerID)
         return
     
-    return incRateItemCostList
+    return incRateItemCostList, expireTime
 
 def __CheckItemCanUseCompound(playerID, index, curItem):
     if not ItemCommon.CheckItemCanUse(curItem):
@@ -561,21 +699,30 @@
 #  @param newItem: 新物品
 #  @param itemCount: 合成数量
 #  @return None
-def GiveNewCompoundItem(curPlayer, newItemID, itemCount, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo):
+def GiveNewCompoundItem(curPlayer, packType, newItemID, itemCount, compoundBindCnt, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime, liantaiInfo):
     compoundUnBindCnt = itemCount - compoundBindCnt
     
     if compoundBindCnt > 0:
-        userData = __GivePlayerCompoundItem(curPlayer, newItemID, compoundBindCnt, True, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo)
+        userData = __GivePlayerCompoundItem(curPlayer, packType, newItemID, compoundBindCnt, True, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime, liantaiInfo)
     if compoundUnBindCnt > 0:
-        userData = __GivePlayerCompoundItem(curPlayer, newItemID, compoundUnBindCnt, False, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo)
+        userData = __GivePlayerCompoundItem(curPlayer, packType, newItemID, compoundUnBindCnt, False, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, itemExpireTime, liantaiInfo)
         
     if not userData:
         return ""
     return userData
 
-def __GivePlayerCompoundItem(curPlayer, newItemID, itemCount, isBind, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo):
+def __GivePlayerCompoundItem(curPlayer, packType, newItemID, itemCount, isBind, wingItemExpInfo, dogzEquipPlusExp, decompoundItemInfo, expireTime, liantaiInfo):
     playerID = curPlayer.GetPlayerID()
-    curSingleItem = ItemControler.GetOutPutItemObj(newItemID, itemCount, isBind)
+    if liantaiInfo:
+        liantaiDecomposeIDCount, liantaiComposeMakeID, liantaiComposeAllItemIDList, liantaiLegendAttrList, liantaiComposeSkillIDList = liantaiInfo
+        if liantaiDecomposeIDCount:
+            itemCount = liantaiDecomposeIDCount
+            GameWorld.DebugLog("分解莲台碎片总个数: %s" % liantaiDecomposeIDCount, playerID)
+        if liantaiComposeMakeID:
+            newItemID = liantaiComposeMakeID
+            GameWorld.DebugLog("莲台合成目标莲台物品ID: %s, 所有莲台ID: %s, 额外传奇属性: %s, 所有技能ID: %s" \
+                               % (liantaiComposeMakeID, liantaiComposeAllItemIDList, liantaiLegendAttrList, liantaiComposeSkillIDList), playerID)
+    curSingleItem = ItemControler.GetOutPutItemObj(newItemID, itemCount, False, expireTime, curPlayer=curPlayer)
     if not curSingleItem:
         GameWorld.ErrLog("创造物品失败, give item itemid:%s,count:%s" % (newItemID, itemCount), playerID)
         return
@@ -612,13 +759,36 @@
             curSingleItem.AddUserAttr(ShareDefine.Def_IudetItemDecompound, decompoundValue)
         GameWorld.Log("保存可拆解装备拆解物品信息: %s" % decompoundItemInfo, playerID)
         
+    # 莲台属性
+    if liantaiInfo:
+        if liantaiComposeAllItemIDList:
+            curSingleItem.ClearUserAttr(ShareDefine.Def_IudetLiantaiItemID)
+            for liantaiItemID in liantaiComposeAllItemIDList:
+                curSingleItem.AddUserAttr(ShareDefine.Def_IudetLiantaiItemID, liantaiItemID)
+                
+        if liantaiComposeSkillIDList:
+            curSingleItem.ClearUserAttr(ShareDefine.Def_IudetAddSkillID)
+            for skillID in liantaiComposeSkillIDList:
+                curSingleItem.AddUserAttr(ShareDefine.Def_IudetAddSkillID, skillID)
+                
+        if liantaiLegendAttrList:
+            curSingleItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrID)
+            curSingleItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValue)
+            for liantaiLegAttrID, liantaiLegAttrValue in liantaiLegendAttrList:
+                curSingleItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, liantaiLegAttrID)
+                curSingleItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, liantaiLegAttrValue)
+                
+        ItemCommon.MakeEquipGS(curSingleItem)
+                
     userData = curSingleItem.GetUserData()
-    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(IPY_GameWorld.rptItem, curSingleItem, 
-                                                                  event=[ChConfig.ItemGive_ItemCompound, False, {}]):
+    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(packType, curSingleItem, event=[ChConfig.ItemGive_ItemCompound, False, {}]):
         GameWorld.ErrLog("给合成物品失败, give item itemid:%s,count:%s" % (newItemID, itemCount), playerID)
         curSingleItem.Clear()
         return
     
+    if liantaiInfo and liantaiDecomposeIDCount:
+        PlayerControl.NotifyCode(curPlayer, "DecompoundLiantai", [liantaiDecomposeIDCount, newItemID])
+        
     return userData
 
 def __SendDogzEquipRemainExpMail(playerID, remainExp, isSucc):
@@ -708,7 +878,7 @@
     
     # 返还物品
     for itemID, itemCount, isBind in giveItemList:
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], 
+        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem], 
                                      event=["ItemDecompound", True, {"decompoundItemNoteDict":decompoundItemNoteDict}])
         
     GameWorld.Log("拆解物品成功: decompoundItemNoteDict=%s" % str(decompoundItemNoteDict), playerID)

--
Gitblit v1.8.0