|  |  |  | 
|---|
|  |  |  | import ChConfig | 
|---|
|  |  |  | import ChEquip | 
|---|
|  |  |  | import EventShell | 
|---|
|  |  |  | import ChPyNetSendPack | 
|---|
|  |  |  | import NetPackCommon | 
|---|
|  |  |  | #------------------------------------------------------------------------------------------- | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #=============================================================================== | 
|---|
|  |  |  | 
|---|
|  |  |  | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PlusLV, ChEquip.GetTotalPlusLV(curPlayer)) | 
|---|
|  |  |  | return | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | def DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV): | 
|---|
|  |  |  | #先刷装备BUFF 再计算属性 | 
|---|
|  |  |  | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrActivatyNotify, ChConfig.Def_AttrActivatyNotify_Plus) | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #刷新所有属性 | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|