~ruther/NosSmooth

d9e813205945be1df45fedad963254f835e5baef — František Boháček 2 years ago aa2fdc4
feat(packets): add buff, chat, raid, teleport, mates control packets
33 files changed, 979 insertions(+), 1 deletions(-)

A Packets/NosSmooth.Packets/Client/Mates/PtctlPacket.cs
A Packets/NosSmooth.Packets/Client/Mates/PtctlSubPacket.cs
A Packets/NosSmooth.Packets/Client/Mates/SuctlPacket.cs
A Packets/NosSmooth.Packets/Client/Movement/GuriPacket.cs
A Packets/NosSmooth.Packets/Enums/Chat/SpeakType.cs
A Packets/NosSmooth.Packets/Server/Battle/CtPacket.cs
A Packets/NosSmooth.Packets/Server/Battle/DmPacket.cs
A Packets/NosSmooth.Packets/Server/Battle/RcPacket.cs
A Packets/NosSmooth.Packets/Server/Buffs/BfEPacket.cs
A Packets/NosSmooth.Packets/Server/Buffs/BfPacket.cs
A Packets/NosSmooth.Packets/Server/Buffs/BfSubPacket.cs
A Packets/NosSmooth.Packets/Server/Buffs/VbPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/InfoiPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/Msgi2Packet.cs
A Packets/NosSmooth.Packets/Server/Chat/MsgiPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/Sayi2Packet.cs
A Packets/NosSmooth.Packets/Server/Chat/SayiPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/SayitemtPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/SaytPacket.cs
A Packets/NosSmooth.Packets/Server/Chat/SpkPacket.cs
A Packets/NosSmooth.Packets/Server/Entities/CharScPacket.cs
A Packets/NosSmooth.Packets/Server/Entities/DiePacket.cs
M Packets/NosSmooth.Packets/Server/Maps/DropPacket.cs
A Packets/NosSmooth.Packets/Server/Maps/MapclearPacket.cs
A Packets/NosSmooth.Packets/Server/Maps/MapoutPacket.cs
A Packets/NosSmooth.Packets/Server/Maps/ThrowPacket.cs
A Packets/NosSmooth.Packets/Server/Maps/TpPacket.cs
A Packets/NosSmooth.Packets/Server/Mates/CtlPacket.cs
A Packets/NosSmooth.Packets/Server/Raids/RaidfHpSubPacket.cs
A Packets/NosSmooth.Packets/Server/Raids/RaidfhpPacket.cs
A Packets/NosSmooth.Packets/Server/Raids/RaidfmpPacket.cs
A Packets/NosSmooth.Packets/Server/UI/DelayPacket.cs
A Packets/NosSmooth.Packets/Server/UI/RestPacket.cs
A Packets/NosSmooth.Packets/Client/Mates/PtctlPacket.cs => Packets/NosSmooth.Packets/Client/Mates/PtctlPacket.cs +27 -0
@@ 0,0 1,27 @@
//
//  PtctlPacket.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.Mates;

