1022 Packet

06/01/2020 11:09 cruey#1
Hello

Can someone help me understand this?
[Only registered and activated users can see links. Click Here To Register...]

im trying to understand what "It is worth noting that InteractType.Magic is hashed using the character ID/Timestamp values." means.


because this packet is sent when my character asks to use magictype 3000


20 00 FE 03 D4 91 3D 01 C9 02 E4 00 74 85 89 CD 27 BE 07 DF 15 00 00 00 4B CD 21 E3 00 00 00 00

but as u can see i cant find the data 3000. i think its probably stored at this part 4B CD 21 E3 but im not sure how to convert the value to 3000.

(also im coding a source for EO, most of the packet structures are the same, im greatful for any help here!)
06/01/2020 16:29 ~Crystaline#2
I believe when you’re casting Magic. You have to decrypt the spell id, x and y. And maybe that’s why you can’t see the magictype 3000 directly. I could be wrong tho, someone can correct me if I’m wrong.
06/01/2020 21:23 pintinho12#3
Quote:
Originally Posted by ~Crystaline View Post
I believe when you’re casting Magic. You have to decrypt the spell id, x and y. And maybe that’s why you can’t see the magictype 3000 directly. I could be wrong tho, someone can correct me if I’m wrong.
Yep, you're right. And most sources has the implementation for that.

Code:
byte[] dataArray = BitConverter.GetBytes(Data);
                    ushort magicType = Convert.ToUInt16((dataArray[0] & 0xFF) | ((dataArray[1] & 0xFF) << 8));
                    magicType ^= 0x915d;
                    magicType ^= (ushort) client.Identity;
                    magicType = (ushort) ((magicType << 0x3) | (magicType >> 0xd));
                    magicType -= 0xeb42;

                    dataArray = BitConverter.GetBytes(TargetIdentity);
                    TargetIdentity = ((uint)dataArray[0] & 0xFF) | (((uint)dataArray[1] & 0xFF) << 8) |
                                    (((uint)dataArray[2] & 0xFF) << 16) | (((uint)dataArray[3] & 0xFF) << 24);
                    TargetIdentity = ((((TargetIdentity & 0xffffe000) >> 13) | ((TargetIdentity & 0x1fff) << 19)) ^ 0x5F2D2463 ^ client.Identity) -
                        0x746F4AE6;

                    dataArray = BitConverter.GetBytes(PosX);
                    long xx = (dataArray[0] & 0xFF) | ((dataArray[1] & 0xFF) << 8);
                    dataArray = BitConverter.GetBytes(PosY);
                    long yy = (dataArray[0] & 0xFF) | ((dataArray[1] & 0xFF) << 8);
                    xx = xx ^ (client.Identity & 0xffff) ^ 0x2ed6;
                    xx = ((xx << 1) | ((xx & 0x8000) >> 15)) & 0xffff;
                    xx |= 0xffff0000;
                    xx -= 0xffff22ee;
                    yy = yy ^ (client.Identity & 0xffff) ^ 0xb99b;
                    yy = ((yy << 5) | ((yy & 0xF800) >> 11)) & 0xffff;
                    yy |= 0xffff0000;
                    yy -= 0xffff8922;
                    PosX = Convert.ToUInt16(xx);
                    PosY = Convert.ToUInt16(yy);
Data is Effect