| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 12 感应法宝 #tagCMThinkMagicWeapon
|
| | |
|
| | | class tagCMThinkMagicWeapon(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MWID", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x12
|
| | | 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 = 0x12
|
| | | self.MWID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMThinkMagicWeapon)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 12 感应法宝 //tagCMThinkMagicWeapon:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MWID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MWID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMThinkMagicWeapon=tagCMThinkMagicWeapon()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMThinkMagicWeapon.Cmd,m_NAtagCMThinkMagicWeapon.SubCmd))] = m_NAtagCMThinkMagicWeapon
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 11 试用首充武器 #tagCMTryFirstGoldItem
|
| | |
|
| | | class tagCMTryFirstGoldItem(Structure):
|
| | |
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 3
|
| | | RegisterPackCount = 4
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x1D
|
| | |
| | | PacketSubCMD_3=0x15
|
| | | PacketCallFunc_3=OnMagicWeaponUp
|
| | |
|
| | | PacketCMD_4=0xA5
|
| | | PacketSubCMD_4=0x12
|
| | | PacketCallFunc_4=OnThinkMagicWeapon
|
| | |
|
| | | ;副本
|
| | | [FBCommon]
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 12 感应法宝 #tagCMThinkMagicWeapon
|
| | |
|
| | | class tagCMThinkMagicWeapon(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MWID", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x12
|
| | | 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 = 0x12
|
| | | self.MWID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMThinkMagicWeapon)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 12 感应法宝 //tagCMThinkMagicWeapon:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MWID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MWID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMThinkMagicWeapon=tagCMThinkMagicWeapon()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMThinkMagicWeapon.Cmd,m_NAtagCMThinkMagicWeapon.SubCmd))] = m_NAtagCMThinkMagicWeapon
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 11 试用首充武器 #tagCMTryFirstGoldItem
|
| | |
|
| | | class tagCMTryFirstGoldItem(Structure):
|
| | |
| | | #完成祈愿
|
| | | RunQuestEvent(curPlayer, "pray", prayType, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_ThinkMagicWeapon(curPlayer):
|
| | | #感应法宝
|
| | | RunQuestEvent(curPlayer, "thinkfabao", 'thinkfabao', Def_RunQuestType_Normal)
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #================================================================================
|
| | |
| | | if isActive:
|
| | | GameWorld.DebugLog(' 该法宝已开启! mwID=%s' % mwID)
|
| | | return
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID':mwID}, True, False)
|
| | | |
| | | #消耗物品判断
|
| | | ipyData = GetWMIpyData(mwID)
|
| | | needItemDict = ipyData.GetNeedItem()
|
| | |
| | |
|
| | | #扣消耗
|
| | | ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, ChConfig.ItemDel_MagicWeapon)
|
| | | else:
|
| | | elif ipyDataList:
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('XBXZ', {'MWID':mwID}, True, False)
|
| | | if not ipyDataList:
|
| | | return
|
| | | for ipyData in ipyDataList:
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_XBXZAwardRecord, ipyData.GetID()):
|
| | | return
|
| | | |
| | | elif mwID != 101: #定海神针特殊 可直接获得
|
| | | return
|
| | | |
| | | DoActiveMW(curPlayer, mwID)
|
| | | return
|
| | |
|
| | |
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_MagicWeaponIsWear, mwID, state, True)
|
| | | return
|
| | |
|
| | | #// A5 12 感应法宝 #tagCMThinkMagicWeapon
|
| | | #
|
| | | #struct tagCMThinkMagicWeapon
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MWID;
|
| | | #};
|
| | | def OnThinkMagicWeapon(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | mwID = clientData.MWID
|
| | | #只触发任务接口
|
| | | EventShell.EventRespons_ThinkMagicWeapon(curPlayer)
|
| | | return |