| | |
| | | import EventReport
|
| | | import PlayerFamily
|
| | | import PlayerActivity
|
| | | import ItemControler
|
| | | import PlayerSuccess
|
| | | import GameFuncComm
|
| | | import PyGameData
|
| | |
| | | Over_leaderID = 'leaderID' #渡劫玩家ID
|
| | | Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限
|
| | | Over_helpPlayer = 'helpPlayer' #助战玩家信息 {"玩家ID":{玩家信息key:value, ...}, ...}
|
| | | Over_ownerID = 'ownerID' #归属玩家ID
|
| | | Over_ownerName = 'ownerName' #归属玩家名
|
| | |
|
| | | #副本行为
|
| | | (
|
| | |
| | | def CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, reqEnterCnt=1, isNotify=True, isTeamAsk=False):
|
| | | # 可否进入副本通用检查, 扫荡通用
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | if not FBLogic.OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
| | | return ShareDefine.EntFBAskRet_OK
|
| | | |
| | | # 总表通用检查
|
| | | if fbIpyData:
|
| | | #开服天开放检查
|
| | |
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "FbLV", [mapID])
|
| | | return ShareDefine.EntFBAskRet_LVLimit
|
| | | |
| | | #职业阶判断
|
| | | jobRankLimit = fbLineIpyData.GetJobRankLimit()
|
| | | if jobRankLimit and PlayerControl.GetJobRank(curPlayer) < jobRankLimit:
|
| | | GameWorld.Log("玩家职业阶级不足, 无法进入副本!mapID=%s,lineID=%s,jobRank=%s < jobRankLimit=%s" |
| | | % (mapID, lineID, PlayerControl.GetJobRank(curPlayer), jobRankLimit), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "SingleEnterJob", [mapID])
|
| | | return ShareDefine.EntFBAskRet_JobRankLimit
|
| | |
|
| | | #门票判断
|
| | | if not GetFBEnterTicket(curPlayer, mapID, lineID, fbLineIpyData, reqEnterCnt, isTeamAsk)[0]:
|
| | |
| | | # @return
|
| | | def SetFBPropertyMark(propertyMark, setPlayer=None):
|
| | | GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_PropertyMark, propertyMark + 1) # 存储时+1才能判断是否存储过
|
| | | if setPlayer != None:
|
| | | PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
|
| | | GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer.GetPlayerID():
|
| | | continue
|
| | | PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
|
| | | GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
|
| | | # if setPlayer != None:
|
| | | # PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
|
| | | # GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
|
| | | # return
|
| | | # |
| | | # playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | # for index in xrange(playerManager.GetPlayerCount()):
|
| | | # curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | # if not curPlayer.GetPlayerID():
|
| | | # continue
|
| | | # PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
|
| | | # GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | ## 是否已经扣除入场券/进入次数等
|
| | |
| | | # @return
|
| | | def SetHadDelTicket(curPlayer, delSign=1):
|
| | | GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign)
|
| | | return
|
| | |
|
| | | ## 自定义场景阶段
|
| | | def GetCustomMapStep(curPlayer, mapID, lineID):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID))
|
| | | def SetCustomMapStep(curPlayer, mapID, lineID, step):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID), step)
|
| | | if step == ChConfig.CustomMapStep_Over:
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | return
|
| | |
|
| | | def GetCurSingleFBPlayer():
|
| | |
| | | continue
|
| | | itemDict['ItemID'] = itemInfo.GetItemTypeID()
|
| | | itemDict['Count'] = itemInfo.GetCount()
|
| | | itemDict['IsAuctionItem'] = itemInfo.GetIsBind()
|
| | | itemDict['IsAuctionItem'] = ItemControler.GetIsAuctionItem(itemInfo)
|
| | | #itemDict['IsSuite'] = int(itemInfo.GetIsSuite())
|
| | | itemDict['UserData'] = itemInfo.GetUserData()
|
| | | jsonItemList.append(itemDict)
|
| | |
| | | #可以进入
|
| | | return True
|
| | | #---------------------------------------------------------------------
|
| | | def Sync_FBNPC(mapID=0, npcIDList=[], curPlayer=None):
|
| | | ## 同步当前副本NPC给副本中的所有玩家
|
| | | if not mapID:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = GetRecordMapID(mapID)
|
| | | npcCntDict = {}
|
| | | gameNPCManager = GameWorld.GetNPCManager()
|
| | | for index in xrange(gameNPCManager.GetNPCCount()):
|
| | | curNPC = gameNPCManager.GetNPCByIndex(index)
|
| | | npcID = curNPC.GetNPCID()
|
| | | if not npcID:
|
| | | continue
|
| | | if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | continue
|
| | | if npcIDList and npcID not in npcIDList:
|
| | | continue
|
| | | npcCntDict[npcID] = npcCntDict.get(npcID, 0) + 1
|
| | | |
| | | if curPlayer:
|
| | | NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
|
| | | else:
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for i in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | if curPlayer.GetID() == 0:
|
| | | continue
|
| | | NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
|
| | | return npcCntDict
|
| | |
|
| | | ##获得地图上的NPC列表
|
| | | # @param 无参数
|
| | | # @return 返回值, NPC实例列表[curNPC,curNPC,,,,,]
|
| | |
| | | return
|
| | |
|
| | | buffType = SkillCommon.GetBuffType(skillBuff)
|
| | | BuffSkill.DoAddBuff(curPlayer, buffType, skillBuff, tick)
|
| | | |
| | | gameFB.SetPlayerGameFBDict(ownerID, key, encourageLV+1)
|
| | | gameFB.SetPlayerGameFBDict(ownerID, encourageCntKey, encourageCnt+1)
|
| | | #GameWorld.Log("FbEncourageBuff encourage nextLV=%s success" % encourageLV)
|
| | |
| | | continue
|
| | | if player.GetFamilyID() != ownerID:
|
| | | continue
|
| | | BuffSkill.DoAddBuff(player, buffType, skillBuff, tick)
|
| | | PlayerControl.NotifyCode(player, "AllianceBossText2", [curPlayer.GetName(), encourageLV+1])
|
| | | SendFBEncourageInfo(player, encourageLV+1, ownerID)
|
| | | if player.GetID() == curPlayer.GetID():
|
| | |
| | | EventShell.EventRespons_FBEncourage(curPlayer, curMapID)
|
| | |
|
| | | else:
|
| | | BuffSkill.DoAddBuff(curPlayer, buffType, skillBuff, tick)
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_628920", [(encourageLV+1)*addHurtNum])
|
| | | SendFBEncourageInfo(curPlayer, encourageLV+1, ownerID)
|
| | | #成就
|
| | |
| | | def AddFbEncourageBuff(curPlayer, key, tick, ownerID=0):
|
| | | curPlayerID = curPlayer.GetID()
|
| | | GameWorld.Log("AddFbEncourageBuff() curPlayerID=%s" % curPlayerID)
|
| | | |
| | | ownerID = ownerID or curPlayer.GetID()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key)
|
| | | if not encourageLV:
|
| | |
| | | fbHelpFunc(curPlayer, tick)
|
| | | return
|
| | |
|
| | | def GetCrossDynamicLineMapZoneID():
|
| | | ## 获取跨服动态线路地图本线路跨服分区
|
| | | return GameWorld.GetGameWorld().GetPropertyID() / 10000
|
| | |
|
| | | def GetCrossDynamicLineMapFuncLineID():
|
| | | ## 获取跨服动态线路地图本线路功能线路ID
|
| | | return GameWorld.GetGameWorld().GetPropertyID() % 10000 / 10
|
| | |
|