addByteArray() public method

public addByteArray ( byte array ) : void
array byte
return void
Esempio n. 1
0
        public void sendMarketPlaceList(WorldClient client)
        {
            // ToDo: make it dynamic with database later (but the "handler" should give the items as arguments for this method
            // List Marketplace Items

            byte[] headerSeperator = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

            // Should foreach this later on "Real Server"
            DynamicArray listItems = new DynamicArray();
            listItems.append(StringUtils.hexStringToBytes("8703000000000034bdcf1200401f00000310db6a4a")); // Foot Wear
            listItems.append(0x00); // Seperate each item

            listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd012000000FFFF01aedc6a4a")); // Google
            listItems.append(0x00); // Seperate each item

            listItems.append(StringUtils.hexStringToBytes("721a000003a04a000bd012000000FFFF01aedc6a4a")); // Item Data
            listItems.append(0x00); // Seperate each item

            listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd01200000000FF01aedc6a4a")); // Item Data
            listItems.append(0x00); // Seperate each item

            // get data size
            byte[] itemSize = NumericalUtils.uint16ToByteArray((UInt16)listItems.getBytes().Length, 1);

            PacketContent pak = new PacketContent();
            pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOAD_MARKERPLACE, 0);
            pak.addUintShort(9); // list offset
            pak.addByteArray(headerSeperator);
            pak.addUint16((UInt16)listItems.getBytes().Length,1);
            pak.addByteArray(listItems.getBytes());
            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
        }
Esempio n. 2
0
        public void sendEmotePerform(WorldClient client, UInt32 emoteID)
        {
            double x = 0; double y = 0; double z = 0;
            byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue();
            NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z);
            int rotation = (int)Store.currentClient.playerInstance.YawInterval.getValue()[0];
            float xPos = (float)x;
            float yPos = (float)y;
            float zPos = (float)z;

            /*
            byte sampleEmoteMsg[] =
            {
                0x03, 0x02, 0x00, 0x01, 0x28, 0xAA, 0x40, 0x00, 0x25, 0x01, 0x00, 0x00, 0x10, 0xBB, 0xBB, 0xBB,
                0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xDD, 0x2A, 0x9F, 0x1E, 0x20, 0x00, 0x00,
            };*/

            // Example REsponse for /rolldice  02 03 02 00 01 28 01 40 00 25 <ID> 00 00 10 cd a7 65 c7 00 00 be 42 33 ff 72 46 b9 51 32 22 00 00
            // Example REsponse for /rolldice  02 03 02 00 01 28 01 40 00 25 5c 00 00 10 cd a7 65 c7 00 00 be 42 33 ff 72 46 b9 51 32 22 00 00
            // Example Response for ClapEmote: 02 03 02 00 01 28 06 40 00 25 04 00 00 10 34 49 84 c7 00 00 be 42 27 a4 7f 46 b3 a6 5e 18 00 00
            // Python Example self.emotePacket="\x02\x03\x02\x00\x01\x28<emoteNum>\x40\x00\x25<emoteID>\x00\x00\x10<coordX><coordY><coordZ>\x2a\x9f\x1e\x20\x00\x00"
            //                                 02 03 02 00 01 28 01 40 00 25 01 00 00 ea 33 47 00 00 be 42 80 55 bd c7 b9 51 32 22 00 00

            // ToDo: parse list and get the f*****g id from uint
            DataLoader objectLoader = DataLoader.getInstance();
            byte emoteByte = new byte();
            emoteByte = objectLoader.findEmoteByLongId(emoteID);

            if(emoteByte>0)
            {
                byte[] emotePak = { 0x01, 0x28, 0x01, 0x40, 0x00, 0x25, emoteByte, 0x00, 0x00, 0x10 };
                PacketContent pak = new PacketContent();
                pak.addUint16(2, 1);
                pak.addByteArray(emotePak);
                pak.addFloatLtVector3f(xPos, yPos, zPos);
                pak.addHexBytes("b9513222"); // We dont know what they are - maybe rotation ?
                pak.addByte(0x00);
                //pak.addByteArray(client.playerInstance.Position.getValue());
                client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
                client.flushQueue();
            }
        }