/// <summary>
/// A mate move packet, moving multiple mates at a time.
/// </summary>
/// <param name="MapId">The current map id.</param>
/// <param name="ControlsCount">The count of controls in array.</param>
/// <param name="Controls">The array containing the mates to move and positions to move them to.</param>
[PacketHeader("ptctl", PacketSource.Server)]
[GenerateSerializer(true)]
public record PtctlPacket
(
    [PacketIndex(0)]
    short MapId,
    [PacketIndex(1)]
    uint? ControlsCount,
    [PacketContextList(2, "Amount", ListSeparator = ' ')]
    IReadOnlyList<PtctlSubPacket> Controls
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Client/Mates/PtctlSubPacket.cs => Packets/NosSmooth.Packets/Client/Mates/PtctlSubPacket.cs +27 -0
@@ 0,0 1,27 @@
//
//  PtctlSubPacket.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.Mates;

/// <summary>
/// A sub packet of <see cref="PtctlPacket"/>.
/// </summary>
/// <param name="MateTransportId">The id of the mate.</param>
/// <param name="PositionX">The x coordinate to move to.</param>
/// <param name="PositionY">The y coordinate to move to.</param>
[PacketHeader(null, PacketSource.Server)]
[GenerateSerializer(true)]
public record PtctlSubPacket
(
    [PacketIndex(0)]
    long MateTransportId,
    [PacketIndex(1)]
    short PositionX,
    [PacketIndex(2)]
    short PositionY
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Client/Mates/SuctlPacket.cs => Packets/NosSmooth.Packets/Client/Mates/SuctlPacket.cs +34 -0
@@ 0,0 1,34 @@
//
//  SuctlPacket.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.Client.Mates;

/// <summary>
/// Attack with the given mate.
/// </summary>
/// <param name="CastId">The id of the skill cast.</param>
/// <param name="EntityType">The type of the mate entity.</param>
/// <param name="MateTransportId">The id of the mate.</param>
/// <param name="TargetType">The entity type of the target.</param>
/// <param name="TargetId">The id of the target.</param>
[PacketHeader("suctl", PacketSource.Server)]
[GenerateSerializer(true)]
public record SuctlPacket
(
    [PacketIndex(0)]
    int CastId,
    [PacketIndex(1)]
    EntityType EntityType,
    [PacketIndex(2)]
    int MateTransportId,
    [PacketIndex(3)]
    EntityType TargetType,
    [PacketIndex(4)]
    long TargetId
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Client/Movement/GuriPacket.cs => Packets/NosSmooth.Packets/Client/Movement/GuriPacket.cs +33 -0
@@ 0,0 1,33 @@
//
//  GuriPacket.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.Movement;

/// <summary>
/// Dancing packet.
/// </summary>
/// <param name="Type">The type of the guri packet.</param>
/// <param name="Argument">The argument.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="Data">The data.</param>
/// <param name="Value">The value.</param>
[PacketHeader("guri", PacketSource.Client)]
[GenerateSerializer(true)]
public record GuriPacket
(
    [PacketIndex(0)]
    int Type,
    [PacketIndex(1, IsOptional = true)]
    int? Argument,
    [PacketIndex(2, IsOptional = true)]
    long? EntityId,
    [PacketIndex(3, IsOptional = true)]
    long? Data,
    [PacketIndex(4, IsOptional = true)]
    string? Value
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Enums/Chat/SpeakType.cs => Packets/NosSmooth.Packets/Enums/Chat/SpeakType.cs +25 -0
@@ 0,0 1,25 @@
//
//  SpeakType.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;
using NosSmooth.Packets.Server.Chat;
#pragma warning disable CS1591

namespace NosSmooth.Packets.Enums.Chat;

/// <summary>
/// A type of <see cref="SpkPacket"/>.
/// </summary>
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1602:Enumeration items should be documented", Justification = "Self-explanatory.")]
public enum SpeakType
{
    Normal = 0,
    Family = 1,
    Group = 3,
    Player = 5,
    TimeSpace = 7,
    GameMaster = 15
}
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Battle/CtPacket.cs => Packets/NosSmooth.Packets/Server/Battle/CtPacket.cs +42 -0
@@ 0,0 1,42 @@
//
//  CtPacket.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.Battle;

/// <summary>
/// A skill cast animation has begun.
/// <see cref="SuPacket"/> or <see cref="BsPacket"/> will be sent after
/// the skill is casted. (after cast time.)
/// </summary>
/// <param name="CasterEntityType">The type of the caster entity.</param>
/// <param name="CasterEntityId">The entity id of the caster.</param>
/// <param name="TargetEntityType">The type of the target entity.</param>
/// <param name="TargetEntityId">The entity id of the target.</param>
/// <param name="CastAnimation">The id of the cast animation.</param>
/// <param name="CastEffect">The id of teh cast effect.</param>
/// <param name="SkillVNum">The VNum of the used skill.</param>
[PacketHeader("ct", PacketSource.Server)]
[GenerateSerializer(true)]
public record CtPacket
(
    [PacketIndex(0)]
    EntityType CasterEntityType,
    [PacketIndex(1)]
    long CasterEntityId,
    [PacketIndex(2)]
    EntityType TargetEntityType,
    [PacketIndex(3)]
    long? TargetEntityId,
    [PacketIndex(4)]
    short? CastAnimation,
    [PacketIndex(5)]
    short? CastEffect,
    [PacketIndex(6)]
    int? SkillVNum
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Battle/DmPacket.cs => Packets/NosSmooth.Packets/Server/Battle/DmPacket.cs +28 -0
@@ 0,0 1,28 @@
//
//  DmPacket.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.Battle;

/// <summary>
/// Damage has been dealt.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="Damage">The damage dealt.</param>
[PacketHeader("dm", PacketSource.Server)]
[GenerateSerializer(true)]
public record DmPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    int Damage
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Battle/RcPacket.cs => Packets/NosSmooth.Packets/Server/Battle/RcPacket.cs +31 -0
@@ 0,0 1,31 @@
//
//  RcPacket.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.Battle;

/// <summary>
/// A heal has been issued.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="Heal">The heal amount.</param>
/// <param name="Unknown">Unknown TODO.</param>
[PacketHeader("rc", PacketSource.Server)]
[GenerateSerializer(true)]
public record RcPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    int Heal,
    [PacketIndex(3)]
    short Unknown
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Buffs/BfEPacket.cs => Packets/NosSmooth.Packets/Server/Buffs/BfEPacket.cs +31 -0
@@ 0,0 1,31 @@
//
//  BfEPacket.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.Buffs;

/// <summary>
/// A const buff effect.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="CardId">The buff card id.</param>
/// <param name="Time">The duration of the buff.</param>
[PacketHeader("bf_e", PacketSource.Server)]
[GenerateSerializer(true)]
public record BfEPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    short CardId,
    [PacketIndex(3)]
    int Time
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Buffs/BfPacket.cs => Packets/NosSmooth.Packets/Server/Buffs/BfPacket.cs +32 -0
@@ 0,0 1,32 @@
//
//  BfPacket.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.Maps;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Buffs;

/// <summary>
/// A buff effect has been added.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="SubPacket">The sub packet containing information about a buff.</param>
/// <param name="CasterLevel">The level of the caster.</param>
[PacketHeader("bf", PacketSource.Server)]
[GenerateSerializer(true)]
public record BfPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2, InnerSeparator = '.')]
    BfSubPacket SubPacket,
    [PacketIndex(3)]
    short CasterLevel
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Buffs/BfSubPacket.cs => Packets/NosSmooth.Packets/Server/Buffs/BfSubPacket.cs +27 -0
@@ 0,0 1,27 @@
//
//  BfSubPacket.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.Buffs;

/// <summary>
/// A sub packet of <see cref="BfPacket"/>.
/// </summary>
/// <param name="Charge">Uknown TODO.</param>
/// <param name="CardId">The buff card id.</param>
/// <param name="Time">The duration of the buff.</param>
[PacketHeader(null, PacketSource.Server)]
[GenerateSerializer(true)]
public record BfSubPacket
(
    [PacketIndex(0)]
    int Charge,
    [PacketIndex(1)]
    short CardId,
    [PacketIndex(2)]
    int Time
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Buffs/VbPacket.cs => Packets/NosSmooth.Packets/Server/Buffs/VbPacket.cs +27 -0
@@ 0,0 1,27 @@
//
//  VbPacket.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.Buffs;

/// <summary>
/// A static buff effect.
/// </summary>
/// <param name="CardId">The buff card id.</param>
/// <param name="IsActive">Whether the buff is active.</param>
/// <param name="Time">The duration of the buff.</param>
[PacketHeader("vb", PacketSource.Server)]
[GenerateSerializer(true)]
public record VbPacket
(
    [PacketIndex(0)]
    short CardId,
    [PacketIndex(1)]
    bool IsActive,
    [PacketIndex(2)]
    int? Time
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/InfoiPacket.cs => Packets/NosSmooth.Packets/Server/Chat/InfoiPacket.cs +25 -0
@@ 0,0 1,25 @@
//
//  InfoiPacket.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.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// An information message.
/// </summary>
/// <param name="MessageConst">The message.</param>
/// <param name="Arguments">The arguments of the message constant.</param>
[PacketHeader("infoi", PacketSource.Server)]
[GenerateSerializer(true)]
public record InfoiPacket
(
    [PacketIndex(0)]
    Game18NConstString MessageConst,
    [PacketListIndex(1, ListSeparator = ' ')]
    IReadOnlyList<string> Arguments
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/Msgi2Packet.cs => Packets/NosSmooth.Packets/Server/Chat/Msgi2Packet.cs +33 -0
@@ 0,0 1,33 @@
//
//  Msgi2Packet.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.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// A constant i18n message received.
/// </summary>
/// <remarks>
/// Same as <see cref="MsgiPacket"/>.
/// </remarks>
/// <param name="MessageType">The type of the message.</param>
/// <param name="MessageConst">The message.</param>
/// <param name="Arguments">The arguments of the message constant.</param>
[PacketHeader("msgi2", PacketSource.Server)]
[GenerateSerializer(true)]
public record Msgi2Packet
(
    [PacketIndex(0)]
    MessageType MessageType,
    [PacketIndex(1)]
    Game18NConstString MessageConst,
    [PacketListIndex(2, ListSeparator = ' ')]
    IReadOnlyList<string> Arguments
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/MsgiPacket.cs => Packets/NosSmooth.Packets/Server/Chat/MsgiPacket.cs +32 -0
@@ 0,0 1,32 @@
//
//  MsgiPacket.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.Chat;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// A constant i18n message received.
/// </summary>
/// <remarks>
/// Same as <see cref="Msgi2Packet"/>.
/// </remarks>
/// <param name="MessageType">The type of the message.</param>
/// <param name="MessageConst">The message.</param>
/// <param name="Arguments">The arguments of the message constant.</param>
[PacketHeader("msgi", PacketSource.Server)]
[GenerateSerializer(true)]
public record MsgiPacket
(
    [PacketIndex(0)]
    MessageType MessageType,
    [PacketIndex(1)]
    Game18NConstString MessageConst,
    [PacketListIndex(2, ListSeparator = ' ')]
    IReadOnlyList<string> Arguments
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/Sayi2Packet.cs => Packets/NosSmooth.Packets/Server/Chat/Sayi2Packet.cs +36 -0
@@ 0,0 1,36 @@
//
//  Sayi2Packet.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.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// A message from an entity in chat.
/// </summary>
/// <param name="EntityType">The type of the entity that spoke.</param>
/// <param name="EntityId">The id of the entity that spoke.</param>
/// <param name="Color">The say/message color.</param>
/// <param name="MessageConst">The message constant.</param>
/// <param name="Arguments">The arguments of the message.</param>
public record Sayi2Packet
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    SayColor Color,
    [PacketIndex(3)]
    Game18NConstString MessageConst,
    [PacketIndex(4)]
    short ParametersCount,
    [PacketListIndex(5, ListSeparator = ' ')]
    IReadOnlyList<string> Parameters
);
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/SayiPacket.cs => Packets/NosSmooth.Packets/Server/Chat/SayiPacket.cs +36 -0
@@ 0,0 1,36 @@
//
//  SayiPacket.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.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// A message from an entity in chat.
/// </summary>
/// <param name="EntityType">The type of the entity that spoke.</param>
/// <param name="EntityId">The id of the entity that spoke.</param>
/// <param name="Color">The say/message color.</param>
/// <param name="MessageConst">The message constant.</param>
/// <param name="Arguments">The arguments of the message.</param>
[PacketHeader("sayi", PacketSource.Server)]
[GenerateSerializer(true)]
public record SayiPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    SayColor Color,
    [PacketIndex(3)]
    Game18NConstString MessageConst,
    [PacketListIndex(4, ListSeparator = ' ')]
    IReadOnlyList<string> Arguments
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/SayitemtPacket.cs => Packets/NosSmooth.Packets/Server/Chat/SayitemtPacket.cs +46 -0
@@ 0,0 1,46 @@
//
//  SayitemtPacket.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.Runtime.InteropServices;
using NosSmooth.Packets.Enums.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;
using NosSmooth.PacketSerializer.Abstractions.Common;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// Information about an item sent to chat.
/// </summary>
/// <param name="EntityType">The type of the entity that spoke.</param>
/// <param name="EntityId">The id of the entity that spoke.</param>
/// <param name="Color">The say/message color.</param>
/// <param name="Amount">The amount.</param>
/// <param name="ItemVNum">The vnum of the item.</param>
/// <param name="Name">The name of the item.</param>
/// <param name="Message">The message template. Usully "{%s%}"</param>
/// <param name="ItemInfo">TODO information about an item, e_info packet.</param>
[PacketHeader("sayitemt", PacketSource.Server)]
[GenerateSerializer(true)]
public record SayitemtPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    SayColor Color,
    [PacketIndex(3)]
    short Amount,
    [PacketIndex(4)]
    int ItemVNum,
    [PacketIndex(5)]
    NameString Name,
    [PacketIndex(6)]
    string Message,
    [PacketGreedyIndex(7)]
    string ItemInfo
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/SaytPacket.cs => Packets/NosSmooth.Packets/Server/Chat/SaytPacket.cs +36 -0
@@ 0,0 1,36 @@
//
//  SaytPacket.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.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;
using NosSmooth.PacketSerializer.Abstractions.Common;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// A message from an entity in chat.
/// </summary>
/// <param name="EntityType">The type of the entity that spoke.</param>
/// <param name="EntityId">The id of the entity that spoke.</param>
/// <param name="Color">The say/message color.</param>
/// <param name="Name">The name of the entity.</param>
/// <param name="Message">The spoken message.</param>
[PacketHeader("sayt", PacketSource.Server)]
[GenerateSerializer(true)]
public record SaytPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    SayColor Color,
    [PacketIndex(3)]
    NameString Name,
    [PacketGreedyIndex(4, IsOptional = true)]
    string? Message
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Chat/SpkPacket.cs => Packets/NosSmooth.Packets/Server/Chat/SpkPacket.cs +36 -0
@@ 0,0 1,36 @@
//
//  SpkPacket.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.Chat;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.PacketSerializer.Abstractions.Attributes;
using NosSmooth.PacketSerializer.Abstractions.Common;

namespace NosSmooth.Packets.Server.Chat;

/// <summary>
/// An entity speak.
/// </summary>
/// <param name="EntityType">The type of the entity that spoke.</param>
/// <param name="EntityId">The id of the entity that spoke.</param>
/// <param name="Type">The type of the speak/message.</param>
/// <param name="Name">The name of the entity.</param>
/// <param name="Message">The spoken message.</param>
[PacketHeader("spk", PacketSource.Server)]
[GenerateSerializer(true)]
public record SpkPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    SpeakType Type,
    [PacketIndex(3)]
    NameString Name,
    [PacketGreedyIndex(4, IsOptional = true)]
    string? Message
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Entities/CharScPacket.cs => Packets/NosSmooth.Packets/Server/Entities/CharScPacket.cs +28 -0
@@ 0,0 1,28 @@
//
//  CharScPacket.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.Entities;

/// <summary>
/// Size of the given entity has changed size.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="Size">The new size of the entity.</param>
[PacketHeader("char_sc", PacketSource.Server)]
[GenerateSerializer(true)]
public record CharScPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    short Size
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Entities/DiePacket.cs => Packets/NosSmooth.Packets/Server/Entities/DiePacket.cs +31 -0
@@ 0,0 1,31 @@
//
//  DiePacket.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.Entities;

/// <summary>
/// An entity has died.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="TargetEntityType">The type of the entity.</param>
/// <param name="TargetEntityId">The id of the entity.</param>
[PacketHeader("die", PacketSource.Server)]
[GenerateSerializer(true)]
public record DiePacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    EntityType TargetEntityType,
    [PacketIndex(3)]
    long TargetEntityId
) : IPacket;
\ No newline at end of file

M Packets/NosSmooth.Packets/Server/Maps/DropPacket.cs => Packets/NosSmooth.Packets/Server/Maps/DropPacket.cs +1 -1
@@ 31,7 31,7 @@ public record DropPacket
    [PacketIndex(3)]
    short Y,
    [PacketIndex(4)]
    short Amount,
    int Amount,
    [PacketIndex(5)]
    bool IsQuestRelated,
    [PacketIndex(6)]

A Packets/NosSmooth.Packets/Server/Maps/MapclearPacket.cs => Packets/NosSmooth.Packets/Server/Maps/MapclearPacket.cs +16 -0
@@ 0,0 1,16 @@
//
//  MapclearPacket.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;

/// <summary>
/// Entities on the map were cleared.
/// </summary>
[PacketHeader("mapclear", PacketSource.Server)]
[GenerateSerializer(true)]
public record MapclearPacket() : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Maps/MapoutPacket.cs => Packets/NosSmooth.Packets/Server/Maps/MapoutPacket.cs +16 -0
@@ 0,0 1,16 @@
//
//  MapoutPacket.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;

/// <summary>
/// Teleported out of map.
/// </summary>
[PacketHeader("mapout", PacketSource.Server)]
[GenerateSerializer(true)]
public record MapoutPacket() : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Maps/ThrowPacket.cs => Packets/NosSmooth.Packets/Server/Maps/ThrowPacket.cs +42 -0
@@ 0,0 1,42 @@
//
//  ThrowPacket.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;

/// <summary>
/// An item has been thrown from the given position to target position.
/// </summary>
/// <remarks>
/// Used in raids after boss is killed.
/// </remarks>
/// <param name="ItemVNum">The vnum of the dropped item.</param>
/// <param name="DropId">The id of the item.</param>
/// <param name="SourceX">The source x coordinate the item is thrown from.</param>
/// <param name="SourceY">The source y coordinate the item is thrown from.</param>
/// <param name="TargetX">The target x coordinate the item is thrown to.</param>
/// <param name="TargetY">The target y coordinate the item is thrown to.</param>
/// <param name="Amount">The amount of items thrown.</param>
[PacketHeader("throw", PacketSource.Server)]
[GenerateSerializer(true)]
public record ThrowPacket
(
    [PacketIndex(0)]
    int ItemVNum,
    [PacketIndex(1)]
    long DropId,
    [PacketIndex(2)]
    short SourceX,
    [PacketIndex(3)]
    short SourceY,
    [PacketIndex(4)]
    short TargetX,
    [PacketIndex(5)]
    short TargetY,
    [PacketIndex(6)]
    int Amount
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Maps/TpPacket.cs => Packets/NosSmooth.Packets/Server/Maps/TpPacket.cs +35 -0
@@ 0,0 1,35 @@
//
//  TpPacket.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.Maps;

/// <summary>
/// An entity teleport packet,
/// the entity jumps to the given position instantly.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="PositionX">The x coordinate the entity teleports to.</param>
/// <param name="PositionY">The y coordinate the entity teleports to.</param>
/// <param name="Unknown">Unknown TODO.</param>
[PacketHeader("tp", PacketSource.Server)]
[GenerateSerializer(true)]
public record TpPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    short PositionX,
    [PacketIndex(3)]
    short PositionY,
    [PacketIndex(4)]
    sbyte Unknown
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Mates/CtlPacket.cs => Packets/NosSmooth.Packets/Server/Mates/CtlPacket.cs +31 -0
@@ 0,0 1,31 @@
//
//  CtlPacket.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.Mates;

/// <summary>
/// The client may control the given pet now.
/// </summary>
/// <param name="EntityType">The type of the mate entity (npc).</param>
/// <param name="EntityId">The id of the mate entity.</param>
/// <param name="Unknown1">Unknown TODO.</param>
/// <param name="Unknown2">Unknown TODO.</param>
[PacketHeader("ctl", PacketSource.Server)]
[GenerateSerializer(true)]
public record CtlPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    byte Unknown1 = 3,
    [PacketIndex(3)]
    byte Unknown2 = 0
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Raids/RaidfHpSubPacket.cs => Packets/NosSmooth.Packets/Server/Raids/RaidfHpSubPacket.cs +25 -0
@@ 0,0 1,25 @@
//
//  RaidfHpSubPacket.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.Raids;

/// <summary>
/// A sub packet of <see cref="RaidfhpPacket"/>,
/// <see cref="RaidfmpPacket"/> containing hp or mp of a player.
/// </summary>
/// <param name="PlayerId">The id of the player.</param>
/// <param name="HpPercentage">The hp or mp percentage of the player.</param>
[PacketHeader(null, PacketSource.Server)]
[GenerateSerializer(true)]
public record RaidfHpSubPacket
(
    [PacketIndex(0)]
    long PlayerId,
    [PacketIndex(1)]
    byte HpPercentage
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Raids/RaidfhpPacket.cs => Packets/NosSmooth.Packets/Server/Raids/RaidfhpPacket.cs +26 -0
@@ 0,0 1,26 @@
//
//  RaidfhpPacket.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.Raids;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Raids;

/// <summary>
/// Raid hp packet that is sent for raids using raidf packet.
/// Raids using raid packet contain hp, mp in raid packet itself.
/// </summary>
/// <param name="Type">The type of the raid packet (3 - player healths)</param>
/// <param name="HpSubPackets">Hp of the players.</param>
[PacketHeader("raidfhp", PacketSource.Server)]
[GenerateSerializer(true)]
public record RaidfhpPacket
(
    [PacketIndex(0)]
    RaidPacketType Type,
    [PacketListIndex(1, ListSeparator = ' ', InnerSeparator = '.')]
    IReadOnlyList<RaidfHpSubPacket> HpSubPackets
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/Raids/RaidfmpPacket.cs => Packets/NosSmooth.Packets/Server/Raids/RaidfmpPacket.cs +26 -0
@@ 0,0 1,26 @@
//
//  RaidfmpPacket.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.Raids;
using NosSmooth.PacketSerializer.Abstractions.Attributes;

namespace NosSmooth.Packets.Server.Raids;

/// <summary>
/// Raid mp packet that is sent for raids using raidf packet.
/// Raids using raid packet contain hp, mp in raid packet itself.
/// </summary>
/// <param name="Type">The type of the raid packet (3 - player healths)</param>
/// <param name="HpSubPackets">Mp of the players.</param>
[PacketHeader("raidfmp", PacketSource.Server)]
[GenerateSerializer(true)]
public record RaidfmpPacket
(
    [PacketIndex(0)]
    RaidPacketType Type,
    [PacketListIndex(1, ListSeparator = ' ', InnerSeparator = '.')]
    IReadOnlyList<RaidfHpSubPacket> HpSubPackets
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/UI/DelayPacket.cs => Packets/NosSmooth.Packets/Server/UI/DelayPacket.cs +30 -0
@@ 0,0 1,30 @@
//
//  DelayPacket.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;

/// <summary>
/// The client should wait before doing the given operation,
/// dancing in the process. The character may not move, sit, etc.
/// In case the character moves, sits or does something else,
/// the operation will be cancelled.
/// </summary>
/// <param name="Delay">The time to wait.</param>
/// <param name="Type">The type of the delay packet.</param>
/// <param name="Argument">The argument to send after waited.</param>
[PacketHeader("delay", PacketSource.Server)]
[GenerateSerializer(true)]
public record DelayPacket
(
    [PacketIndex(0)]
    int Delay,
    [PacketIndex(1)]
    int Type,
    [PacketIndex(2)]
    string Argument
) : IPacket;
\ No newline at end of file

A Packets/NosSmooth.Packets/Server/UI/RestPacket.cs => Packets/NosSmooth.Packets/Server/UI/RestPacket.cs +28 -0
@@ 0,0 1,28 @@
//
//  RestPacket.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.UI;

/// <summary>
/// The given entity sitting state has been changed.
/// </summary>
/// <param name="EntityType">The type of the entity.</param>
/// <param name="EntityId">The id of the entity.</param>
/// <param name="IsSitting">Whether the entity is sitting.</param>
[PacketHeader("rest", PacketSource.Server)]
[GenerateSerializer(true)]
public record RestPacket
(
    [PacketIndex(0)]
    EntityType EntityType,
    [PacketIndex(1)]
    long EntityId,
    [PacketIndex(2)]
    bool IsSitting
) : IPacket;
\ No newline at end of file

Do not follow this link