| | |
| | |
|
| | | def ActiveMagicWeaponByFB(curPlayer, mapID, lineID, passLV=0):
|
| | | ##通关副本激活法宝(人族、魔族法宝)
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('MagicWeaponFB', {'LineID':lineID, 'Level':passLV})
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('MagicWeaponFB', {'LineID':lineID, 'Level':passLV}, isLogNone=False)
|
| | | if ipyData:
|
| | | mwID = ipyData.GetMWID()
|
| | | GameWorld.Log('更新魔族副本关卡 mwID=%s,level=%s' % (mwID, passLV), curPlayer.GetID())
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('Treasure', {'FBMapID':mapID, 'FBLineID':lineID})
|
| | | if not ipyData:
|
| | | return
|
| | | mwID = ipyData.GetID()
|
| | | if curPlayer.GetLV() < ipyData.GetNeedLV():
|
| | | GameWorld.Log('通关副本激活法宝 ,等级不足!!!mwID=%s, needLV=%s' % (mwID, ipyData.GetNeedLV()))
|
| | | return
|
| | | mwID = ipyData.GetID()
|
| | |
|
| | | DoActiveMW(curPlayer, mwID)
|
| | | return
|
| | |
|
| | |
| | | else:
|
| | | sysMark = IpyGameDataPY.GetFuncEvalCfg('UnblockTreasure', 2, {}).get(mwID, 'UnblockTreasure')
|
| | | PlayerControl.WorldNotify(0, sysMark, [curPlayer.GetName(), mwID])
|
| | | |
| | | if mwID == IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 1):
|
| | | __DoFabaoAddPoint(curPlayer)
|
| | | |
| | |
|
| | | EventShell.EventRespons_MagicWeaponLV(curPlayer, mwID, mwLV)
|
| | | #通知客户端等级
|
| | |
| | | DataRecordPack.DR_MagicWeaponActive(curPlayer, mwID, mwLV)
|
| | | return True
|
| | |
|
| | | # 获得法宝加点
|
| | | def __DoFabaoAddPoint(curPlayer):
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_AddPoint):
|
| | | # 未开启前不可加点,因为DoAddPointOpen会一次性补齐,避免意外情况多加了点数
|
| | | return
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | fabaoAddPoint = PlayerControl.GetFabaoAddPoint(curPlayer)
|
| | |
|
| | | curLV = curPlayer.GetLV()
|
| | | addFreePoint = 0
|
| | | for rangLVs, point in addPointDict.items():
|
| | | if curLV < rangLVs[0]:
|
| | | continue
|
| | | addFreePoint += fabaoAddPoint * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | | freePoint = curPlayer.GetFreePoint()
|
| | | updFreePoint = freePoint + addFreePoint
|
| | | curPlayer.SetFreePoint(updFreePoint)
|
| | | GameWorld.DebugLog("获得法宝增加自由属性点: freePoint=%s,addFreePoint=%s,curLV=%s,updFreePoint=%s" |
| | | % (freePoint, addFreePoint, curLV, updFreePoint))
|
| | | |
| | | return
|
| | | def GetWMIpyData(mwID):return IpyGameDataPY.GetIpyGameData('Treasure', mwID)
|
| | |
|
| | |
|
| | |
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, ChConfig.ItemDel_MagicWeapon)
|
| | | elif ipyDataList:
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID':mwID}, True, False)
|
| | | if not ipyDataList:
|
| | | return
|
| | | for ipyData in ipyDataList:
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
|
| | | return
|
| | | elif mwID == 101: #定海神针特殊 可直接获得
|
| | | FBCommon.Notify_FB_Over(curPlayer, {FBCommon.Over_dataMapID:ChConfig.Def_FBMapID_MagicWeapon,FBCommon.Over_isPass:1})
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | else:
|
| | | return
|
| | | DoActiveMW(curPlayer, mwID)
|
| | | return
|
| | |
|
| | | def GetXBXZAwardProgress(curPlayer, mwID):
|
| | | ##获取仙宝寻主当前达到条件的个数(包含已领取的)
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID': mwID}, True, False)
|
| | | if not ipyDataList:
|
| | | return 0
|
| | | cnt = 0
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for ipyData in ipyDataList:
|
| | | if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
|
| | | cnt += 1
|
| | | continue
|
| | | curType = ipyData.GetType()
|
| | | conditionList = ipyData.GetCondition()
|
| | | |
| | | if curType == 1:
|
| | | #穿戴X阶X颜色是否套装X部位装备
|
| | | for classlv, color, suite, place in conditionList:
|
| | | equipIpyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap',classlv,place)
|
| | | if not equipIpyData:
|
| | | continue
|
| | | gridIndex = equipIpyData.GetGridIndex()
|
| | | curEquip = playerEquip.GetAt(gridIndex)
|
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | curItemColor = curEquip.GetItemColor()
|
| | | curIsSuite = curEquip.GetSuiteID()
|
| | | if curItemColor >= color and curIsSuite >= suite:
|
| | | cnt += 1
|
| | | break
|
| | | else:
|
| | | continue
|
| | | return cnt
|
| | |
|
| | | # ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID': mwID}, True, False)
|
| | | # cnt = 0
|
| | | # if ipyDataList:
|
| | | # for ipyData in ipyDataList:
|
| | | # if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
|
| | | # cnt += 1
|
| | | # return cnt
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | |
|
| | |
| | | conditionList = ipyData.GetCondition()
|
| | | cnt = 0
|
| | | if curType == 1:
|
| | | #角色防御到XX
|
| | | cnt = PlayerControl.GetFuncDef(curPlayer)
|
| | | |
| | | elif curType == 2:
|
| | | #穿戴三阶橙色1星或四阶紫色1星以上头盔
|
| | | #穿戴X阶X颜色是否套装X部位装备
|
| | | cnt = 0
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | SamboSpecialUnlock = IpyGameDataPY.GetFuncEvalCfg('SamboSpecialUnlock')
|
| | | for equipIndex in xrange(playerEquip.GetCount()):
|
| | | curEquip = playerEquip.GetAt(equipIndex)
|
| | | for classlv, color, suite, place in conditionList:
|
| | | equipIpyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap',classlv,place)
|
| | | if not equipIpyData:
|
| | | continue
|
| | | gridIndex = equipIpyData.GetGridIndex()
|
| | | curEquip = playerEquip.GetAt(gridIndex)
|
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | curClassLV = ItemCommon.GetItemClassLV(curEquip)
|
| | | itemColor = curEquip.GetItemColor()
|
| | | itemQuality = curEquip.GetItemQuality()
|
| | | itemID = curEquip.GetItemTypeID()
|
| | | for classlv, color, star, place in conditionList:
|
| | | if equipIndex is place and itemID in SamboSpecialUnlock:
|
| | | cnt = 1
|
| | | break
|
| | | if equipIndex is place and curClassLV >= classlv and itemColor >= color and itemQuality >= star:
|
| | | cnt = 1
|
| | | break
|
| | | if cnt:
|
| | | curItemColor = curEquip.GetItemColor()
|
| | | curIsSuite = curEquip.GetSuiteID()
|
| | | if curItemColor >= color and curIsSuite >= suite:
|
| | | cnt = 1
|
| | | break
|
| | | # elif curType == 3:
|
| | | # #全身装备X星
|
| | | # cnt = ChEquip.GetTotalEquipStars(curPlayer)
|
| | | |
| | | # elif curType == 4:
|
| | | # #X阶普通、强化套装
|
| | | # suiteCntDict = {}
|
| | | # playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | # for equipIndex in xrange(playerEquip.GetCount()):
|
| | | # curEquip = playerEquip.GetAt(equipIndex)
|
| | | # if curEquip.IsEmpty():
|
| | | # continue
|
| | | # suiteInfo = ChEquip.GetSuiteInfoByPlace(curPlayer, equipIndex, curEquip)
|
| | | # for suitelv, suiteType in conditionList:
|
| | | # if suiteInfo.get(suiteType, 0) >= suitelv:
|
| | | # suiteCntDict[suiteType] = suiteCntDict.get(suiteType, 0)+1
|
| | | # cnt = max(suiteCntDict.values()) if suiteCntDict else 0
|
| | |
|
| | | else:
|
| | | return
|
| | |
| | | SyncXBXZAwardRecord(curPlayer, [index])
|
| | | #成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_XBXZ, 1, [ipyData.GetMWID()])
|
| | | EventShell.EventRespons_XBXZ(curPlayer, ipyData.GetMWID())
|
| | | GameWorld.DebugLog(' 仙宝寻主领奖OK, ID=%s, cnt=%s' % (index, cnt))
|
| | | return
|
| | |
|
| | |
|
| | | ## 通知仙宝寻主对应奖励领奖记录
|
| | | # @param None
|