hxp
2018-09-12 73f586a3147b956b81e56aa6c6ffdfefa4cff1cc
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -72,9 +72,10 @@
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初始化->出生调用
@@ -140,6 +141,9 @@
    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))
@@ -219,6 +223,7 @@
    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:
@@ -296,6 +301,8 @@
        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]