hxp
2019-10-30 149afba0633985377f570abfc51e70508db15e2e
8325 【主干】【后端】套装属性增加激活功能
9个文件已修改
352 ■■■■■ 已修改文件
PySysDB/PySysDBPY.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PySysDB/PySysDBPY.h
@@ -437,6 +437,7 @@
    dict        AttrInfo;    //属性
    DWORD        SkillID;    //技能ID
    BYTE        IsNotify;    //是否广播
    WORD        ActivateIndex;    //激活索引
};
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -9373,6 +9373,70 @@
#------------------------------------------------------
# A5 C6 装备部位星级套装激活 #tagCMEquipPartSuiteActivate
class  tagCMEquipPartSuiteActivate(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("ClassLV", c_ubyte),    # 所属装备阶
                  ("SuiteID", c_ushort),    # 套装ID
                  ("SuiteCount", c_ubyte),    # 件数
                  ("Star", c_ubyte),    # 星数
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA5
        self.SubCmd = 0xC6
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xA5
        self.SubCmd = 0xC6
        self.ClassLV = 0
        self.SuiteID = 0
        self.SuiteCount = 0
        self.Star = 0
        return
    def GetLength(self):
        return sizeof(tagCMEquipPartSuiteActivate)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A5 C6 装备部位星级套装激活 //tagCMEquipPartSuiteActivate:
                                Cmd:%s,
                                SubCmd:%s,
                                ClassLV:%d,
                                SuiteID:%d,
                                SuiteCount:%d,
                                Star:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.ClassLV,
                                self.SuiteID,
                                self.SuiteCount,
                                self.Star
                                )
        return DumpString
m_NAtagCMEquipPartSuiteActivate=tagCMEquipPartSuiteActivate()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipPartSuiteActivate.Cmd,m_NAtagCMEquipPartSuiteActivate.SubCmd))] = m_NAtagCMEquipPartSuiteActivate
#------------------------------------------------------
# A5 48 兑换大师等级经验 #tagCMExchangeMasterEXP
class  tagCMExchangeMasterEXP(Structure):
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -14104,6 +14104,73 @@
#------------------------------------------------------
# A3 B2 装备部位星级套装激活信息 #tagMCEquipPartSuiteActivateInfo
class  tagMCEquipPartSuiteActivateInfo(Structure):
    Head = tagHead()
    Count = 0    #(BYTE Count)
    SuiteActivateStateInfo = list()    #(vector<DWORD> SuiteActivateStateInfo)//激活状态值列表,每个数按位存31个激活索引,每个位代表对应的激活索引是否已激活
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA3
        self.Head.SubCmd = 0xB2
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Count):
            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
            self.SuiteActivateStateInfo.append(value)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA3
        self.Head.SubCmd = 0xB2
        self.Count = 0
        self.SuiteActivateStateInfo = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        length += 4 * self.Count
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteBYTE(data, self.Count)
        for i in range(self.Count):
            data = CommFunc.WriteDWORD(data, self.SuiteActivateStateInfo[i])
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Count:%d,
                                SuiteActivateStateInfo:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Count,
                                "..."
                                )
        return DumpString