Esempio n. 3
0
        public void sendSystemChatMessage(WorldClient client, string message, string type)
        {
            byte typeByte;
            switch (type)
            {

                case "SYSTEM":
                    typeByte = 0x07;
                    break;
                case "MODAL":
                    typeByte = 0x17;
                    break;
                case "FRAMEMODAL":
                    typeByte = 0xd7;
                    break;
                case "BROADCAST":
                    typeByte = 0xc7;
                    break;

                default:
                    typeByte = 0x07;
                    break;
            }

            UInt16 messageSize = (UInt16)(message.Length + 1);

            byte[] hexContents = StringUtils.hexStringToBytes("00000000000000000024000000000000000000000000000000000000000000000000");

            PacketContent pak = new PacketContent();
            pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE);
            pak.addByte(typeByte);
            pak.addByteArray(hexContents);
            pak.addSizedTerminatedString(message);

            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
            client.flushQueue();
        }
Esempio n. 4
0
        public void processHyperJump(ref byte[] packet)
        {
            byte[]       destXBytes = new byte[8];
            byte[]       destYBytes = new byte[8];
            byte[]       destZBytes = new byte[8];
            byte[]       maxHeight  = new byte[4];
            byte[]       theLast4   = new byte[4]; // we dont know what this is lol
            DynamicArray restBytes  = new DynamicArray();

            ArrayUtils.copy(packet, 0, destXBytes, 0, 8);
            ArrayUtils.copy(packet, 8, destYBytes, 0, 8);
            ArrayUtils.copy(packet, 16, destZBytes, 0, 8);
            ArrayUtils.copy(packet, 30, maxHeight, 0, 4);
            ArrayUtils.copy(packet, packet.Length - 4, theLast4, 0, 4);

            // Players current X Z Y
            double x = 0; double y = 0; double z = 0;

            byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue();
            NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z);
            int   rotation = (int)Store.currentClient.playerInstance.YawInterval.getValue()[0];
            float xPos     = (float)x;
            float yPos     = (float)y;
            float zPos     = (float)z;

            float xDestFloat = (float)NumericalUtils.byteArrayToDouble(destXBytes, 1);
            float yDestFloat = (float)NumericalUtils.byteArrayToDouble(destYBytes, 1);
            float zDestFloat = (float)NumericalUtils.byteArrayToDouble(destZBytes, 1);

            float  distance = getDistance(xPos, yPos, zPos, xDestFloat, yDestFloat, zDestFloat);
            UInt16 duration = (UInt16)(distance * 1.5);
            //UInt32 startTime = TimeUtils.getUnixTimeUint32() - 100000;
            //UInt32 endTime = startTime + duration;

            UInt32        startTime = TimeUtils.getUnixTimeUint32();
            UInt32        endTime   = startTime + duration;
            PacketContent pak       = new PacketContent();

            pak.addByte(0x02);
            pak.addByte(0x00);
            pak.addByte(0x03);
            pak.addByte(0x09);
            pak.addByte(0x08);
            pak.addByte(0x00);
            pak.addFloatLtVector3f(xPos, yPos, zPos);
            pak.addUint32(startTime, 1);
            pak.addByte(0x80);
            pak.addByte(0x80);
            pak.addByte(0xb8);
            pak.addByte(0x14); // if 0xb8
            pak.addByte(0x00); // if 0xb8
            pak.addUint32(endTime, 1);
            pak.addByteArray(destXBytes);
            pak.addByteArray(destYBytes);
            pak.addByteArray(destZBytes);
            pak.addByteArray(new byte[] { 0x10, 0xff, 0xff });
            pak.addByte(0x00);
            pak.addByte(0x00);
            pak.addByte(0x00);
            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), true);
        }
        public void processOpenDoor(StaticWorldObject door)
        {
            UInt16 typeId = NumericalUtils.ByteArrayToUint16(door.type, 1);

            byte[] masterViewId = { 0x01, 0x00 };
            byte[] seperator    = { 0xcd, 0xab };

            Store.currentClient.playerData.newViewIdCounter++; // It is just for a test Later we will change this to have a List with Views and Object IDs

            byte[] disarmDifficultyMaybe = { 0x03, 0x84 };
            byte[] endViewID             = { 0x00, 0x00 };

            byte[] spawnCounter = NumericalUtils.uint16ToByteArrayShort(Store.currentClient.playerData.assignSpawnIdCounter());
            Output.WriteLine("[DOOR]POS X : " + door.pos_x.ToString() + " POS Y: " + door.pos_y.ToString() + " POS Z: " + door.pos_z.ToString() + ", TypeId: " + StringUtils.bytesToString_NS(door.type));

            switch (typeId)
            {
            case 417:
            case 419:
                // ToDo: Packet Format for Elevator
                // 02 03 01 00
                // 08
                // a3 01
                // 6b 01 f0 3d be
                // cd ab 03 88 00 00 00 00 ff ff 7f 3f 00 00 00 00 f3 04 35 33
                // 22 00 00 00 00 40 f4 fb 40 00 00 00 00 00 90 75 40 00 00 00 00 00 40 af 40 ff ff ff ff 19 00 00
                // 11 00 01 00 04 61 97 e1 47 f0 bf 2d 44 de 30 35 45 00 00
                PacketContent content = new PacketContent();
                content.addByteArray(masterViewId);
                content.addByte(0x08);
                content.addByteArray(door.type);
                content.addByteArray(NumericalUtils.uint32ToByteArray(door.mxoId, 1));
                content.addByteArray(spawnCounter);                            // Spawn Object Counter
                content.addByteArray(seperator);
                content.addByte(0x03);                                         // Number of Attributes to parse (3)
                content.addByte(0x88);                                         // GROUP 1 - more groups ON, Attribute 4 (305,Orientation,LTQuaternion,16) SET (10001000)
                content.addByteArray(StringUtils.hexStringToBytes(door.quat)); // ToDo: replace it later with the real LTQuaternion
                content.addByte(0x22);                                         // GROUP 2 - more groups OFF, Attribute 2,6  SET (00100010)
                content.addDoubleLtVector3d(door.pos_x, door.pos_y, door.pos_z);
                content.addByteArray(new byte[] { 0xff, 0xff, 0xff, 0xff });
                content.addByteArray(NumericalUtils.uint16ToByteArray(Store.currentClient.playerData.newViewIdCounter, 1));
                content.addByteArray(endViewID);
                content.addByte(0x00);
                Store.currentClient.messageQueue.addObjectMessage(content.returnFinalPacket(), false);
                break;

            case 2506:
                // ToDo: Packet Format for Elevator


                break;

            default:

                PacketContent contentDefault = new PacketContent();
                contentDefault.addByteArray(masterViewId);
                contentDefault.addByte(0x08);
                contentDefault.addByteArray(door.type);
                contentDefault.addByteArray(NumericalUtils.uint32ToByteArray(door.mxoId, 1));
                contentDefault.addByteArray(spawnCounter);     // Spawn Object Counter
                contentDefault.addByteArray(seperator);
                contentDefault.addByteArray(disarmDifficultyMaybe);
                contentDefault.addByte(0x00);                                                                  // isZionAligned?
                contentDefault.addByteArray(StringUtils.hexStringToBytes("0000000000803F000000000000000041")); // ToDo: replace it later with the real values from the object
                contentDefault.addDoubleLtVector3d(door.pos_x, door.pos_y, door.pos_z);
                contentDefault.addByteArray(StringUtils.hexStringToBytes("34080000"));
                contentDefault.addByteArray(NumericalUtils.uint16ToByteArray(Store.currentClient.playerData.newViewIdCounter, 1));
                contentDefault.addByteArray(endViewID);
                contentDefault.addByte(0x00);
                Store.currentClient.messageQueue.addObjectMessage(contentDefault.returnFinalPacket(), false);
                break;
            }
        }
Esempio n. 6
0
        public void processLoadAbility(ref byte[] packet)
        {
            // read the values from the packet
            byte[] staticObjectByteID = new byte[4];
            ArrayUtils.copyTo(packet, 0, staticObjectByteID, 0, 4);

            byte[] unloadFlagByte = new byte[2];
            ArrayUtils.copyTo(packet, 4, unloadFlagByte, 0, 2);

            byte[] loadFlagByte = new byte[2];
            ArrayUtils.copyTo(packet, 6, loadFlagByte, 0, 2);

            byte[] countAbilityBytes = new byte[2];
            ArrayUtils.copyTo(packet, 8, countAbilityBytes, 0, 2);
            UInt16 countAbilities = NumericalUtils.ByteArrayToUint16(countAbilityBytes, 1);

            // Get the Ability Related Header Data
            UInt32 staticObjectID = NumericalUtils.ByteArrayToUint32(staticObjectByteID, 1);
            UInt16 unloadFlag = NumericalUtils.ByteArrayToUint16(unloadFlagByte, 1);
            UInt16 loadFlag = NumericalUtils.ByteArrayToUint16(loadFlagByte, 1);

            int pointer = 11; // Start at index 11
            List<UInt16> abilitySlots = new List<UInt16>();

            for (int i = 1; i <= countAbilities; i++)
            {

                // This must be looped
                byte[] slotByteID = new byte[2];
                ArrayUtils.copyTo(packet, pointer, slotByteID, 0, 2);
                pointer = pointer + 2;

                byte[] abilityByteID = new byte[2];
                ArrayUtils.copyTo(packet, pointer, abilityByteID, 0, 2);
                pointer = pointer + 4;

                byte[] abilityByteLevel = new byte[2];
                ArrayUtils.copyTo(packet, pointer, abilityByteLevel, 0, 2);
                pointer = pointer + 3;

                UInt16 slotID = NumericalUtils.ByteArrayToUint16(slotByteID, 1);
                UInt16 AbilityID = NumericalUtils.ByteArrayToUint16(abilityByteID, 1);
                UInt16 AbilityLevel = NumericalUtils.ByteArrayToUint16(abilityByteLevel, 1);

                PacketContent pak = new PacketContent();
                if (unloadFlag > 0)
                {
                    pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_UNLOAD, 0);
                    pak.addByteArray(abilityByteID);

                }
                else
                {
                    pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_LOAD, 0);
                    pak.addByteArray(abilityByteID);
                    pak.addByteArray(abilityByteLevel);
                    pak.addByteArray(slotByteID);
                }
                abilitySlots.Add(slotID);
                Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket());

            }

            if (unloadFlag > 0)
            {
                Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 0);
            }
            else
            {
                Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 1);
            }
        }
Esempio n. 7
0
        public void processLoadAbility(ref byte[] packet)
        {
            // read the values from the packet
            byte[] staticObjectByteID = new byte[4];
            ArrayUtils.copyTo(packet, 0, staticObjectByteID, 0, 4);

            byte[] unloadFlagByte = new byte[2];
            ArrayUtils.copyTo(packet, 4, unloadFlagByte, 0, 2);

            byte[] loadFlagByte = new byte[2];
            ArrayUtils.copyTo(packet, 6, loadFlagByte, 0, 2);

            byte[] countAbilityBytes = new byte[2];
            ArrayUtils.copyTo(packet, 8, countAbilityBytes, 0, 2);
            UInt16 countAbilities = NumericalUtils.ByteArrayToUint16(countAbilityBytes, 1);

            // Get the Ability Related Header Data
            UInt32 staticObjectID = NumericalUtils.ByteArrayToUint32(staticObjectByteID, 1);
            UInt16 unloadFlag     = NumericalUtils.ByteArrayToUint16(unloadFlagByte, 1);
            UInt16 loadFlag       = NumericalUtils.ByteArrayToUint16(loadFlagByte, 1);

            int           pointer      = 11; // Start at index 11
            List <UInt16> abilitySlots = new List <UInt16>();

            for (int i = 1; i <= countAbilities; i++)
            {
                // This must be looped
                byte[] slotByteID = new byte[2];
                ArrayUtils.copyTo(packet, pointer, slotByteID, 0, 2);
                pointer = pointer + 2;

                byte[] abilityByteID = new byte[2];
                ArrayUtils.copyTo(packet, pointer, abilityByteID, 0, 2);
                pointer = pointer + 4;

                byte[] abilityByteLevel = new byte[2];
                ArrayUtils.copyTo(packet, pointer, abilityByteLevel, 0, 2);
                pointer = pointer + 3;


                UInt16 slotID       = NumericalUtils.ByteArrayToUint16(slotByteID, 1);
                UInt16 AbilityID    = NumericalUtils.ByteArrayToUint16(abilityByteID, 1);
                UInt16 AbilityLevel = NumericalUtils.ByteArrayToUint16(abilityByteLevel, 1);

                PacketContent pak = new PacketContent();
                if (unloadFlag > 0)
                {
                    pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_UNLOAD, 0);
                    pak.addByteArray(abilityByteID);
                }
                else
                {
                    pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_LOAD, 0);
                    pak.addByteArray(abilityByteID);
                    pak.addByteArray(abilityByteLevel);
                    pak.addByteArray(slotByteID);
                }
                abilitySlots.Add(slotID);
                Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket());
            }


            if (unloadFlag > 0)
            {
                Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 0);
            }
            else
            {
                Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 1);
            }
        }
Esempio n. 8
0
        public void processHyperJump(ref byte[] packet)
        {
            byte[] destXBytes = new byte[8];
            byte[] destYBytes = new byte[8];
            byte[] destZBytes = new byte[8];
            byte[] maxHeight = new byte[4];
            byte[] theLast4 = new byte[4]; // we dont know what this is lol
            DynamicArray restBytes = new DynamicArray();

            ArrayUtils.copy(packet, 0, destXBytes, 0, 8);
            ArrayUtils.copy(packet, 8, destYBytes, 0, 8);
            ArrayUtils.copy(packet, 16, destZBytes, 0, 8);
            ArrayUtils.copy(packet, 30, maxHeight, 0, 4);
            ArrayUtils.copy(packet, packet.Length - 4,theLast4, 0, 4);

            // Players current X Z Y
            double x = 0; double y = 0; double z = 0;
            byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue();
            NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z);
            int rotation = (int)Store.currentClient.playerInstance.YawInterval.getValue()[0];
            float xPos = (float)x;
            float yPos = (float)y;
            float zPos = (float)z;

            float xDestFloat = (float)NumericalUtils.byteArrayToDouble(destXBytes,1);
            float yDestFloat = (float)NumericalUtils.byteArrayToDouble(destYBytes, 1);
            float zDestFloat = (float)NumericalUtils.byteArrayToDouble(destZBytes, 1);

            float distance = getDistance(xPos, yPos, zPos, xDestFloat, yDestFloat, zDestFloat);
            UInt16 duration = (UInt16)(distance * 1.5);
            //UInt32 startTime = TimeUtils.getUnixTimeUint32() - 100000;
            //UInt32 endTime = startTime + duration;

            UInt32 startTime = TimeUtils.getUnixTimeUint32();
            UInt32 endTime = startTime + duration;
            PacketContent pak = new PacketContent();
            pak.addByte(0x02);
            pak.addByte(0x00);
            pak.addByte(0x03);
            pak.addByte(0x09);
            pak.addByte(0x08);
            pak.addByte(0x00);
            pak.addFloatLtVector3f(xPos, yPos, zPos);
            pak.addUint32(startTime, 1);
            pak.addByte(0x80);
            pak.addByte(0x80);
            pak.addByte(0xb8);
            pak.addByte(0x14); // if 0xb8
            pak.addByte(0x00); // if 0xb8
            pak.addUint32(endTime, 1);
            pak.addByteArray(destXBytes);
            pak.addByteArray(destYBytes);
            pak.addByteArray(destZBytes);
            pak.addByteArray(new byte[] { 0x10, 0xe3, 0x00 });
            pak.addByte(0x00);
            pak.addByte(0x00);
            pak.addByte(0x00);
            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), true);
        }
Esempio n. 9
0
        public void testCloseCombat(ref byte[] packet)
        {
            byte[] targetViewWithSpawnId = new byte[4];
            ArrayUtils.copy(packet, 0, targetViewWithSpawnId, 0, 4);
            string hexString = StringUtils.bytesToString_NS(targetViewWithSpawnId);
            string hexStringPak = StringUtils.bytesToString_NS(packet);
            Store.currentClient.messageQueue.addObjectMessage(StringUtils.hexStringToBytes("020003010C00808400808080800100001000"), false); // Make me combat mode "on"

            // The 55 View Packet
            PacketContent ilCombatHandler = new PacketContent();
            ilCombatHandler.addHexBytes("01000C370036CDAB0205");
            ilCombatHandler.addByteArray(Store.currentClient.playerInstance.Position.getValue());
            ilCombatHandler.addHexBytes("cdec4023"); // Time starts i think
            ilCombatHandler.addHexBytes("fd0000"); // view ID fd00
            Store.currentClient.messageQueue.addObjectMessage(ilCombatHandler.returnFinalPacket(), false);
            Store.currentClient.flushQueue();
            // The other 03 Packet for combat
            PacketContent unknownCreatePak = new PacketContent();
            unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("010002A700"));
            unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("FD00")); // ViewID from Combat Object
            unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01"));
            unknownCreatePak.addByteArray(Store.currentClient.playerInstance.Position.getValue());
            unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("0100000003000000"));
            unknownCreatePak.addByteArray(targetViewWithSpawnId);
            unknownCreatePak.addUint16(2, 1);
            unknownCreatePak.addUint16(Store.currentClient.playerData.selfSpawnIdCounter, 1);
            unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01010207030000200BF5C2000020C19420B9C300000000000020C100000000070001001201000007037608E00603145200008B0B0024145200008B0B0024882300008B0B00240000000000000000000000000000000064000000640000000010001010000000020000001000000002000000000000000000000000"));
            Store.currentClient.messageQueue.addObjectMessage(unknownCreatePak.returnFinalPacket(), false);
            Store.currentClient.flushQueue();
        }
Esempio n. 10
0
 public void sendPlayerSpawn(WorldClient receiverClient, WorldClient otherClient, UInt16 viewId)
 {
     PacketContent pak = new PacketContent();
     byte[] spawnPaket = new BootingHelperRsi().generatePlayerSpawnPacket(otherClient, receiverClient.playerData.assignSpawnIdCounter());
     pak.addByteArray(spawnPaket);
     pak.addUint16(viewId,1);
     pak.addByte(0x00);
     receiverClient.messageQueue.addObjectMessage(pak.returnFinalPacket(),false);
     receiverClient.flushQueue();
 }
Esempio n. 11
0
        public void sendPlayerAnimation(WorldClient client, String hexAnimation)
        {
            // See animations.txt - hex animation is the first Id
            // Some samples:
            /*
             * 7312 1273 = Stand_Abil_ProgLauSelectivePhage2s_A
               7412 1274 = Stand_Abil_ProgLauSelectivePhage4s_A
               7512 1275 = Stand_Abil_ProgLauSelectivePhage6s_A
               7612 1276 = Stand_Abil_ProgLauSelectivePhage8s_A
             */
            Random rand = new Random();
            byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue();
            double x = 0;
            double y = 0;
            double z = 0;
            NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z);
            float xPos = (float)x;
            float yPos = (float)y;
            float zPos = (float)z;

            PacketContent pak = new PacketContent();
            pak.addUint16(2, 1);
            pak.addByteArray(new byte[]{0x01,0x28});
            pak.addUintShort((ushort)rand.Next(0, 255));
            pak.addByteArray(new byte[] { 0x40, 00 });
            pak.addByte(0x29);
            pak.addHexBytes(hexAnimation);
            pak.addByteArray(new byte[] { 0x00, 0x01 });
            pak.addFloat(xPos,1);
            pak.addFloat(yPos,1);
            pak.addFloat(zPos,1);
            pak.addByteArray(new byte[] {0x20, 0x9f, 0x1e, 0x20});
            pak.addUint16(0, 1);
            client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
            client.flushQueue();
        }
Esempio n. 12
0
 public void sendMoodChange(WorldClient client, byte moodByte)
 {
     byte[] moodPak = { 0x02, 0x00, 0x01, 0x01, 0x00, moodByte, 0x00, 0x00 };
     PacketContent pak = new PacketContent();
     pak.addUint16(2, 1);
     pak.addByte(0x02);
     pak.addByteArray(moodPak);
     client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
     client.flushQueue();
 }
Esempio n. 13
0
 // Updates the Inner Strenght Value
 public void sendISCurrent(WorldClient client, UInt16 innerStrengthValue )
 {
     PacketContent pak = new PacketContent();
     pak.addUint16(2, 1);
     pak.addByte(0x02);
     pak.addByteArray(new byte[]{0x80,0x80,0x80});
     pak.addByte(0x10);
     pak.addUint16(innerStrengthValue,1);
     client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
     client.flushQueue();
 }