| | |
| | | import PassiveBuffEffMng
|
| | | import ItemControler
|
| | | import PlayerActivity
|
| | | import ChEquip
|
| | | import FBCommon
|
| | | import PlayerVip
|
| | |
|
| | | import random
|
| | |
| | | if isActive:
|
| | | GameWorld.DebugLog(' 该法宝已开启! mwID=%s' % mwID)
|
| | | return
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID':mwID}, True, False)
|
| | | |
| | | #消耗物品判断
|
| | | ipyData = GetWMIpyData(mwID)
|
| | | needItemDict = ipyData.GetNeedItem()
|
| | |
| | |
|
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, ChConfig.ItemDel_MagicWeapon)
|
| | | else:
|
| | | 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})
|
| | | else:
|
| | | return
|
| | | DoActiveMW(curPlayer, mwID)
|
| | | return
|
| | |
|
| | |
| | | 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
|
| | |
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_MagicWeaponIsWear, mwID, state, True)
|
| | | return
|
| | |
|
| | | #// A5 12 感应法宝 #tagCMThinkMagicWeapon
|
| | | #
|
| | | #struct tagCMThinkMagicWeapon
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MWID;
|
| | | #};
|
| | | def OnThinkMagicWeapon(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | mwID = clientData.MWID
|
| | | #只触发任务接口
|
| | | EventShell.EventRespons_ThinkMagicWeapon(curPlayer)
|
| | | return |