| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import Operate_EquipStone
|
| | | import PlayerFairyCeremony
|
| | | import PlayerActBossTrial
|
| | | import PlayerMagicWeapon
|
| | | import PlayerXiangong
|
| | | import IpyGameDataPY
|
| | | import DataRecordPack
|
| | | import PlayerGubao
|
| | | import PyGameData
|
| | | import PlayerVip
|
| | | import ChEquip
|
| | | import PlayerHero
|
| | |
|
| | |
| | | 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)):
|
| | | itemKeyData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_VPackItem % (packIndex, place))
|
| | |
| | | PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, itemCount, moneyEventName, addDict)
|
| | | elif itemID == ChConfig.Def_ItemID_FuncSysPrivilege:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FuncSysPrivilege, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_FCPartyPoint:
|
| | | PlayerFairyCeremony.AddFCPartyPoint(curPlayer, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_BTGMPoint:
|
| | | PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_BTGMPoint, itemCount)
|
| | | elif itemID == ChConfig.Def_ItemID_GuShenMoney:
|
| | |
| | | isNeedRecord = False
|
| | | itemID = tagItem.GetItemTypeID()
|
| | | #激活成就的道具
|
| | | if tagItem.GetType() in [ChConfig.Def_ItemType_ActiveMWItem, ChConfig.Def_ItemType_ActiveMWItem2]:
|
| | | PlayerMagicWeapon.DoActiveMW(curPlayer, tagItem.GetEffectByIndex(0).GetEffectValue(0))
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #if tagItem.GetType() in [ChConfig.Def_ItemType_ActiveMWItem, ChConfig.Def_ItemType_ActiveMWItem2]:
|
| | | # PlayerMagicWeapon.DoActiveMW(curPlayer, tagItem.GetEffectByIndex(0).GetEffectValue(0))
|
| | | # tagItem.Clear()
|
| | | # return True
|
| | | itemEff = tagItem.GetEffectByIndex(0)
|
| | | #物品碎片
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_ItemCount:
|
| | |
| | | PlayerXiangong.AddTiandaoQiyun(curPlayer, addQiyun, {"ItemID":itemID, "ItemCount":tagItemCount, "isAutoUse":1})
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #直升VIP
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_VIPLVCard:
|
| | | isAutoUse = itemEff.GetEffectValue(1)
|
| | | if isAutoUse:
|
| | | tagVIPLV = itemEff.GetEffectValue(0)
|
| | | isOK, _ = PlayerVip.UpgradeVIPLV(curPlayer, tagVIPLV)
|
| | | if isOK:
|
| | | #GameWorld.DebugLog("直升VIP默认使用")
|
| | | tagItem.Clear()
|
| | | return True
|
| | | #增加副本次数
|
| | | if itemEff.GetEffectID() == ChConfig.Def_Effect_AddFBCnt:
|
| | | isAutoUse = itemEff.GetEffectValue(1)
|
| | |
| | | # isNeedRecord = True # 拍品要记录
|
| | | else:
|
| | | maxPackCount = curItemData.GetPackCount()
|
| | | |
| | | if packIndex == IPY_GameWorld.rptIdentify:
|
| | | defaultPile = False # 掉落背包默认不判断堆叠
|
| | |
|
| | | # 虚拟背包, 默认不做叠加
|
| | | if packIndex in ShareDefine.Def_VPack_TypeList:
|
| | |
| | | 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
|
| | |
|
| | | # 聚魂物品存储字典数值数据结构: 前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):
|