| | |
| | | import ItemControler
|
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import FBCommon
|
| | |
|
| | | def DoPlayerOnDay(curPlayer):
|
| | | ## 过天处理
|
| | |
| | | GameWorld.DebugLog("请求协助CD中!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | return
|
| | |
|
| | | mapAssistGiftDict = IpyGameDataPY.GetFuncEvalCfg("AssistAward", 2, {})
|
| | | if str(mapID) not in mapAssistGiftDict:
|
| | | return
|
| | | |
| | | teamID = curPlayer.GetTeamID()
|
| | | if teamID:
|
| | | if curPlayer.GetTeamLV() != IPY_GameWorld.tmlLeader:
|
| | | GameWorld.DebugLog("非队长,无法发布副本协助!")
|
| | | return
|
| | | |
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | | |
| | | queryData = [mapID, lineID]
|
| | | QueryGameServer_PlayerAssist(playerID, "RequestAssistTeamFB", queryData)
|
| | | return
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def SetFBNoAssistPlayerID(curPlayer):
|
| | | ## 设置副本非协助玩家ID,玩家进入副本时调用
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | if gameFB.GetGameFBDictByKey("FBNoAssistPlayerID"):
|
| | | 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
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | noAssistPlayerID = gameFB.GetGameFBDictByKey("FBNoAssistPlayerID")
|
| | | GameWorld.DebugLog("副本协助结算: mapID=%s,lineID=%s,noAssistPlayerID=%s" % (mapID, lineID, noAssistPlayerID))
|
| | | |
| | | 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)]
|
| | | |
| | | friendList, memFamilyIDDict = [], {}
|
| | | teamID = GameWorld.GetGameWorld().GetPropertyID()
|
| | | if teamID in PyGameData.g_teamFBMemRelationDict:
|
| | | friendList, memFamilyIDDict = PyGameData.g_teamFBMemRelationDict[teamID][:2]
|
| | | noAssistPlayerFamilyID = memFamilyIDDict.get(noAssistPlayerID, 0)
|
| | | |
| | | assistAwardItemID = liheItemID
|
| | | assistPlayerDict = {}
|
| | | copyPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | noAssistPlayer = copyPlayerManager.FindPlayerByID(noAssistPlayerID)
|
| | | for index in xrange(copyPlayerManager.GetPlayerCount()):
|
| | | curPlayer = copyPlayerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID == noAssistPlayerID:
|
| | | continue
|
| | | |
| | | assistPlayer = curPlayer
|
| | | assistPlayerID = playerID
|
| | | isFriend = [noAssistPlayerID, playerID] in friendList or [playerID, noAssistPlayerID] in friendList
|
| | | assistFamilyID = assistPlayer.GetFamilyID()
|
| | | |
| | | addAssistMoney = AddTodayAssistMoney(curPlayer, assistMoneyType, assistMoney, isFriend)
|
| | | assistPlayerMoneyDict[assistPlayerID] = addAssistMoney
|
| | | 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)
|
| | | |
| | | if noAssistPlayer and assistPlayerDict:
|
| | | GameWorld.DebugLog("发布方给感谢礼盒奖励: noAssistPlayerID=%s,assistAwardItemID=%s" % (noAssistPlayerID, assistAwardItemID), mapID, lineID)
|
| | | ItemControler.GivePlayerItemOrMail(noAssistPlayer, [[assistAwardItemID, 1, 0]])
|
| | | |
| | | queryData = [mapID, lineID, noAssistPlayerID, assistAwardItemID, assistPlayerDict]
|
| | | QueryGameServer_PlayerAssist(0, "OnFBAssistOver", queryData)
|
| | | return noAssistPlayerID, assistMoneyType, assistPlayerMoneyDict
|
| | |
|
| | | def AddTodayAssistMoney(curPlayer, moneyType, addMoney, isSocialEx):
|
| | | ''' 增加今日协助货币奖励
|
| | | @param moneyType: 货币类型
|