hch
2018-12-26 b6ba2976a06e9d288c740e8ab83186b7feb5dcea
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -33,6 +33,7 @@
import Operate_EquipStone
import Operate_EquipSuitCompose
import IpyGameDataPY
import DataRecordPack
import EventShell
import math
@@ -878,9 +879,10 @@
                return -1
        curPlayer = self.__Player
        #equipPack = self.__PlayerEquip
        #equipItem = equipPack.GetAt(packEquipIndex)
        equipPack = self.__PlayerEquip
        equipItem = equipPack.GetAt(packEquipIndex)
        desItemID, desUserData = [0, ''] if equipItem.IsEmpty() else [equipItem.GetItemTypeID(), equipItem.GetUserData()]
        srcItemID, srcUserData = curItem.GetItemTypeID(), curItem.GetUserData()
        # 装备绑定处理 在 DoLogic_ItemBindType函数有处理,此处注释掉
#        if not curItem.GetIsBind():
#            SetItemIsBind(curItem, True)
@@ -896,6 +898,9 @@
            #套装降级处理
            Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, packEquipIndex)
            EventShell.EventRespons_EquipStar(curPlayer)
            dataDict = {'dotype':'EquipItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
            DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
        self.RefreshStartEquipCount()
        return packEquipIndex if result else -1
    
@@ -955,7 +960,7 @@
            return
        
        equipID = curEquip.GetItemTypeID()
        userData = curEquip.GetUserData()
        #该物品锁定不执行==============================================
        if curEquip.GetIsLocked():
            PlayerControl.NotifyCode(curPlayer, "RescannotEquip")
@@ -993,6 +998,8 @@
        #套装降级处理
        Operate_EquipSuitCompose.CheckEquipSuitReduce(curPlayer, equipIndex)
        EventShell.EventRespons_EquipStar(curPlayer)
        dataDict = {'dotype':'UnEquipItem', 'equipID':equipID, 'userData':userData}
        DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
#===============================================================================
#        #destItemPlace = 卸下物品的位置        
#        destItemPlace = curPack.GetAt(packIndex)
@@ -1022,6 +1029,8 @@
        if packIndex == ShareDefine.rptRune:
            runeSource = tagItem.GetUserAttr(ShareDefine.Def_IudetRuneSource) or 1
            setItemKeyData = GetRuneItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetRuneLV), source=runeSource)
        elif packIndex == ShareDefine.rptGatherSoul:
            setItemKeyData = GetGatherSoulItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetGatherSoulLV))
        refreshPlaceList = []
        for place in xrange(ItemCommon.GetVPackCnt(packIndex)):
@@ -1076,7 +1085,12 @@
            GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'AddBossRebornPoint', msgStr, len(msgStr))
        elif itemID == ChConfig.Def_ItemID_Ysog:
            PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_Ysog, itemCount)
        elif itemID == ChConfig.Def_ItemID_SoulDust:
            PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulDust, itemCount)
        elif itemID == ChConfig.Def_ItemID_SoulSplinters:
            PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulSplinters, itemCount)
        elif itemID == ChConfig.Def_ItemID_SoulCore:
            PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_SoulCore, itemCount)
        return True
    
    ## 放入物品 
@@ -1131,7 +1145,7 @@
        isBind = tagItem.GetIsBind()
        isNeedRecord = False
        # 目前暂只记录放入背包的
        if packIndex in [IPY_GameWorld.rptItem, ShareDefine.rptTreasure, ShareDefine.rptRune]:
        if packIndex in [IPY_GameWorld.rptItem, ShareDefine.rptTreasure, ShareDefine.rptRune, ShareDefine.rptGatherSoul]:
            isNeedRecord = ItemNeedRecord(tagItem) or isForceEvent
        putResult = False
        
@@ -1371,6 +1385,14 @@
def IsRuneItemNeedRecord(curItem, plusLV):
    return plusLV > 0 or curItem.GetItemColor() >= ChConfig.Def_Quality_Orange
# 聚魂物品存储字典数值数据结构: 前5位为物品ID, 6~8位为强化等级
def GetGatherSoulItemKeyData(itemID, GatherSoulLV):
    return min(GatherSoulLV, 999) * 100000 + itemID
def GetGatherSoulItemID(keyData): return keyData % 100000
def GetGatherSoulItemPlusLV(keyData): return keyData % 100000000 / 100000
def IsGatherSoulItemNeedRecord(curItem, plusLV):
    return plusLV > 0 or curItem.GetItemColor() >= ChConfig.Def_Quality_Orange
def SetVPackItemKeyData(curPlayer, packIndex, place, keyData, isSync=True):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_VPackItem % (packIndex, place), keyData)
    if isSync: