5372 【后端】【1.4】聚魂副本开发(npc速度通知)
| | |
| | |
|
| | | m_NAtagPlayerReborn=tagPlayerReborn()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagPlayerReborn.Cmd,m_NAtagPlayerReborn.SubCmd))] = m_NAtagPlayerReborn
|
| | |
|
| | | #04 18 周围对象刷新#tagObjInfoRefresh
|
| | |
|
| | | class tagObjInfoRefresh(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ObjID", c_int), |
| | | ("ObjType", c_ubyte), |
| | | ("RefreshType", c_ubyte), |
| | | ("Value", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0x04
|
| | | self.SubCmd = 0x18
|
| | | 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 = 0x04
|
| | | self.SubCmd = 0x18
|
| | | self.ObjID = 0
|
| | | self.ObjType = 0
|
| | | self.RefreshType = 0
|
| | | self.Value = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagObjInfoRefresh)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''//04 18 周围对象刷新//tagObjInfoRefresh:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ObjID:%d,
|
| | | ObjType:%d,
|
| | | RefreshType:%d,
|
| | | Value:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ObjID,
|
| | | self.ObjType,
|
| | | self.RefreshType,
|
| | | self.Value
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagObjInfoRefresh=tagObjInfoRefresh()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagObjInfoRefresh.Cmd,m_NAtagObjInfoRefresh.SubCmd))] = m_NAtagObjInfoRefresh
|
| | |
| | | import SkillShell
|
| | | import BuffSkill
|
| | | import BaseAttack
|
| | | import PlayerTruck
|
| | | import ChNetSendPack
|
| | | import SkillCommon
|
| | | import AttackCommon
|
| | | import ItemControler
|
| | |
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_SpeedPer, 0)
|
| | | return
|
| | | speed = int(curNPC.GetSpeed() * (ShareDefine.Def_MaxRateValue) / max(100.0, float(ShareDefine.Def_MaxRateValue + speedPer)))
|
| | | |
| | | curNPC.SetSpeed(speed)
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_SpeedPer, speedPer)
|
| | | if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_GatherSoul:
|
| | | #目前只在聚魂副本里通知
|
| | | NPCSpeedChangeNotify(curNPC, speed)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | GameWorld.DebugLog("通知GameServer地图Boss分流信息: mapID=%s,lineID=%s,shuntPlayerDict=%s" % (mapID, lineID, shuntPlayerDict), lineID)
|
| | | return
|
| | |
|
| | | def NPCSpeedChangeNotify(curNPC, speed):
|
| | | ##通知NPC速度
|
| | | sendPack = ChNetSendPack.tagObjInfoRefresh()
|
| | | sendPack.Clear()
|
| | | sendPack.ObjID = curNPC.GetID()
|
| | | sendPack.ObjType = curNPC.GetGameObjType()
|
| | | sendPack.RefreshType = IPY_GameWorld.CDBPlayerRefresh_Speed
|
| | | sendPack.Value = speed
|
| | | curNPC.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength())
|
| | | return
|