Пример #1
0
        public SubPacket CreateSpawnPositonPacket(Player player, ushort spawnType)
        {
            //TODO: FIX THIS IF
            uint      playerActorId = player == null ? 0 : player.actorId; //Get Rid
            SubPacket spawnPacket;

            if (!spawnedFirstTime && playerActorId == actorId)
            {
                spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, 0x1, false);
            }
            else if (playerActorId == actorId)
            {
                spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true);
            }
            else
            {
                if (this is Player)
                {
                    spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, spawnType, false);
                }
                else
                {
                    spawnPacket = SetActorPositionPacket.BuildPacket(actorId, actorId, positionX, positionY, positionZ, rotation, spawnType, false);
                }
            }

            //return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
            spawnedFirstTime = true;

            return(spawnPacket);
        }
Пример #2
0
        public SubPacket CreateSpawnTeleportPacket(ushort spawnType)
        {
            SubPacket spawnPacket;

            spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false);

            //return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);

            //spawnPacket.DebugPrintSubPacket();

            return(spawnPacket);
        }