| | |
| | | Sync_TodayAssistMoneyInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnPlayerLeaveMap(curPlayer):
|
| | | ## 玩家离开地图处理
|
| | | |
| | | NPCHurtManager.OnPlayerLeaveMap(curPlayer)
|
| | | |
| | | mapID = curPlayer.GetMapID()
|
| | | if GameWorld.GetMap().GetMapFBTypeByMapID(mapID) == IPY_GameWorld.fbtTeam:
|
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | if str(mapID) in mapAssistGiftDict and PlayerControl.GetAssistTagPlayerID(curPlayer):
|
| | | lineID = PlayerControl.GetFBFuncLineID(curPlayer)
|
| | | OnCancelAssistTeamFB(curPlayer.GetPlayerID(), mapID, lineID, "LeaveMap")
|
| | | |
| | | return
|
| | |
|
| | | #// B0 10 请求协助Boss #tagCMRequestAssistBoss
|
| | | #
|
| | | #struct tagCMRequestAssistBoss
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | objID = clientData.ObjID
|
| | | npcID = clientData.NPCID
|
| | | |
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | |
|
| | | if not curPlayer.GetFamilyID():
|
| | | GameWorld.DebugLog("没有仙盟不能请求协助!", playerID)
|
| | |
| | | mapID = clientData.MapID
|
| | | lineID = clientData.LineID
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | |
| | | if not curPlayer.GetFamilyID():
|
| | | GameWorld.DebugLog("没有仙盟不能请求协助!", playerID)
|
| | | return
|
| | |
| | | ## 开始协助组队副本,协助玩家进入副本调用
|
| | | queryData = [mapID, lineID, tagPlayerID]
|
| | | QueryGameServer_PlayerAssist(playerID, "OnStartAssistTeamFB", queryData)
|
| | | return
|
| | |
|
| | | def OnCancelAssistTeamFB(playerID, mapID, lineID, reason):
|
| | | ## 取消副本协助
|
| | | queryData = [mapID, lineID, reason]
|
| | | QueryGameServer_PlayerAssist(playerID, "OnCancelAssistTeamFB", queryData)
|
| | | return
|
| | |
|
| | | def QueryGameServer_PlayerAssist(playerID, queryType, queryData):
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def SetFBNoAssistPlayerID(curPlayer):
|
| | | ## 设置副本非协助玩家ID,玩家进入副本时调用
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | if gameFB.GetGameFBDictByKey("FBNoAssistPlayerID"):
|
| | | def OnPlayerEnterAssistFB(curPlayer, mapID, lineID=0):
|
| | | ## 玩家进入协助副本
|
| | | |
| | | if GameWorld.GetMap().GetMapFBTypeByMapID(mapID) != IPY_GameWorld.fbtTeam:
|
| | | return
|
| | | if curPlayer.GetTeamID():
|
| | | if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
|
| | | return
|
| | | noAssistPlayerID = curPlayer.GetPlayerID()
|
| | | gameFB.SetGameFBDict("FBNoAssistPlayerID", noAssistPlayerID)
|
| | | GameWorld.DebugLog("设置副本非协助玩家: noAssistPlayerID=%s" % noAssistPlayerID)
|
| | | return
|
| | |
|
| | | def OnFBAssistOver(mapID, lineID=0):
|
| | | ## 副本协助结束
|
| | | assistPlayerMoneyDict = {}
|
| | | assistMoneyType = ShareDefine.TYPE_Price_FamilyActivity
|
| | | |
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | if str(mapID) not in mapAssistGiftDict:
|
| | | return
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | noAssistPlayerID = gameFB.GetGameFBDictByKey("FBNoAssistPlayerID")
|
| | | GameWorld.DebugLog("副本协助结算: mapID=%s,lineID=%s,noAssistPlayerID=%s" % (mapID, lineID, noAssistPlayerID))
|
| | | if noAssistPlayerID:
|
| | | if playerID != noAssistPlayerID:
|
| | | OnStartAssistTeamFB(playerID, mapID, lineID, noAssistPlayerID)
|
| | | return
|
| | |
|
| | | if not noAssistPlayerID:
|
| | | return noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict
|
| | | |
| | | liheItemID, assistMoney = 0, 0
|
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | if str(mapID) in mapAssistGiftDict:
|
| | | liheItemID, assistMoney = mapAssistGiftDict[str(mapID)]
|
| | | if curPlayer.GetTeamID():
|
| | | if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
|
| | | # 非队长先进入的,暂不处理,等待队长进入后统一处理
|
| | | return
|
| | |
|
| | | noAssistPlayerID = playerID # 队长或无队伍进入则为非协助玩家
|
| | | gameFB.SetGameFBDict("FBNoAssistPlayerID", noAssistPlayerID)
|
| | | GameWorld.DebugLog("设置副本非协助玩家: noAssistPlayerID=%s" % noAssistPlayerID)
|
| | | |
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(copyPlayerManager.GetPlayerCount()):
|
| | | player = copyPlayerManager.GetPlayerByIndex(index)
|
| | | if not player:
|
| | | continue
|
| | | fbPlayerID = player.GetPlayerID()
|
| | | if fbPlayerID == noAssistPlayerID:
|
| | | continue
|
| | | if PlayerControl.GetAssistTagPlayerID(player) != noAssistPlayerID:
|
| | | OnStartAssistTeamFB(fbPlayerID, mapID, lineID, noAssistPlayerID)
|
| | | |
| | | return
|
| | |
|
| | | def OnFBAssistOver(isPass, mapID, lineID=0):
|
| | | ''' 副本协助结束
|
| | | @return: noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict
|
| | | 当 noAssistPlayerID 为0时代表没有成功结算协助,副本额外的协助奖励也不能结算,防止被刷协助奖励
|
| | | '''
|
| | | assistPlayerMoneyDict = {}
|
| | | assistMoneyType = ShareDefine.TYPE_Price_FamilyActivity
|
| | | defaultReturn = (0, assistMoneyType, assistPlayerMoneyDict)
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | noAssistPlayerID = gameFB.GetGameFBDictByKey("FBNoAssistPlayerID")
|
| | | GameWorld.DebugLog("副本协助结算: isPass=%s,mapID=%s,lineID=%s,noAssistPlayerID=%s" % (isPass, mapID, lineID, noAssistPlayerID))
|
| | | |
| | | if not isPass or not noAssistPlayerID:
|
| | | return defaultReturn
|
| | | |
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | noAssistPlayer = copyPlayerManager.FindPlayerByID(noAssistPlayerID)
|
| | | if not noAssistPlayer:
|
| | | GameWorld.DebugLog(" 非协助玩家不在,不结算协助奖励!")
|
| | | return defaultReturn
|
| | | |
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | if str(mapID) not in mapAssistGiftDict:
|
| | | return defaultReturn
|
| | | liheItemID, assistMoney = mapAssistGiftDict[str(mapID)]
|
| | | |
| | | friendList, memFamilyIDDict = [], {}
|
| | | teamID = GameWorld.GetGameWorld().GetPropertyID()
|
| | | if teamID in PyGameData.g_teamFBMemRelationDict:
|
| | |
| | |
|
| | | assistAwardItemID = liheItemID
|
| | | assistPlayerDict = {}
|
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | noAssistPlayer = copyPlayerManager.FindPlayerByID(noAssistPlayerID)
|
| | | for index in xrange(copyPlayerManager.GetPlayerCount()):
|
| | | curPlayer = copyPlayerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | |
| | | GameWorld.DebugLog("协助方给活跃令奖励: assistPlayerID=%s,assistMoney=%s,isFriend=%s,addAssistMoney=%s"
|
| | | % (assistPlayerID, assistMoney, isFriend, addAssistMoney), mapID, lineID)
|
| | |
|
| | | if noAssistPlayer:
|
| | | todayGiftCount = assistPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GetThanksGiftCount % liheItemID)
|
| | | assistPlayerDict[assistPlayerID] = {"PlayerName":assistPlayer.GetPlayerName(), "Job":assistPlayer.GetJob(), |
| | | "LV":assistPlayer.GetLV(), "RealmLV":assistPlayer.GetOfficialRank(),
|
| | | "TodayGiftCount":todayGiftCount}
|
| | | |
| | | # 暂定支持同队伍不同仙盟间协助
|
| | | if assistFamilyID and assistFamilyID == noAssistPlayerFamilyID:
|
| | | notifyParam = [assistPlayer.GetPlayerName(), noAssistPlayer.GetPlayerName(), mapID]
|
| | | PlayerControl.FamilyNotify(assistFamilyID, "AssistFBFinish", notifyParam)
|
| | | todayGiftCount = assistPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GetThanksGiftCount % liheItemID)
|
| | | assistPlayerDict[assistPlayerID] = {"PlayerName":assistPlayer.GetPlayerName(), "Job":assistPlayer.GetJob(), |
| | | "LV":assistPlayer.GetLV(), "RealmLV":assistPlayer.GetOfficialRank(),
|
| | | "TodayGiftCount":todayGiftCount}
|
| | | |
| | | # 暂定支持同队伍不同仙盟间协助
|
| | | if assistFamilyID and assistFamilyID == noAssistPlayerFamilyID:
|
| | | notifyParam = [assistPlayer.GetPlayerName(), noAssistPlayer.GetPlayerName(), mapID]
|
| | | PlayerControl.FamilyNotify(assistFamilyID, "AssistFBFinish", notifyParam)
|
| | |
|
| | | if noAssistPlayer and assistPlayerDict:
|
| | | if assistPlayerDict:
|
| | | GameWorld.DebugLog("发布方给感谢礼盒奖励: noAssistPlayerID=%s,assistAwardItemID=%s" % (noAssistPlayerID, assistAwardItemID), mapID, lineID)
|
| | | ItemControler.GivePlayerItemOrMail(noAssistPlayer, [[assistAwardItemID, 1, 0]])
|
| | |
|