Okay today when I wake up I started studying tibia in olly. I was trying to learn more about the sendPacketfunction, I noticed that before every call to the sendPacket() there was some other calls.
I will show you here:
Code:
// this is for player speech in main channel.
PUSH 96h //packetType
CALL 0524A50h // a function that adds packettype into networkstream
PUSH EBX // I know this is a byte value so I can assume that 524D70h is the function to add byte values to the stream
CALL 0524D70h
PUSH EDI // same here I know this is a string.
CALL 0525290h
PUSH 1h // this is always 1
CALL 0525740h
Code:
PUSH 0A1h
CALL 0524A50h //yet again to add packetype
PUSH ESI
CALL 05250D0h this is new? But I know this is a uint32 value becouse this creatureID
MOV EAX,DWORD PTR DS:[9A5A54h]
PUSH EAX
CALL 05250D0h yep same function as above attackCount
PUSH 1h
CALL 0525740h
I was just playing around with this and did not gave so much time, I just wanted to see if it would work and it did.
Updated it, fixed the problem with esp thanks to Sketchy also some other fixes. Now it should work properly