| | |
| | | ) = range(5)
|
| | |
|
| | | BZZD_TotalNPCCount = 'BZZD_TotalNPCCount' # 总需击杀NPC数量
|
| | | BZZD_LastNPCID = 'BZZD_LastNPCID' # 最后一只怪NPCID,指定怪物刷完后,后续补刷的怪直接刷该NPCID,防止异常导致怪物不够杀无法结算
|
| | | BZZD_IsKillAll = 'BZZD_IsKillAll' # 是否已经击杀到指定怪物数量
|
| | |
|
| | | FBPlayerDict_KillCnt = 'FBPlayerDict_KillCnt' # 击杀数
|
| | | FBPlayerDict_EnterLV = 'FBPlayerDict_EnterLV' # 进入副本时的等级
|
| | |
| | | totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
|
| | | exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
|
| | | expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
|
| | | grade = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_Grade)
|
| | |
|
| | | #副本帮助
|
| | | helpDict = {FBCommon.Help_npcTotal:killNPCCnt, FBCommon.Help_npcTotalNeed:totalNPCCount,
|
| | | FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint}
|
| | | FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, FBCommon.Help_grade:grade}
|
| | | GameWorld.DebugLog("DoFBHelp %s" % str(helpDict))
|
| | | FBCommon.Notify_FBHelp(curPlayer, helpDict)
|
| | | return
|
| | |
| | | if lineID not in PyGameData.g_bzzdRefreshNPCListDict:
|
| | | return
|
| | | refreshNPCList = PyGameData.g_bzzdRefreshNPCListDict[lineID]
|
| | | if not refreshNPCList:
|
| | | return
|
| | | #if not refreshNPCList:
|
| | | # return
|
| | |
|
| | | isRefresh = False
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameNPC = GameWorld.GetNPCManager()
|
| | | customNPCRefreshCount = gameNPC.GetCustomNPCRefreshCount()
|
| | | for i in xrange(customNPCRefreshCount):
|
| | |
| | | if npcRefresh.GetCount():
|
| | | continue
|
| | | rMark = npcRefresh.GetRefreshMark()
|
| | | npcID = refreshNPCList.pop(0) # 直接按顺序取NPCID
|
| | | NPCCustomRefresh.SetNPCRefresh(rMark, [npcID])
|
| | | |
| | | if not refreshNPCList:
|
| | | GameWorld.DebugLog("怪全部刷完了,没怪了!")
|
| | | if refreshNPCList:
|
| | | npcID = refreshNPCList.pop(0) # 直接按顺序取NPCID
|
| | | gameFB.SetGameFBDict(BZZD_LastNPCID, npcID)
|
| | | else:
|
| | | npcID = gameFB.GetGameFBDictByKey(BZZD_LastNPCID)
|
| | | GameWorld.DebugLog("怪全部刷完了,使用最后一次刷怪的NPCID=%s" % npcID)
|
| | | |
| | | if not npcID:
|
| | | break
|
| | |
|
| | | NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即出发一次标识点刷新 |
| | | isRefresh = True
|
| | | NPCCustomRefresh.SetNPCRefresh(rMark, [npcID])
|
| | | |
| | | if isRefresh:
|
| | | NPCCustomRefresh.ProcessAllNPCRefresh(tick) # 立即触发一次标识点刷新 |
| | | return
|
| | |
|
| | | ## 副本进行中
|
| | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | if gameFB.GetFBStep() != FB_Step_Fighting:
|
| | | return False
|
| | | |
| | | if gameFB.GetGameFBDictByKey(BZZD_IsKillAll):
|
| | | #GameWorld.DebugLog("击杀怪物数已达到最大,无法再攻击!")
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | |
| | | if not curPlayer:
|
| | | return 0
|
| | |
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | isKillAll = gameFB.GetGameFBDictByKey(BZZD_IsKillAll)
|
| | | if isKillAll:
|
| | | GameWorld.DebugLog("已经杀到指定怪物数了,无法再获得经验! isKillAll=%s" % isKillAll)
|
| | | return 0
|
| | | |
| | | npcID = curNPC.GetNPCID()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | baseExp = curNPC.GetExp()
|
| | | expMulti = IpyGameDataPY.GetFuncCfg("XjmjMonsterExp", 2)
|
| | |
| | | killNPCCnt = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_KillCnt) + 1
|
| | | gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_KillCnt, killNPCCnt)
|
| | | DoFBHelp(curPlayer, GameWorld.GetGameWorld().GetTick())
|
| | | |
| | | totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
|
| | | if killNPCCnt >= totalNPCCount:
|
| | | gameFB.SetGameFBDict(BZZD_IsKillAll, killNPCCnt)
|
| | | GameWorld.DebugLog("怪物已击杀到指定数量: killNPCCnt=%s,totalNPCCount=%s" % (killNPCCnt, totalNPCCount))
|
| | | |
| | | return addExp
|
| | |
|
| | | ## 获得经验
|
| | |
| | |
|
| | | playerID = curPlayer.GetID()
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | |
| | | if gameFB.GetFBStep() != FB_Step_Fighting:
|
| | | #GameWorld.DebugLog("非战斗阶段,不处理! addExp=%s" % addExp)
|
| | | return
|
| | | |
| | | exp = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExp)
|
| | | expPoint = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_TotalExpPoint)
|
| | | totalExp = expPoint * ChConfig.Def_PerPointValue + exp
|
| | |
| | |
|
| | | #GameWorld.DebugLog("OnGetExp() totalExp=%s,addExp=%s,updTotalExp=%s" % (totalExp, addExp, updTotalExp), playerID)
|
| | |
|
| | | killNPCCnt = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_KillCnt)
|
| | | totalNPCCount = gameFB.GetGameFBDictByKey(BZZD_TotalNPCCount)
|
| | | if killNPCCnt >= totalNPCCount:
|
| | | if gameFB.GetGameFBDictByKey(BZZD_IsKillAll):
|
| | | GameWorld.DebugLog("怪物已全部杀完,结算副本!")
|
| | | __DoBZZDOver()
|
| | | return
|
| | |
| | | totalExpRecord = expPointRecord * ChConfig.Def_PerPointValue + expRecord
|
| | | upPer = 0 #提升比例
|
| | | if totalExp > totalExpRecord:#超过旧记录
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExp, exp)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExpPoint, expPoint)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExp, totalExp % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BZZD_TotalFightExpPoint, totalExp / ChConfig.Def_PerPointValue)
|
| | | upPer = (totalExp - totalExpRecord) * 100 / totalExpRecord if totalExpRecord else 0
|
| | | #单场总经验成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_XJMJGetExp, 1, [expPoint])
|
| | |
| | |
|
| | | # 通知结果
|
| | | enterLV = gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EnterLV)
|
| | | overDict = {FBCommon.Over_enterLV:enterLV, FBCommon.Over_exp:exp, FBCommon.Over_expPoint:expPoint, 'gradeExp':gradeExp,
|
| | | overDict = {FBCommon.Over_enterLV:enterLV, FBCommon.Over_exp:totalExp % ChConfig.Def_PerPointValue, |
| | | FBCommon.Over_expPoint: totalExp / ChConfig.Def_PerPointValue, |
| | | 'gradeExp':gradeExp % ChConfig.Def_PerPointValue, 'gradeExpPoint':gradeExp / ChConfig.Def_PerPointValue,
|
| | | FBCommon.Over_costTime:costTime, FBCommon.Over_npcTotal:killNPCCnt, 'upPer':upPer, FBCommon.Over_grade:grade}
|
| | | __SendBZZDOverInfo(curPlayer, overDict)
|
| | |
|