m_NAtagMCEquipPartSuiteActivateInfo=tagMCEquipPartSuiteActivateInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCEquipPartSuiteActivateInfo.Head.Cmd,m_NAtagMCEquipPartSuiteActivateInfo.Head.SubCmd))] = m_NAtagMCEquipPartSuiteActivateInfo
#------------------------------------------------------
# A3 BB 装备位洗练属性信息 #tagMCEquipPartXLAttrInfo
class  tagMCEquipPartXLAttrValue(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1244,7 +1244,7 @@
Writer = xdh
Releaser = xdh
RegType = 0
RegisterPackCount = 2
RegisterPackCount = 3
PacketCMD_1=0xA5
PacketSubCMD_1=0x03
@@ -1254,6 +1254,10 @@
PacketSubCMD_2=0x18
PacketCallFunc_2=OnLingQiEquipBreak
PacketCMD_3=0xA5
PacketSubCMD_3=0xC6
PacketCallFunc_3=OnEquipPartSuiteActivate
;仙盟抢boss
[FamilyRobBoss]
ScriptName = GameWorldLogic\FamilyRobBoss.py
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3946,7 +3946,7 @@
#套装
Def_PDict_EquipPartSuiteLV = "EQPartSuiteLV_%s_%s" #部位套装等级 参数 部位、套装类型
Def_PDict_EquipPartSuiteNotify = "EQPartSuiteNotify_%s" #部位套装提示记录 参数 标记
Def_PDict_EquipPartSuiteActivate = "EQPartSuiteActivate_%s" #套装激活记录 参数 key编号
#神兽
Def_PDict_DogzFightState = "DogzFightState_%s" # 神兽助战状态,参数为key编号,按神兽ID二进制位存储
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -9373,6 +9373,70 @@
#------------------------------------------------------
# A5 C6 装备部位星级套装激活 #tagCMEquipPartSuiteActivate
class  tagCMEquipPartSuiteActivate(Structure):
    _pack_ = 1
    _fields_ = [
                  ("Cmd", c_ubyte),
                  ("SubCmd", c_ubyte),
                  ("ClassLV", c_ubyte),    # 所属装备阶
                  ("SuiteID", c_ushort),    # 套装ID
                  ("SuiteCount", c_ubyte),    # 件数
                  ("Star", c_ubyte),    # 星数
                  ]
    def __init__(self):
        self.Clear()
        self.Cmd = 0xA5
        self.SubCmd = 0xC6
        return
    def ReadData(self, stringData, _pos=0, _len=0):
        self.Clear()
        memmove(addressof(self), stringData[_pos:], self.GetLength())
        return _pos + self.GetLength()
    def Clear(self):
        self.Cmd = 0xA5
        self.SubCmd = 0xC6
        self.ClassLV = 0
        self.SuiteID = 0
        self.SuiteCount = 0
        self.Star = 0
        return
    def GetLength(self):
        return sizeof(tagCMEquipPartSuiteActivate)
    def GetBuffer(self):
        return string_at(addressof(self), self.GetLength())
    def OutputString(self):
        DumpString = '''// A5 C6 装备部位星级套装激活 //tagCMEquipPartSuiteActivate:
                                Cmd:%s,
                                SubCmd:%s,
                                ClassLV:%d,
                                SuiteID:%d,
                                SuiteCount:%d,
                                Star:%d
                                '''\
                                %(
                                self.Cmd,
                                self.SubCmd,
                                self.ClassLV,
                                self.SuiteID,
                                self.SuiteCount,
                                self.Star
                                )
        return DumpString
m_NAtagCMEquipPartSuiteActivate=tagCMEquipPartSuiteActivate()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMEquipPartSuiteActivate.Cmd,m_NAtagCMEquipPartSuiteActivate.SubCmd))] = m_NAtagCMEquipPartSuiteActivate
#------------------------------------------------------
# A5 48 兑换大师等级经验 #tagCMExchangeMasterEXP
class  tagCMExchangeMasterEXP(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -14104,6 +14104,73 @@
#------------------------------------------------------
# A3 B2 装备部位星级套装激活信息 #tagMCEquipPartSuiteActivateInfo
class  tagMCEquipPartSuiteActivateInfo(Structure):
    Head = tagHead()
    Count = 0    #(BYTE Count)
    SuiteActivateStateInfo = list()    #(vector<DWORD> SuiteActivateStateInfo)//激活状态值列表,每个数按位存31个激活索引,每个位代表对应的激活索引是否已激活
    data = None
    def __init__(self):
        self.Clear()
        self.Head.Cmd = 0xA3
        self.Head.SubCmd = 0xB2
        return
    def ReadData(self, _lpData, _pos=0, _Len=0):
        self.Clear()
        _pos = self.Head.ReadData(_lpData, _pos)
        self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
        for i in range(self.Count):
            value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
            self.SuiteActivateStateInfo.append(value)
        return _pos
    def Clear(self):
        self.Head = tagHead()
        self.Head.Clear()
        self.Head.Cmd = 0xA3
        self.Head.SubCmd = 0xB2
        self.Count = 0
        self.SuiteActivateStateInfo = list()
        return
    def GetLength(self):
        length = 0
        length += self.Head.GetLength()
        length += 1
        length += 4 * self.Count
        return length
    def GetBuffer(self):
        data = ''
        data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
        data = CommFunc.WriteBYTE(data, self.Count)
        for i in range(self.Count):
            data = CommFunc.WriteDWORD(data, self.SuiteActivateStateInfo[i])
        return data
    def OutputString(self):
        DumpString = '''
                                Head:%s,
                                Count:%d,
                                SuiteActivateStateInfo:%s
                                '''\
                                %(
                                self.Head.OutputString(),
                                self.Count,
                                "..."
                                )
        return DumpString
m_NAtagMCEquipPartSuiteActivateInfo=tagMCEquipPartSuiteActivateInfo()
ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCEquipPartSuiteActivateInfo.Head.Cmd,m_NAtagMCEquipPartSuiteActivateInfo.Head.SubCmd))] = m_NAtagMCEquipPartSuiteActivateInfo
#------------------------------------------------------
# A3 BB 装备位洗练属性信息 #tagMCEquipPartXLAttrInfo
class  tagMCEquipPartXLAttrValue(Structure):
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -366,6 +366,7 @@
                        ("dict", "AttrInfo", 0),
                        ("DWORD", "SkillID", 0),
                        ("BYTE", "IsNotify", 0),
                        ("WORD", "ActivateIndex", 0),
                        ),
                "WingRefineAttr":(
@@ -2234,6 +2235,7 @@
        self.AttrInfo = {}
        self.SkillID = 0
        self.IsNotify = 0
        self.ActivateIndex = 0
        return
        
    def GetSuiteID(self): return self.SuiteID # 套装ID
@@ -2242,6 +2244,7 @@
    def GetAttrInfo(self): return self.AttrInfo # 属性
    def GetSkillID(self): return self.SkillID # 技能ID
    def GetIsNotify(self): return self.IsNotify # 是否广播
    def GetActivateIndex(self): return self.ActivateIndex # 激活索引
# 羽翼精炼属性表
class IPY_WingRefineAttr():
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -325,6 +325,7 @@
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalStoneLV, totalStoneLV)
    GameWorld.DebugLog("登录更新装备相关值汇总: orangeEquipCount=%s,totalStar=%s,totalPlusLV=%s,totalEvolveLV=%s,totalWashLV=%s,totalStoneLV=%s" 
                       % (orangeEquipCount, totalStar, totalPlusLV, totalEvolveLV, totalWashLV, totalStoneLV)) 
    Sync_EquipPartSuiteActivateInfo(curPlayer)
    return
