| | |
| | | import Operate_EquipStone
|
| | | import Operate_EquipSuitCompose
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import EventShell
|
| | |
|
| | | import math
|
| | |
| | | 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)
|
| | |
| | | #套装降级处理
|
| | | 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
|
| | |
|
| | |
| | | return
|
| | |
|
| | | equipID = curEquip.GetItemTypeID()
|
| | |
|
| | | userData = curEquip.GetUserData()
|
| | | #该物品锁定不执行==============================================
|
| | | if curEquip.GetIsLocked():
|
| | | PlayerControl.NotifyCode(curPlayer, "RescannotEquip")
|
| | |
| | | #套装降级处理
|
| | | 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)
|
| | |
| | | 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)):
|
| | |
| | | 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
|
| | |
|
| | | ## 放入物品
|
| | |
| | | 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
|
| | |
|
| | |
| | | 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:
|