| | |
| | | ) = 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' # 进入副本时的等级
|
| | |
| | | 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
|