How to read nearby Characters & mobs location

04/16/2020 14:05 ahmed4ever2u#1
Code:
[S -> C][B021]
C5 7B 02 00                                    Character ID [Int32()]
01                                                  Flag [Int8()]
A6 60                                             Region ID [Int16()]
F9 06                                             ................
00 00                                             ................
56 06                                             ................
01                                                  Flag [Int8()]
A6 60                                             Region ID [Int16()]
BB 45                                             ................
98 5E 18 40                                    ................
69 3B                                             ................
can any buddy help me to understand which is the x&y&z
as i can see there are 2 (x&y&z) data in the same packet,
thank you in advance


my C# code
Code:
Int32 ID = packet.ReadInt32();
            if (ID == UniqueID)
            {

                if (packet.ReadInt8() == 1)
                {
                    int RegionIDsecPacket = packet.ReadInt16();
                    int sec_x = packet.ReadUInt16();
                    int sec_y = packet.ReadUInt16();
                    int sec_z = packet.ReadUInt16();
                    packet.ReadInt8();
                    int RegionIDPacket = packet.ReadInt16();
                    int x = packet.ReadInt16();
                    int z = packet.ReadInt16();
                    int y = packet.ReadInt16();
                    Single angle = packet.ReadInt16();
                }
            }
04/16/2020 14:45 homelesshobo#2
Code:
[S -> C][B021]
C5 7B 02 00                                    Character ID [Int32()]
01                                             Flag [Int8()]
A6 60                                          Region ID [Int16()]
F9 06                                          // x offset
00 00                                          // z offset
56 06                                          // y offset
01                                             //has origin
A6 60                                          Region ID [Int16()]
BB 45                                          // x offset
98 5E 18 40                                    // z offset // y offset
69 3B                                          // angle
Source: [Only registered and activated users can see links. Click Here To Register...]
04/16/2020 15:29 ahmed4ever2u#3
okay what if i want to convert db postion to ingame postion ? any idea?
04/16/2020 16:24 JellyBitz#4
Quote:
Originally Posted by ahmed4ever2u View Post
okay what if i want to convert db postion to ingame postion ? any idea?
C# right? One of three constructors I use for this task.

Code:
/// <summary>
/// Creates a Silkroad coordinate with all information by using an internal coordinate.
/// </summary>
public SRCoord(ushort Region, int X, int Z, int Y)
{
	this.Region = Region;
	if (inDungeon())
	{
		this.PosX = 128 * 192 + X / 10;
		this.PosY = 128 * 192 + Y / 10;
		this.xSector = (byte)(((128.0 * 192.0 + this.PosX) / 192.0) - 128);
		this.ySector = (byte)(((128.0 * 192.0 + this.PosY) / 192.0) - 128);
	}
	else
	{
		this.xSector = (byte)(Region & 0xFF);
		this.ySector = (byte)(Region >> 8);
		this.PosX = (xSector - 135) * 192 + X / 10;
		this.PosY = (ySector - 92) * 192 + Y / 10;
	}

	this.X = X;
	this.Y = Y;
	this.Z = Z;
}