Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Move Packet #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was studying the move packet and, as you probably know, when a creature
other than yourself moves you'll receive the incoming CreatureMovePacket
that only contains the fromPos, stackPos, and toPos. When your player
moves, however, it also sends a move direction byte followed by tile
information to update the map. After a little research I finally figured
out the packet structure. Here are two examples, one walking to a location
on the same floor, and the other walking to a location that makes you
change floors (going up a staircase).

Same Floor
59 00 6D 64 00 73 00 07 01 65 00 73 00 07 66 68 04 00 FF 68 04 88 18 00 FF
F5 11 70 11 00 FF F5 11 00 FF A3 11 1E 12 00 FF A3 11 20 12 00 FF F5 11 00
FF F5 11 00 FF F5 11 00 FF A3 11 1E 12 00 FF A3 11 22 12 00 FF A4 11 00 FF
A3 11 6E 11 00 FF 72 11 00 FF AD 01 FC 04 61 FF

59 - packet length
00 - 
6D - packet type (creature move)
64 00 - fromX
73 00 - fromY
07 - fromZ
01 - stackPos
65 00 - toX
73 00 - toY
07 - toZ
66 - move direction (65=north, 66=east, 67=south, 68=west)

map update pattern
68 04 - tile ID
00 FF - skip
If there is more than one item on a tile (ie. 68 04 88 18) the first id (68
04) is the bottom item, then it goes up from there.
That pattern continues until all tiles have been received.

61 FF - ends the map update (i'm not sure exactly what the 61 is since it's
different everytime)

Now when changing floors it's a little different. This only pertains to
going up a staircase.

Up Floor
37 03 6D 65 00 73 00 07 01 65 00 72 00 07 65 68 04 00 FF 68 04 00 FF 68 04
00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00
FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF
68 04 00 FF 68 04 00 FF 68 04 59 04 00 FF A0 01 B3 11 37 12 00 FF A0 01 B3
11 36 12 00 FF A0 01 B7 11 00 FF A0 01 BA 11 00 FF A0 01 B4 11 B5 11 00 FF
A3 11 00 FF A3 11 00 FF A3 11 00 FF A3 11 48 18 00 FF AB 11 F6 04 00 FF AD
01 DD 16 DF 16 00 FF AD 01 00 FF AD 01 00 FF AD 01 00 FF AD 01 00 FF AD 01
00 FF AD 01 82 0D 00 FF AD 01 F6 04 08 FF 85 04 00 FF 86 04 00 FF 86 04 00
FF 86 04 00 FF 89 04 00 FF 87 04 00 FF 87 04 00 FF 87 04 00 FF 87 04 00 FF
88 04 5A FF 6D 65 00 72 00 07 02 64 00 72 00 06 BE 68 68 04 00 FF 68 04 00
FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 AB 05 00 FF 9A 01 00 FF 9A 01
00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 AB
05 A6 0A 00 FF A0 01 B3 11 00 FF A0 01 B5 11 37 12 00 FF AE 11 31 12 00 FF
AC 11 35 12 00 FF DF 05 00 FF 9A 01 B1 0B BA 09 00 FF 9A 01 00 FF 9A 01 CA
05 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 C9 05 04 FF
81 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00 FF 80
04 00 FF 80 04 00 FF 80 04 00 FF BC 13 47 FF 65 68 04 00 FF 68 04 00 FF 68
04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04
00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00
FF 68 04 00 FF 68 04 00 FF 68 04 00 FF A3 11 47 18 00 FF AC 11 00 FF A3 11
00 FF A0 01 B6 11 B3 11 00 FF A0 01 35 12 B3 11 00 FF A0 01 B4 11 B7 11 00
FF A3 11 00 FF A3 11 00 FF A5 11 49 18 00 FF A6 11 00 FF A3 11 F6 04 00 FF
AD 01 E5 16 E7 16 00 FF AD 01 18 0A 00 FF AD 01 19 0A 00 FF AD 01 19 0A 00
FF AD 01 19 0A 00 FF AD 01 1A 0A 00 FF AD 01 2F 0C 82 0D 09 FF 85 04 00 FF
86 04 00 FF 86 04 00 FF 86 04 00 FF 89 04 00 FF 87 04 00 FF 87 04 00 FF 87
04 00 FF 87 04 5A FF 68 68 04 00 FF 68 04 00 FF 68 04 00 FF 68 04 00 FF 68
04 00 FF 68 04 00 FF 68 04 AC 05 00 FF 68 04 AA 05 00 FF 68 04 BB 05 00 FF
68 04 AA 05 00 FF 68 04 BC 05 7F 0B 00 FF 68 04 AA 05 00 FF B0 11 BB 05 00
FF A3 11 AA 05 00 FF A3 11 00 FF A0 01 B3 11 B9 11 00 FF A0 01 B5 11 B6 11
00 FF B0 11 49 18 00 FF A5 11 00 FF A3 11 AB 05 00 FF 9A 01 B9 09 00 FF 9A
01 00 FF 9A 01 AB 05 00 FF 9A 01 00 FF 9A 01 00 FF 9A 01 7D 09 00 FF 9A 01
7E 09 00 FF 9A 01 AB 05 04 FF 81 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00
FF 80 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00 FF 80 04 00 FF BC 13 46 FF 

37 - packet length
03 -
6D - packet type (creature move)
65 00 - fromX
73 00 - fromY
07 - fromZ
01 - stackPos
65 00 - toX
72 00 - toY
07 - toZ
65 move direction (65=north, 66=east, 67=south, 68=west)

map update pattern
68 04 - tile ID
00 FF - skip
If there is more than one item on a tile (ie. 68 04 59 04) the first id (68
04) is the bottom item, then it goes up from there.
That pattern continues until all tiles have been received.

5A FF - ends the map update (i'm not sure exactly what the 61 is since it's
different everytime)

6D - packet type (creature move)
65 00 - fromX
72 00 - fromY
07 - fromZ
02 - stackPos
64 00 - toX
72 00 - toY
06 - toZ
BE - floor change (BE=up, BF=down)
68 - move to new location (65=north, 68=west)

map update pattern
68 04 - tile ID
00 FF - skip
I think you get the hang of this.

46 FF - ends the map update

Things to know
1) If you're moving up to a level of 6 or less then you'd follow the above
example.
2) If you're moving up to the ground level (7) then it would first update
floors 0-5 then add *move to new location (65=north, 68=west)*.
3) If you're moving up underground (8+) then it would first update upto 3
levels above you then add *move to new location (65=north, 68=west)*. (I
believe this is right, not 100% sure though).

4) If you're moving down to floor 8 then it would first update levels 8-10
then add *move to new location (66=east, 67=south)*.
5) If you're moving down below floor 8 (9+) then it would first update upto
2 levels below you then add *move to new location (66=east, 67=south)*. (I
believe this is right, not 100% sure though).
6) If you're moving down above ground (to floors 7-) then you'd follow the
above example, but instead of moving north or west you'd move east or south.

7) Any kind of floor change that doesn't involve your player moving first
(roping up, using a sewer grate, etc.) is considered a MapItemRemovePacket(6C).

I think I got everything and hopefully we'll be able to use this to improve
the CreatureMovePacket.

Jo3

Original issue reported on code.google.com by joebingham07@gmail.com on 1 Dec 2008 at 8:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
In Things to know, wherever it says (add *move to new location (x, x)*) it 
should be
(*move to new location (x, x)* then continue with the example where it adds the 
*move
to new location*).

Original comment by joebingham07@gmail.com on 1 Dec 2008 at 8:42

GoogleCodeExporter commented 9 years ago
Also take a look at the packet that is sent when you cross over the premmy 
bridge in 
rookgaard as a free account player. This is also a creaturemove packet but it 
has 
two movements in it and a message. The first one moves onto the switch and 
updates 
the packet. The second one moves from the switch three tiles back to just off 
the 
bridge. And at the end there is a message that gives the standard message 'you 
have 
to be a premium account player to enter this area'. 

Original comment by jared.ca...@gmail.com on 2 Dec 2008 at 8:19

GoogleCodeExporter commented 9 years ago
Added.

Original comment by brunodun...@gmail.com on 17 Dec 2008 at 11:55