8374 【后端】【主干】通知客户端攻击封包增加专精技能(改为用扩展属性 ExAttr7、ExAttr8 通知)
2个文件已修改
56 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -6123,16 +6123,16 @@
    #EventReport.WriteEvent_lost_zhenqi(curPlayer, eventName, eventData, lostValue, value)
    return True
## SP真气值
def GetZhenQi(curPlayer): return curPlayer.GetExAttr8() * ChConfig.Def_PerPointValue + curPlayer.GetExAttr7()
## SP真气值 - 暂废弃 ExAttr7、ExAttr8 改为专精选择通知,用于前端表现其他玩家的不同专精特效
def GetZhenQi(curPlayer): return 0 #curPlayer.GetExAttr8() * ChConfig.Def_PerPointValue + curPlayer.GetExAttr7()
def SetZhenQi(curPlayer, totalZhenQi):
    zhenQi = totalZhenQi % ChConfig.Def_PerPointValue
    zhenQiPoint = min(totalZhenQi / ChConfig.Def_PerPointValue, ChConfig.Def_UpperLimit_DWord)
    # 玩家单独通知,不广播; c++接口默认广播,故这里设置False
    if zhenQi != curPlayer.GetExAttr7():
        curPlayer.SetExAttr7(zhenQi)
    if zhenQiPoint != curPlayer.GetExAttr8():
        curPlayer.SetExAttr8(zhenQiPoint)
#    zhenQi = totalZhenQi % ChConfig.Def_PerPointValue
#    zhenQiPoint = min(totalZhenQi / ChConfig.Def_PerPointValue, ChConfig.Def_UpperLimit_DWord)
#    # 玩家单独通知,不广播; c++接口默认广播,故这里设置False
#    if zhenQi != curPlayer.GetExAttr7():
#        curPlayer.SetExAttr7(zhenQi)
#    if zhenQiPoint != curPlayer.GetExAttr8():
#        curPlayer.SetExAttr8(zhenQiPoint)
    return
#===============================================================================
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -2133,7 +2133,7 @@
            GameWorld.DebugLog('更换专精 不成功 selectSkillID=%s'%selectSkillID)
            return
        
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
        UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID)
        #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
        if curElementSkillID and curElementSkillID != selectSkillID:
            #原技能删除
@@ -2148,6 +2148,40 @@
        curControl.RefreshPlayerAttrState()
       
    NotifyElementSkillInfo(curPlayer, mainSkillID, selectSkillID if updSelectSkillLV != activeSkillLV else 0)
    return
def UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID):
    ## 更新专精技能选择, selectSkillID 可能被重置为0
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
    #GameWorld.DebugLog("更新专精技能选择  mainSkillID=%s, selectSkillID=%s" % (mainSkillID, selectSkillID))
    # 以下额外更新选择的专精技能对应编号,用于表现其他玩家不同专精技能特效用
    mainSkillList = IpyGameDataPY.GetFuncEvalCfg("SkillActTypeIdSort", curPlayer.GetJob())
    if mainSkillID not in mainSkillList:
        return
    mainSkillIndex = mainSkillList.index(mainSkillID)
    if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
        exAttrValue = curPlayer.GetExAttr7()
        exAttrIndex = mainSkillIndex
    else:
        exAttrValue = curPlayer.GetExAttr8()
        exAttrIndex = mainSkillIndex - ShareDefine.Def_PDictDigitCnt
    elementSkillNum = 0
    if selectSkillID:
        ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', selectSkillID)
        if ipyData:
            elementSkillNum = ipyData.GetElementSkillNum()
    updExAttrValue = GameWorld.ChangeDataByDigitPlace(exAttrValue, exAttrIndex, elementSkillNum)
    #GameWorld.DebugLog("    exAttrValue=%s,exAttrIndex=%s,elementSkillNum=%s,updExAttrValue=%s"
    #                   % (exAttrValue, exAttrIndex, elementSkillNum, updExAttrValue))
    # 需要广播周围玩家
    if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
        curPlayer.SetExAttr7(updExAttrValue, True)
    else:
        curPlayer.SetExAttr8(updExAttrValue, True)
    return
def RefreshElementSkill(curPlayer, skillTypeID, isChangeLV=True):
@@ -2192,7 +2226,7 @@
        if updSkillLV == 0:#重置为未选状态
            ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', skillTypeID)
            mainSkillID = ipyData.GetMainSkillID()
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, 0)
            UpdateElementSkillSelect(curPlayer, mainSkillID, 0)
            #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
            isNotify = True
    else: