| | |
| | |
|
| | | return
|
| | |
|
| | | #// A3 18 灵器突破 #tagCMLingQiEquipBreak
|
| | | #
|
| | | #struct tagCMLingQiEquipBreak
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD ItemID; //突破的物品ID
|
| | | #}; |
| | | def OnLingQiEquipBreak(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | breakItemID = clientData.ItemID
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('LingQiAttr', breakItemID)
|
| | | if not ipyData:
|
| | | return
|
| | | nextItemID = ipyData.GetNextItemID() #突破后的物品ID
|
| | | if not IpyGameDataPY.GetIpyGameData('LingQiAttr', nextItemID):
|
| | | return
|
| | | breakItemData = GameWorld.GetGameData().GetItemByTypeID(breakItemID)
|
| | | nextItemData = GameWorld.GetGameData().GetItemByTypeID(nextItemID)
|
| | | if not breakItemData or not nextItemData:
|
| | | return
|
| | | equipIndex = ItemCommon.GetEquipPackIndex(breakItemData)
|
| | | if equipIndex != ItemCommon.GetEquipPackIndex(nextItemData):
|
| | | GameWorld.DebugLog("突破的物品和突破后的物品不是同个装备位!breakItemID=%s,nextItemID=%s" |
| | | % (breakItemID, nextItemID))
|
| | | return
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if not curEquip or curEquip.IsEmpty():
|
| | | GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | if curEquip.GetEndureReduceType():
|
| | | GameWorld.DebugLog("突破的物品是时效物品!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | if curEquip.GetItemTypeID() != breakItemID:
|
| | | GameWorld.DebugLog("突破的物品未穿戴!breakItemID=%s" |
| | | % (breakItemID))
|
| | | return
|
| | | |
| | | |
| | | costItemDict = ipyData.GetUpCostItem()
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(costItemDict, itemPack)
|
| | | if lackItemDict:
|
| | | GameWorld.DebugLog("突破消耗物品不足!breakItemID=%s,costItemDict=%s,lackItemDict=%s" |
| | | % (breakItemID, costItemDict, lackItemDict))
|
| | | return
|
| | | |
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, 'LingQiEquipBreak')
|
| | | ItemCommon.DelItem(curPlayer, curEquip, 1, False, ChConfig.ItemDel_LingQiEquipBreak, {}, True)
|
| | | #给物品
|
| | | ItemControler.GivePlayerItem(curPlayer, nextItemID, 1, 0, [IPY_GameWorld.rptEquip], |
| | | event=[ChConfig.ItemGive_LingQiEquipBreak, False, {}])
|
| | | changeItemID = curEquip.GetItemTypeID()
|
| | | changeItemStarLV = 0 #curItem.GetItemStarLV()
|
| | | changeItemStoneCnt = 0 #curItem.GetUseStoneCount()
|
| | | changeItemHoleCnt = 0 #curItem.GetCanPlaceStoneCount()
|
| | | changeItemUseData = curEquip.GetUserData()
|
| | | curPlayer.ChangeEquip(changeItemID, equipIndex, changeItemStarLV, changeItemHoleCnt, changeItemStoneCnt, changeItemUseData)
|
| | | #刷属性
|
| | | RefreshPlayerLingQiEquipAttr(curPlayer)
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | #通知结果
|
| | | resultPack = ChPyNetSendPack.tagMCLingQiEquipBreakResult()
|
| | | resultPack.Clear()
|
| | | resultPack.MakeItemID = nextItemID
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | return
|
| | |
|
| | | def RefreshPlayerLingQiEquipAttr(curPlayer):
|
| | | ''' 刷新玩家灵器装备属性
|
| | | '''
|