| | |
| | | if not templateID: |
| | | GameWorld.Log("本次活动没有个人榜奖励!") |
| | | return |
| | | tempIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActXianXiaMJBillTemp", templateID) |
| | | if not tempIpyDataList: |
| | | billboardDataCount = billBoard.GetCount() |
| | | billBoard.Sort() |
| | | |
| | | GameWorld.Log("结算个人榜单奖励: billboardType=%s,templateID=%s,billboardDataCount=%s" % (billboardType, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActXianXiaMJBillTemp", templateID) |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | rankAwardDict = {} |
| | | for tempIpyData in tempIpyDataList: |
| | | rankAwardDict[tempIpyData.GetRank()] = tempIpyData.GetAwardItemList() |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | GameWorld.Log("结算个人榜单奖励: templateID=%s,rankAwardDict=%s" % (templateID, rankAwardDict)) |
| | | billBoard.Sort() |
| | | for index in xrange(billBoard.GetCount()): |
| | | billBoardData = billBoard.At(index) |
| | | if not billBoardData: |
| | | continue |
| | | |
| | | rank = index + 1 |
| | | |
| | | awardItemList = GameWorld.GetOrderValueByDict(rankAwardDict, rank, False) |
| | | if not awardItemList: |
| | | break |
| | | |
| | | playerID = billBoardData.GetID() |
| | | name2 = billBoardData.GetName2() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | GameWorld.Log(" 发放仙匣秘境个人榜单奖励: rank=%s,playerID=%s,cmpValue=%s,awardItemList=%s, %s" |
| | | % (rank, playerID, cmpValue, awardItemList, name2)) |
| | | |
| | | PlayerCompensation.SendMailByKey("XianXiaMJPlayer", [playerID], awardItemList, [rank]) |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | billBoardData = billBoard.At(index) |
| | | playerID = billBoardData.GetID() |
| | | name2 = billBoardData.GetName2() |
| | | cmpValue = billBoardData.GetCmpValue() |
| | | |
| | | if cmpValue < needScore: |
| | | GameWorld.Log(" 积分不足该榜单所需积分,跳过该名次: index=%s,rank=%s,playerID=%s,cmpValue=%s < %s" % (index, rank, playerID, cmpValue, needScore)) |
| | | break |
| | | |
| | | awardItemExList = [] |
| | | for scoreEx in scoreAwardExList: |
| | | if cmpValue < scoreEx: |
| | | break |
| | | awardItemExList = scoreAwardEx[scoreEx] # 取最大满足条件的一档 |
| | | finalAwardItemList = awardItemList + awardItemExList |
| | | |
| | | playerRank = rank - orderCountTotal + 1 |
| | | GameWorld.Log(" 发放仙匣秘境个人榜单奖励: index=%s,rank=%s,playerRank=%s,playerID=%s,cmpValue=%s,awardItemList=%s,scoreAwardEx=%s,finalAwardItemList=%s, %s" |
| | | % (index, rank, playerRank, playerID, cmpValue, awardItemList, scoreAwardEx, finalAwardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("XianXiaMJPlayer", [playerID], finalAwardItemList, [playerRank]) |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | return |
| | | |
| | | def MapServer_XianXiaMJ(curPlayer, msgList): |
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("CrossActXianXiaMJ", cfgID) |
| | | if not ipyData: |
| | | return |
| | | personlLimit = ipyData.GetRankLimitPersonal() |
| | | PersonalTemplateID = ipyData.GetPersonalTemplateID() |
| | | rankIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActXianXiaMJBillTemp", PersonalTemplateID) |
| | | if not rankIpyDataList: |
| | | return |
| | | lastRankIpyData = rankIpyDataList[-1] # 取最后一个为最低上榜积分限制 |
| | | personlLimit = lastRankIpyData.GetNeedScore() |
| | | |
| | | playerID = playerInfo["playerID"] |
| | | playerName = playerInfo["playerName"] |
| | |
| | | if playerLotteryScore >= personlLimit: |
| | | name2, type2, value1, value2 = accID, job, realmLV, 0 |
| | | CrossBillboard.UpdCrossBillboard(ShareDefine.Def_CBT_XianXiaMJScore, groupValue1, playerID, playerName, |
| | | name2, type2, value1, value2, playerLotteryScore) |
| | | name2, type2, value1, value2, playerLotteryScore, autoSort=False) |
| | | return |
| | | |
| | | def OnCrossActIDChange(cfgID, zoneID, ipyData, state): |
| | |
| | | % (billboardType, zoneID, cfgID, templateID, billboardDataCount)) |
| | | |
| | | orderIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActXianXiaMJBillTemp", templateID) |
| | | if orderIpyDataList: |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | orderCount = 0 |
| | | if not orderIpyDataList: |
| | | return |
| | | |
| | | rankPre = 0 |
| | | billboardIndex = 0 |
| | | for ipyData in orderIpyDataList: |
| | | rank = ipyData.GetRank() |
| | | needScore = ipyData.GetNeedScore() |
| | | scoreAwardEx = ipyData.GetScoreAwardEx() |
| | | scoreAwardExList = scoreAwardEx.keys() |
| | | scoreAwardExList.sort() |
| | | awardItemList = ipyData.GetAwardItemList() |
| | | orderCountTotal = rank - rankPre # 奖励名次数量 |
| | | rankPre = rank |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCountTotal <= 0: |
| | | break |
| | | |
| | | for index in xrange(billboardIndex, billboardDataCount): |
| | | if orderCount >= orderCountTotal: |
| | | billboardData = billboardObj.At(index) |
| | | playerID = billboardData.ID |
| | | name2 = billboardData.Name2 |
| | | cmpValue = billboardData.CmpValue |
| | | if cmpValue < needScore: |
| | | GameWorld.Log(" 积分不足该榜单所需积分,跳过该名次: index=%s,rank=%s,playerID=%s,cmpValue=%s < %s" % (index, rank, playerID, cmpValue, needScore)) |
| | | break |
| | | |
| | | awardItemExList = [] |
| | | for scoreEx in scoreAwardExList: |
| | | if cmpValue < scoreEx: |
| | | break |
| | | |
| | | billboardData = billboardObj.At(index) |
| | | playerID = billboardData.ID |
| | | name2 = billboardData.Name2 |
| | | cmpValue = billboardData.CmpValue |
| | | |
| | | playerRank = index + 1 |
| | | GameWorld.Log(" 发放仙匣秘境个人榜单奖励: rank=%s,playerID=%s,cmpValue=%s,awardItemList=%s, %s" |
| | | % (rank, playerID, cmpValue, awardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("XianXiaMJCrossPlayer", [playerID], awardItemList, [playerRank], crossMail=True) |
| | | |
| | | orderCount += 1 |
| | | billboardIndex += 1 |
| | | |
| | | awardItemExList = scoreAwardEx[scoreEx] # 取最大满足条件的一档 |
| | | finalAwardItemList = awardItemList + awardItemExList |
| | | |
| | | playerRank = rank - orderCountTotal + 1 |
| | | GameWorld.Log(" 发放仙匣秘境个人榜单奖励: index=%s,rank=%s,playerRank=%s,playerID=%s,cmpValue=%s,awardItemList=%s,scoreAwardEx=%s,finalAwardItemList=%s, %s" |
| | | % (index, rank, playerRank, playerID, cmpValue, awardItemList, scoreAwardEx, finalAwardItemList, name2)) |
| | | PlayerCompensation.SendMailByKey("XianXiaMJCrossPlayer", [playerID], finalAwardItemList, [playerRank], crossMail=True) |
| | | |
| | | orderCountTotal -= 1 |
| | | billboardIndex += 1 |
| | | |
| | | return |
| | | |