| | |
| | | eventName, isForceEvent, addDict = event
|
| | | isNeedRecord = isForceEvent or ItemNeedRecord(tagItem)
|
| | | if packIndex == ShareDefine.rptRune:
|
| | | setItemKeyData = GetRuneItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetRuneLV))
|
| | | runeSource = tagItem.GetUserAttr(ShareDefine.Def_IudetRuneSource) or 1
|
| | | setItemKeyData = GetRuneItemKeyData(tagItem.GetItemTypeID(), tagItem.GetUserAttr(ShareDefine.Def_IudetRuneLV), source=runeSource)
|
| | |
|
| | | refreshPlaceList = []
|
| | | for place in xrange(ItemCommon.GetVPackCnt(packIndex)):
|
| | |
| | | return False
|
| | | return True
|
| | |
|
| | | def __DoTransformItem(self, curPlayer, tagItem):
|
| | | def DoTransformItem(self, curPlayer, tagItem):
|
| | | ## 将特殊物品转化为对应数值
|
| | | itemID = tagItem.GetItemTypeID()
|
| | | if itemID not in ChConfig.Def_TransformItemIDList:
|
| | |
| | | elif itemID == ChConfig.Def_ItemID_BossReborn:
|
| | | msgStr = str(itemCount)
|
| | | 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)
|
| | |
|
| | | return True
|
| | |
|
| | |
| | | def PutInItem(self, packIndex, tagItem, defaultPile=True, event=["", False, {}]):
|
| | | curPlayer = self.__Player
|
| | |
|
| | | if self.__DoTransformItem(curPlayer, tagItem):
|
| | | tagItem.Clear() # 需清除,不然会导致内存泄露
|
| | | if packIndex != ShareDefine.rptTreasure and self.DoTransformItem(curPlayer, tagItem):
|
| | | tagItem.Clear() # 需清除,不然会导致内存泄露 寻宝仓库可暂存直接转化数值的物品
|
| | | return True
|
| | |
|
| | | isEquip = ItemCommon.CheckItemIsEquip(tagItem)
|
| | |
| | | return True, itemIndex
|
| | |
|
| | | #==============================================================================
|
| | | # 符印物品存储字典数值数据结构: 前5位为物品ID, 6~8位为强化等级, 第10位为是否锁定
|
| | | def GetRuneItemKeyData(itemID, RuneLV, lockState=0):
|
| | | # 符印物品存储字典数值数据结构: 前5位为物品ID, 6~8位为强化等级, 第9位为来源(老号0,默认1,合成2),第10位为是否锁定
|
| | | def GetRuneItemKeyData(itemID, RuneLV, lockState=0, source=1):
|
| | | lockState = 1 if lockState > 0 else 0
|
| | | return lockState * 1000000000 + min(RuneLV, 999) * 100000 + itemID
|
| | | return lockState * 1000000000 + source * 100000000 + min(RuneLV, 999) * 100000 + itemID
|
| | | def GetRuneItemID(keyData): return keyData % 100000
|
| | | def GetRuneItemPlusLV(keyData): return keyData % 100000000 / 100000
|
| | | def GetRuneItemIsLock(keyData): return keyData / 1000000000
|
| | | def GetRuneItemSource(keyData): return keyData % 1000000000 / 100000000
|
| | | def IsRuneItemNeedRecord(curItem, plusLV):
|
| | | return plusLV > 0 or curItem.GetItemColor() >= ChConfig.Def_Quality_Orange
|
| | |
|
| | |
| | | DropItemToOtherPack(curPlayer, clientData.SrcBackpack, clientData.DesBackPack, clientData.SrcIndex, clientData.IsAll)
|
| | | return
|
| | |
|
| | | def DropItemToOtherPack(curPlayer, fromPackIndex, toPackIndex, index, isAll=False):
|
| | | def DropItemToOtherPack(curPlayer, fromPackIndex, desPackIndex, index, isAll=False):
|
| | | '''拖动某个背包物品到玩家物品背包
|
| | | '''
|
| | | movePack = curPlayer.GetItemManager().GetPack(fromPackIndex)
|
| | |
| | |
|
| | | #整个背包转移
|
| | | if isAll:
|
| | | fullPackList = []
|
| | | for itemIndex in xrange(movePack.GetCount()):
|
| | | curItem = movePack.GetAt(itemIndex)
|
| | | if not curItem or curItem.IsEmpty():
|
| | | continue
|
| | | toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), desPackIndex)
|
| | | if toPackIndex in fullPackList:
|
| | | continue
|
| | | if not __DoDropItemToOtherPack(curPlayer, itemControl, fromPackIndex, toPackIndex, itemIndex, curItem):
|
| | | return
|
| | | if toPackIndex not in fullPackList:
|
| | | fullPackList.append(toPackIndex)
|
| | | |
| | | for fullPackIndex in fullPackList:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [fullPackIndex])
|
| | |
|
| | | #单个物品转移
|
| | | else:
|
| | | curItem = movePack.GetAt(index)
|
| | | if not curItem or curItem.IsEmpty():
|
| | | return
|
| | | toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), desPackIndex)
|
| | | __DoDropItemToOtherPack(curPlayer, itemControl, fromPackIndex, toPackIndex, index, curItem)
|
| | | return
|
| | |
|
| | | def __DoDropItemToOtherPack(curPlayer, itemControl, fromPackIndex, toPackIndex, itemIndex, curItem):
|
| | | if itemControl.DoTransformItem(curPlayer, curItem):
|
| | | curItem.Clear()
|
| | | return True
|
| | | curItemTypeID = curItem.GetItemTypeID()
|
| | | #curItemGUID = curItem.GetGUID()
|
| | | curItemCount = curItem.GetCount()
|
| | | curItemIsBind = curItem.GetIsBind()
|
| | | toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), toPackIndex)
|
| | | #toPackIndex = ChConfig.GetItemPackType(curItem.GetType(), toPackIndex)
|
| | |
|
| | | # 常规物品转移到虚拟符印背包
|
| | | if toPackIndex == ShareDefine.rptRune:
|
| | |
| | | # {属性ID:{颜色:数值, ...}, ...}
|
| | | if isDogzEquip:
|
| | | # 神兽装备数值不一样
|
| | | legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor2")
|
| | | legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor2", 1, {})
|
| | | legAttrValueClassLVColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor2", 2, {})
|
| | | else:
|
| | | legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor")
|
| | | legAttrValueColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor", 1, {})
|
| | | legAttrValueClassLVColorDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByColor", 2, {})
|
| | | legAttrValueClassLVDict = IpyGameDataPY.GetFuncEvalCfg("LegendAttrValueByClassLV")
|
| | | for attrID in randAttrIDList:
|
| | | if attrID in legAttrValueColorDict:
|
| | |
| | | GameWorld.ErrLog("没有配置传奇属性ID装备颜色对应的数值, attrID=%s,itemColor=%s" % (attrID, itemColor))
|
| | | continue
|
| | | attrValue = colorValueDict[itemColor]
|
| | | # {属性ID:{阶:{颜色:数值, ...}, ...}, ...}
|
| | | elif attrID in legAttrValueClassLVColorDict:
|
| | | classLVColorValueDict = legAttrValueClassLVColorDict[attrID]
|
| | | if itemClassLV in classLVColorValueDict:
|
| | | colorValueDict = classLVColorValueDict[itemClassLV]
|
| | | else:
|
| | | minClassLV, maxClassLV = min(classLVColorValueDict), max(classLVColorValueDict)
|
| | | if itemClassLV <= minClassLV:
|
| | | colorValueDict = classLVColorValueDict[minClassLV]
|
| | | elif itemClassLV >= maxClassLV:
|
| | | colorValueDict = classLVColorValueDict[maxClassLV]
|
| | | else:
|
| | | GameWorld.ErrLog("没有配置传奇属性ID装备阶级颜色对应的数值, attrID=%s,itemClassLV=%s" % (attrID, itemClassLV))
|
| | | continue
|
| | | if itemColor not in colorValueDict:
|
| | | GameWorld.ErrLog("没有配置传奇属性ID装备阶级颜色对应的数值, attrID=%s,itemClassLV=%s,itemColor=%s" % (attrID, itemClassLV, itemColor))
|
| | | continue
|
| | | attrValue = colorValueDict[itemColor]
|
| | | elif attrID in legAttrValueClassLVDict:
|
| | | classLVValueDict = legAttrValueClassLVDict[attrID]
|
| | | if itemClassLV in classLVValueDict:
|