feature/84-character-creation #88
1 changed files with 19 additions and 19 deletions
|
@ -18,38 +18,38 @@ public class CharacterCreationResponsePacket : IPacket
|
||||||
{
|
{
|
||||||
Span<byte> data = stackalloc byte[132];
|
Span<byte> data = stackalloc byte[132];
|
||||||
|
|
||||||
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(0 + 132, 4), 0);
|
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(0, 4), 0);
|
||||||
Encoding.ASCII.GetBytes(Character.Name, data.Slice(4 + 132, 20));
|
Encoding.ASCII.GetBytes(Character.Name, data.Slice(4, 20));
|
||||||
|
|
||||||
// Job Data
|
// Job Data
|
||||||
data[24 + 132] = Character.Job.FirstJob;
|
data[24] = Character.Job.FirstJob;
|
||||||
data[25 + 132] = Character.Job.SecondJob;
|
data[25] = Character.Job.SecondJob;
|
||||||
data[26 + 132] = Character.Job.ThirdJob;
|
data[26] = Character.Job.ThirdJob;
|
||||||
data[27 + 132] = Character.Job.FourthJob;
|
data[27] = Character.Job.FourthJob;
|
||||||
|
|
||||||
data[28 + 132] = (byte)Character.Gender;
|
data[28] = (byte)Character.Gender;
|
||||||
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(49 + 132, 2), Character.Level);
|
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(49, 2), Character.Level);
|
||||||
data[31 + 132] = (byte)Character.Experience;
|
data[31] = (byte)Character.Experience;
|
||||||
|
|
||||||
// Stats
|
// Stats
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(32 + 132, 2), Character.Stats.Strength);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(32, 2), Character.Stats.Strength);
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(34 + 132, 2), Character.Stats.Dexterity);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(34, 2), Character.Stats.Dexterity);
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(36 + 132, 2), Character.Stats.Intelligence);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(36, 2), Character.Stats.Intelligence);
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(38 + 132, 2), Character.Stats.Vitality);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(38, 2), Character.Stats.Vitality);
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(40 + 132, 2), Character.Stats.Luck);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(40, 2), Character.Stats.Luck);
|
||||||
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(42 + 132, 2), Character.Stats.Wisdom);
|
BinaryPrimitives.WriteInt16LittleEndian(data.Slice(42, 2), Character.Stats.Wisdom);
|
||||||
|
|
||||||
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(44 + 132, 4), Character.Health);
|
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(44, 4), Character.Health);
|
||||||
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(48 + 132, 4), Character.Mana);
|
BinaryPrimitives.WriteInt32LittleEndian(data.Slice(48, 4), Character.Mana);
|
||||||
|
|
||||||
for (var i = 0; i < 20; i++)
|
for (var i = 0; i < 20; i++)
|
||||||
{
|
{
|
||||||
// Equipped Items
|
// Equipped Items
|
||||||
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(52 + 132 + i * 2, 2),
|
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(52 + i * 2, 2),
|
||||||
Character.EquippedItems.Length > i ? Character.EquippedItems[i] : (ushort)0);
|
Character.EquippedItems.Length > i ? Character.EquippedItems[i] : (ushort)0);
|
||||||
|
|
||||||
// Equipped Cash Items
|
// Equipped Cash Items
|
||||||
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(92 + 132 + i * 2, 2),
|
BinaryPrimitives.WriteUInt16LittleEndian(data.Slice(92 + i * 2, 2),
|
||||||
Character.EquippedCashItems.Length > i ? Character.EquippedCashItems[i] : (ushort)0);
|
Character.EquippedCashItems.Length > i ? Character.EquippedCashItems[i] : (ushort)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue