| | |
| | | #已经是这个状态了
|
| | | continue
|
| | |
|
| | | if state:
|
| | | # 骑宠争夺活动开始前同步有效人数到地图
|
| | | if dailyActionID == ShareDefine.DailyActionID_FamilyRobBoss:
|
| | | GameWorldBoss.SyncMapServer_HorsePetRobBossPlayerCount()
|
| | | |
| | | #通知Mapserver,设置字典
|
| | | GameWorld.SendMapServerMsgEx(dictName, state)
|
| | | #更新字典值
|
| | |
| | | GameWorld.Log("骑宠争夺仙盟击杀Boss数统计: %s" % PyGameData.g_familyKillHorsePetRobBossCntDict)
|
| | | return
|
| | |
|
| | | def SyncMapServer_HorsePetRobBossPlayerCount():
|
| | | ## 活动开始前,同步有效活动人数到地图,作为Boss属性成长系数用
|
| | | |
| | | diffWorldLV = int(IpyGameDataPY.GetFuncCfg("FairyGrabBossID", 3))
|
| | | funcLimitLV = PlayerControl.GetFuncLimitLV(ShareDefine.GameFuncID_HorsePetRobBoss)
|
| | | curWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | minLV = max(funcLimitLV, curWorldLV + diffWorldLV)
|
| | | |
| | | playerCount = 0
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetActivePlayerCount()):
|
| | | findPlayer = playerManager.GetActivePlayerAt(i)
|
| | | if findPlayer == None or not findPlayer.GetInitOK():
|
| | | continue
|
| | | |
| | | if PlayerControl.GetIsTJG(findPlayer):
|
| | | continue
|
| | | |
| | | if not findPlayer.GetFamilyID():
|
| | | continue
|
| | | |
| | | if findPlayer.GetLV() < minLV:
|
| | | continue
|
| | | |
| | | playerCount += 1
|
| | | |
| | | GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_HorsePetRobBossPlayerCount, playerCount)
|
| | | GameWorld.Log("同步骑宠争夺有效参与人数: playerCount=%s,minLV=%s,funcLimitLV=%s,curWorldLV=%s,diffWorldLV=%s" |
| | | % (playerCount, minLV, funcLimitLV, curWorldLV, diffWorldLV))
|
| | | return
|
| | |
|
| | | def OnHorsePetRobBossActionChange(isOpen):
|
| | | ## 骑宠争夺活动状态变更
|
| | |
|
| | |
| | | import GameWorld
|
| | | import IPY_GameServer
|
| | | import MergeBroadcast
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | | import types
|
| | |
| | | sysMsg = '%s'%([actionid, addCnt])
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, "AddFamilyActivity", sysMsg, len(sysMsg))
|
| | | return
|
| | |
|
| | | ## 获取功能限制等级(等级条件为全局)
|
| | | def GetFuncLimitLV(funcID):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("FuncOpenLV", funcID)
|
| | | if not ipyData:
|
| | | return 0
|
| | | |
| | | return ipyData.GetLimitLV()
|
| | |
|
| | |
| | | Def_Notify_WorldKey_BossShuntPlayer = 'BossShuntPlayer' # boss分流玩家信息
|
| | | Def_Notify_WorldKey_BossShuntDeadLine = 'BossShuntDeadLine' # boss分流线路已死亡的线路
|
| | | Def_Notify_WorldKey_BossOnlineHeroCnt = 'BossOnlineHeroCnt_%s' # boss刷新时间用的在线人数, 参数为NPCID
|
| | | Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt = 'FamilyKillHorsePetRobBossCnt' # boss分流线路已死亡的线路
|
| | | Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt = 'FamilyKillHorsePetRobBossCnt' # 仙盟击杀骑宠boss数统计
|
| | | Def_Notify_WorldKey_HorsePetRobBossPlayerCount = 'HorsePetRobBossPlayerCount' # 骑宠争夺活动有效参考人数
|
| | |
|
| | | Def_Notify_WorldKey_FamilyActivityDayState = "FamilyActivityDayState" #战盟相关活动今日开启状态, 按位存储代表今日是否开启过
|
| | |
|
| | |
| | | GameFuncID_DailyQuest = 78 # 日常
|
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | # 以下为暂时无用的
|
| | | GameFuncID_GreatMaster = 28 # 大师
|
| | | GameFuncID_Truck = 33 # 运镖
|
| | |
| | | NPCAttr_ParamDict, # 过程参数公式
|
| | | NPCAttr_AttrStrengthenList, # 等级成长属性公式
|
| | | NPCAttr_PlayerCntCoefficient, # 地图人数对应属性额外成长系数 {mapID:{"属性名":{组队进入人数:系数, ...}, ...}, ...}
|
| | | NPCAttr_NPCPlayerCntCoefficient, # NPC特殊成长人数对应属性额外成长系数 {npcID:{"属性名":{人数:系数, ...}, ...}, ...}, 优先级大于地图人数系数
|
| | | NPCAttr_DynNPCLVMap, # 动态等级的地图ID列表,默认已刷新出来的NPC等级不会再变更,下次刷出来的怪物等级变更 [地图ID, ...]
|
| | | NPCAttr_DynPCCoefficientMap, # 动态人数系数的地图ID {地图ID:是否马上刷新属性, ...}
|
| | | ) = range(5)
|
| | | ) = range(6)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##NPC初始化->出生调用
|
| | |
| | | gameFB = GameWorld.GetGameFB()
|
| | |
|
| | | if strengthenIpyData.GetIsStrengthenByPlayerCount():
|
| | | if FamilyRobBoss.IsHorsePetRobBoss(npcID):
|
| | | strengthenPlayerCnt = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_HorsePetRobBossPlayerCount)
|
| | | else:
|
| | | strengthenPlayerCnt = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NPCStrengthenPlayerCnt)
|
| | | if not strengthenPlayerCnt:
|
| | | GameWorld.ErrLog("NPC配置了按玩家人数成长类型,但是无法获取到对应的玩家人数!npcID=%s" % (npcID))
|
| | |
| | | paramDict = attrStrengthenInfo[NPCAttr_ParamDict] # 过程参数公式字典
|
| | | attrStrengthenList = attrStrengthenInfo[NPCAttr_AttrStrengthenList] # 属性成长公式字典
|
| | | playerCntCoefficient = attrStrengthenInfo[NPCAttr_PlayerCntCoefficient] # 人数系数
|
| | | npcIDPlayerCntCoefficient = attrStrengthenInfo[NPCAttr_NPCPlayerCntCoefficient] # 特殊NPC人数系数
|
| | | baseMaxHP = npcData.GetHPEx() * ShareDefine.Def_PerPointValue + npcData.GetHP()
|
| | |
|
| | | if strengthenLV:
|
| | |
| | | playerCntAttrCoefficient = playerCntCoefficient.get(mapID, {})
|
| | | if not playerCntAttrCoefficient and dataMapID in playerCntCoefficient:
|
| | | playerCntAttrCoefficient = playerCntCoefficient[dataMapID]
|
| | | if npcID in npcIDPlayerCntCoefficient:
|
| | | playerCntAttrCoefficient = npcIDPlayerCntCoefficient[npcID]
|
| | | for attrKey, coefficientDict in playerCntAttrCoefficient.items():
|
| | | if attrKey in attrDict:
|
| | | attrValue = attrDict[attrKey]
|
| | |
| | | Def_Notify_WorldKey_BossShuntPlayer = 'BossShuntPlayer' # boss分流玩家信息
|
| | | Def_Notify_WorldKey_BossShuntDeadLine = 'BossShuntDeadLine' # boss分流线路已死亡的线路
|
| | | Def_Notify_WorldKey_BossOnlineHeroCnt = 'BossOnlineHeroCnt_%s' # boss刷新时间用的在线人数, 参数为NPCID
|
| | | Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt = 'FamilyKillHorsePetRobBossCnt' # boss分流线路已死亡的线路
|
| | | Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt = 'FamilyKillHorsePetRobBossCnt' # 仙盟击杀骑宠boss数统计
|
| | | Def_Notify_WorldKey_HorsePetRobBossPlayerCount = 'HorsePetRobBossPlayerCount' # 骑宠争夺活动有效参考人数
|
| | |
|
| | | Def_Notify_WorldKey_FamilyActivityDayState = "FamilyActivityDayState" #战盟相关活动今日开启状态, 按位存储代表今日是否开启过
|
| | |
|
| | |
| | | GameFuncID_DailyQuest = 78 # 日常
|
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | # 以下为暂时无用的
|
| | | GameFuncID_GreatMaster = 28 # 大师
|
| | | GameFuncID_Truck = 33 # 运镖
|