From 06233c1cb36e7a1bdd10d7d88d94473878e96dba Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 19 三月 2019 20:45:04 +0800 Subject: [PATCH] 6369 【后端】【2.0】删除职业阶设定 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py | 288 +++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 189 insertions(+), 99 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py index 0afee67..38cff40 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py @@ -30,8 +30,9 @@ import EventReport import PlayerFamily import PlayerActivity +import ItemControler import PlayerSuccess -import PlayerMagicWeapon +import GameFuncComm import PyGameData import PlayerVip import GameObj @@ -63,6 +64,13 @@ Help_score = 'score' #已获得积分 Help_grade = 'grade' #评级(5-S,4-A,3-B,2-C,1-D) Help_leaderID = 'leaderID' #渡劫玩家ID +Help_isHelp = 'isHelp' #本次是否是助战 +Help_helpCount = 'helpCount' #该副本今日已助战次数 +Help_relation = 'relation' #该副本关系加成信息 [优先关系, 总加成] +Help_robotJob = 'robotJob' #机器人职业 {"ObjID":job, ...} +Help_isAuto = 'isAuto' #是否自动召唤 +Help_hasRefreshBoss = 'hasRefreshBoss' #是否已刷新boss +Help_gsItemInfo = 'gsItemInfo' #聚魂副本物品信息 {"波数":[[{"ItemID":101, "ItemCount":10}]]} #副本结算信息通用key Over_dataMapID = 'dataMapID' #数据地图ID @@ -86,6 +94,8 @@ Over_extrScore = 'extrScore' #已获得额外积分 Over_enterLV = 'enterLV' #进入时等级 Over_leaderID = 'leaderID' #渡劫玩家ID +Over_xianyuanCoin = 'xianyuanCoin' #获得仙缘币信息 [获得仙缘币数, 没有获得的原因] 原因: 1-达到助战次数上限,2-达到每日获得仙缘币上限 +Over_helpPlayer = 'helpPlayer' #助战玩家信息 {"玩家ID":{玩家信息key:value, ...}, ...} #副本行为 ( @@ -163,19 +173,12 @@ return ShareDefine.EntFBAskRet_FBClose #进入次数判断 - maxTimes = fbIpyData.GetDayTimes() - helpPoint = fbIpyData.GetHelpPoint() - if maxTimes and not helpPoint and mapID not in ChConfig.Def_NoLimitEnterCntMap: - enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID) - maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) - if enterCnt + reqEnterCnt > maxCnt: - GameWorld.Log("已达到当日最大进入次数!mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" - % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID) - if isNotify: - PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_268121", [mapID]) - return ShareDefine.EntFBAskRet_NoEnterCnt - - # 周今日次数暂不做,待扩展... + canEnter, notifyMark = __CheckCanEnterFBByTime(curPlayer, mapID, fbIpyData, reqEnterCnt, isTeamAsk) + if not canEnter: + if notifyMark: + PlayerControl.NotifyCode(curPlayer, notifyMark, [mapID]) + return ShareDefine.EntFBAskRet_NoEnterCnt + #进入CD判断 if CheckIsEnterCD(curPlayer, mapID): if isNotify: @@ -200,15 +203,6 @@ 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]: if isNotify: @@ -216,6 +210,50 @@ return ShareDefine.EntFBAskRet_NoTicket return ShareDefine.EntFBAskRet_OK + +def __CheckCanEnterFBByTime(curPlayer, mapID, fbIpyData, reqEnterCnt, isTeamAsk): + #进入次数判断 + maxTimes = fbIpyData.GetDayTimes() + if not maxTimes: + return True, "" + + #playerID = curPlayer.GetPlayerID() + enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID) + maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) + if enterCnt + reqEnterCnt <= maxCnt: + return True, "" + + ### 以下是到达次数上限后的处理 + fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID) + + # 单人副本达到次数后不可再进入 + if fbType == IPY_GameWorld.fbtSingle: + #GameWorld.Log("已达到当日最大进入次数!单人副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" + # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID) + return False, "GeRen_chenxin_268121" + + # 组队副本 + if fbType == IPY_GameWorld.fbtTeam: + # 无助战的不可再进入 + if not fbIpyData.GetHelpPoint(): + #GameWorld.Log("已达到当日最大进入次数!组队副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" + # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID) + return False, "GeRen_chenxin_268121" + + # 可助战的不可单人进入助战,可发起匹配 + if not isTeamAsk and (not curPlayer.GetTeamID() or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamMemCount) <= 1): + #GameWorld.Log("已达到当日最大进入次数!组队副本不可单人助战! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" + # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID) + return False, "TeamSingleEnter" + + elif mapID not in ChConfig.Def_NoLimitEnterCntMap: + #GameWorld.Log("已达到当日最大进入次数! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" + # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID) + return False, "GeRen_chenxin_268121" + + # 周进入次数暂不做,待扩展... + + return True, "" ## 获取副本进入门票信息 # @param curPlayer 玩家实例 @@ -330,6 +368,17 @@ gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, maxLV) GameWorld.Log("NPC成长动态等级变更: isLeave=%s,totalLV=%s,playerCnt=%s,averageLV=%s,maxLV=%s" % (isLeave, totalLV, playerCnt, averageLV, maxLV), playerID) + # 上古战场特殊处理 + if mapID == ChConfig.Def_FBMapID_ElderBattlefield: + lineID = GameWorld.GetGameWorld().GetPropertyID() - 1 + fbLineIpyData = GetFBLineIpyData(mapID, lineID) + lvLimitMin = 0 if not fbLineIpyData else fbLineIpyData.GetLVLimitMin() + robotLVDiff = IpyGameDataPY.GetFuncCfg("ElderBattlefieldCfg", 5) + robotLVMin, robotLVMax = averageLV - robotLVDiff, averageLV + robotLVMin = max(lvLimitMin, robotLVMin) + gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMaxLV, robotLVMax) + gameFB.SetGameFBDict(ChConfig.Def_FB_NPCStrengthenMinLV, robotLVMin) + GameWorld.Log(" 更新上古机器人等级范围: lineID=%s,robotLVDiff=%s,robotLV=(%s~%s)" % (lineID, robotLVDiff, robotLVMin, robotLVMax)) return True def UpdFBLineNPCStrengthenPlayerCnt(playerID, isLeave): @@ -525,7 +574,7 @@ return def GetJsonItemList(itemList): - ## [[itemID,itemCount,isBind], curItem] -> [{"ItemID":101, "Count":10, "IsBind":1, "IsSuite":1, "UserData":"自定义属性字符串"}] + ## [[itemID,itemCount,isAuctionItem], curItem] -> [{"ItemID":101, "Count":10, "IsAuctionItem":1, "UserData":"自定义属性字符串"}] jsonItemList = [] for itemInfo in itemList: itemDict = {} @@ -536,7 +585,7 @@ if infolen > 1: itemDict['Count'] = itemInfo[1] if infolen > 2: - itemDict['IsBind'] = int(itemInfo[2]) + itemDict['IsAuctionItem'] = int(itemInfo[2]) elif isinstance(itemInfo, int): itemDict['ItemID'] = itemInfo else: #物品实例 @@ -544,8 +593,8 @@ continue itemDict['ItemID'] = itemInfo.GetItemTypeID() itemDict['Count'] = itemInfo.GetCount() - itemDict['IsBind'] = int(itemInfo.GetIsBind()) - itemDict['IsSuite'] = int(itemInfo.GetIsSuite()) + itemDict['IsAuctionItem'] = ItemControler.GetIsAuctionItem(itemInfo) + #itemDict['IsSuite'] = int(itemInfo.GetIsSuite()) itemDict['UserData'] = itemInfo.GetUserData() jsonItemList.append(itemDict) return jsonItemList @@ -573,7 +622,7 @@ #--------------------------------------------------------------------- def SyncDynamicBarrierState(barrierPointList, state, curPlayer=None): '''同步动态障碍物是否有效性 - @param barrierPointList: 障碍物点列表 [[aPosX,aPosY,bPosX,bPosY], [aPosX,aPosY,bPosX,bPosY], ...] + @param barrierPointList: 障碍物点列表 [[aPosX,aPosY,bPosX,bPosY,angle可选], [aPosX,aPosY,bPosX,bPosY,angle可选], ...] @param state: 是否有效 @param curPlayer: 指定通知目标玩家,为None时广播本地图所有玩家 ''' @@ -581,12 +630,15 @@ barrierStatePack.Clear() barrierStatePack.State = state barrierStatePack.BarrierList = [] - for aPosX, aPosY, bPosX, bPosY in barrierPointList: + for posInfo in barrierPointList: + aPosX, aPosY, bPosX, bPosY = posInfo[:4] + angle = posInfo[4] if len(posInfo) > 4 else 0 barrier = ChPyNetSendPack.tagMCDynamicBarrier() barrier.APosX = aPosX barrier.APosY = aPosY barrier.BPosX = bPosX barrier.BPosY = bPosY + barrier.Angle = angle barrierStatePack.BarrierList.append(barrier) barrierStatePack.Count = len(barrierStatePack.BarrierList) if curPlayer: @@ -943,7 +995,17 @@ if gameWorld.GetCloseFBTick() > 0: #不可进入 return False - + + if askStruct.GetTeamLV() == IPY_GameWorld.tmlLeader: + '''原因: + 队长退出组队副本,其他队员还在里面,此时副本不会被关闭 + 队长在队伍ID不变的情况下又组了其他人,然后又想进去该副本,那么这时会进入之前队员还在的那条队伍分线,导致队伍线路错乱 + 所以此处不允许该队长进入,并提示其等待或重新建队进入 + + FBinCantEnter 副本清理中,请等待关闭或重新创建队伍进入 + ''' + return False, "FBinCantEnter" + #副本在等待关闭状态不允许玩家进入 return (gameWorld.GetOpenState() != IPY_GameWorld.fbosWaitForClose) @@ -1041,7 +1103,7 @@ #根据副本需求, 过滤NPC for curNPC in gameNPCList: #尸体不处理 - if curNPC.GetHP() <= 0: + if GameObj.GetHP(curNPC) <= 0: continue #召唤兽特殊判断 @@ -1370,7 +1432,7 @@ fbIpyData = GetFBIpyData(mapID) maxTimes = fbIpyData.GetDayTimes() MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID() - wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID) + mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0 extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID() extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID) @@ -1386,7 +1448,7 @@ enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID) maxTimes = fbIpyData.GetDayTimes() MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID() - wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID) + mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0 maxTimes += mwAddCnt #法宝增加的次数加到基础次数里 extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID() @@ -1537,31 +1599,6 @@ ##获取是否助战 return GameWorld.GetGameFB().GetPlayerGameFBDictByKey(curPlayer.GetID(), ChConfig.FBPlayerDict_IsHelpFight) - -def AddFBHelpPoint(curPlayer, mapID, addFBCnt=1): - ##增加副本助战积分 - PlayerControl.NotifyCode(curPlayer, 'TodayNoDungeonReward') - fbIpyData = GetFBIpyData(mapID) - helpPoint = fbIpyData.GetHelpPoint() - if not helpPoint: - return 0 - #任务 - EventShell.EventRespons_FBEvent(curPlayer, 'fbhelp') - # 每日活动 - PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FBHelp) - addHelpPoint = helpPoint * addFBCnt - dayMaxPoint = IpyGameDataPY.GetFuncCfg('DungeonIntegral') - curDayPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBHelpPointCntDay) - if curDayPoint >= dayMaxPoint: - PlayerControl.NotifyCode(curPlayer, 'AssistantIntegralFull') - return 0 - addHelpPoint = min(addHelpPoint, dayMaxPoint-curDayPoint) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, curDayPoint+addHelpPoint) - PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_FBHelpPoint, addHelpPoint, isSysHint=False) - PlayerControl.NotifyCode(curPlayer, 'AssistantIntegral', [addHelpPoint]) - GameWorld.DebugLog(" 增加副本助战积分!mapID=%s, addHelpPoint=%s"%(mapID, addHelpPoint), curPlayer.GetID()) - return addHelpPoint - def FBOnWeek(curPlayer, onWeekType): mapIDInfo = [] @@ -1600,6 +1637,14 @@ for i in xrange(ipyDataMgr.GetFBFuncCount()): ipyData = ipyDataMgr.GetFBFuncByIndex(i) mapID = ipyData.GetDataMapID() + + # 有真实助战次数奖励限制的 + if ipyData.GetDayHelpCountMax(): + helpCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FBRealHelpCount % mapID) + if helpCount: + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FBRealHelpCount % mapID, 0) + GameWorld.DebugLog("重置日助战奖励次数限制!mapID=%s" % mapID) + dayTimes = ipyData.GetDayTimes() # 没有日次数限制的不处理 if not dayTimes and not ipyData.GetBuyTimesVIPPriID() and not ipyData.GetExtraTimesVIPPriID() and not ipyData.GetExtraTimesMWPriID(): @@ -1641,6 +1686,13 @@ newEnterCnt = max(0, dayTimes - (maxCnt - enterCnt)) PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, newEnterCnt) GameWorld.DebugLog(" 特殊副本已进入次数更新: newEnterCnt=%s" % newEnterCnt) + elif mapID == ChConfig.Def_FBMapID_ZhuXianBoss: + if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_ZhuXianBoss): + curCnt = min(maxCnt - enterCnt + IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg'), IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2)) + if curCnt > dayTimes: + PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, curCnt - dayTimes) + elif curCnt < dayTimes: + PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, dayTimes - curCnt) mapIDInfo.append(mapID) @@ -1648,10 +1700,6 @@ Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo) Sync_FBPlayerFBBuyCount(curPlayer, mapIDInfo) - #重置每日获得的助战积分 - if onDayType ==ShareDefine.Def_OnEventTypeEx: - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBHelpPointCntDay, 0) - return ## 玩家通用副本登录处理 @@ -1667,6 +1715,7 @@ #判断副本里离线超过一定时间则退出副本 CheckFBPlayerOffine(curPlayer) return + def CheckFBPlayerOffine(curPlayer): mapid = curPlayer.GetMapID() @@ -1703,7 +1752,15 @@ canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID) hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID) - + maxDayTimes = ipyData.GetDayTimes() + maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) + enterCnt = GetEnterFBCount(curPlayer, mapID) + if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes: + GameWorld.DebugLog('当前次数已满,无需购买。。') + return + if mapID == ChConfig.Def_FBMapID_ZhuXianBoss and maxCnt - enterCnt >= IpyGameDataPY.GetFuncCfg('ZhuXianBossCntCfg', 2): + return + if hasBuyCnt >= canBuyCnt: GameWorld.DebugLog("购买次数已经用完mapID=%s"%mapID) return @@ -1722,12 +1779,10 @@ return PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_BuyFbCntDay % mapID, hasBuyCnt + 1) Sync_FBPlayerFBBuyCount(curPlayer, [mapID]) - + PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID]) lastRegainTime= curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID) if lastRegainTime: - maxDayTimes = ipyData.GetDayTimes() maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) - enterCnt = GetEnterFBCount(curPlayer, mapID) if maxCnt - enterCnt == maxDayTimes: curTime = int(time.time()) needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID) @@ -1848,11 +1903,11 @@ ## 副本行为 - 鼓舞buff # @param curPlayer 玩家 # @param key 副本玩家字典key -# @param encourageType 1-铜钱 2-消耗绑玉或仙玉 +# @param encourageType 金钱类型 # @param tick 当前时间 # @param isMaxlv 是否直接满级 # @return None -def FbEncourageBuff(curPlayer, key, encourageType, tick, isMaxlv=False): +def FbEncourageBuff(curPlayer, key, encourageType, tick, ownerID=0): #GameWorld.Log("FbEncourageBuff moneyType=%s" % (moneyType)) curMapID = curPlayer.GetMapID() curMapID = GetRecordMapID(curMapID) @@ -1861,25 +1916,28 @@ return maxCnt = ipyData.GetInspireMaxLV() gameFB = GameWorld.GetGameFB() - curPlayerID = curPlayer.GetID() - encourageLV = gameFB.GetPlayerGameFBDictByKey(curPlayerID, key) + ownerID = ownerID or curPlayer.GetID() + encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key) encourageCntKey = 'FbEncourageCnt_%s' % encourageType - encourageCnt = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey) - if encourageLV >= 10: + encourageCnt = gameFB.GetPlayerGameFBDictByKey(ownerID, encourageCntKey) + maxLV = IpyGameDataPY.GetFuncEvalCfg('FBEncourageBuff', 2, {}).get(curMapID, 0) + if encourageLV >= maxLV: PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_93643") return if encourageCnt >= maxCnt: - if encourageType == 1: + if encourageType == IPY_GameWorld.TYPE_Price_Silver_Money: PlayerControl.NotifyCode(curPlayer, "Xjmj_CopperInspireFull") else: PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_93643") return - encourageCost = ipyData.GetMoneyCount() - if encourageType == 1: - costMoneyList = [[IPY_GameWorld.TYPE_Price_Silver_Money, encourageCost]] - else: - costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, encourageCost) + encourageCost = eval(ipyData.GetMoneyCount()) + if curMapID == ChConfig.Def_FBMapID_SealDemon: + isDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble) + if isDouble: #封魔坛双倍挑战则鼓舞双倍花费 + encourageCost *= 2 + + costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, encourageType, encourageCost) if not costMoneyList: return @@ -1896,28 +1954,47 @@ return buffType = SkillCommon.GetBuffType(skillBuff) - BuffSkill.DoAddBuff(curPlayer, buffType, skillBuff, tick) - gameFB.SetPlayerGameFBDict(curPlayerID, key, encourageLV+1) - gameFB.SetPlayerGameFBDict(curPlayerID, encourageCntKey, encourageCnt+1) + + gameFB.SetPlayerGameFBDict(ownerID, key, encourageLV+1) + gameFB.SetPlayerGameFBDict(ownerID, encourageCntKey, encourageCnt+1) #GameWorld.Log("FbEncourageBuff encourage nextLV=%s success" % encourageLV) - PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_628920", [(encourageLV+1)*10]) - SendFBEncourageInfo(curPlayer, encourageLV+1) - #成就 - PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FBEncourage, 1, [curMapID]) - EventShell.EventRespons_FBEncourage(curPlayer, curMapID) - return + addHurtNum = IpyGameDataPY.GetFuncEvalCfg('FBEncourageBuff', 3, {}).get(curMapID, 0) + if curMapID == ChConfig.Def_FBMapID_AllFamilyBoss: + #给副本里所有盟成员提示 + playerManager = GameWorld.GetMapCopyPlayerManager() + for index in xrange(playerManager.GetPlayerCount()): + player = playerManager.GetPlayerByIndex(index) + if not player: + 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(): + PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FBEncourage, 1, [curMapID]) + 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) + #成就 + PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FBEncourage, 1, [curMapID]) + EventShell.EventRespons_FBEncourage(curPlayer, curMapID) + return True ## 添加副本鼓舞buff,一般用于玩家掉线后,在规定时间内重新上线回到副本时重新上buff # @param curPlayer 玩家 # @param key 副本玩家字典key # @param tick 当前时间 # @return None -def AddFbEncourageBuff(curPlayer, key, tick): +def AddFbEncourageBuff(curPlayer, key, tick, ownerID=0): curPlayerID = curPlayer.GetID() GameWorld.Log("AddFbEncourageBuff() curPlayerID=%s" % curPlayerID) gameFB = GameWorld.GetGameFB() - encourageLV = gameFB.GetPlayerGameFBDictByKey(curPlayerID, key) + encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key) if not encourageLV: return mapID = GameWorld.GetMap().GetMapID() @@ -1932,7 +2009,7 @@ buffType = SkillCommon.GetBuffType(skillBuff) BuffSkill.DoAddBuff(curPlayer, buffType, skillBuff, tick) - SendFBEncourageInfo(curPlayer, encourageLV) + SendFBEncourageInfo(curPlayer, encourageLV, ownerID) return ## 清除鼓舞buff @@ -1952,17 +2029,27 @@ ## 发送副本鼓舞信息 # @param curPlayer 玩家 # @return None -def SendFBEncourageInfo(curPlayer, lv): +def SendFBEncourageInfo(curPlayer, lv, ownerID=0): #//A3 0A 副本鼓舞信息通知 #tagMCFBEncourageInfo + curMapID = curPlayer.GetMapID() + curMapID = GetRecordMapID(curMapID) + ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('FbEncourage', {'DataMapID':curMapID}, True) + if not ipyDataList: + return encourageInfo = ChPyNetSendPack.tagMCFBEncourageInfo() encourageInfo.Clear() - #encourageInfo.LV = lv + encourageInfo.InfoList = [] encourageCntKey = 'FbEncourageCnt_%s' gameFB = GameWorld.GetGameFB() - curPlayerID = curPlayer.GetID() - encourageInfo.Cnt1 = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey%1) - encourageInfo.Cnt2 = gameFB.GetPlayerGameFBDictByKey(curPlayerID, encourageCntKey%2) - NetPackCommon.SendFakePack(curPlayer, encourageInfo) + ownerID = ownerID or curPlayer.GetID() + for ipyData in ipyDataList: + inspireType = ipyData.GetInspireType() + packData = ChPyNetSendPack.tagMCFBEncourageCnt() + packData.MoneyType = inspireType + packData.EncourageCnt = gameFB.GetPlayerGameFBDictByKey(ownerID, encourageCntKey % inspireType) + encourageInfo.InfoList.append(packData) + encourageInfo.Cnt = len(encourageInfo.InfoList) + NetPackCommon.SendFakePack(curPlayer, encourageInfo) return ## 获取玩家所在副本区域福利倍值 @@ -1997,7 +2084,10 @@ if mapID not in enterCDDict: return 0 - + lvLimitDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 3) + if mapID in lvLimitDict: + if curPlayer.GetLV() >= lvLimitDict[mapID]: + return 0 cdTick = enterCDDict[mapID] lastEnterTick = GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID) if not lastEnterTick: @@ -2087,7 +2177,7 @@ enterTickObj = ChPyNetSendPack.tagMCFBEnterTick() enterTickObj.Clear() enterTickObj.MapID = mapID - enterTickObj.LastEnterTick = max(enterCDDict.get(mapID) - (timeNum - lastEnterTick), 0) + enterTickObj.LastEnterTick = lastEnterTick#max(enterCDDict.get(mapID) - (timeNum - lastEnterTick), 0) enterList.EnterTickList.append(enterTickObj) enterList.Cnt = len(enterList.EnterTickList) @@ -2231,7 +2321,7 @@ rewardFormatDict = IpyGameDataPY.GetFuncEvalCfg(cfgKeyName) getCntLimit = IpyGameDataPY.GetFuncCfg(cfgKeyName, 3) lastAwardTick = gameFB.GetGameFBDictByKey(ChConfig.Map_FBDict_LastAreaRewardTick) - if tick - lastAwardTick < rewardInterval * 1000: + if tick - lastAwardTick < rewardInterval: return gameFB.SetGameFBDict(ChConfig.Map_FBDict_LastAreaRewardTick, tick) -- Gitblit v1.8.0