## 刷新所有装备对人物属性的改变
@@ -1039,7 +1040,10 @@
            suiteCnt = ipyData.GetSuiteCnt()
            needStar = ipyData.GetStar()
            skillID = ipyData.GetSkillID()
            if [1 if star >= needStar else 0 for star in starList].count(1) >= suiteCnt:
            activateIndex = ipyData.GetActivateIndex()
            isActivate = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteActivate, activateIndex)
            #GameWorld.DebugLog("suiteID=%s,suiteCnt=%s,needStar=%s,isActivate=%s" % (suiteID, suiteCnt, needStar, isActivate))
            if isActivate and [1 if star >= needStar else 0 for star in starList].count(1) >= suiteCnt:
                #GameWorld.DebugLog("    套装: suiteID=%s,suiteCnt=%s,needStar=%s" % (suiteID, suiteCnt, needStar))
                for attrID, attrValue in ipyData.GetAttrInfo().items():
                    PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListSuit)
@@ -1047,11 +1051,11 @@
                #技能
                if skillID and not skillManager.FindSkillBySkillTypeID(skillID):
                    learnSkillList.append(skillID)
                #广播
                notifyMark = ipyData.GetIsNotify()
                if notifyMark and not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteNotify, notifyMark):
                    PlayerControl.WorldNotify(0, 'AllStarLevelUp' if needStar else 'AllStarLevelUp2', [playerName, suiteID, suiteCnt, needStar])
                    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteNotify, notifyMark, 1)
