| | |
| | | import ChConfig
|
| | | import ChEquip
|
| | | import EventShell
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | #-------------------------------------------------------------------------------------------
|
| | |
|
| | | #===============================================================================
|
| | |
| | | return
|
| | |
|
| | | curPartPlusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, index)
|
| | | classLV = ItemCommon.GetItemClassLV(curEquip)
|
| | | plusMaxIpyData = IpyGameDataPY.GetIpyGameData("ItemPlusMax", findType, classLV)
|
| | | if not plusMaxIpyData:
|
| | | return
|
| | | plusLVMax = plusMaxIpyData.GetPlusLVMax()
|
| | | if curPartPlusLV >= plusLVMax:
|
| | | #GameWorld.DebugLog("强化达到本阶最大等级,无法强化! classLV=%s,plusLVMax=%s,curPartPlusLV=%s" % (classLV, plusLVMax, curPartPlusLV))
|
| | | return
|
| | | plusIpyData = IpyGameDataPY.GetIpyGameData("ItemPlus", findType, curPartPlusLV)
|
| | | if not plusIpyData:
|
| | | return
|
| | | costSilver = plusIpyData.GetCostCount()
|
| | | if not costSilver:
|
| | | costItemInfo = plusIpyData.GetCostItemInfo()
|
| | | if not costSilver and not costItemInfo:
|
| | | #GameWorld.DebugLog("已到强化最大等级! curPartPlusLV=%s" % curPartPlusLV, playerID)
|
| | | return
|
| | |
|
| | |
| | | % (curPartPlusLV, maxPlusLV, curEvolveLV), playerID)
|
| | | return
|
| | |
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver, isNotify=False):
|
| | | if costSilver and not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver):
|
| | | GameWorld.DebugLog("铜钱不足,无法强化! costSilver=%s" % costSilver)
|
| | | return
|
| | |
|
| | | totalExp = plusIpyData.GetTotalExp()
|
| | | curExp = ChEquip.GetEquipPartProficiency(curPlayer, packType, index) + plusIpyData.GetAddExp()
|
| | | costItemID, costItemCount = 0, 0
|
| | | if costItemInfo:
|
| | | costItemID, costItemCount = costItemInfo
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemIndexList = ItemCommon.GetItem_FromPack_ByID(costItemID, itemPack, costItemCount)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("材料不足,无法强化! costItemID=%s, costItemCount=%s" % (costItemID, costItemCount))
|
| | | return
|
| | | |
| | | if costSilver:
|
| | | PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, costSilver, isNotify=False)
|
| | |
|
| | | if curExp >= totalExp:
|
| | | #升级
|
| | | if costItemID:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, costItemCount, True, ChConfig.ItemDel_EquipPlus)
|
| | | |
| | | isLVUp = False
|
| | | curExp = 0
|
| | | addExp = plusIpyData.GetAddExp()
|
| | | totalExp = plusIpyData.GetTotalExp()
|
| | | if addExp and totalExp:
|
| | | curExp = ChEquip.GetEquipPartProficiency(curPlayer, packType, index) + addExp
|
| | | if curExp >= totalExp:
|
| | | curExp = curExp - totalExp
|
| | | isLVUp = True
|
| | | else:
|
| | | isLVUp = True
|
| | | |
| | | if isLVUp:
|
| | | curPartPlusLV += 1
|
| | | curExp = curExp - totalExp
|
| | | __EquipMayaPlusChange(curPlayer, packType, curEquip, index, curPartPlusLV)
|
| | |
|
| | | DataRecordPack.DR_UpStarLVSuccess(curPlayer, curExp, curPartPlusLV)
|
| | |
| | | # 增加强化成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipPlus, 1)
|
| | | EventShell.EventRespons_EquipPlus(curPlayer, classLV, updPlusLV)
|
| | | |
| | | |
| | | # 开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PlusLV, ChEquip.GetTotalPlusLV(curPlayer))
|
| | | #OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Plus, ChEquip.GetTotalPlusLV(curPlayer))
|
| | | return
|
| | |
|
| | |
|
| | | def DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV):
|
| | | #先刷装备BUFF 再计算属性
|
| | |
| | | return
|
| | | delItemDict[tuple(indexList)] = itemCnt
|
| | | for itemIndexList, delCnt in delItemDict.items():
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_EquipPlusEvolve)
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_EquipPlus)
|
| | |
|
| | | ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, equipPackindex, nextEvolveLV)
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType, ItemCommon.GetItemClassLV(curEquip))
|
| | |
| | | EventShell.EventRespons_EquipPlusEvolve(curPlayer, nextEvolveLV)
|
| | | return
|
| | |
|
| | |
|
| | | #// A5 C7 激活大师强化等级 #tagCMActivateMasterPlusLV
|
| | | #
|
| | | #struct tagCMActivateMasterPlusLV
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE ClassLV; // 所属装备阶
|
| | | # WORD MasterPlusLV; // 大师强化等级
|
| | | #};
|
| | | def OnActivateMasterPlusLV(index, clientData, tick):
|
| | | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | classLV = clientData.ClassLV
|
| | | actMasterPlusLV = clientData.MasterPlusLV
|
| | | |
| | | curMasterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
|
| | | if curMasterPlusLV >= actMasterPlusLV:
|
| | | # 已经激活过了
|
| | | GameWorld.DebugLog("已经激活过该强化大师等级了! actMasterPlusLV=%s,curMasterPlusLV=%s" % (actMasterPlusLV, curMasterPlusLV))
|
| | | return
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition("ItemPlusMaster", {"ClassLV":classLV, "MasterPlusLV":actMasterPlusLV}, False, False)
|
| | | if not ipyData:
|
| | | GameWorld.DebugLog("不存在该强化大师等级! actMasterPlusLV=%s" % actMasterPlusLV)
|
| | | return
|
| | | |
| | | packType = IPY_GameWorld.rptEquip
|
| | | # 判断可否激活
|
| | | for equipPlace in ChConfig.EquipPlace_Base:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | return
|
| | | equipIndex = ipyData.GetGridIndex()
|
| | | plusLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, equipIndex)
|
| | | if plusLV < actMasterPlusLV:
|
| | | GameWorld.DebugLog("部位强化等级不足,无法激活强化大师! equipPlace=%s,equipIndex=%s,plusLV=%s < %s" |
| | | % (equipPlace, equipIndex, plusLV, actMasterPlusLV))
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("激活强化大师等级! classLV=%s,actMasterPlusLV=%s" % (classLV, actMasterPlusLV))
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV, actMasterPlusLV)
|
| | | |
| | | SyncEquipMasterPlusLVInfo(curPlayer, classLV)
|
| | | ChEquip.ChangeEquipEffectByPlusMaster(curPlayer, classLV)
|
| | | #刷新所有属性
|
| | | DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
|
| | | return
|
| | |
|
| | | def SyncEquipMasterPlusLVInfo(curPlayer, classLV=0, isForce=False):
|
| | | ## 同步大师强化等级信息
|
| | | if not classLV:
|
| | | needSyncClassLVList = xrange(1, IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + 1)
|
| | | else:
|
| | | needSyncClassLVList = [classLV]
|
| | | |
| | | masterPlusLVInfoList = []
|
| | | for classLV in needSyncClassLVList:
|
| | | masterPlusLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartMasterPlusLV % classLV)
|
| | | if not masterPlusLV and not isForce:
|
| | | continue
|
| | | lvInfo = ChPyNetSendPack.tagMCMasterPlusLV()
|
| | | lvInfo.ClassLV = classLV
|
| | | lvInfo.MasterPlusLV = masterPlusLV
|
| | | masterPlusLVInfoList.append(lvInfo)
|
| | | |
| | | if not masterPlusLVInfoList:
|
| | | return
|
| | | |
| | | clientPack = ChPyNetSendPack.tagMCMasterPlusLVInfo()
|
| | | clientPack.MasterPlusLVInfoList = masterPlusLVInfoList
|
| | | clientPack.Count = len(masterPlusLVInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | |
|