From 8154990e3f07a5de484867c29fe2b1dfc2dd1768 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Wed, 4 Jan 2023 22:55:06 +0100 Subject: [PATCH] feat(packets): add many new packets --- Core/NosSmooth.Game/Helpers/EntityHelpers.cs | 2 +- .../Characters/CharacterInitResponder.cs | 2 +- .../Entities/SkillUsedResponder.cs | 5 +- .../PacketHandlers/Map/InResponder.cs | 4 +- .../Client/Battle/NcifPacket.cs | 1 + .../Client/Battle/UseSkillPacket.cs | 1 + .../Client/Login/CClosePacket.cs | 21 +++ .../Client/Login/GameStartPacket.cs | 24 +++ .../Client/Login/LbsPacket.cs | 28 ++++ .../Client/Login/SelectPacket.cs | 29 ++++ .../Enums/Entities/EntityType.cs | 2 +- .../Enums/Entities/FactionType.cs | 2 +- .../Enums/Mates/PartnerSkillRank.cs | 53 +++++++ .../Enums/Packets/AscrPacketType.cs | 35 +++++ .../Enums/Packets/QSlotType.cs | 38 +++++ .../Enums/Players/AuthorityType.cs | 2 +- .../Enums/Quests/QuestGoalType.cs | 47 ++++++ .../Enums/Relations/CharacterRelationType.cs | 33 ++++ .../NosSmooth.Packets/Server/Act4/FcPacket.cs | 1 + .../Server/Battle/BsPacket.cs | 1 + .../Server/Battle/SuPacket.cs | 1 + .../Server/Character/AscrPacket.cs | 46 ++++++ .../{Players => Character}/CInfoPacket.cs | 3 +- .../Server/Character/CInfoResetPacket.cs | 30 ++++ .../{Players => Character}/CModePacket.cs | 4 +- .../{Players => Character}/FamilySubPacket.cs | 2 +- .../Server/Character/FdPacket.cs | 30 ++++ .../Server/Character/FsPacket.cs | 22 +++ .../{Players => Character}/LevPacket.cs | 2 +- .../Server/Character/RagePacket.cs | 24 +++ .../Server/Character/ResistanceSubPacket.cs | 30 ++++ .../Server/Character/RsfiPacket.cs | 37 +++++ .../Server/Character/RsfpPacket.cs | 24 +++ .../Server/Character/ScArmorSubPacket.cs | 37 +++++ .../Server/Character/ScPacket.cs | 36 +++++ .../Server/Character/ScWeaponSubPacket.cs | 37 +++++ .../Server/Character/TitPacket.cs | 31 ++++ .../Server/Character/TitinfoPacket.cs | 31 ++++ .../Server/Character/TitlePacket.cs | 21 +++ .../Server/Character/TitleSubPacket.cs | 25 +++ .../Server/Chat/SayPacket.cs | 1 + .../Server/Entities/CondPacket.cs | 1 + .../Server/Entities/MovePacket.cs | 1 + .../Server/Entities/StPacket.cs | 1 + .../Server/Families/GidxPacket.cs | 39 +++++ .../Server/Groups/PinitSubPacket.cs | 1 + .../Server/Inventory/EqPacket.cs | 3 +- .../Server/Inventory/EquipPacket.cs | 28 ++++ .../Server/Inventory/EquipSubPacket.cs | 37 +++++ .../Server/Inventory/ExtsPacket.cs | 32 ++++ .../Server/Inventory/GoldPacket.cs | 24 +++ .../Server/Inventory/PairyPacket.cs | 38 +++++ .../Server/Login/CListEndPacket.cs | 21 +++ .../Server/Login/CListEquipmentSubPacket.cs | 44 ++++++ .../Server/Login/CListPacket.cs | 81 ++++++++++ .../Server/Login/CListPetSubPacket.cs | 24 +++ .../Server/Login/CListStartPacket.cs | 26 ++++ .../Server/Login/FStashEndPacket.cs | 16 ++ .../Server/Login/OkPacket.cs | 20 +++ .../Server/Maps/Bgm2Packet.cs | 21 +++ .../NosSmooth.Packets/Server/Maps/InPacket.cs | 1 + .../Server/Maps/InPlayerSubPacket.cs | 5 +- .../Server/Maps/OutPacket.cs | 1 + .../Server/Mates/ScNEquipmentSubPacket.cs | 29 ++++ .../Server/Mates/ScNPacket.cs | 143 ++++++++++++++++++ .../Server/Mates/ScNSkillSubPacket.cs | 27 ++++ .../Server/Mates/ScNSpSubPacket.cs | 26 ++++ .../Server/Mates/ScPPacket.cs | 112 ++++++++++++++ .../Server/Npc/ShopPacket.cs | 39 +++++ .../Quests/QstListObjectiveSubPacket.cs | 26 ++++ .../Server/Quests/QstListPacket.cs | 22 +++ .../Server/Quests/QstListSubPacket.cs | 53 +++++++ .../Server/Quicklist/QSlotPacket.cs | 24 +++ .../Server/Quicklist/QSlotSubPacket.cs | 32 ++++ .../Server/Relations/FInfoPacket.cs | 21 +++ .../Server/Relations/FInfoSubPacket.cs | 29 ++++ .../Server/Relations/FInitPacket.cs | 21 +++ .../Server/Relations/FInitSubPacket.cs | 33 ++++ .../NosSmooth.Packets/Server/UI/Act6Packet.cs | 16 ++ .../NosSmooth.Packets/Server/UI/BnPacket.cs | 29 ++++ .../NosSmooth.Packets/Server/UI/TwkPacket.cs | 42 +++++ .../Packets/FcPacketConverterTests.cs | 1 + .../Packets/InPacketConverterTests.cs | 2 +- .../Packets/MovePacketConverterTests.cs | 2 +- .../Packets/PinitPacketConverterTest.cs | 2 +- .../Packets/SkiPacketConverterTests.cs | 2 - 86 files changed, 1976 insertions(+), 27 deletions(-) create mode 100644 Packets/NosSmooth.Packets/Client/Login/CClosePacket.cs create mode 100644 Packets/NosSmooth.Packets/Client/Login/GameStartPacket.cs create mode 100644 Packets/NosSmooth.Packets/Client/Login/LbsPacket.cs create mode 100644 Packets/NosSmooth.Packets/Client/Login/SelectPacket.cs create mode 100644 Packets/NosSmooth.Packets/Enums/Mates/PartnerSkillRank.cs create mode 100644 Packets/NosSmooth.Packets/Enums/Packets/AscrPacketType.cs create mode 100644 Packets/NosSmooth.Packets/Enums/Packets/QSlotType.cs create mode 100644 Packets/NosSmooth.Packets/Enums/Quests/QuestGoalType.cs create mode 100644 Packets/NosSmooth.Packets/Enums/Relations/CharacterRelationType.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs rename Packets/NosSmooth.Packets/Server/{Players => Character}/CInfoPacket.cs (97%) create mode 100644 Packets/NosSmooth.Packets/Server/Character/CInfoResetPacket.cs rename Packets/NosSmooth.Packets/Server/{Players => Character}/CModePacket.cs (93%) rename Packets/NosSmooth.Packets/Server/{Players => Character}/FamilySubPacket.cs (93%) create mode 100644 Packets/NosSmooth.Packets/Server/Character/FdPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/FsPacket.cs rename Packets/NosSmooth.Packets/Server/{Players => Character}/LevPacket.cs (97%) create mode 100644 Packets/NosSmooth.Packets/Server/Character/RagePacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/ResistanceSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/RsfiPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/RsfpPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/ScArmorSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/ScPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/ScWeaponSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/TitPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/TitinfoPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/TitlePacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Character/TitleSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Families/GidxPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Inventory/EquipPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Inventory/EquipSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Inventory/ExtsPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Inventory/GoldPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Inventory/PairyPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/CListEndPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/CListEquipmentSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/CListPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/CListPetSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/CListStartPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/FStashEndPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Login/OkPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Maps/Bgm2Packet.cs create mode 100644 Packets/NosSmooth.Packets/Server/Mates/ScNEquipmentSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Mates/ScNPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Mates/ScNSkillSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Mates/ScNSpSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Mates/ScPPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Npc/ShopPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Quests/QstListObjectiveSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Quests/QstListPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Quests/QstListSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Quicklist/QSlotPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Quicklist/QSlotSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Relations/FInitPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/UI/Act6Packet.cs create mode 100644 Packets/NosSmooth.Packets/Server/UI/BnPacket.cs create mode 100644 Packets/NosSmooth.Packets/Server/UI/TwkPacket.cs diff --git a/Core/NosSmooth.Game/Helpers/EntityHelpers.cs b/Core/NosSmooth.Game/Helpers/EntityHelpers.cs index 6554e4a8e80eba8eb5676c0f69ef5f390d2a7018..24b773db275ab21f3fae7fbebb87cf68abfc3fff 100644 --- a/Core/NosSmooth.Game/Helpers/EntityHelpers.cs +++ b/Core/NosSmooth.Game/Helpers/EntityHelpers.cs @@ -5,7 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Game.Data.Entities; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; namespace NosSmooth.Game.Helpers; diff --git a/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs index f34ef4303440e85545959411749b1968df56a122..3869db988f3d4dbadae577e7f9f3746d58a1c6f6 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs @@ -10,7 +10,7 @@ using NosSmooth.Game.Data.Info; using NosSmooth.Game.Data.Social; using NosSmooth.Game.Events.Characters; using NosSmooth.Game.Events.Core; -using NosSmooth.Packets.Server.Players; +using NosSmooth.Packets.Server.Character; using Remora.Results; namespace NosSmooth.Game.PacketHandlers.Characters; diff --git a/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs index a39e58cf1dd822aa634fdfddb8056b27daa35b91..8a514c43e83327b6db21d78a8e59063a6a4f493b 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs @@ -5,11 +5,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.Logging; -using Microsoft.VisualBasic; using NosSmooth.Core.Extensions; using NosSmooth.Core.Packets; using NosSmooth.Data.Abstractions; -using NosSmooth.Data.Abstractions.Enums; using NosSmooth.Game.Data.Characters; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; @@ -19,8 +17,7 @@ using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Entities; using NosSmooth.Game.Extensions; using NosSmooth.Game.Helpers; -using NosSmooth.Packets.Client.Battle; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Battle; using NosSmooth.Packets.Server.Skills; using Remora.Results; diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs index 4bfcf6ec295e384cfb181d236c690ea566211c3b..a0e0e5c0727bb87c5028d125fb98ea672814c46c 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs @@ -10,13 +10,11 @@ using NosSmooth.Core.Packets; using NosSmooth.Data.Abstractions; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; -using NosSmooth.Game.Data.Items; using NosSmooth.Game.Data.Social; using NosSmooth.Game.Events.Core; using NosSmooth.Game.Events.Entities; using NosSmooth.Game.Helpers; -using NosSmooth.Packets.Enums; -using NosSmooth.Packets.Server.Entities; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Maps; using Remora.Results; diff --git a/Packets/NosSmooth.Packets/Client/Battle/NcifPacket.cs b/Packets/NosSmooth.Packets/Client/Battle/NcifPacket.cs index f9b034064d061fe9f6d30653c400e1923ba44055..06da474ab653e495a9f175e2a6a9fe269fb56666 100644 --- a/Packets/NosSmooth.Packets/Client/Battle/NcifPacket.cs +++ b/Packets/NosSmooth.Packets/Client/Battle/NcifPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Client.Battle; diff --git a/Packets/NosSmooth.Packets/Client/Battle/UseSkillPacket.cs b/Packets/NosSmooth.Packets/Client/Battle/UseSkillPacket.cs index a4404f542df066e2c27a3e36a46a76c1e8183b69..4c0a1fc492f0b38d039fcb864066f2a281b668ad 100644 --- a/Packets/NosSmooth.Packets/Client/Battle/UseSkillPacket.cs +++ b/Packets/NosSmooth.Packets/Client/Battle/UseSkillPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Client.Battle; diff --git a/Packets/NosSmooth.Packets/Client/Login/CClosePacket.cs b/Packets/NosSmooth.Packets/Client/Login/CClosePacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..432ac2cd86fb92ddf3963c3278eac7a54b4189d0 --- /dev/null +++ b/Packets/NosSmooth.Packets/Client/Login/CClosePacket.cs @@ -0,0 +1,21 @@ +// +// CClosePacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Client.Login; + +/// +/// Unknown function +/// +/// Unknown, seems to be either 0 or 1. +[GenerateSerializer(true)] +[PacketHeader("c_close", PacketSource.Client)] +public record CClosePacket +( + [PacketIndex(0)] + byte Unknown +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Client/Login/GameStartPacket.cs b/Packets/NosSmooth.Packets/Client/Login/GameStartPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..a5c458764ca3cd8c3142f755f85b7c4ea80d647f --- /dev/null +++ b/Packets/NosSmooth.Packets/Client/Login/GameStartPacket.cs @@ -0,0 +1,24 @@ +// +// GameStartPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Login; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Client.Login; + +/// +/// Start the game. +/// +/// +/// Sent after that was received +/// after sending . +/// +/// After , +/// should follow. +/// +[GenerateSerializer(true)] +[PacketHeader("game_start", PacketSource.Client)] +public record GameStartPacket() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Client/Login/LbsPacket.cs b/Packets/NosSmooth.Packets/Client/Login/LbsPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..d626b77c959f6c2f6f7dc4f99bd3bb4ee0a06c55 --- /dev/null +++ b/Packets/NosSmooth.Packets/Client/Login/LbsPacket.cs @@ -0,0 +1,28 @@ +// +// LbsPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Login; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Client.Login; + +/// +/// Function unknown, sent +/// right after . +/// +/// +/// After was received, +/// and +/// should follow. +/// +/// Unknown, seems to be always 0. +[PacketHeader("lbs", PacketSource.Client)] +[GenerateSerializer(true)] +public record LbsPacket +( + [PacketIndex(0)] + byte Unknown = 0 +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Client/Login/SelectPacket.cs b/Packets/NosSmooth.Packets/Client/Login/SelectPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..c7b2fc26024067dc4413f967b7134be484aa0957 --- /dev/null +++ b/Packets/NosSmooth.Packets/Client/Login/SelectPacket.cs @@ -0,0 +1,29 @@ +// +// SelectPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Login; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Client.Login; + +/// +/// Select character on the given slot from . +/// +/// +/// should be sent from the server +/// after select. +/// +/// Then the client sends +/// and . +/// +/// The slot of the character from clist. +[GenerateSerializer(true)] +[PacketHeader("select", PacketSource.Client)] +public record SelectPacket +( + [PacketIndex(0)] + byte Slot +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Enums/Entities/EntityType.cs b/Packets/NosSmooth.Packets/Enums/Entities/EntityType.cs index ea5471bf32a1aa74f3d7ddcb282f3625baa64ec5..c73571bde10aff5edee808a0f0576b0918c6add4 100644 --- a/Packets/NosSmooth.Packets/Enums/Entities/EntityType.cs +++ b/Packets/NosSmooth.Packets/Enums/Entities/EntityType.cs @@ -4,7 +4,7 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace NosSmooth.Packets.Enums; +namespace NosSmooth.Packets.Enums.Entities; /// /// Type of the entity. diff --git a/Packets/NosSmooth.Packets/Enums/Entities/FactionType.cs b/Packets/NosSmooth.Packets/Enums/Entities/FactionType.cs index cae8ee04e80fe6ff46c473d2cb078c58a25c5744..f3226874d828729b0cd2e7dd056943c6a182eeec 100644 --- a/Packets/NosSmooth.Packets/Enums/Entities/FactionType.cs +++ b/Packets/NosSmooth.Packets/Enums/Entities/FactionType.cs @@ -4,7 +4,7 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace NosSmooth.Packets.Enums; +namespace NosSmooth.Packets.Enums.Entities; /// /// Faction of an entity. diff --git a/Packets/NosSmooth.Packets/Enums/Mates/PartnerSkillRank.cs b/Packets/NosSmooth.Packets/Enums/Mates/PartnerSkillRank.cs new file mode 100644 index 0000000000000000000000000000000000000000..724d277cc1698baaab2377c8c608763026650cad --- /dev/null +++ b/Packets/NosSmooth.Packets/Enums/Mates/PartnerSkillRank.cs @@ -0,0 +1,53 @@ +// +// PartnerSkillRank.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace NosSmooth.Packets.Enums.Mates; + +/// +/// Ranks of partner sp skills. +/// +public enum PartnerSkillRank +{ + /// + /// The skills rank must be revealed first. + /// + NotIdentifiedYet = 0, + + /// + /// Worst skill rank. + /// + F = 1, + + /// + /// E skill rank. + /// + E = 2, + + /// + /// D skill rank. + /// + D = 3, + + /// + /// C skill rank. + /// + C = 4, + + /// + /// B skill rank. + /// + B = 5, + + /// + /// A skill rank. + /// + A = 6, + + /// + /// Best skill rank. + /// + S = 7 +} \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Enums/Packets/AscrPacketType.cs b/Packets/NosSmooth.Packets/Enums/Packets/AscrPacketType.cs new file mode 100644 index 0000000000000000000000000000000000000000..975ebeb2aa49e11933b14f571c82e410e39d9714 --- /dev/null +++ b/Packets/NosSmooth.Packets/Enums/Packets/AscrPacketType.cs @@ -0,0 +1,35 @@ +// +// AscrPacketType.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Character; + +namespace NosSmooth.Packets.Enums.Packets; + +/// +/// Type of . +/// +public enum AscrPacketType +{ + /// + /// Unknown TODO. + /// + Close = -1, + + /// + /// Unknown TOOD. + /// + Alone = 0, + + /// + /// Unknown TODO. + /// + Group = 1, + + /// + /// Unknown TODO. + /// + Family = 2 +} \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Enums/Packets/QSlotType.cs b/Packets/NosSmooth.Packets/Enums/Packets/QSlotType.cs new file mode 100644 index 0000000000000000000000000000000000000000..50dbb45331a409c0db90e47f5aa383047090868c --- /dev/null +++ b/Packets/NosSmooth.Packets/Enums/Packets/QSlotType.cs @@ -0,0 +1,38 @@ +// +// QSlotType.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace NosSmooth.Packets.Enums.Packets; + +/// +/// Type of a qslot packet. +/// +public enum QSlotType +{ + /// + /// Unknown TODO. + /// + Default = 0, + + /// + /// Set the given slot to new value. + /// + Set = 1, + + /// + /// Move the given slot item. + /// + Move = 2, + + /// + /// Remove the given slot item. + /// + Remove = 3, + + /// + /// Reset the given slot. + /// + Reset = 7 +} \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Enums/Players/AuthorityType.cs b/Packets/NosSmooth.Packets/Enums/Players/AuthorityType.cs index 89099095d211a59ac82878bbd5bbe9ff9fddd7f8..a83fb9808884b691c778c8284dd305b33d610db4 100644 --- a/Packets/NosSmooth.Packets/Enums/Players/AuthorityType.cs +++ b/Packets/NosSmooth.Packets/Enums/Players/AuthorityType.cs @@ -4,7 +4,7 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace NosSmooth.Packets.Enums; +namespace NosSmooth.Packets.Enums.Players; /// /// Authority of a player. diff --git a/Packets/NosSmooth.Packets/Enums/Quests/QuestGoalType.cs b/Packets/NosSmooth.Packets/Enums/Quests/QuestGoalType.cs new file mode 100644 index 0000000000000000000000000000000000000000..506e80537c17947baf79767445913674a3638de5 --- /dev/null +++ b/Packets/NosSmooth.Packets/Enums/Quests/QuestGoalType.cs @@ -0,0 +1,47 @@ +// +// QuestGoalType.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Diagnostics.CodeAnalysis; + +#pragma warning disable CS1591 +namespace NosSmooth.Packets.Enums.Quests; + +/// +/// A goal type of a quest. +/// +/// +/// Says when the reward may be obtained. +/// +[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1602:Enumeration items should be documented", Justification = "Too many fields that are self-explanatory.")] +public enum QuestGoalType +{ + Hunt = 1, + SpecialCollect = 2, + CollectInRaid = 3, + Brings = 4, + CaptureWithoutGettingTheMonster = 5, + Capture = 6, + TimesSpace = 7, + Product = 8, + NumberOfKill = 9, + TargetReput = 10, + TsPoint = 11, + Dialog1 = 12, + CollectInTs = 13, // Collect in TimeSpace + Required = 14, + Wear = 15, + Needed = 16, + Collect = 17, // Collect basic items & quests items + TransmitGold = 18, + GoTo = 19, + CollectMapEntity = 20, // Collect from map entity ( Ice Flower / Water ) + Use = 21, + Dialog2 = 22, + UnKnow = 23, + Inspect = 24, + WinRaid = 25, + FlowerQuest = 26, +} \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Enums/Relations/CharacterRelationType.cs b/Packets/NosSmooth.Packets/Enums/Relations/CharacterRelationType.cs new file mode 100644 index 0000000000000000000000000000000000000000..972ac7c7f0d37199f46974003e558693751359ad --- /dev/null +++ b/Packets/NosSmooth.Packets/Enums/Relations/CharacterRelationType.cs @@ -0,0 +1,33 @@ +// +// CharacterRelationType.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace NosSmooth.Packets.Enums.Relations; + +/// +/// Type of character-player relation. +/// +public enum CharacterRelationType +{ + /// + /// The player is blocked. + /// + Blocked = -1, + + /// + /// The player is a friend. + /// + Friend = 0, + + /// + /// The player is a hidden spouse. + /// + HiddenSpouse = 2, + + /// + /// The player is spouse. + /// + Spouse = 5, +} \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Act4/FcPacket.cs b/Packets/NosSmooth.Packets/Server/Act4/FcPacket.cs index d76f603e49e1bfbc9ba07e759765c0db163ae58e..82a89899e874039c42634b9cb05eff66b8b8a72d 100644 --- a/Packets/NosSmooth.Packets/Server/Act4/FcPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Act4/FcPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Act4; diff --git a/Packets/NosSmooth.Packets/Server/Battle/BsPacket.cs b/Packets/NosSmooth.Packets/Server/Battle/BsPacket.cs index 5aca851a20eee7e12a330b3829fe09e823b07002..d25d0ddf09e91485528f9a3715e30342ab7f9438 100644 --- a/Packets/NosSmooth.Packets/Server/Battle/BsPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Battle/BsPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Battle; diff --git a/Packets/NosSmooth.Packets/Server/Battle/SuPacket.cs b/Packets/NosSmooth.Packets/Server/Battle/SuPacket.cs index 0f01d03f3833bbf2cfce8c55d0bcffbc2ec69465..ed5ae1d476e4c928bb0bede7d4d5985e40832403 100644 --- a/Packets/NosSmooth.Packets/Server/Battle/SuPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Battle/SuPacket.cs @@ -6,6 +6,7 @@ using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Battle; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Battle; diff --git a/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs b/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..3a10b425de4b7542483ddd4165d9fbdda6d2e1cf --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/AscrPacket.cs @@ -0,0 +1,46 @@ +// +// AscrPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Packets; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Character statistics (kills, deaths) packet. +/// +/// The current kill count. +/// The current die count. +/// The current tc count. +/// The current arena kill count. +/// The current arena die count. +/// The current arena tc count. +/// Unknown TODO. +/// Unknown TODO. +/// The type of the ascr packet. +[PacketHeader("ascr", PacketSource.Server)] +[GenerateSerializer(true)] +public record AscrPacket +( + [PacketIndex(0)] + int CurrentKill, + [PacketIndex(1)] + int CurrentDie, + [PacketIndex(2)] + int CurrentTc, + [PacketIndex(3)] + int ArenaKill, + [PacketIndex(4)] + int ArenaDie, + [PacketIndex(5)] + int ArenaTc, + [PacketIndex(6)] + int KillGroup, + [PacketIndex(7)] + int DieGroup, + [PacketIndex(8)] + AscrPacketType? Type +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Players/CInfoPacket.cs b/Packets/NosSmooth.Packets/Server/Character/CInfoPacket.cs similarity index 97% rename from Packets/NosSmooth.Packets/Server/Players/CInfoPacket.cs rename to Packets/NosSmooth.Packets/Server/Character/CInfoPacket.cs index 85d9025a593c435dd627bce2ead8bdb80e9ac7ad..63fa10cbb9e99f7dc76e7f51fae8db30e6788a64 100644 --- a/Packets/NosSmooth.Packets/Server/Players/CInfoPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Character/CInfoPacket.cs @@ -4,11 +4,10 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Players; using NosSmooth.PacketSerializer.Abstractions.Attributes; -namespace NosSmooth.Packets.Server.Players; +namespace NosSmooth.Packets.Server.Character; /// /// Information about the playing character. diff --git a/Packets/NosSmooth.Packets/Server/Character/CInfoResetPacket.cs b/Packets/NosSmooth.Packets/Server/Character/CInfoResetPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..37de4eed96036402f21924bf3ba5445939bff2d7 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/CInfoResetPacket.cs @@ -0,0 +1,30 @@ +// +// CInfoResetPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Reset information about the character +/// (except for stuff from c_info) +/// +/// +/// Sent upon game initialization, +/// seems that it should reset the +/// character information. May be +/// useful when relogging as +/// different character. +/// +/// This is sent AFTER c_info, +/// that means not everything from +/// the character should be reset, +/// only fields that are not +/// in c_info. +/// +[PacketHeader("c_info_reset", PacketSource.Server)] +[GenerateSerializer(true)] +public record CInfoResetPacket() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Players/CModePacket.cs b/Packets/NosSmooth.Packets/Server/Character/CModePacket.cs similarity index 93% rename from Packets/NosSmooth.Packets/Server/Players/CModePacket.cs rename to Packets/NosSmooth.Packets/Server/Character/CModePacket.cs index b182b4087846e7e1fb151ba9205653bf2e5c9688..6adfba1086df7343a60f6f7006753b0fdf99b502 100644 --- a/Packets/NosSmooth.Packets/Server/Players/CModePacket.cs +++ b/Packets/NosSmooth.Packets/Server/Character/CModePacket.cs @@ -4,10 +4,10 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; -namespace NosSmooth.Packets.Server.Players; +namespace NosSmooth.Packets.Server.Character; /// /// TODO diff --git a/Packets/NosSmooth.Packets/Server/Players/FamilySubPacket.cs b/Packets/NosSmooth.Packets/Server/Character/FamilySubPacket.cs similarity index 93% rename from Packets/NosSmooth.Packets/Server/Players/FamilySubPacket.cs rename to Packets/NosSmooth.Packets/Server/Character/FamilySubPacket.cs index 0deb9b33dcdf1a93ac10fca8f1c2192112c02d57..65549564bfaabee006c7c7c7dc6b80f708ba9962 100644 --- a/Packets/NosSmooth.Packets/Server/Players/FamilySubPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Character/FamilySubPacket.cs @@ -6,7 +6,7 @@ using NosSmooth.PacketSerializer.Abstractions.Attributes; -namespace NosSmooth.Packets.Server.Players; +namespace NosSmooth.Packets.Server.Character; /// /// Sub packet with family information. diff --git a/Packets/NosSmooth.Packets/Server/Character/FdPacket.cs b/Packets/NosSmooth.Packets/Server/Character/FdPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a302d8c2bdf671f3247d18d1bacf2c2c38a55f5 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/FdPacket.cs @@ -0,0 +1,30 @@ +// +// FdPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Reputation and dignity packet. +/// +/// The character's reputation. +/// The character's reputation icon. +/// The character's dignity. +/// The character's dignity icon. +[PacketHeader("fd", PacketSource.Server)] +[GenerateSerializer(true)] +public record FdPacket +( + [PacketIndex(0)] + long Reputation, + [PacketIndex(1)] + short ReputationIcon, + [PacketIndex(2)] + int Dignity, + [PacketIndex(3)] + short DignityIcon +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/FsPacket.cs b/Packets/NosSmooth.Packets/Server/Character/FsPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..a84f1275c4668b99001a97a57ec8ff89ed323bc2 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/FsPacket.cs @@ -0,0 +1,22 @@ +// +// FsPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Character's faction he belongs to. +/// +/// The faction the character belongs to. +[PacketHeader("fs", PacketSource.Server)] +[GenerateSerializer(true)] +public record FsPacket +( + [PacketIndex(0)] + FactionType Faction +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Players/LevPacket.cs b/Packets/NosSmooth.Packets/Server/Character/LevPacket.cs similarity index 97% rename from Packets/NosSmooth.Packets/Server/Players/LevPacket.cs rename to Packets/NosSmooth.Packets/Server/Character/LevPacket.cs index 9c3e3899f0fb7f54dee0cc3c5d79e5d002a67c62..65da2dd73c4c47dad70e39c6af5c32a3c7324a61 100644 --- a/Packets/NosSmooth.Packets/Server/Players/LevPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Character/LevPacket.cs @@ -6,7 +6,7 @@ using NosSmooth.PacketSerializer.Abstractions.Attributes; -namespace NosSmooth.Packets.Server.Players; +namespace NosSmooth.Packets.Server.Character; /// /// Sent on map change. diff --git a/Packets/NosSmooth.Packets/Server/Character/RagePacket.cs b/Packets/NosSmooth.Packets/Server/Character/RagePacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..d2fd225c8357be22a35b977f47618707af2769b3 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/RagePacket.cs @@ -0,0 +1,24 @@ +// +// RagePacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Current rage of the character. +/// +/// The rage points. +/// The maximum amount of rage points. +[PacketHeader("rage", PacketSource.Server)] +[GenerateSerializer(true)] +public record RagePacket +( + [PacketIndex(0)] + long RagePoints, + [PacketIndex(1)] + long RagePointsMax +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/ResistanceSubPacket.cs b/Packets/NosSmooth.Packets/Server/Character/ResistanceSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..b182826ca83898fb5aa04f7c12cee46c0dc53a8c --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/ResistanceSubPacket.cs @@ -0,0 +1,30 @@ +// +// ResistanceSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A sub packet containing information about resistance. +/// +/// The fire resistance. +/// The water resistance. +/// The light resistance. +/// The dark resistance. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ResistanceSubPacket +( + [PacketIndex(0)] + short FireResistance, + [PacketIndex(1)] + short WaterResistance, + [PacketIndex(2)] + short LightResistance, + [PacketIndex(3)] + short DarkResistance +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/RsfiPacket.cs b/Packets/NosSmooth.Packets/Server/Character/RsfiPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..f494767bde4f101c0a83b432861606f513049c20 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/RsfiPacket.cs @@ -0,0 +1,37 @@ +// +// RsfiPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A packet containing information about act that +/// the client should play story. +/// +/// The act. +/// The part of the act. +/// Unknown TODO. +/// Unknown TODO. +/// Unknown TODO. +/// Unknown TODO. +[PacketHeader("rsfi", PacketSource.Server)] +[GenerateSerializer(true)] +public record RsfiPacket +( + [PacketIndex(0)] + byte Act, + [PacketIndex(1)] + byte ActPart, + [PacketIndex(2)] + byte Unknown1, + [PacketIndex(3)] + byte Unknown2, + [PacketIndex(4)] + byte Ts, + [PacketIndex(5)] + byte TsMax +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/RsfpPacket.cs b/Packets/NosSmooth.Packets/Server/Character/RsfpPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..4b60f73b524ea240b357147d631a0b579db7d189 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/RsfpPacket.cs @@ -0,0 +1,24 @@ +// +// RsfpPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Unknown. Sent upon world initialization. +/// +/// Unknown TODO. +/// Unknown TODO. +[PacketHeader("rsfp", PacketSource.Server)] +[GenerateSerializer(true)] +public record RsfpPacket +( + [PacketIndex(0)] + short? MapX, + [PacketIndex(1)] + short? MapY +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/ScArmorSubPacket.cs b/Packets/NosSmooth.Packets/Server/Character/ScArmorSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..7df03c27e9588ae9108664a490d0ab0f8b32ef5e --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/ScArmorSubPacket.cs @@ -0,0 +1,37 @@ +// +// ScArmorSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A sub packet for +/// containing information about armor. +/// +/// The upgrade of the armor +/// The melee defence of the armor. +/// The melee dodge rate of the armor. +/// The ranged defence of the armor. +/// The ranged dodge rate of the armor. +/// The magical defence of the armor. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ScArmorSubPacket +( + [PacketIndex(0)] + byte ArmorUpgrade, + [PacketIndex(1)] + int MeleeDefence, + [PacketIndex(2)] + int MeleeDefenceDodgeRate, + [PacketIndex(3)] + int RangeDefence, + [PacketIndex(4)] + int RangeDefenceDodgeRate, + [PacketIndex(5)] + int MagicalDefence +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/ScPacket.cs b/Packets/NosSmooth.Packets/Server/Character/ScPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..d51638d49eaa3f3aaf581e5c7e0ce828f930d768 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/ScPacket.cs @@ -0,0 +1,36 @@ +// +// ScPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Information about character's weapons, armor, resistance. +/// +/// The class of the character minus one. +/// The information about character's main weapon. +/// Whether the character is an archer. +/// The information about character's secondary weapon. +/// The information about character's armor. +/// The character's resistance +[PacketHeader("sc", PacketSource.Server)] +[GenerateSerializer(true)] +public record ScPacket +( + [PacketIndex(0)] + byte ClassMinusOne, + [PacketIndex(1, InnerSeparator = ' ')] + ScWeaponSubPacket MainWeaponSubPacket, + [PacketIndex(2)] + byte IsArcher, + [PacketIndex(3, InnerSeparator = ' ')] + ScWeaponSubPacket SecondaryWeaponSubPacket, + [PacketIndex(4)] + ScArmorSubPacket ArmorSubPacket, + [PacketIndex(5)] + ResistanceSubPacket ResistanceSubPacket +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/ScWeaponSubPacket.cs b/Packets/NosSmooth.Packets/Server/Character/ScWeaponSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..5bf0ea553a66478b639c4504882dbdc252951b7f --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/ScWeaponSubPacket.cs @@ -0,0 +1,37 @@ +// +// ScWeaponSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A sub packet of +/// containing information about character's weapon. +/// +/// The upgrade of the weapon. +/// The minimal hit amount. +/// The maximal hit amount. +/// The hit rate. +/// The critical hit rate. +/// The critical hit multiplier. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ScWeaponSubPacket +( + [PacketIndex(0)] + byte WeaponUpgrade, + [PacketIndex(1)] + int MinHit, + [PacketIndex(2)] + int MaxHit, + [PacketIndex(3)] + int HitRate, + [PacketIndex(4)] + int CriticalHitRate, + [PacketIndex(5)] + int CriticalHitMultiplier +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/TitPacket.cs b/Packets/NosSmooth.Packets/Server/Character/TitPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..a7901dd96caf903b2b6740824eba86f9e42df11c --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/TitPacket.cs @@ -0,0 +1,31 @@ +// +// TitPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A packet containing translated class name and the character's name. +/// +/// +/// Sent during initialization. +/// I do not know what purpose of this packet is +/// as the client has all the information from +/// this packet already. +/// +/// The class translated in client language. +/// The name of the client character. +[PacketHeader("tit", PacketSource.Server)] +[GenerateSerializer(true)] +public record TitPacket +( + [PacketIndex(0)] + string TranslatedClass, + [PacketGreedyIndex(1)] + NameString Name +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/TitinfoPacket.cs b/Packets/NosSmooth.Packets/Server/Character/TitinfoPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..99dd50f0409a13e054ea68257469ef5e6efa2236 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/TitinfoPacket.cs @@ -0,0 +1,31 @@ +// +// TitinfoPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Information about titles of the character. +/// +/// The type of the entity, seems to be always a player. +/// The id of the character. +/// Unknown, seems to be vnum of title, but which one? +/// Unknown, seems to be vnum of title, but which one? +[PacketHeader("titinfo", PacketSource.Server)] +[GenerateSerializer(true)] +public record TitinfoPacket +( + [PacketIndex(0)] + EntityType EntityType, + [PacketIndex(1)] + long CharacterId, + [PacketIndex(2)] + long UnknownTitleVNum1, + [PacketIndex(3)] + long UnknownTitleVnum2 +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/TitlePacket.cs b/Packets/NosSmooth.Packets/Server/Character/TitlePacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..13d5093bbb7bf007702142ec2220f90e6745d4e8 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/TitlePacket.cs @@ -0,0 +1,21 @@ +// +// TitlePacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// Titles the player has obtained. +/// +/// The obtained titles. +[PacketHeader("title", PacketSource.Server)] +[GenerateSerializer(true)] +public record TitlePacket +( + [PacketListIndex(0, InnerSeparator = '.', ListSeparator = ' ')] + IReadOnlyList TitleSubPackets +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Character/TitleSubPacket.cs b/Packets/NosSmooth.Packets/Server/Character/TitleSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..70b356519d2bce97ee1ade45382b074306acf543 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Character/TitleSubPacket.cs @@ -0,0 +1,25 @@ +// +// TitleSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Character; + +/// +/// A sub packet for +/// with information about and obtained title. +/// +/// The id of the title. +/// The status of the title. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record TitleSubPacket +( + [PacketIndex(0)] + short TitleId, + [PacketIndex(1)] + byte TitleStatus +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Chat/SayPacket.cs b/Packets/NosSmooth.Packets/Server/Chat/SayPacket.cs index 2441e86ffa8252b6fea4304eda4a92a2d020569b..dfb997d5090062477b95d41741a2f8f662945c60 100644 --- a/Packets/NosSmooth.Packets/Server/Chat/SayPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Chat/SayPacket.cs @@ -6,6 +6,7 @@ using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Chat; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Chat; diff --git a/Packets/NosSmooth.Packets/Server/Entities/CondPacket.cs b/Packets/NosSmooth.Packets/Server/Entities/CondPacket.cs index 1b93dc96e77948c3e424bd92d2424bdae877ae31..a307f485fc6700c3a54f09780ca0c5338d342c03 100644 --- a/Packets/NosSmooth.Packets/Server/Entities/CondPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Entities/CondPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Entities; diff --git a/Packets/NosSmooth.Packets/Server/Entities/MovePacket.cs b/Packets/NosSmooth.Packets/Server/Entities/MovePacket.cs index 858b176cb0a1bdb54c40981ae8196c832098f2ac..b09b84d57f2351ba44fdfd5809cdaba6d6b3cd28 100644 --- a/Packets/NosSmooth.Packets/Server/Entities/MovePacket.cs +++ b/Packets/NosSmooth.Packets/Server/Entities/MovePacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Entities; diff --git a/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs b/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs index 7184edf9ada590fda7f1c766381207e0e562422b..5e03ea9500259c2d2b40dd965c6bb1f7c779a7dd 100644 --- a/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Entities/StPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Entities; diff --git a/Packets/NosSmooth.Packets/Server/Families/GidxPacket.cs b/Packets/NosSmooth.Packets/Server/Families/GidxPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..e6bd46a2138123523c81714769762f6a73db1c1e --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Families/GidxPacket.cs @@ -0,0 +1,39 @@ +// +// GidxPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.Packets.Server.Character; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Families; + +/// +/// Information about player's family. +/// +/// The type of the entity (always a player). +/// The id of the player. +/// The sub packet with information about the family, or null, if not in family. +/// The name of the family. +/// The rank of the family. +/// The icons of the family. +[PacketHeader("gidx", PacketSource.Server)] +[GenerateSerializer(true)] +public record GidxPacket +( + [PacketIndex(0)] + EntityType EntityType, + [PacketIndex(1)] + long EntityId, + [PacketIndex(2, InnerSeparator = '.')] + FamilySubPacket FamilySubPacket, + [PacketIndex(3)] + NameString? FamilyName, + [PacketIndex(4)] + NameString? FamilyCustomRank, + [PacketListIndex(5, ListSeparator = '|')] + IReadOnlyList FamilyIcons +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Groups/PinitSubPacket.cs b/Packets/NosSmooth.Packets/Server/Groups/PinitSubPacket.cs index 1f47ced4cae14e301ad21d1509bcc8cc5f10c00e..b4bebc136c623dd9d378f0e47701e65481df9416 100644 --- a/Packets/NosSmooth.Packets/Server/Groups/PinitSubPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Groups/PinitSubPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; using NosSmooth.PacketSerializer.Abstractions.Common; diff --git a/Packets/NosSmooth.Packets/Server/Inventory/EqPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/EqPacket.cs index 9e3da1b2ae7a89300e98646ca6c73161e7e16301..2b7f07d0988a2356a159bba0068020999e8a144c 100644 --- a/Packets/NosSmooth.Packets/Server/Inventory/EqPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Inventory/EqPacket.cs @@ -4,13 +4,12 @@ // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Players; using NosSmooth.Packets.Server.Maps; using NosSmooth.Packets.Server.Weapons; using NosSmooth.PacketSerializer.Abstractions.Attributes; -namespace NosSmooth.Packets.Server.Entities; +namespace NosSmooth.Packets.Server.Inventory; /// /// Player diff --git a/Packets/NosSmooth.Packets/Server/Inventory/EquipPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/EquipPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..dd95cf2e3c0c2e9c5938211874e351b55c14b492 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Inventory/EquipPacket.cs @@ -0,0 +1,28 @@ +// +// EquipPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Weapons; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Inventory; + +/// +/// Information about the player's equipped items. +/// +/// The main weapon upgrade rare. +/// The armor upgrade rare. +/// The packet with equipment. +[PacketHeader("equip", PacketSource.Server)] +[GenerateSerializer(true)] +public record EquipPacket +( + [PacketIndex(0)] + UpgradeRareSubPacket WeaponUpgradeRareSubPacket, + [PacketIndex(1)] + UpgradeRareSubPacket ArmorUpgradeRareSubPacket, + [PacketListIndex(2, ListSeparator = ' ', InnerSeparator = '.')] + IReadOnlyList EquipSubPacket +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Inventory/EquipSubPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/EquipSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..0ef0d23be67aa0d882350a5456494c525341c4e1 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Inventory/EquipSubPacket.cs @@ -0,0 +1,37 @@ +// +// EquipSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Inventory; + +/// +/// A sub packet for +/// containing information about individual items equipped. +/// +/// The equipment slot. +/// The vnum of the item. +/// The rare. +/// Can be design for colored items, otherwise upgrade. +/// Unknown TODO. Seems to be always 0. +/// The count of runes. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record EquipSubPacket +( + [PacketIndex(0)] + byte Slot, + [PacketIndex(1)] + long ItemVNum, + [PacketIndex(2)] + byte? Rare, + [PacketIndex(3)] + short DesignOrRare, + [PacketIndex(4)] + byte Unknown, + [PacketIndex(5)] + int RuneCount +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Inventory/ExtsPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/ExtsPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..632ea3af42445eaecb6696fc82f2990a795d44ff --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Inventory/ExtsPacket.cs @@ -0,0 +1,32 @@ +// +// ExtsPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Inventory; + +/// +/// Inventory extensions (slots) of the player. +/// Each field contains the number of slots +/// in the given inventory bag. +/// +/// Unknown TODO. +/// The number of slots in equipment bag. +/// The number of slots in main bag. +/// The number of slots in etc bag. +[PacketHeader("exts", PacketSource.Server)] +[GenerateSerializer(true)] +public record ExtsPacket +( + [PacketIndex(0)] + byte Type, + [PacketIndex(1)] + byte EquipmentSlots, + [PacketIndex(2)] + byte MainSlots, + [PacketIndex(3)] + byte EtcSlots +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Inventory/GoldPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/GoldPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..0c061ab2598cc794992fe2dccb5f9e6f24fc30d8 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Inventory/GoldPacket.cs @@ -0,0 +1,24 @@ +// +// GoldPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Inventory; + +/// +/// Amount of gold the character has. +/// +/// The amount of gold the character has. +/// Unknown TODO. +[PacketHeader("gold", PacketSource.Server)] +[GenerateSerializer(true)] +public record GoldPacket +( + [PacketIndex(0)] + long Gold, + [PacketIndex(1)] + byte Unknown +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Inventory/PairyPacket.cs b/Packets/NosSmooth.Packets/Server/Inventory/PairyPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..b40795e4b3048be35881eccc86c0b36fb88b9f96 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Inventory/PairyPacket.cs @@ -0,0 +1,38 @@ +// +// PairyPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Inventory; + +/// +/// Information about a fairy of an entity. +/// +/// The entity type. +/// The id of the entity. +/// The fairy's move type. +/// The fairy's element. +/// The fairy's element rate. +/// The fairy's morph vnum. +[PacketHeader("pairy", PacketSource.Server)] +[GenerateSerializer(true)] +public record PairyPacket +( + [PacketIndex(0)] + EntityType EntityType, + [PacketIndex(1)] + long EntityId, + [PacketIndex(2)] + int MoveType, + [PacketIndex(3)] + Element Element, + [PacketIndex(4)] + int ElementRate, + [PacketIndex(5)] + int MorphVNum +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/CListEndPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListEndPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..286557eb20fe16fdb751c5e2f82f90c3b138f5ad --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/CListEndPacket.cs @@ -0,0 +1,21 @@ +// +// CListEndPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// End of character list. +/// +/// +/// Before clist, clist_start will be sent. +/// clist for each character will follow, +/// after that, clist_end will be sent. +/// +[GenerateSerializer(true)] +[PacketHeader("clist_end", PacketSource.Server)] +public record CListEndPacket() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/CListEquipmentSubPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListEquipmentSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..2653647803ecbfd1f2ab654c00e2b1768bddc64f --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/CListEquipmentSubPacket.cs @@ -0,0 +1,44 @@ +// +// CListEquipmentSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// Sub packet of present if the in packet +/// is for a player. Contains information about the player's +/// weapon. +/// /// +/// The VNum of the hat. +/// The VNum of the armor. +/// The vnum of skin of the weapon or main weapon vnum. +/// The VNum of the secondary weapon. +/// The VNum of the mask. +/// The VNum of the fairy item. +/// The VNum of the costume suit. +/// The VNum of the costume hat. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record CListEquipmentSubPacket +( + [PacketIndex(0)] + int? HatVNum, + [PacketIndex(1)] + int? ArmorVNum, + [PacketIndex(2)] + int? MainWeaponSkinOrWeaponVNum, + [PacketIndex(3)] + int? SecondaryWeaponVNum, + [PacketIndex(4)] + int? MaskVNum, + [PacketIndex(5)] + int? FairyVNum, + [PacketIndex(6)] + int? CostumeSuitVNum, + [PacketIndex(7)] + int? CostumeHatVNum +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..f393d2125c35c25580ba9aaea8f78196dd35f149 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/CListPacket.cs @@ -0,0 +1,81 @@ +// +// CListPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Players; +using NosSmooth.Packets.Server.Maps; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// Contains information about a character in character +/// slect upon login. +/// +/// +/// Before clist, clist_start will be sent. +/// clist for each character will follow, +/// after that, clist_end will be sent. +/// +/// The character slot the character is from. +/// The name of the character. +/// Unknown, seems to be always 0. +/// The sex of the character. +/// The hair style of the character. +/// The hair color of the character. +/// Unknown, seems to be always 0. +/// The class of the character. +/// The level of the character. +/// The hero level of the character. +/// The equipment of the player. +/// The job level of the character. +/// There is an extra space in the packet, for the converter to work correctly, this should be an empty string. TODO add Prefix field to PacketIndex and put Prefix ' ' on Unknown2. +/// Unknown, seems to be always 1. +/// Unknown, seems to be always 1. +/// The pets of the character. +/// The design of the hat. +/// Unknown, seems to be always 0. +[GenerateSerializer(true)] +[PacketHeader("clist", PacketSource.Server)] +public record CListPacket +( + [PacketIndex(0)] + byte Slot, + [PacketIndex(1)] + NameString Name, + [PacketIndex(2)] + byte Unknown, + [PacketIndex(3)] + SexType Sex, + [PacketIndex(4)] + HairStyle HairStyle, + [PacketIndex(5)] + HairColor HairColor, + [PacketIndex(6)] + byte Unknown1, + [PacketIndex(7)] + PlayerClass Class, + [PacketIndex(8)] + byte Level, + [PacketIndex(9)] + byte HeroLevel, + [PacketIndex(10, InnerSeparator = '.')] + CListEquipmentSubPacket EquipmentSubPacket, + [PacketIndex(11)] + byte JobLevel, + [PacketIndex(12)] + string ExtraSpace, + [PacketIndex(13)] + byte Unknown2, + [PacketIndex(14)] + byte Unknown3, + [PacketListIndex(15, ListSeparator = '.', InnerSeparator = '.')] + IReadOnlyList PetsSubPacket, + [PacketIndex(16)] + byte HatDesign, + [PacketIndex(17)] + byte Unknown4 +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/CListPetSubPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListPetSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b0f8814d083ec92edb6adbbe7f11ec41958910a --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/CListPetSubPacket.cs @@ -0,0 +1,24 @@ +// +// CListPetSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// An item of pet list inside of . +/// +/// Skin of partner. +/// The vnum of the pet. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record CListPetSubPacket +( + [PacketIndex(0)] + long? Skin, + [PacketIndex(1)] + long? PetVNum +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/CListStartPacket.cs b/Packets/NosSmooth.Packets/Server/Login/CListStartPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..c97a211a940a0dad42a3aca9d32dd0ac08012feb --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/CListStartPacket.cs @@ -0,0 +1,26 @@ +// +// CListStartPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Server.Groups; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// Signals start of character list. +/// +/// +/// clist for each character will follow, +/// after that clist_end will be sent. +/// +/// Unknown, seems to be always 0. +[GenerateSerializer(true)] +[PacketHeader("clist_start", PacketSource.Server)] +public record CListStartPacket +( + [PacketIndex(0)] + int Unknown = 0 +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/FStashEndPacket.cs b/Packets/NosSmooth.Packets/Server/Login/FStashEndPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..728483531d90da31f3f462edf863103e463ca7fd --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/FStashEndPacket.cs @@ -0,0 +1,16 @@ +// +// FStashEndPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// Unknown function. +/// +[PacketHeader("f_stash_end", PacketSource.Server)] +[GenerateSerializer(true)] +public record FStashEndPacket() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Login/OkPacket.cs b/Packets/NosSmooth.Packets/Server/Login/OkPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..ca28c5f59266bae1918613c348d768ad4a667af7 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Login/OkPacket.cs @@ -0,0 +1,20 @@ +// +// OkPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Client.Login; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Login; + +/// +/// The selection of character is approved. +/// +/// +/// Sent after . +/// +[PacketHeader("OK", PacketSource.Server)] +[GenerateSerializer(true)] +public record OkPacket() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Maps/Bgm2Packet.cs b/Packets/NosSmooth.Packets/Server/Maps/Bgm2Packet.cs new file mode 100644 index 0000000000000000000000000000000000000000..60603ea9bd79961f3707b1b69243b68ff3aadc36 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Maps/Bgm2Packet.cs @@ -0,0 +1,21 @@ +// +// Bgm2Packet.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Maps; + +/// +/// A music to be played. +/// +/// The id of the music to be played. +[PacketHeader("bgm2", PacketSource.Server)] +[GenerateSerializer(true)] +public record Bgm2Packet +( + [PacketIndex(0)] + long MusicId +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Maps/InPacket.cs b/Packets/NosSmooth.Packets/Server/Maps/InPacket.cs index 3855a5ae6d282b16dc69b9310383179ffb823540..91b077ba185b69ff1d211320a4b29a726f51fbb9 100644 --- a/Packets/NosSmooth.Packets/Server/Maps/InPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Maps/InPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; using NosSmooth.PacketSerializer.Abstractions.Common; diff --git a/Packets/NosSmooth.Packets/Server/Maps/InPlayerSubPacket.cs b/Packets/NosSmooth.Packets/Server/Maps/InPlayerSubPacket.cs index 7e4ec8db4561f89300713ba0cc33928b8ac52ef5..31014512e909738cb935bd8d707e02277cb17da1 100644 --- a/Packets/NosSmooth.Packets/Server/Maps/InPlayerSubPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Maps/InPlayerSubPacket.cs @@ -5,8 +5,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Enums.Players; -using NosSmooth.Packets.Server.Players; +using NosSmooth.Packets.Server.Character; using NosSmooth.Packets.Server.Weapons; using NosSmooth.PacketSerializer.Abstractions.Attributes; @@ -84,7 +85,7 @@ public record InPlayerSubPacket [PacketIndex(14)] byte Unknown2, [PacketIndex(15)] - byte Unknown3, + short Unknown3, [PacketIndex(16)] UpgradeRareSubPacket WeaponUpgradeRareSubPacket, [PacketIndex(17)] diff --git a/Packets/NosSmooth.Packets/Server/Maps/OutPacket.cs b/Packets/NosSmooth.Packets/Server/Maps/OutPacket.cs index ddb5ca3493cc3340ffcbafbc9a3a311313e0c58a..29d386f3c2e9ebd7d5a65ae45af7b73bb0094165 100644 --- a/Packets/NosSmooth.Packets/Server/Maps/OutPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Maps/OutPacket.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.PacketSerializer.Abstractions.Attributes; namespace NosSmooth.Packets.Server.Maps; diff --git a/Packets/NosSmooth.Packets/Server/Mates/ScNEquipmentSubPacket.cs b/Packets/NosSmooth.Packets/Server/Mates/ScNEquipmentSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..971d87c72fb2b47f17660cd88b435f0716171045 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Mates/ScNEquipmentSubPacket.cs @@ -0,0 +1,29 @@ +// +// ScNEquipmentSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Mates; + +/// +/// A sub packet of +/// containing information about partner's +/// equipped item. +/// +/// +/// +/// +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ScNEquipmentSubPacket +( + [PacketIndex(0)] + long? ItemVNum, + [PacketIndex(1, IsOptional = true)] + long? ItemRare, + [PacketIndex(2, IsOptional = true)] + long? ItemUpgrade +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Mates/ScNPacket.cs b/Packets/NosSmooth.Packets/Server/Mates/ScNPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c3208fb72dc77e4d3af40f77e5f5f226258607c --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Mates/ScNPacket.cs @@ -0,0 +1,143 @@ +// +// ScNPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Server.Character; +using NosSmooth.Packets.Server.Maps; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Mates; + +/// +/// Information about a partner the +/// character owns. +/// +/// The id of the partner entity. +/// The vnum of the partner. +/// Unknown TODO. +/// The level of the partner. +/// The loyalty of the partner. +/// The experience of the partner. +/// Information about partner's weapon. +/// Information about partner's armor. +/// Information about partner's gauntlet. +/// Information about partner's boots. +/// Unknown TODO. +/// Unknown TODO. +/// Unknown TODO. +/// The upgrade of attack. +/// The minimum attack amount. +/// The maximum attack amount. +/// Unknown TODO. +/// The critical chance of the partner's hit. +/// The critical rate of the partner's hit. +/// The partner's defence upgrade. +/// The melee defence. +/// The dodge of melee defence. +/// The ranged defence. +/// The dodge of ranged defence. +/// The magical defence. +/// The element of the partner. +/// Information about partner's resistance +/// The current hp of the partner. +/// The maximum hp of the partner. +/// The current mp of the partner. +/// The maximum mp of the partner. +/// Unknown TODO. +/// The maximum experience in current level of the partner. +/// The name of the partner. +/// The morph vnum of the partner, if any. +/// Whether the partner is summonable. +/// The currently equipped sp of the partner. +/// Information about first skill of the partner's sp. +/// Information about second skill of the partner's sp. +/// Information about third skill of the partner's sp. +[PacketHeader("sc_n", PacketSource.Server)] +[GenerateSerializer(true)] +public record ScNPacket +( + [PacketIndex(0)] + long PartnerId, + [PacketIndex(1)] + long NpcVNum, + [PacketIndex(2)] + long TransportId, + [PacketIndex(3)] + short Level, + [PacketIndex(4)] + short Loyalty, + [PacketIndex(5)] + long Experience, + [PacketIndex(6, InnerSeparator = '.')] + ScNEquipmentSubPacket? WeaponSubPacket, + [PacketIndex(7, InnerSeparator = '.')] + ScNEquipmentSubPacket? ArmodSubPacket, + [PacketIndex(8, InnerSeparator = '.')] + ScNEquipmentSubPacket? GauntletSubPacket, + [PacketIndex(9, InnerSeparator = '.')] + ScNEquipmentSubPacket? BootsSubPacket, + [PacketIndex(10, InnerSeparator = '.')] + short Unknown1, + [PacketIndex(11)] + short Unknown2, + [PacketIndex(12)] + short Unknown3, + [PacketIndex(13)] + short AttackUpgrade, + [PacketIndex(14)] + int MinimumAttack, + [PacketIndex(15)] + int MaximumAttack, + [PacketIndex(16)] + int Precision, + [PacketIndex(17)] + int CriticalChance, + [PacketIndex(18)] + int CriticalRate, + [PacketIndex(19)] + short DefenceUpgrade, + [PacketIndex(20)] + int MeleeDefence, + [PacketIndex(21)] + int MeleeDefenceDodge, + [PacketIndex(22)] + int RangeDefence, + [PacketIndex(23)] + int RangeDodgeRate, + [PacketIndex(24)] + int MagicalDefence, + [PacketIndex(25)] + Element Element, + [PacketIndex(26, InnerSeparator = ' ')] + ResistanceSubPacket ResistanceSubPacket, + [PacketIndex(27)] + int Hp, + [PacketIndex(28)] + int HpMax, + [PacketIndex(29)] + int Mp, + [PacketIndex(30)] + int MpMax, + [PacketIndex(31)] + int Unknown4, + [PacketIndex(32)] + int LevelExperience, + [PacketIndex(33)] + NameString Name, + [PacketIndex(34)] + int? MorphVNum, + [PacketIndex(35)] + bool IsSummonable, + [PacketIndex(36, InnerSeparator = '.')] + ScNSpSubPacket? SpSubPacket, + [PacketIndex(37, InnerSeparator = '.')] + ScNSkillSubPacket? Skill1SubPacket, + [PacketIndex(38, InnerSeparator = '.')] + ScNSkillSubPacket? Skill2SubPacket, + [PacketIndex(39, InnerSeparator = '.')] + ScNSkillSubPacket? Skill3SubPacket +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Mates/ScNSkillSubPacket.cs b/Packets/NosSmooth.Packets/Server/Mates/ScNSkillSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..624c0ceaa17ef26b54dd756fe3af62e72a92b887 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Mates/ScNSkillSubPacket.cs @@ -0,0 +1,27 @@ +// +// ScNSkillSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Mates; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Mates; + +/// +/// A sub packet of +/// containing information about partner's +/// sp skill. +/// +/// The vnum of the skill. +/// The rank of the skill. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ScNSkillSubPacket +( + [PacketIndex(0)] + long? SkillVNum, + [PacketIndex(1, IsOptional = true)] + PartnerSkillRank? Rank +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Mates/ScNSpSubPacket.cs b/Packets/NosSmooth.Packets/Server/Mates/ScNSpSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..a1ba231bde1b3dd9a621752bbb3d89d01bcfe40b --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Mates/ScNSpSubPacket.cs @@ -0,0 +1,26 @@ +// +// ScNSpSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Mates; + +/// +/// A sub packet of +/// containing information about sp of the +/// partner. +/// +/// +/// +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record ScNSpSubPacket +( + [PacketIndex(0)] + long? ItemVNum, + [PacketIndex(1, IsOptional = true)] + byte? AgilityPercentage +); \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Mates/ScPPacket.cs b/Packets/NosSmooth.Packets/Server/Mates/ScPPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..a7ce4d3bbff5e652e2ffe5cd0333c1444c72b316 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Mates/ScPPacket.cs @@ -0,0 +1,112 @@ +// +// ScPPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Server.Character; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Mates; + +/// +/// Information about a pet the +/// character owns. +/// +/// The id of the pet entity. +/// The vnum of the pet. +/// Unknown TODO. +/// The level of the pet. +/// The loyalty of the pet. +/// The experience of the pet. +/// Unknown TODO. +/// The upgrade of attack. +/// The minimum attack amount. +/// The maximum attack amount. +/// Unknown TODO. +/// The critical chance of the pet's hit. +/// The critical rate of the pet's hit. +/// The pet's defence upgrade. +/// The melee defence. +/// The dodge of melee defence. +/// The ranged defence. +/// The dodge of ranged defence. +/// The magical defence. +/// The element of the pet. +/// Information about pet's resistance +/// The current hp of the pet. +/// The maximum hp of the pet. +/// The current mp of the pet. +/// The maximum mp of the pet. +/// Unknown TODO. +/// The maximum experience in current level of the pet. +/// Whether the pet can pick up stuff. +/// The name of the pet. +/// Whether the pet is summonable. +[PacketHeader("sc_p", PacketSource.Server)] +[GenerateSerializer(true)] +public record ScPPacket +( + [PacketIndex(0)] + long PetId, + [PacketIndex(1)] + long NpcVNum, + [PacketIndex(2)] + long TransportId, + [PacketIndex(3)] + short Level, + [PacketIndex(4)] + short Loyalty, + [PacketIndex(5)] + long Experience, + [PacketIndex(6)] + short Unknown1, + [PacketIndex(7)] + short AttackUpgrade, + [PacketIndex(8)] + int MinimumAttack, + [PacketIndex(9)] + int MaximumAttack, + [PacketIndex(10)] + int Concentrate, + [PacketIndex(11)] + int CriticalChance, + [PacketIndex(12)] + int CriticalRate, + [PacketIndex(13)] + short DefenceUpgrade, + [PacketIndex(14)] + int MeleeDefence, + [PacketIndex(15)] + int MeleeDefenceDodge, + [PacketIndex(16)] + int RangeDefence, + [PacketIndex(17)] + int RangeDodgeRate, + [PacketIndex(18)] + int MagicalDefence, + [PacketIndex(19)] + Element Element, + [PacketIndex(20, InnerSeparator = ' ')] + ResistanceSubPacket ResistanceSubPacket, + [PacketIndex(21)] + int Hp, + [PacketIndex(22)] + int HpMax, + [PacketIndex(23)] + int Mp, + [PacketIndex(24)] + int MpMax, + [PacketIndex(25)] + int Unknown4, + [PacketIndex(26)] + int LevelExperience, + [PacketIndex(27)] + bool CanPickUp, + [PacketIndex(28)] + NameString Name, + [PacketIndex(29)] + bool IsSummonable +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Npc/ShopPacket.cs b/Packets/NosSmooth.Packets/Server/Npc/ShopPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..e50854151d8a0bc10689add295c8fa9c80e360fb --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Npc/ShopPacket.cs @@ -0,0 +1,39 @@ +// +// ShopPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Npc; + +/// +/// A shop on the map. +/// +/// The type of the entity. +/// The entity vnum. +/// The id of the shop. +/// The menu type, unknown values. +/// The shop type, unkonwn values. +/// The name of the shop. (shown above the NPC) +[PacketHeader("shop", PacketSource.Server)] +[GenerateSerializer(true)] +public record ShopPacket +( + [PacketIndex(0)] + EntityType EntityType, + [PacketIndex(1)] + long EntityVNum, + [PacketIndex(2)] + long ShopId, + [PacketIndex(3)] + byte MenuType, + [PacketIndex(4, IsOptional = true)] + byte? ShopType, + [PacketGreedyIndex(5, IsOptional = true)] + NameString? Name +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Quests/QstListObjectiveSubPacket.cs b/Packets/NosSmooth.Packets/Server/Quests/QstListObjectiveSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..ce85e583937e6613e7ac415da27d3574f094d186 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Quests/QstListObjectiveSubPacket.cs @@ -0,0 +1,26 @@ +// +// QstListObjectiveSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Quests; + +/// +/// A sub packet of +/// containing information about a quest +/// objective. +/// +/// +/// +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record QstListObjectiveSubPacket +( + [PacketIndex(0)] + short CurrentCount, + [PacketIndex(1)] + short MaxCount +); \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Quests/QstListPacket.cs b/Packets/NosSmooth.Packets/Server/Quests/QstListPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..ddbc8b3fed3a365a68e406488f3f01e8c1f5b875 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Quests/QstListPacket.cs @@ -0,0 +1,22 @@ +// +// QstListPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Quests; + +/// +/// A list of quests +/// that are currently active. +/// +/// The list of the active quests. +[PacketHeader("qstlist", PacketSource.Server)] +[GenerateSerializer(true)] +public record QstListPacket +( + [PacketListIndex(0, InnerSeparator = '.', ListSeparator = ' ')] + IReadOnlyList QuestSubPackets +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Quests/QstListSubPacket.cs b/Packets/NosSmooth.Packets/Server/Quests/QstListSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..5642275e0ab289311c9469d6fd551c2ee00da154 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Quests/QstListSubPacket.cs @@ -0,0 +1,53 @@ +// +// QstListSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Quests; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Quests; + +/// +/// A sub packet of +/// containing information about an active quest. +/// +/// The number of the quest. +/// The info id of the quest to obtain it from .NOS files. +/// Unknown TODO. +/// The quest goal type. +/// The first objective of the quest. +/// +/// The second objective of the quest. +/// The third objective of the quest. +/// The fourth objective of the quest. +/// The fifth objective of the quest. +/// Whether to show dialog at start of the quest. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record QstListSubPacket +( + [PacketIndex(0)] + short QuestNumber, + [PacketIndex(1)] + short InfoId, + [PacketIndex(2)] + short InfoId2, + [PacketIndex(3)] + QuestGoalType GoalType, + [PacketIndex(4, InnerSeparator = '.')] + QstListObjectiveSubPacket Objective1SubPacket, + [PacketIndex(5)] + bool IsQuestFinished, + [PacketIndex(6, InnerSeparator = '.')] + QstListObjectiveSubPacket Objective2SubPacket, + [PacketIndex(7, InnerSeparator = '.')] + QstListObjectiveSubPacket Objective3SubPacket, + [PacketIndex(8, InnerSeparator = '.')] + QstListObjectiveSubPacket Objective4SubPacket, + [PacketIndex(9, InnerSeparator = '.')] + QstListObjectiveSubPacket Objective5SubPacket, + [PacketIndex(10)] + bool ShowDialog +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Quicklist/QSlotPacket.cs b/Packets/NosSmooth.Packets/Server/Quicklist/QSlotPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..d9db0ecb7b7f637217bf613364c084a73fdb8cf3 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Quicklist/QSlotPacket.cs @@ -0,0 +1,24 @@ +// +// QSlotPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Quicklist; + +/// +/// Quicklist slot information. (skills, items in quick list) +/// +/// The slot the information is about. +/// The data (skills, items) in the slot. +[PacketHeader("qslot", PacketSource.Server)] +[GenerateSerializer(true)] +public record QSlotPacket +( + [PacketIndex(0)] + byte Slot, + [PacketListIndex(1, InnerSeparator = '.', ListSeparator = ' ')] + IReadOnlyList DataSubPacket +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Quicklist/QSlotSubPacket.cs b/Packets/NosSmooth.Packets/Server/Quicklist/QSlotSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..c9bbba6f09ff31b42cec192375b5076a2652ec3c --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Quicklist/QSlotSubPacket.cs @@ -0,0 +1,32 @@ +// +// QSlotSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Packets; +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Quicklist; + +/// +/// A sub packet of +/// containing information about an operation for a box in the slot. +/// +/// The type of the operation. +/// Unknown TODO. +/// Unknown TODO. +/// Unknown TODO. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record QSlotSubPacket +( + [PacketIndex(0)] + QSlotType Type, + [PacketIndex(1)] + short? Slot, + [PacketIndex(2)] + short? Position, + [PacketIndex(3, IsOptional = true)] + short? Data +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs b/Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..4227f0f2c472e91c74b34ace4521ee6de38114db --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Relations/FInfoPacket.cs @@ -0,0 +1,21 @@ +// +// FInfoPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Relations; + +/// +/// Information about friends of a character. +/// +/// The friends list. +[PacketHeader("finfo", PacketSource.Server)] +[GenerateSerializer(true)] +public record FInfoPacket +( + [PacketListIndex(0, InnerSeparator = '.', ListSeparator = ' ')] + IReadOnlyList FriendSubPackets +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs b/Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..9aa22b5e2b81be167a67783d1cd799cdd8896a5a --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Relations/FInfoSubPacket.cs @@ -0,0 +1,29 @@ +// +// FInfoSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Relations; + +/// +/// A sub packet of +/// containing information about a friend. +/// +/// The id of the friend. +/// Whether the friend is connected. +/// The name of the friend. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record FInfoSubPacket +( + [PacketIndex(0)] + long PlayerId, + [PacketIndex(1)] + bool IsConnected, + [PacketIndex(2)] + NameString Name +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Relations/FInitPacket.cs b/Packets/NosSmooth.Packets/Server/Relations/FInitPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..ab2672292aecf2bb64e62d0cf1ab336bc1384c45 --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Relations/FInitPacket.cs @@ -0,0 +1,21 @@ +// +// FInitPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.Relations; + +/// +/// Information about friends (and other relations) of a character. +/// +/// +[PacketHeader("finit", PacketSource.Server)] +[GenerateSerializer(true)] +public record FInitPacket +( + [PacketListIndex(0, InnerSeparator = '|', ListSeparator = ' ')] + IReadOnlyList FriendSubPackets +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs b/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..8ba4dee7443442245f945bea375209ec7998594f --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/Relations/FInitSubPacket.cs @@ -0,0 +1,33 @@ +// +// FInitSubPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums.Relations; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.Relations; + +/// +/// A sub packet of +/// containing information about a friend. +/// +/// The id of the friend. +/// The relation between character-player. +/// Whether the friend is connected. +/// The name of the friend. +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record FInitSubPacket +( + [PacketIndex(0)] + long PlayerId, + [PacketIndex(1)] + CharacterRelationType? RelationType, + [PacketIndex(2)] + bool IsConnected, + [PacketIndex(3)] + NameString Name +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/UI/Act6Packet.cs b/Packets/NosSmooth.Packets/Server/UI/Act6Packet.cs new file mode 100644 index 0000000000000000000000000000000000000000..7fcae5b6ccb9736c8d775433f4be5f19291c8e4c --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/UI/Act6Packet.cs @@ -0,0 +1,16 @@ +// +// Act6Packet.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; + +namespace NosSmooth.Packets.Server.UI; + +/// +/// Unknown TODO. +/// +[PacketHeader(null, PacketSource.Server)] +[GenerateSerializer(true)] +public record Act6Packet() : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/UI/BnPacket.cs b/Packets/NosSmooth.Packets/Server/UI/BnPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..94273242b9a1fea68cb194023d2c3a3e26294b4d --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/UI/BnPacket.cs @@ -0,0 +1,29 @@ +// +// BnPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.UI; + +/// +/// A broadcast message. +/// +/// +/// In the client this is shown on bottom left +/// under the chat. +/// +/// The number of the message. +/// The message. +[PacketHeader("bn", PacketSource.Server)] +[GenerateSerializer(true)] +public record BnPacket +( + [PacketIndex(0)] + byte BnNumber, + [PacketIndex(1)] + NameString Message +) : IPacket; \ No newline at end of file diff --git a/Packets/NosSmooth.Packets/Server/UI/TwkPacket.cs b/Packets/NosSmooth.Packets/Server/UI/TwkPacket.cs new file mode 100644 index 0000000000000000000000000000000000000000..82c7a174ad7034bb0162f83148edb9daade89cbc --- /dev/null +++ b/Packets/NosSmooth.Packets/Server/UI/TwkPacket.cs @@ -0,0 +1,42 @@ +// +// TwkPacket.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; +using NosSmooth.PacketSerializer.Abstractions.Attributes; +using NosSmooth.PacketSerializer.Abstractions.Common; + +namespace NosSmooth.Packets.Server.UI; + +/// +/// Information about account, character, language. +/// +/// The type of the character entity. +/// The id of the character. +/// The name of the logged in account. +/// The name of the character. +/// A salt, seems to always be shtmxpdlfeoqkr. +/// The language of the server. +/// The language of the client. +[PacketHeader("twk", PacketSource.Server)] +[GenerateSerializer(true)] +public record TwkPacket +( + [PacketIndex(0)] + EntityType EntityType, + [PacketIndex(1)] + long EntityId, + [PacketIndex(2)] + string AccountName, + [PacketIndex(3)] + NameString CharacterName, + [PacketIndex(4)] + string Salt, + [PacketIndex(5, IsOptional = true)] + string? ServerLanguage, + [PacketIndex(6, IsOptional = true)] + string? ClientLanguage +) : IPacket; \ No newline at end of file diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/FcPacketConverterTests.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/FcPacketConverterTests.cs index 3b54366c1ed492fff1155e343bd20f4e784009a7..6ea39e209ebba75d22faee08c07cd274b9c26d61 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/FcPacketConverterTests.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/FcPacketConverterTests.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.DependencyInjection; using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Act4; using NosSmooth.PacketSerializer; using NosSmooth.PacketSerializer.Abstractions.Attributes; diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs index a52dc7a692baa0376a6f7064a3db9434a790432b..19357302084f960f47967880557f0dfee9a5a4e1 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs @@ -9,8 +9,8 @@ using Microsoft.Extensions.DependencyInjection; using NosSmooth.Packets.Enums; using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Enums.Players; +using NosSmooth.Packets.Server.Character; using NosSmooth.Packets.Server.Maps; -using NosSmooth.Packets.Server.Players; using NosSmooth.Packets.Server.Weapons; using NosSmooth.PacketSerializer; using NosSmooth.PacketSerializer.Abstractions.Attributes; diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/MovePacketConverterTests.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/MovePacketConverterTests.cs index fda4dcb662edb2c18054516566fe73a8020ff549..7aca4b21a5789b341bdb7072fbf8890de5b8040c 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/MovePacketConverterTests.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/MovePacketConverterTests.cs @@ -5,7 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.DependencyInjection; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Entities; using NosSmooth.PacketSerializer; using NosSmooth.PacketSerializer.Abstractions.Attributes; diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/PinitPacketConverterTest.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/PinitPacketConverterTest.cs index 708bcea92213036f5704ab78fd6031a53f2c7203..a61e26e6b43e8a99b51f17d3390d6c2485f8d5dc 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/PinitPacketConverterTest.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/PinitPacketConverterTest.cs @@ -5,7 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.DependencyInjection; -using NosSmooth.Packets.Enums; +using NosSmooth.Packets.Enums.Entities; using NosSmooth.Packets.Server.Groups; using NosSmooth.PacketSerializer; using NosSmooth.PacketSerializer.Abstractions.Attributes; diff --git a/Tests/NosSmooth.Packets.Tests/Converters/Packets/SkiPacketConverterTests.cs b/Tests/NosSmooth.Packets.Tests/Converters/Packets/SkiPacketConverterTests.cs index e2d365b4cf49918246b1ce5ae73a6e57b963c073..d9ab011a6523de134b097ad12f84ebbaee2be43b 100644 --- a/Tests/NosSmooth.Packets.Tests/Converters/Packets/SkiPacketConverterTests.cs +++ b/Tests/NosSmooth.Packets.Tests/Converters/Packets/SkiPacketConverterTests.cs @@ -5,8 +5,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Extensions.DependencyInjection; -using NosSmooth.Packets.Enums; -using NosSmooth.Packets.Server.Groups; using NosSmooth.Packets.Server.Skills; using NosSmooth.PacketSerializer; using NosSmooth.PacketSerializer.Abstractions.Attributes;