hxp
2018-10-11 a0675393eb85910110ce5a081c41bc8299ad529d
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -1201,6 +1201,9 @@
                    ItemCommon.DR_GetItem(curPlayer, packIndex, eventName, itemNoteDict, addDict)
            else:
                #可以放下
                if isEquip:
                    self.CheckEquipAttr(packIndex, tagItem)
                if tagItem.GetGameWorldItemType() == IPY_GameWorld.gwitRoleItem:
                    item.PutIn(tagItem)
                elif tagItem.GetGameWorldItemType() == IPY_GameWorld.gwitSingleItem:
@@ -1217,6 +1220,51 @@
        #放入东西
        return putResult
    
    def CheckEquipAttr(self, packType, curItem):
        legendAttrIDCount = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrID)
        legendAttrValueCount = curItem.GetUserAttrCount(ShareDefine.Def_IudetLegendAttrValue)
        if legendAttrIDCount and legendAttrValueCount and legendAttrIDCount == legendAttrValueCount:
            return
        legendAttrInfo = GetAddEquipLegendAttr(curItem)
        if not legendAttrInfo:
            return
        curPlayer = self.__Player
        srcScore = ItemCommon.GetEquipGearScore(curItem)
        legendAttrIDList, legendAttrValueList = legendAttrInfo
        curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrID)
        curItem.ClearUserAttr(ShareDefine.Def_IudetLegendAttrValue)
        for i in xrange(len(legendAttrIDList)):
            curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrID, legendAttrIDList[i])
            curItem.AddUserAttr(ShareDefine.Def_IudetLegendAttrValue, legendAttrValueList[i])
        ItemCommon.MakeEquipGS(curItem)
        updScore = ItemCommon.GetEquipGearScore(curItem)
        GameWorld.ErrLog("传奇属性异常,重新刷新一次属性: packType=%s,itemID=%s,legendAttrIDList=%s,legendAttrValueList=%s,srcScore=%s,updScore=%s"
                         % (packType, curItem.GetItemTypeID(), legendAttrIDList, legendAttrValueList, srcScore, updScore), curPlayer.GetPlayerID())
        return
    def CheckRolePackEquipAttr(self):
        curPlayer = self.__Player
        key = "LoginCheckEquipAttr"
        if curPlayer.NomalDictGetProperty(key):
            return
        checkPackList = [IPY_GameWorld.rptEquip, IPY_GameWorld.rptItem, IPY_GameWorld.rptWarehouse]
        for packType in checkPackList:
            curPack = curPlayer.GetItemManager().GetPack(packType)
            for i in xrange(curPack.GetCount()):
                curItem = curPack.GetAt(i)
                #GameWorld.DebugLog("packType=%s,i=%s" % (packType, i))
                if curItem.IsEmpty():
                    continue
                isEquip = ItemCommon.CheckItemIsEquip(curItem)
                if not isEquip:
                    continue
                self.CheckEquipAttr(packType, curItem)
        PlayerControl.NomalDictSetProperty(curPlayer, key, 1)
        return
    ## 是否能放入物品 
    #  @param packIndex 背包索引
    #  @param curItemID 当前物品ID
@@ -1255,6 +1303,9 @@
            GameWorld.Log("策划填表错误 %s -> maxPackCount = %s" % (curItemID , maxPackCount))
            return False, 0
        
        # 特殊处理不同的物品放入不同的背包,如神兽背包
        packIndex = ChConfig.GetItemPackType(curItemData.GetType(), packIndex)
        maxCanPutItem = 0
        curPlayer = self.__Player
        # 虚拟背包