#                #广播,改为激活时广播即可
#                notifyMark = ipyData.GetIsNotify()
#                if notifyMark and not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteNotify, notifyMark):
#                    PlayerControl.WorldNotify(0, 'AllStarLevelUp' if needStar else 'AllStarLevelUp2', [playerName, suiteID, suiteCnt, needStar])
#                    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteNotify, notifyMark, 1)
            else:
                if skillID and skillManager.FindSkillBySkillTypeID(skillID):
@@ -1071,6 +1075,68 @@
        PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer)    
    return
#// A5 C6 装备部位星级套装激活 #tagCMEquipPartSuiteActivate
#
#struct    tagCMEquipPartSuiteActivate
#{
#    tagHead        Head;
#    BYTE    ClassLV;    // 所属装备阶
#    WORD    SuiteID;    // 套装ID
#    BYTE    SuiteCount;    // 件数
#    BYTE    Star;    // 星数
#};
def OnEquipPartSuiteActivate(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    classLV = clientData.ClassLV
    suiteID = clientData.SuiteID
    suiteCount = clientData.SuiteCount
    star = clientData.Star
    ipyDataList = IpyGameDataPY.GetIpyGameDataList('EquipSuitAttr', suiteID)
    if not ipyDataList:
        return
    actIpyData = None
    for ipyData in ipyDataList:
        needCount = ipyData.GetSuiteCnt()
        needStar = ipyData.GetStar()
        if suiteCount == needCount and star == needStar:
            actIpyData = ipyData
            break
    if not actIpyData:
        return
    activateIndex = actIpyData.GetActivateIndex()
    # 这里就不判断是否满足件数、星数条件了,算属性的时候本身也是条件之一,是否激活只是附加条件,这里只处理激活状态变更,能否激活前端判断即可
    isActivate = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteActivate, activateIndex)
    if isActivate:
        return
    GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_EquipPartSuiteActivate, activateIndex, 1)
    Sync_EquipPartSuiteActivateInfo(curPlayer)
    #广播
    notifyMark = actIpyData.GetIsNotify()
    if notifyMark:
        PlayerControl.WorldNotify(0, 'AllStarLevelUp' if needStar else 'AllStarLevelUp2', [curPlayer.GetPlayerName(), suiteID, suiteCount, star])
    RefreshPlayerEquipAttribute(curPlayer, classLV)
    #刷新所有属性
    playControl = PlayerControl.PlayerControl(curPlayer)
    playControl.RefreshPlayerAttrState()
    return
def Sync_EquipPartSuiteActivateInfo(curPlayer):
    ## 同步装备位星级套装激活状态信息
    keyCount = 10
    activateStateList = []
    for i in xrange(keyCount):
        activateStateList.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_EquipPartSuiteActivate % i))
    if activateStateList.count(0) == keyCount:
        return
    activateInfo = ChPyNetSendPack.tagMCEquipPartSuiteActivateInfo()
    activateInfo.SuiteActivateStateInfo = activateStateList
    activateInfo.Count = len(activateInfo.SuiteActivateStateInfo)
    NetPackCommon.SendFakePack(curPlayer, activateInfo)
    return
##全身橙色装备数量触发相关(包含橙色品质以上的装备数量)
def OnOrangeQualityCntChange(curPlayer, orangeQualityCnt):