public static void SendFishingBooksInfoResponse(IRealmClient client, Asda2FishingBook book) { using (var packet = new RealmPacketOut(RealmServerOpCode.FishingBooksInfo)) //6174 { packet.WriteByte(book.Num); //{fishBookNum}default value : 0 Len : 1 packet.WriteInt32(0); //value name : unk4 default value : 0Len : 4 for (int i = 0; i < 30; i += 1) { packet.WriteInt32(book.FishIds[i]); //{fishId}default value : 0 Len : 4 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.Amounts[i]); //{amounts}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.MaxLength[i]); //{maxLength}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(book.MinLengths[i]); //{minLength}default value : 0 Len : 2 } client.Send(packet, addEnd: true); } }
[PacketHandler(RealmServerOpCode.RegisterFishingBook)]//6176 public static void RegisterFishingBookRequest(IRealmClient client, RealmPacketIn packet) { var cell = packet.ReadInt16();//default : 17Len : 2 var itm = client.ActiveCharacter.Asda2Inventory.GetRegularItem(cell); if (itm == null) { client.ActiveCharacter.YouAreFuckingCheater("Tryes to register not existing fishing book", 10); SendFishingBookRegisteredResponse(client, RegisterFishingBookStatus.Fail, null, null); return; } if (itm.Category != Asda2ItemCategory.FishingBook) { client.ActiveCharacter.YouAreFuckingCheater("Tryes to register not a fishing book", 70); SendFishingBookRegisteredResponse(client, RegisterFishingBookStatus.Fail, null, null); return; } var fb = client.ActiveCharacter.RegisteredFishingBooks.Values.FirstOrDefault(f => f.BookId == itm.ItemId); if (fb != null) { SendFishingBookRegisteredResponse(client, RegisterFishingBookStatus.AlreadyRegistered, null, null); return; } RealmServer.IOQueue.AddMessage(() => { var nfb = new Asda2FishingBook(itm.ItemId, client.ActiveCharacter, (byte)client.ActiveCharacter.RegisteredFishingBooks.Count); nfb.CreateLater(); client.ActiveCharacter.RegisteredFishingBooks.Add(nfb.Num, nfb); itm.Destroy(); SendFishingBookRegisteredResponse(client, RegisterFishingBookStatus.Ok, itm, nfb); }); }
public static void SendFishingBookRegisteredResponse(IRealmClient client, RegisterFishingBookStatus status, Asda2Item book, Asda2FishingBook fishingBook) { using (var packet = new RealmPacketOut(RealmServerOpCode.FishingBookRegistered)) //6177 { packet.WriteByte((byte)status); //{status}default value : 1 Len : 1 if (fishingBook != null) { packet.WriteInt16(client.ActiveCharacter.Asda2Inventory.Weight); //{invWeight}default value : 8980 Len : 2 packet.WriteInt32(book == null ? 0 : book.ItemId); //{bookId}default value : 31824 Len : 4 packet.WriteByte((byte)(book == null ? 0 : book.InventoryType)); //{inv}default value : 2 Len : 1 packet.WriteInt16(book == null ? 0 : book.Slot); //{cell}default value : 17 Len : 2 packet.WriteSkip(unk10); //value name : unk10 default value : unk10Len : 50 packet.WriteByte(fishingBook.Num); //{bookNum}default value : 1 Len : 1 packet.WriteInt32(0); //value name : unk4 default value : 0Len : 4 for (int i = 0; i < 30; i += 1) { packet.WriteInt32(fishingBook.FishIds[0]); //{fishId}default value : 0 Len : 4 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(fishingBook.Amounts[i]); //{amounts}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(fishingBook.MaxLength[i]); //{maxLength}default value : 0 Len : 2 } for (int i = 0; i < 30; i += 1) { packet.WriteInt16(fishingBook.MinLengths[i]); //{minLength}default value : 0 Len : 2 } } client.Send(packet, addEnd: true); } }