From 777cd8a047d6c4d7a1d74554bb52a9a71401ec0e Mon Sep 17 00:00:00 2001 From: NotKappa Date: Tue, 7 Feb 2023 23:32:36 +0300 Subject: [PATCH] Add Partner properties to Npc entity --- Core/NosSmooth.Game/Data/Entities/Npc.cs | 10 ++++++++++ Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs | 4 +++- .../Server/Maps/InNonPlayerSubPacket.cs | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Core/NosSmooth.Game/Data/Entities/Npc.cs b/Core/NosSmooth.Game/Data/Entities/Npc.cs index 2e677a2..e7feddf 100644 --- a/Core/NosSmooth.Game/Data/Entities/Npc.cs +++ b/Core/NosSmooth.Game/Data/Entities/Npc.cs @@ -28,6 +28,11 @@ public class Npc : ILivingEntity /// public long Id { get; set; } + /// + /// Gets or sets the id of the owner, if any. + /// + public long? OwnerId { get; set; } + /// public string? Name { get; set; } @@ -40,6 +45,11 @@ public class Npc : ILivingEntity /// public bool CantAttack { get; set; } + /// + /// Gets or sets whether the entity is a partner. + /// + public bool? IsPartner { get; set; } + /// public Position? Position { get; set; } diff --git a/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs index 4405ded..e81876b 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs @@ -199,7 +199,9 @@ public class InResponder : IPacketResponder Position = new Position(packet.PositionX, packet.PositionY), IsInvisible = nonPlayerSubPacket.IsInvisible, Level = monsterInfo?.Level ?? null, - IsSitting = nonPlayerSubPacket.IsSitting + IsSitting = nonPlayerSubPacket.IsSitting, + OwnerId = nonPlayerSubPacket.OwnerId, + IsPartner = nonPlayerSubPacket.IsPartner }; } diff --git a/Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs b/Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs index d63f99e..037e97a 100644 --- a/Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs +++ b/Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs @@ -62,7 +62,7 @@ public record InNonPlayerSubPacket [PacketIndex(9)] NameString? Name, [PacketIndex(10)] - string? Unknown, + bool? IsPartner, [PacketIndex(11)] string? Unknown2, [PacketIndex(12)] -- 2.49.0