Jasaka wrote:
Code:
var packet:=CreatePacket(0xC0,36);
//packet.SetInt8(1,0x0); //cmd
packet.SetInt32(2,caster.serial); //sourceSerial
packet.SetInt32(3,cast_on.serial); //targetSerial
packet.SetInt16(4,0x36D4); //itemID
packet.SetInt16(5,caster.x); //xS
packet.SetInt16(6,caster.y); //yS
packet.SetInt8(7,caster.z); //zS
packet.SetInt16(8,cast_on.x); //xT
packet.SetInt16(9,cast_on.y); //yT
packet.SetInt8(10,cast_on.z); //zT
packet.SetInt8(11,0x5); //speed
//packet.SetInt8(12,0x0); //duration
//packet.SetInt8(13,cast_on.y); //unk
//packet.SetInt16(14,0x0); //fixedD
packet.SetInt8(15,0x1); //explodes
//packet.SetInt32(16,0x482); //hue
//packet.SetInt16(17,cast_on.y); //renderMode
packet.SendPacket(caster);
And that doesn't work... Nothing shows on my screen

Thats probably because your offsets are completely off.. (the first param you give to the SetInt*...)
My main example for you would be
packet.SetInt32(2,caster.serial); //sourceSerial
packet.SetInt32(3,cast_on.serial); //targetSerial
You set a 32 bit int on the second byte then another on the third byte. 32 bits is 4 bytes though.
Instead, you would have to set it this way
packet.SetInt32(2,caster.serial); //sourceSerial
Set that on the second byte (the 2 you passed.)
Now the next one should be
packet.SetInt32(
6,cast_on.serial); //targetSerial
You set this to the 6th byte, not the third because the second, third, fourth, and fifth are taken by the last 32 bit Int you set (the source serial).
For Int8 you add 1, for Int16 you add 2, for Int32 you add 4.
Now for reading something like this off of MuadDib's site
Code:
Packet Breakdown
BYTE[1] cmd
BYTE[1] type
BYTE[4] sourceSerial
BYTE[4] targetSerial
BYTE[2] itemID
BYTE[2] xSource
BYTE[2] ySource
BYTE[1] zSource
BYTE[2] xTarget
BYTE[2] yTarget
BYTE[1] zTarget
BYTE[1] speed
BYTE[1] duration
BYTE[2] unk // On OSI, flamestrikes are 0x0100
BYTE[1] fixedDirection
BYTE[1] explodes
BYTE[4] hue
BYTE[4] renderMode
All you need to do is add the bytes up to find out where your next offset is going to be. Do not put cmd at number 1 though since its actually at number 0. Although if you're adding all of the bytes before one thing to get to the correct offset, you'll want it as your placeholder... Example... To get to ySource, You'll add 1 + 1 + 4 + 4 + 2 + 2 = 14.
1 - Type (8 bit int [or 1 byte])
2 - Source Serial (32 bit int [or 4 bytes])
6 - Target Serial (32 bit int [or 4 bytes])
10 - ItemID (16 bit int [or 2 bytes])
12 - xSource (16 bit int [or 2 bytes])
14 - ySource (16 bit int [or 2 bytes])
16 - zSource (8 bit int [or 1 byte])
and so on...