~ruther/NosSmooth

41e23e7d2153e2788480fa7f85d1248ef2225196 — Rutherther 2 years ago 54cfd23 + 15d099c
Merge pull request #68 from plsfixrito/NpcOwnerId

Add OwnerId and IsPartner properties to NPC (partners/nosmates)
M Core/NosSmooth.Game/Data/Entities/Npc.cs => Core/NosSmooth.Game/Data/Entities/Npc.cs +10 -0
@@ 28,6 28,11 @@ public class Npc : ILivingEntity
    /// <inheritdoc/>
    public long Id { get; set; }

    /// <summary>
    /// Gets or sets the id of the owner, if any.
    /// </summary>
    public long? OwnerId { get; set; }

    /// <inheritdoc/>
    public string? Name { get; set; }



@@ 40,6 45,11 @@ public class Npc : ILivingEntity
    /// <inheritdoc />
    public bool CantAttack { get; set; }

    /// <summary>
    /// Gets or sets whether the entity is a partner.
    /// </summary>
    public bool? IsPartner { get; set; }

    /// <inheritdoc/>
    public Position? Position { get; set; }


M Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs => Core/NosSmooth.Game/PacketHandlers/Map/InResponder.cs +3 -1
@@ 199,7 199,9 @@ public class InResponder : IPacketResponder<InPacket>
            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.PartnerMask == 1
        };
    }


M Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs => Packets/NosSmooth.Packets/Server/Maps/InNonPlayerSubPacket.cs +2 -2
@@ 25,7 25,7 @@ namespace NosSmooth.Packets.Server.Maps;
/// <param name="IsSitting">Whether the entity is sitting.</param>
/// <param name="MorphVNum">The id of the morph (for special cards an such).</param>
/// <param name="Name">The name of the entity, if any.</param>
/// <param name="Unknown">Unknown.</param>
/// <param name="PartnerMask">Whether the entity is a partner.</param>
/// <param name="Unknown2">Unknown.</param>
/// <param name="Unknown3">Unknown.</param>
/// <param name="Skill1">The first skill VNum of the entity.</param>


@@ 62,7 62,7 @@ public record InNonPlayerSubPacket
    [PacketIndex(9)]
    NameString? Name,
    [PacketIndex(10)]
    string? Unknown,
    sbyte PartnerMask,
    [PacketIndex(11)]
    string? Unknown2,
    [PacketIndex(12)]

M Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs => Tests/NosSmooth.Packets.Tests/Converters/Packets/InPacketConverterTests.cs +2 -2
@@ 235,7 235,7 @@ public class InPacketConverterTests
                false,
                null,
                null,
                "0",
                0,
                "-1",
                "0",
                0,


@@ 285,7 285,7 @@ public class InPacketConverterTests
                false,
                -1,
                null,
                "0",
                0,
                null,
                "0",
                0,

Do not follow this link