|
You last visited: Today at 21:50
Advertisement
5180 Offsets
Discussion on 5180 Offsets within the CO2 Private Server forum part of the Conquer Online 2 category.
02/15/2011, 14:41
|
#1
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
5180 Offsets
Hey guys just wondering if anyone has the correct SpawnEntity offsets for 5180 source?
I have been working on them and cant seem to get the colour offsets right :/
I have used a few 5180 sources that I found as a reference but Exodus Binaries is very poorly layed out and quite hard to figure out what is what in that source lmao
Anyone that can PM me or post them here is a lifesaver and about another 5 hours of me scratching my head solved haha
Thanks in advance
|
|
|
02/15/2011, 15:14
|
#2
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
I've got entityspawn for Characters for 5180, Talk to me on msn
|
|
|
02/15/2011, 16:15
|
#3
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Quote:
Originally Posted by Iron~Man
I've got entityspawn for Characters for 5180, Talk to me on msn
|
Ummm what's your msn??
|
|
|
02/15/2011, 16:24
|
#4
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
You already have me..
|
|
|
02/15/2011, 19:58
|
#5
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
PHP Code:
public void ClearItemview(uint Position) { switch ((ushort)Position) { case Network.GamePackets.ConquerItem.Head: Network.Writer.WriteUInt32(0, 30, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 103, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Garment: Network.Writer.WriteUInt32(0, 34, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Armor: Network.Writer.WriteUInt32(0, 38, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 99, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.RightWeapon: Network.Writer.WriteUInt32(0, 46, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.LeftWeapon: Network.Writer.WriteUInt32(0, 42, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 101, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Steed: Network.Writer.WriteUInt32(0, 50, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 109, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt32(0, 115, Owner.Entity.SpawnPacket); break; } } public void UpdateItemview(Interfaces.IConquerItem item) { switch ((ushort)item.Position) { case Network.GamePackets.ConquerItem.Head: Network.Writer.WriteUInt32(item.ID, 30, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 103, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Garment: Network.Writer.WriteUInt32(item.ID, 34, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Armor: Network.Writer.WriteUInt32(item.ID, 38, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 99, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.RightWeapon: Network.Writer.WriteUInt32(item.ID, 46, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.LeftWeapon: Network.Writer.WriteUInt32(item.ID, 42, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 101, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Steed: Network.Writer.WriteUInt32(item.ID, 50, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Plus, 109, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt32(item.SocketProgress, 115, Owner.Entity.SpawnPacket); break; } }
|
|
|
02/15/2011, 21:54
|
#6
|
elite*gold: 0
Join Date: Dec 2010
Posts: 162
Received Thanks: 31
|
Quote:
Originally Posted by -impulse-
PHP Code:
public void ClearItemview(uint Position) { switch ((ushort)Position) { case Network.GamePackets.ConquerItem.Head: Network.Writer.WriteUInt32(0, 30, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 103, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Garment: Network.Writer.WriteUInt32(0, 34, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Armor: Network.Writer.WriteUInt32(0, 38, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 99, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.RightWeapon: Network.Writer.WriteUInt32(0, 46, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.LeftWeapon: Network.Writer.WriteUInt32(0, 42, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 101, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Steed: Network.Writer.WriteUInt32(0, 50, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16(0, 109, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt32(0, 115, Owner.Entity.SpawnPacket); break; } } public void UpdateItemview(Interfaces.IConquerItem item) { switch ((ushort)item.Position) { case Network.GamePackets.ConquerItem.Head: Network.Writer.WriteUInt32(item.ID, 30, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 103, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Garment: Network.Writer.WriteUInt32(item.ID, 34, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Armor: Network.Writer.WriteUInt32(item.ID, 38, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 99, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.RightWeapon: Network.Writer.WriteUInt32(item.ID, 46, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.LeftWeapon: Network.Writer.WriteUInt32(item.ID, 42, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Color, 101, Owner.Entity.SpawnPacket); break; case Network.GamePackets.ConquerItem.Steed: Network.Writer.WriteUInt32(item.ID, 50, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt16((byte)item.Plus, 109, Owner.Entity.SpawnPacket); Network.Writer.WriteUInt32(item.SocketProgress, 115, Owner.Entity.SpawnPacket); break; } }
|
I <3 Your Packet Builder.
|
|
|
02/16/2011, 00:16
|
#7
|
elite*gold: 0
Join Date: Jan 2010
Posts: 139
Received Thanks: 45
|
Quote:
Originally Posted by Iron~Man
I <3 Your Packet Builder.
|
You mean Hybrids packet builder?
|
|
|
02/16/2011, 08:05
|
#8
|
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
|
Quote:
Originally Posted by QuickCo
You mean Hybrids packet builder?
|
Indeed.
|
|
|
02/16/2011, 08:53
|
#9
|
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
|
Quote:
Originally Posted by -impulse-
Indeed.
|
It's so much more organized than CoEmu and NewestCOServer's packet builder. What's not to love about it. lol
Btw,
Code:
client = _client;
Buffer = new byte[84];
WriteUInt16((ushort)(Buffer.Length - 8), 0, Buffer);
WriteUInt16(1009, 2, Buffer);
WriteUInt32(46, 12, Buffer);
WriteUInt32(id, (28 + (Position * 4)), Buffer);
client.Send(Buffer);
and calling "new ItemView(Owner, (byte)Position, 0);" and "new ItemView(Owner, Position, item.UID);"
might be a better way of doing that.
|
|
|
02/16/2011, 15:11
|
#10
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Mmmkay thanks for the help guys got my characters spawning now
No GM or PM shows up nor does the chars name on a different client screen... but I can work on that ahaa
+k to people that helped
|
|
|
02/16/2011, 16:12
|
#11
|
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
|
Quote:
Originally Posted by Spirited
It's so much more organized than CoEmu and NewestCOServer's packet builder. What's not to love about it. lol
Btw,
Code:
client = _client;
Buffer = new byte[84];
WriteUInt16((ushort)(Buffer.Length - 8), 0, Buffer);
WriteUInt16(1009, 2, Buffer);
WriteUInt32(46, 12, Buffer);
WriteUInt32(id, (28 + (Position * 4)), Buffer);
client.Send(Buffer);
and calling "new ItemView(Owner, (byte)Position, 0);" and "new ItemView(Owner, Position, item.UID);"
might be a better way of doing that.
|
And make more unnecassary work for the GC?
|
|
|
02/16/2011, 17:09
|
#12
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Right, I am having quite a few problems and wanna see if anyone can see whats wrong in this code. I can view my own name in my client but I cant view other peoples names :/ and vice versa.
Also GM and PM are not showing up... I am not too fussed about that atm though
Spawn entity void
Code:
public static byte[] SpawnEntity(Character C)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
Writer.UInt16(Convert.ToUInt16(Packet.Length - 8), 0, Packet);
Writer.UInt16(10014, 2, Packet);
Writer.UInt32(C.Mesh, 4, Packet);
Writer.UInt32(C.EntityID, 8, Packet);
if (C.Guild != null)
{
Writer.UInt16(C.Guild.ID, 3, Packet);
Writer.Byte(Convert.ToByte(C.GuildRank), 15, Packet);
}
Writer.UInt64(Convert.ToUInt64(C.StatEff.Value), 24, Packet);
if (C.Alive)
{
Writer.UInt32(C.Equipment.HeadGear.ID, 30, Packet);
Writer.UInt32(C.Equipment.Garment.ID, 34, Packet);
Writer.UInt32(C.Equipment.Armor.ID, 38, Packet);
Writer.UInt32(C.Equipment.LeftHand.ID, 42, Packet);
Writer.UInt32(C.Equipment.RightHand.ID, 46, Packet);
Writer.UInt32(C.Equipment.Steed.ID, 50, Packet);
Writer.UInt16(C.Hair, 62, Packet);
}
// Offset:4 Value: Mesh (uint) //Offset:8 Value: UID (uint)
//Offset:24 Value: StatusFlag (ulong)
//Offset:58 Value: HitPoints (ushort)
//Offset:62 Value: HairStyle (ushort)
//Offet:64 Value: X (ushort)
//Offet:66 Value: Y (ushort)
//Offset:68 Vaue: Angle (byte)
//Offset:69 Value: Action (byte)
//Offset:75 Value: Level (byte)
//Offset:104 Value: QuizPoints (uint)
//Offset:156 Value: String.Length
//Offset:157 Value: String
//Writer.UInt32(12, 48, Packet);
//Writer.UInt32(0, 52, Packet);
Writer.UInt16(C.Loc.X, 64, Packet);
Writer.UInt16(C.Loc.Y, 66, Packet);
Writer.Byte(C.Direction, 68, Packet);
Writer.Byte(C.Action, 69, Packet);
Writer.Byte(C.Reborns, 74, Packet);
Writer.UInt16(C.Level, 75, Packet);
Writer.Byte(0, 71, Packet);
Writer.UInt32(Convert.ToUInt32(C.Nobility.Rank), 88, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.Armor.Color), 99, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.LeftHand.Color), 101, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.HeadGear.Color), 103, Packet);
Writer.UInt32(C.UniversityPoints, 98, Packet);
Writer.UInt32(C.UniversityPoints, 104, Packet);
Writer.UInt16(C.Equipment.Steed.Plus, 109, Packet);
Writer.UInt32(C.Equipment.Steed.TalismanProgress, 115, Packet);
Writer.Byte(1, 136, Packet);
Writer.Byte(Convert.ToByte(C.Name.Length + C.Client.AuthInfo.Status.Length), 156, Packet);
Writer.String(C.Name + C.Client.AuthInfo.Status, 157, Packet);
return Packet;
}
Spawn Viewed
Code:
public static COPacket SpawnViewed(Character C, byte Type)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10014);
P.WriteInt32(C.Mesh);
P.WriteInt32(C.EntityID);
if (C.Guild != null)
{
P.WriteInt16(C.Guild.ID);
P.Move(1);
P.WriteByte((byte)C.GuildRank);
}
else
P.Move(4);
P.WriteInt64((ulong)C.StatEff.Value);
if (C.Alive)
{
P.WriteInt32(C.Equipment.HeadGear.ID);
P.WriteInt32(C.Equipment.Garment.ID);
P.WriteInt32(C.Equipment.Armor.ID);
P.WriteInt32(C.Equipment.LeftHand.ID);
P.WriteInt32(C.Equipment.RightHand.ID);
P.WriteInt32(C.Equipment.Steed.ID);
}
else P.Move(24);
P.WriteInt32(12);
P.WriteInt16(0);
P.WriteInt16(0);
if (C.Alive)
P.WriteInt16(C.Hair);
else P.Move(2);
P.WriteInt16(C.Loc.X);
P.WriteInt16(C.Loc.Y);
P.WriteByte(C.Direction);
P.WriteByte(C.Action);
P.Move(4);
P.WriteByte(C.Reborns);
P.WriteInt16(C.Level);
P.WriteByte(Type);//type 0 = screen / 1 = window
P.Move(16);
P.WriteInt32((byte)C.Nobility.Rank);
P.WriteInt16((ushort)C.Equipment.Armor.Color);
P.WriteInt16((ushort)C.Equipment.LeftHand.Color);
P.WriteInt16((ushort)C.Equipment.HeadGear.Color);
P.WriteInt32(C.UniversityPoints);
P.WriteInt16(C.Equipment.Steed.Plus);
P.WriteInt32(0);
P.WriteInt32(C.Equipment.Steed.TalismanProgress);
P.Move(24);
P.WriteByte(1);
P.WriteByte((byte)(C.Name + C.Client.AuthInfo.Status).Length);
P.WriteString((C.Name + C.Client.AuthInfo.Status));
return P;
}
Hero Information.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MayaConquer_v2.GameSystem;
namespace MayaConquer_v2.Packets
{
public class CharacterInfo : Writer, Interfaces.IPacket
{
GameClient client;
public CharacterInfo(GameClient _client)
{
client = _client;
}
public void Deserialize(byte[] buffer)
{
throw new NotImplementedException();
}
public byte[] ToArray()
{
byte[] Packet = new byte[160 + (client.Char.Spouse.Length) + (client.Char.Name + client.Char.Client.AuthInfo.Status).Length + 4];
UInt16((ushort)(Packet.Length - 8), 0, Packet);
UInt16(0x3ee, 2, Packet);
UInt32(client.Char.EntityID, 4, Packet);
UInt32(client.Char.Mesh, 8, Packet);
UInt16(client.Char.Hair, 12, Packet);
UInt32(client.Char.Silvers, 14, Packet);
UInt32(client.Char.CPs, 18, Packet);
UInt64(client.Char.Experience, 22, Packet);
UInt16(client.Char.Str, 50, Packet);
UInt16(client.Char.Agi, 52, Packet);
UInt16(client.Char.Vit, 54, Packet);
UInt16(client.Char.Spi, 56, Packet);
UInt16(client.Char.StatPoints, 58, Packet);
UInt16((ushort)client.Char.CurHP, 60, Packet);
UInt16(client.Char.CurMP, 62, Packet);
UInt16(client.Char.PKPoints, 64, Packet);
Packet[66] = client.Char.Level;
Packet[67] = client.Char.Job;
Packet[69] = client.Char.Reborns;
Packet[70] = 1;
UInt32(client.Char.UniversityPoints, 71, Packet);
Packet[81] = 1;
Packet[89] = 2;
WriteStringWithLength(client.Char.Name, 90, Packet);
WriteStringWithLength(client.Char.Spouse, 91 + Packet[90], Packet);
return Packet;
}
public void Send(GameClient client)
{
client.Send(ToArray());
}
}
}
I have only just started learning about packets and offsets so even if you point me in the right direction would be alot of help.
anymore info you need just ask
Thanks in advance
|
|
|
02/16/2011, 17:09
|
#13
|
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
|
Right, I am having quite a few problems and wanna see if anyone can see whats wrong in this code. I can view my own name in my client but I cant view other peoples names :/ and vice versa.
Also GM and PM are not showing up... I am not too fussed about that atm though
Spawn entity void
Code:
public static byte[] SpawnEntity(Character C)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
Writer.UInt16(Convert.ToUInt16(Packet.Length - 8), 0, Packet);
Writer.UInt16(10014, 2, Packet);
Writer.UInt32(C.Mesh, 4, Packet);
Writer.UInt32(C.EntityID, 8, Packet);
if (C.Guild != null)
{
Writer.UInt16(C.Guild.ID, 3, Packet);
Writer.Byte(Convert.ToByte(C.GuildRank), 15, Packet);
}
Writer.UInt64(Convert.ToUInt64(C.StatEff.Value), 24, Packet);
if (C.Alive)
{
Writer.UInt32(C.Equipment.HeadGear.ID, 30, Packet);
Writer.UInt32(C.Equipment.Garment.ID, 34, Packet);
Writer.UInt32(C.Equipment.Armor.ID, 38, Packet);
Writer.UInt32(C.Equipment.LeftHand.ID, 42, Packet);
Writer.UInt32(C.Equipment.RightHand.ID, 46, Packet);
Writer.UInt32(C.Equipment.Steed.ID, 50, Packet);
Writer.UInt16(C.Hair, 62, Packet);
}
// Offset:4 Value: Mesh (uint) //Offset:8 Value: UID (uint)
//Offset:24 Value: StatusFlag (ulong)
//Offset:58 Value: HitPoints (ushort)
//Offset:62 Value: HairStyle (ushort)
//Offet:64 Value: X (ushort)
//Offet:66 Value: Y (ushort)
//Offset:68 Vaue: Angle (byte)
//Offset:69 Value: Action (byte)
//Offset:75 Value: Level (byte)
//Offset:104 Value: QuizPoints (uint)
//Offset:156 Value: String.Length
//Offset:157 Value: String
//Writer.UInt32(12, 48, Packet);
//Writer.UInt32(0, 52, Packet);
Writer.UInt16(C.Loc.X, 64, Packet);
Writer.UInt16(C.Loc.Y, 66, Packet);
Writer.Byte(C.Direction, 68, Packet);
Writer.Byte(C.Action, 69, Packet);
Writer.Byte(C.Reborns, 74, Packet);
Writer.UInt16(C.Level, 75, Packet);
Writer.Byte(0, 71, Packet);
Writer.UInt32(Convert.ToUInt32(C.Nobility.Rank), 88, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.Armor.Color), 99, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.LeftHand.Color), 101, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.HeadGear.Color), 103, Packet);
Writer.UInt32(C.UniversityPoints, 98, Packet);
Writer.UInt32(C.UniversityPoints, 104, Packet);
Writer.UInt16(C.Equipment.Steed.Plus, 109, Packet);
Writer.UInt32(C.Equipment.Steed.TalismanProgress, 115, Packet);
Writer.Byte(1, 136, Packet);
Writer.Byte(Convert.ToByte(C.Name.Length + C.Client.AuthInfo.Status.Length), 156, Packet);
Writer.String(C.Name + C.Client.AuthInfo.Status, 157, Packet);
return Packet;
}
Spawn Viewed
Code:
public static COPacket SpawnViewed(Character C, byte Type)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10014);
P.WriteInt32(C.Mesh);
P.WriteInt32(C.EntityID);
if (C.Guild != null)
{
P.WriteInt16(C.Guild.ID);
P.Move(1);
P.WriteByte((byte)C.GuildRank);
}
else
P.Move(4);
P.WriteInt64((ulong)C.StatEff.Value);
if (C.Alive)
{
P.WriteInt32(C.Equipment.HeadGear.ID);
P.WriteInt32(C.Equipment.Garment.ID);
P.WriteInt32(C.Equipment.Armor.ID);
P.WriteInt32(C.Equipment.LeftHand.ID);
P.WriteInt32(C.Equipment.RightHand.ID);
P.WriteInt32(C.Equipment.Steed.ID);
}
else P.Move(24);
P.WriteInt32(12);
P.WriteInt16(0);
P.WriteInt16(0);
if (C.Alive)
P.WriteInt16(C.Hair);
else P.Move(2);
P.WriteInt16(C.Loc.X);
P.WriteInt16(C.Loc.Y);
P.WriteByte(C.Direction);
P.WriteByte(C.Action);
P.Move(4);
P.WriteByte(C.Reborns);
P.WriteInt16(C.Level);
P.WriteByte(Type);//type 0 = screen / 1 = window
P.Move(16);
P.WriteInt32((byte)C.Nobility.Rank);
P.WriteInt16((ushort)C.Equipment.Armor.Color);
P.WriteInt16((ushort)C.Equipment.LeftHand.Color);
P.WriteInt16((ushort)C.Equipment.HeadGear.Color);
P.WriteInt32(C.UniversityPoints);
P.WriteInt16(C.Equipment.Steed.Plus);
P.WriteInt32(0);
P.WriteInt32(C.Equipment.Steed.TalismanProgress);
P.Move(24);
P.WriteByte(1);
P.WriteByte((byte)(C.Name + C.Client.AuthInfo.Status).Length);
P.WriteString((C.Name + C.Client.AuthInfo.Status));
return P;
}
Hero Information.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MayaConquer_v2.GameSystem;
namespace MayaConquer_v2.Packets
{
public class CharacterInfo : Writer, Interfaces.IPacket
{
GameClient client;
public CharacterInfo(GameClient _client)
{
client = _client;
}
public void Deserialize(byte[] buffer)
{
throw new NotImplementedException();
}
public byte[] ToArray()
{
byte[] Packet = new byte[160 + (client.Char.Spouse.Length) + (client.Char.Name + client.Char.Client.AuthInfo.Status).Length + 4];
UInt16((ushort)(Packet.Length - 8), 0, Packet);
UInt16(0x3ee, 2, Packet);
UInt32(client.Char.EntityID, 4, Packet);
UInt32(client.Char.Mesh, 8, Packet);
UInt16(client.Char.Hair, 12, Packet);
UInt32(client.Char.Silvers, 14, Packet);
UInt32(client.Char.CPs, 18, Packet);
UInt64(client.Char.Experience, 22, Packet);
UInt16(client.Char.Str, 50, Packet);
UInt16(client.Char.Agi, 52, Packet);
UInt16(client.Char.Vit, 54, Packet);
UInt16(client.Char.Spi, 56, Packet);
UInt16(client.Char.StatPoints, 58, Packet);
UInt16((ushort)client.Char.CurHP, 60, Packet);
UInt16(client.Char.CurMP, 62, Packet);
UInt16(client.Char.PKPoints, 64, Packet);
Packet[66] = client.Char.Level;
Packet[67] = client.Char.Job;
Packet[69] = client.Char.Reborns;
Packet[70] = 1;
UInt32(client.Char.UniversityPoints, 71, Packet);
Packet[81] = 1;
Packet[89] = 2;
WriteStringWithLength(client.Char.Name, 90, Packet);
WriteStringWithLength(client.Char.Spouse, 91 + Packet[90], Packet);
return Packet;
}
public void Send(GameClient client)
{
client.Send(ToArray());
}
}
}
I have only just started learning about packets and offsets so even if you point me in the right direction would be alot of help.
anymore info you need just ask
Thanks in advance
|
|
|
02/16/2011, 17:11
|
#14
|
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
|
Quote:
Originally Posted by Yup Arco
And make more unnecassary work for the GC?
|
You're not a real coder Arco. Unless it comes out of a real coder, I don't think that the small difference really matters. This way it doesn't have to try to get the equipment of the character. It's given it instead one equip at a time.
Quote:
Originally Posted by .Beatz
Right, I am having quite a few problems and wanna see if anyone can see whats wrong in this code. I can view my own name in my client but I cant view other peoples names :/ and vice versa.
Also GM and PM are not showing up... I am not too fussed about that atm though
Spawn entity void
Code:
public static byte[] SpawnEntity(Character C)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
Writer.UInt16(Convert.ToUInt16(Packet.Length - 8), 0, Packet);
Writer.UInt16(10014, 2, Packet);
Writer.UInt32(C.Mesh, 4, Packet);
Writer.UInt32(C.EntityID, 8, Packet);
if (C.Guild != null)
{
Writer.UInt16(C.Guild.ID, 3, Packet);
Writer.Byte(Convert.ToByte(C.GuildRank), 15, Packet);
}
Writer.UInt64(Convert.ToUInt64(C.StatEff.Value), 24, Packet);
if (C.Alive)
{
Writer.UInt32(C.Equipment.HeadGear.ID, 30, Packet);
Writer.UInt32(C.Equipment.Garment.ID, 34, Packet);
Writer.UInt32(C.Equipment.Armor.ID, 38, Packet);
Writer.UInt32(C.Equipment.LeftHand.ID, 42, Packet);
Writer.UInt32(C.Equipment.RightHand.ID, 46, Packet);
Writer.UInt32(C.Equipment.Steed.ID, 50, Packet);
Writer.UInt16(C.Hair, 62, Packet);
}
// Offset:4 Value: Mesh (uint) //Offset:8 Value: UID (uint)
//Offset:24 Value: StatusFlag (ulong)
//Offset:58 Value: HitPoints (ushort)
//Offset:62 Value: HairStyle (ushort)
//Offet:64 Value: X (ushort)
//Offet:66 Value: Y (ushort)
//Offset:68 Vaue: Angle (byte)
//Offset:69 Value: Action (byte)
//Offset:75 Value: Level (byte)
//Offset:104 Value: QuizPoints (uint)
//Offset:156 Value: String.Length
//Offset:157 Value: String
//Writer.UInt32(12, 48, Packet);
//Writer.UInt32(0, 52, Packet);
Writer.UInt16(C.Loc.X, 64, Packet);
Writer.UInt16(C.Loc.Y, 66, Packet);
Writer.Byte(C.Direction, 68, Packet);
Writer.Byte(C.Action, 69, Packet);
Writer.Byte(C.Reborns, 74, Packet);
Writer.UInt16(C.Level, 75, Packet);
Writer.Byte(0, 71, Packet);
Writer.UInt32(Convert.ToUInt32(C.Nobility.Rank), 88, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.Armor.Color), 99, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.LeftHand.Color), 101, Packet);
Writer.UInt16(Convert.ToUInt16(C.Equipment.HeadGear.Color), 103, Packet);
Writer.UInt32(C.UniversityPoints, 98, Packet);
Writer.UInt32(C.UniversityPoints, 104, Packet);
Writer.UInt16(C.Equipment.Steed.Plus, 109, Packet);
Writer.UInt32(C.Equipment.Steed.TalismanProgress, 115, Packet);
Writer.Byte(1, 136, Packet);
Writer.Byte(Convert.ToByte(C.Name.Length + C.Client.AuthInfo.Status.Length), 156, Packet);
Writer.String(C.Name + C.Client.AuthInfo.Status, 157, Packet);
return Packet;
}
Spawn Viewed
Code:
public static COPacket SpawnViewed(Character C, byte Type)
{
byte[] Packet = new byte[8 + 160 + (C.Name + C.Client.AuthInfo.Status).Length + 4];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10014);
P.WriteInt32(C.Mesh);
P.WriteInt32(C.EntityID);
if (C.Guild != null)
{
P.WriteInt16(C.Guild.ID);
P.Move(1);
P.WriteByte((byte)C.GuildRank);
}
else
P.Move(4);
P.WriteInt64((ulong)C.StatEff.Value);
if (C.Alive)
{
P.WriteInt32(C.Equipment.HeadGear.ID);
P.WriteInt32(C.Equipment.Garment.ID);
P.WriteInt32(C.Equipment.Armor.ID);
P.WriteInt32(C.Equipment.LeftHand.ID);
P.WriteInt32(C.Equipment.RightHand.ID);
P.WriteInt32(C.Equipment.Steed.ID);
}
else P.Move(24);
P.WriteInt32(12);
P.WriteInt16(0);
P.WriteInt16(0);
if (C.Alive)
P.WriteInt16(C.Hair);
else P.Move(2);
P.WriteInt16(C.Loc.X);
P.WriteInt16(C.Loc.Y);
P.WriteByte(C.Direction);
P.WriteByte(C.Action);
P.Move(4);
P.WriteByte(C.Reborns);
P.WriteInt16(C.Level);
P.WriteByte(Type);//type 0 = screen / 1 = window
P.Move(16);
P.WriteInt32((byte)C.Nobility.Rank);
P.WriteInt16((ushort)C.Equipment.Armor.Color);
P.WriteInt16((ushort)C.Equipment.LeftHand.Color);
P.WriteInt16((ushort)C.Equipment.HeadGear.Color);
P.WriteInt32(C.UniversityPoints);
P.WriteInt16(C.Equipment.Steed.Plus);
P.WriteInt32(0);
P.WriteInt32(C.Equipment.Steed.TalismanProgress);
P.Move(24);
P.WriteByte(1);
P.WriteByte((byte)(C.Name + C.Client.AuthInfo.Status).Length);
P.WriteString((C.Name + C.Client.AuthInfo.Status));
return P;
}
Hero Information.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MayaConquer_v2.GameSystem;
namespace MayaConquer_v2.Packets
{
public class CharacterInfo : Writer, Interfaces.IPacket
{
GameClient client;
public CharacterInfo(GameClient _client)
{
client = _client;
}
public void Deserialize(byte[] buffer)
{
throw new NotImplementedException();
}
public byte[] ToArray()
{
byte[] Packet = new byte[160 + (client.Char.Spouse.Length) + (client.Char.Name + client.Char.Client.AuthInfo.Status).Length + 4];
UInt16((ushort)(Packet.Length - 8), 0, Packet);
UInt16(0x3ee, 2, Packet);
UInt32(client.Char.EntityID, 4, Packet);
UInt32(client.Char.Mesh, 8, Packet);
UInt16(client.Char.Hair, 12, Packet);
UInt32(client.Char.Silvers, 14, Packet);
UInt32(client.Char.CPs, 18, Packet);
UInt64(client.Char.Experience, 22, Packet);
UInt16(client.Char.Str, 50, Packet);
UInt16(client.Char.Agi, 52, Packet);
UInt16(client.Char.Vit, 54, Packet);
UInt16(client.Char.Spi, 56, Packet);
UInt16(client.Char.StatPoints, 58, Packet);
UInt16((ushort)client.Char.CurHP, 60, Packet);
UInt16(client.Char.CurMP, 62, Packet);
UInt16(client.Char.PKPoints, 64, Packet);
Packet[66] = client.Char.Level;
Packet[67] = client.Char.Job;
Packet[69] = client.Char.Reborns;
Packet[70] = 1;
UInt32(client.Char.UniversityPoints, 71, Packet);
Packet[81] = 1;
Packet[89] = 2;
WriteStringWithLength(client.Char.Name, 90, Packet);
WriteStringWithLength(client.Char.Spouse, 91 + Packet[90], Packet);
return Packet;
}
public void Send(GameClient client)
{
client.Send(ToArray());
}
}
}
I have only just started learning about packets and offsets so even if you point me in the right direction would be alot of help.
anymore info you need just ask
Thanks in advance
|
Character Spawn packet.
Length is 160 + Name.Length
Spawn[155] = 1;
Spawn[156] = (byte)_Name.Length;
WriteString(_Name, 157, Spawn);
|
|
|
02/16/2011, 17:20
|
#15
|
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
|
Quote:
Originally Posted by Spirited
You're not a real coder Arco.
|
Oh shut the hell up, I'm just repeating the information I got from Hybrid. QQ
|
|
|
|
|
Similar Threads
|
[Arena] 5180 Help!
01/23/2011 - CO2 Private Server - 7 Replies
Hello e*PvPers. I'm trying to learn how the packets are going, But I've got a trouble. Once i try to send the arena packet , the client crashes :/ I've made the packet from 12tails' Packet Structure. Please check if it's right. and forward me on the right way.
There's the packet.
public static COPacket ArenaInfo(Game.Character C)
{
byte Packet = new byte;
COPacket P = new COPacket(Packet);//0
P.WriteInt16(2209);//2
...
|
[5180] Packets
12/30/2010 - CO2 Private Server - 6 Replies
Hello Everybody,, I need little help
Can Somebody tell me which packets I gotta update at 5180
My Current Source version was 5165 , Now It's 5180..
Which Packets Are Different Between 5165 - 5180?
I appreciate your help
Thanks.
Best Regards,
TheKnight
|
Hey patch 5180
11/05/2009 - Conquer Online 2 - 6 Replies
Takes out all of the files for multi client and replaces it.
So you can only have 2 clients.
Anyone working on making another multi client again?
|
All times are GMT +2. The time now is 21:50.
|
|