| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 07 重置加点 #tagCMResetAttrPoint
|
| | |
|
| | | class tagCMResetAttrPoint(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x07
|
| | | 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 = 0xB2
|
| | | self.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMResetAttrPoint)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 07 重置加点 //tagCMResetAttrPoint:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMResetAttrPoint=tagCMResetAttrPoint()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMResetAttrPoint.Cmd,m_NAtagCMResetAttrPoint.SubCmd))] = m_NAtagCMResetAttrPoint
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #B2 01 脱机挂状态 # tagCMLoginState
|
| | |
|
| | | class tagCMLoginState(Structure):
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 22
|
| | | RegisterPackCount = 23
|
| | |
|
| | | PacketCMD_1 = 0xA5
|
| | | PacketSubCMD_1 = 0x04
|
| | |
| | | PacketSubCMD_22=0x33
|
| | | PacketCallFunc_22=OnClientExitCustomScene
|
| | |
|
| | | PacketCMD_23=0xB2
|
| | | PacketSubCMD_23=0x07
|
| | | PacketCallFunc_23=OnResetAttrPoint
|
| | |
|
| | | ;购买相关的
|
| | | [BuySomething]
|
| | | ScriptName = Event\EventSrc\Operate_PlayerBuyZhenQi.py
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 07 重置加点 #tagCMResetAttrPoint
|
| | |
|
| | | class tagCMResetAttrPoint(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x07
|
| | | 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 = 0xB2
|
| | | self.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMResetAttrPoint)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 07 重置加点 //tagCMResetAttrPoint:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMResetAttrPoint=tagCMResetAttrPoint()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMResetAttrPoint.Cmd,m_NAtagCMResetAttrPoint.SubCmd))] = m_NAtagCMResetAttrPoint
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #B2 01 脱机挂状态 # tagCMLoginState
|
| | |
|
| | | class tagCMLoginState(Structure):
|
| | |
| | | # @param tick
|
| | | # @return None
|
| | | def DoEnterFB(curPlayer, tick):
|
| | | PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 2)
|
| | | PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 3)
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
|
| | |
| | | freePoint = curPlayer.GetFreePoint()
|
| | | curPlayer.SetFreePoint(freePoint + resetPointTotal)
|
| | | ChPlayer.NotifyPlayerBasePoint(curPlayer, resetIDList)
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetAttrID':resetID, 'resetPoint':resetPoint})
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetIDList':resetIDList, 'resetPointTotal':resetPointTotal})
|
| | |
|
| | | #刷新人物所有状态
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | |
| | | import PlayerNewFairyCeremony
|
| | | import PlayerFeastRedPacket
|
| | | import PlayerLuckyTreasure
|
| | | import Item_ResetAttrPoint
|
| | | import CrossRealmPlayer
|
| | | import ChNetSendPack
|
| | | import FamilyRobBoss
|
| | |
| | | playerControl.RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | #// B2 07 重置加点 #tagCMResetAttrPoint
|
| | | #struct tagCMResetAttrPoint
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnResetAttrPoint(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | canResetIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
|
| | | canReset = False
|
| | | for attrID in canResetIDList:
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | if curPoint:
|
| | | canReset = True
|
| | | break
|
| | | if not canReset:
|
| | | GameWorld.DebugLog('重置加点 没有点数需要重置')
|
| | | return
|
| | | isFree = curPlayer.GetLV() < IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 4)
|
| | | if not isFree:
|
| | | needItemID = IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 5)
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, 1)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("重置加点 item(%s) isn't enough" % (needItemID))
|
| | | return
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, 1, False, ChConfig.ItemDel_ResetAttrPoint)
|
| | | |
| | | Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, 0, 0, 0)
|
| | | return
|
| | |
|
| | | def NotifyPlayerBasePoint(curPlayer, syncAttrIDList=[]):
|
| | | # 通知基础属性点,已分配的自由点数
|
| | |
|