| | |
| | |
|
| | | def SendAllMapGlobalDropInfo():
|
| | | # 同步所有地图所有全服掉落控制信息
|
| | | globalDropCDDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD") # {物品ID:分钟, ...}
|
| | | globalDropCDDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 1) # {物品ID:分钟, ...}
|
| | | globalKilledCountDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2) # 全服击杀次数必掉
|
| | | globalDropRateDict = IpyGameDataPY.GetFuncEvalCfg("NPCGlobalDropRate") # {物品ID:[[npcID列表], "概率公式"], ...}
|
| | |
|
| | | for itemID in globalDropCDDict.keys():
|
| | |
| | | killedCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(key)
|
| | | GameWorld.SendMapServerMsgEx(key, killedCnt)
|
| | |
|
| | | for npcID in globalKilledCountDropDict.keys():
|
| | | key = ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID
|
| | | killedCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(key)
|
| | | GameWorld.SendMapServerMsgEx(key, killedCnt)
|
| | | return
|
| | |
|
| | | def UpdGlobalDropCD(msgList):
|
| | |
| | | GameWorld.SendMapServerMsgEx(key, updKilledCnt)
|
| | | return
|
| | |
|
| | | def UpdGlobalKillCount(msgList):
|
| | | ## 更新全局击杀次数
|
| | | npcID, updKilledCnt = msgList
|
| | | key = ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(key, updKilledCnt)
|
| | | GameWorld.SendMapServerMsgEx(key, updKilledCnt)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #//////////////////////////////////////////////////////////////
|
| | | #//01 05 注册副本信息#tagGRegisterFBInfo
|
| | |
| | | if callName =="GlobalDropRate":
|
| | | GameWorldProcess.UpdGlobalDropRate(eval(resultName))
|
| | | return
|
| | | # 全局击杀数统计
|
| | | if callName =="GlobalKillCount":
|
| | | GameWorldProcess.UpdGlobalKillCount(eval(resultName))
|
| | | return
|
| | |
|
| | | # 自定义商店全服限购次数清空
|
| | | if callName =="ShopItemClearBuyCnt":
|
| | |
| | |
|
| | | Def_Notify_WorldKey_LastDropTime = "LastDropTime_%s" # 全局物品上次掉落时间, 参数(itemID)
|
| | | Def_Notify_WorldKey_DropNPCKilledCnt = "DropNPCKilledCnt_%s" # 全局物品绑定的NPC击杀次数, 参数(itemID)
|
| | | Def_Notify_WorldKey_NPCKilledCount = "NPCKilledCount_%s" # 全局NPC被击杀次数, 参数(npcID)
|
| | |
|
| | | Def_Notify_WorldKey_WorldAverageLv = "WorldAverageLv" #世界等级
|
| | | Def_Notify_WorldKey_YdayLoginCnt= 'YdayLoginCnt' # 昨天总在线人数
|
| | |
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCountDrop % npcID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_NPCKillCount % npcID, 0)
|
| | | resetNPCIDList.append(npcID)
|
| | | |
| | | gw = GameWorld.GetGameWorld()
|
| | | globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2)
|
| | | for npcID in globalKillDropDict.keys():
|
| | | killedCount = gw.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID)
|
| | | if not killedCount:
|
| | | continue
|
| | | msgInfo = str([npcID, 0])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalKillCount", msgInfo, len(msgInfo))
|
| | | resetNPCIDList.append(npcID)
|
| | | |
| | | GameWorld.DebugAnswer(curPlayer, "重置OK: %s" % resetNPCIDList)
|
| | | return
|
| | |
|
| | |
| | | msgInfo = str([itemID, updKilledCnt])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalDropRate", msgInfo, len(msgInfo))
|
| | |
|
| | | # 4. 指定全服击杀次数必掉,算额外掉落
|
| | | globalKillDropDict = IpyGameDataPY.GetFuncEvalCfg("GlobalDropCD", 2) # {NPCID:{击杀次数:[是否本职业, [物品ID, ...], [随机物品ID, ...]]}, ...}
|
| | | if npcID in globalKillDropDict:
|
| | | killCountDropDict = globalKillDropDict[npcID]
|
| | | updNPCKilledCount = min(gw.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_NPCKilledCount % npcID) + 1, ShareDefine.Def_UpperLimit_DWord)
|
| | | GameWorld.DebugLog("更新全服击杀次数: %s" % updNPCKilledCount)
|
| | | # 通知GameServer记录
|
| | | msgInfo = str([npcID, updNPCKilledCount])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "GlobalKillCount", msgInfo, len(msgInfo))
|
| | | if updNPCKilledCount in killCountDropDict:
|
| | | isJobLimit, itemIDList, randItemIDList = killCountDropDict[updNPCKilledCount]
|
| | | for itemID in itemIDList:
|
| | | if isJobLimit:
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
|
| | | if not itemData:
|
| | | continue
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | if itemJob and itemJob != curPlayer.GetJob():
|
| | | # 非本职业可用,不掉落
|
| | | GameWorld.DebugLog("全服击杀次数必掉,非本职业可用,不掉落! itemID=%s" % itemID)
|
| | | continue
|
| | | dropItemIDList.append(itemID)
|
| | | GameWorld.DebugLog("全服击杀次数必掉物品: itemID=%s" % itemID)
|
| | | if randItemIDList:
|
| | | if isJobLimit:
|
| | | randJobItemList = []
|
| | | for rItemID in randItemIDList:
|
| | | itemData = GameWorld.GetGameData().GetItemByTypeID(rItemID)
|
| | | if not itemData:
|
| | | continue
|
| | | itemJob = itemData.GetJobLimit() / 100
|
| | | if itemJob and itemJob != curPlayer.GetJob():
|
| | | # 非本职业可用,不掉落
|
| | | GameWorld.DebugLog("全服击杀次数必掉随机,非本职业可用,不掉落! rItemID=%s" % rItemID)
|
| | | continue
|
| | | randJobItemList.append(rItemID)
|
| | | randItemID = random.choice(randJobItemList)
|
| | | else:
|
| | | randItemID = random.choice(randItemIDList)
|
| | | dropItemIDList.append(randItemID)
|
| | | GameWorld.DebugLog("全服击杀次数必掉随机物品: randItemID=%s" % randItemID)
|
| | | |
| | | return dropItemIDList
|
| | |
|
| | | def __GetEquipIDList(npcID, classLV, color, placeList, star, itemJobList, tagPlace=None):
|
| | |
| | |
|
| | | Def_Notify_WorldKey_LastDropTime = "LastDropTime_%s" # 全局物品上次掉落时间, 参数(itemID)
|
| | | Def_Notify_WorldKey_DropNPCKilledCnt = "DropNPCKilledCnt_%s" # 全局物品绑定的NPC击杀次数, 参数(itemID)
|
| | | Def_Notify_WorldKey_NPCKilledCount = "NPCKilledCount_%s" # 全局NPC被击杀次数, 参数(npcID)
|
| | |
|
| | | Def_Notify_WorldKey_WorldAverageLv = "WorldAverageLv" #世界等级
|
| | | Def_Notify_WorldKey_YdayLoginCnt= 'YdayLoginCnt' # 昨天总在线人数
|