| | |
| | | dict AttrInfo; //属性
|
| | | DWORD SkillID; //技能ID
|
| | | BYTE IsNotify; //是否广播
|
| | | WORD ActivateIndex; //激活索引
|
| | | };
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|
| | |
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 2
|
| | | RegisterPackCount = 3
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x03
|
| | |
| | | PacketSubCMD_2=0x18
|
| | | PacketCallFunc_2=OnLingQiEquipBreak
|
| | |
|
| | | PacketCMD_3=0xA5
|
| | | PacketSubCMD_3=0xC6
|
| | | PacketCallFunc_3=OnEquipPartSuiteActivate
|
| | |
|
| | | ;仙盟抢boss
|
| | | [FamilyRobBoss]
|
| | | ScriptName = GameWorldLogic\FamilyRobBoss.py
|
| | |
| | |
|
| | | #套装
|
| | | Def_PDict_EquipPartSuiteLV = "EQPartSuiteLV_%s_%s" #部位套装等级 参数 部位、套装类型
|
| | | Def_PDict_EquipPartSuiteNotify = "EQPartSuiteNotify_%s" #部位套装提示记录 参数 标记
|
| | | Def_PDict_EquipPartSuiteActivate = "EQPartSuiteActivate_%s" #套装激活记录 参数 key编号
|
| | |
|
| | | #神兽
|
| | | Def_PDict_DogzFightState = "DogzFightState_%s" # 神兽助战状态,参数为key编号,按神兽ID二进制位存储
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # 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):
|
| | |
| | | ("dict", "AttrInfo", 0),
|
| | | ("DWORD", "SkillID", 0),
|
| | | ("BYTE", "IsNotify", 0),
|
| | | ("WORD", "ActivateIndex", 0),
|
| | | ),
|
| | |
|
| | | "WingRefineAttr":(
|
| | |
| | | self.AttrInfo = {}
|
| | | self.SkillID = 0
|
| | | self.IsNotify = 0 |
| | | self.ActivateIndex = 0 |
| | | return |
| | | |
| | | def GetSuiteID(self): return self.SuiteID # 套装ID
|
| | |
| | | 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(): |
| | |
| | | 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
|
| | |
|
| | | ## 刷新所有装备对人物属性的改变
|
| | |
| | | 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)
|
| | |
| | | #技能
|
| | | 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):
|
| | |
| | | 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):
|