~ruther/NosSmooth

3a1c26d97569e35c45d98ad5764f948885b75e68 — František Boháček 3 years ago c107857
fix: use nos smooth packets in game
M Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs => Core/NosSmooth.Game/Apis/NostaleChatPacketApi.cs +6 -22
@@ 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 NosCore.Packets.Enumerations;
using NosCore.Packets.ServerPackets.Chats;
using NosSmooth.Core.Client;
using NosSmooth.Game.Data.Entities;
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Enums.Chat;
using NosSmooth.Packets.Packets.Server.Chat;
using Remora.Results;

namespace NosSmooth.Game.Apis;


@@ 39,16 39,8 @@ public class NostaleChatPacketApi
    /// <param name="color">The color of the message.</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> ReceiveSystemMessageAsync(string content, SayColorType color = SayColorType.Yellow, CancellationToken ct = default)
    {
        return _client.ReceivePacketAsync(
            new SayPacket
            {
                Message = content, Type = color
            },
            ct
        );
    }
    public Task<Result> ReceiveSystemMessageAsync(string content, SayColor color = SayColor.Yellow, CancellationToken ct = default)
        => _client.ReceivePacketAsync(new SayPacket(EntityType.Map, 0, color, content), ct);

    /// <summary>
    /// Sends the given message to the public chat.


@@ 57,15 49,7 @@ public class NostaleChatPacketApi
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> SendMessageAsync(string content, CancellationToken ct = default)
    {
        return _client.SendPacketAsync(
            new SayPacket
            {
                Message = content
            },
            ct
        );
    }
        => _client.SendPacketAsync(new Packets.Packets.Client.Chat.SayPacket(content), ct);

    /// <summary>
    /// Sends the given message to the family chat.

M Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs => Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs +114 -48
@@ 4,12 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 NosCore.Packets.ClientPackets.Battle;
using NosCore.Shared.Enumerations;
using NosSmooth.Core.Client;
using NosSmooth.Game.Data.Characters;
using NosSmooth.Game.Data.Entities;
using NosSmooth.Game.Errors;
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Packets.Client.Battle;
using Remora.Results;

namespace NosSmooth.Game.Apis;


@@ 42,17 42,30 @@ public class NostaleSkillsPacketApi
    /// <param name="entityType">The type of the supplied entity.</param>
    /// <param name="mapX">The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="mapY">The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillOn(long skillVNum, long entityId, VisualType entityType, short? mapX = default, short? mapY = default)
    public Task<Result> UseSkillOn
    (
        long skillVNum,
        long entityId,
        EntityType entityType,
        short? mapX = default,
        short? mapY = default,
        CancellationToken ct = default
    )
    {
        return _client.SendPacketAsync(new UseSkillPacket
        {
            CastId = skillVNum,
            MapX = mapX,
            MapY = mapY,
            TargetId = entityId,
            TargetVisualType = entityType
        });
        return _client.SendPacketAsync
        (
            new UseSkillPacket
            (
                skillVNum,
                entityType,
                entityId,
                mapX,
                mapY
            ),
            ct
        );
    }

    /// <summary>


@@ 66,17 79,29 @@ public class NostaleSkillsPacketApi
    /// <param name="entity">The entity to use the skill on.</param>
    /// <param name="mapX">The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="mapY">The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillOn(long skillVNum, ILivingEntity entity, short? mapX = default, short? mapY = default)
    public Task<Result> UseSkillOn
    (
        long skillVNum,
        ILivingEntity entity,
        short? mapX = default,
        short? mapY = default,
        CancellationToken ct = default
    )
    {
        return _client.SendPacketAsync(new UseSkillPacket
        {
            CastId = skillVNum,
            MapX = mapX,
            MapY = mapY,
            TargetId = entity.Id,
            TargetVisualType = entity.Type
        });
        return _client.SendPacketAsync
        (
            new UseSkillPacket
            (
                skillVNum,
                entity.Type,
                entity.Id,
                mapX,
                mapY
            ),
            ct
        );
    }

    /// <summary>


@@ 91,22 116,34 @@ public class NostaleSkillsPacketApi
    /// <param name="entity">The entity to use the skill on.</param>
    /// <param name="mapX">The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="mapY">The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillOn(Skill skill, ILivingEntity entity, short? mapX = default, short? mapY = default)
    public Task<Result> UseSkillOn
    (
        Skill skill,
        ILivingEntity entity,
        short? mapX = default,
        short? mapY = default,
        CancellationToken ct = default
    )
    {
        if (skill.IsOnCooldown)
        {
            return Task.FromResult<Result>(new SkillOnCooldownError(skill));
        }

        return _client.SendPacketAsync(new UseSkillPacket
        {
            CastId = skill.SkillVNum,
            MapX = mapX,
            MapY = mapY,
            TargetId = entity.Id,
            TargetVisualType = entity.Type
        });
        return _client.SendPacketAsync
        (
            new UseSkillPacket
            (
                skill.SkillVNum,
                entity.Type,
                entity.Id,
                mapX,
                mapY
            ),
            ct
        );
    }

    /// <summary>


@@ 121,22 158,35 @@ public class NostaleSkillsPacketApi
    /// <param name="entityType">The type of the supplied entity.</param>
    /// <param name="mapX">The x coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="mapY">The y coordinate on the map. (Used for non targeted dashes etc., says where the dash will be to.)</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillOn(Skill skill, long entityId, VisualType entityType, short? mapX = default, short? mapY = default)
    public Task<Result> UseSkillOn
    (
        Skill skill,
        long entityId,
        EntityType entityType,
        short? mapX = default,
        short? mapY = default,
        CancellationToken ct = default
    )
    {
        if (skill.IsOnCooldown)
        {
            return Task.FromResult<Result>(new SkillOnCooldownError(skill));
        }

        return _client.SendPacketAsync(new UseSkillPacket
        {
            CastId = skill.SkillVNum,
            MapX = mapX,
            MapY = mapY,
            TargetId = entityId,
            TargetVisualType = entityType
        });
        return _client.SendPacketAsync
        (
            new UseSkillPacket
            (
                skill.SkillVNum,
                entityType,
                entityId,
                mapX,
                mapY
            ),
            ct
        );
    }

    /// <summary>


@@ 148,13 198,21 @@ public class NostaleSkillsPacketApi
    /// <param name="skillVNum">The id of the skill.</param>
    /// <param name="mapX">The x coordinate to use the skill at.</param>
    /// <param name="mapY">The y coordinate to use the skill at.</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillAt(long skillVNum, short mapX, short mapY)
    public Task<Result> UseSkillAt
    (
        long skillVNum,
        short mapX,
        short mapY,
        CancellationToken ct = default
    )
    {
        return _client.SendPacketAsync(new UseAoeSkillPacket
        {
            CastId = skillVNum, MapX = mapX, MapY = mapY
        });
        return _client.SendPacketAsync
        (
            new UseAOESkillPacket(skillVNum, mapX, mapY),
            ct
        );
    }

    /// <summary>


@@ 166,17 224,25 @@ public class NostaleSkillsPacketApi
    /// <param name="skill">The skill to use.</param>
    /// <param name="mapX">The x coordinate to use the skill at.</param>
    /// <param name="mapY">The y coordinate to use the skill at.</param>
    /// <param name="ct">The cancellation token for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    public Task<Result> UseSkillAt(Skill skill, short mapX, short mapY)
    public Task<Result> UseSkillAt
    (
        Skill skill,
        short mapX,
        short mapY,
        CancellationToken ct = default
    )
    {
        if (skill.IsOnCooldown)
        {
            return Task.FromResult<Result>(new SkillOnCooldownError(skill));
        }

        return _client.SendPacketAsync(new UseAoeSkillPacket
        {
            CastId = skill.SkillVNum, MapX = mapX, MapY = mapY
        });
        return _client.SendPacketAsync
        (
            new UseAOESkillPacket(skill.SkillVNum, mapX, mapY),
            ct
        );
    }
}
\ No newline at end of file

M Core/NosSmooth.Game/Data/Act4/Act4Status.cs => Core/NosSmooth.Game/Data/Act4/Act4Status.cs +1 -1
@@ 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.

using NosCore.Packets.Enumerations;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Game.Data.Act4;


M Core/NosSmooth.Game/Data/Characters/Character.cs => Core/NosSmooth.Game/Data/Characters/Character.cs +6 -6
@@ 4,12 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 NosCore.Packets.Enumerations;
using NosCore.Shared.Enumerations;
using NosSmooth.Game.Data.Chat;
using NosSmooth.Game.Data.Entities;
using NosSmooth.Game.Data.Info;
using NosSmooth.Game.Data.Social;
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Enums.Players;

namespace NosSmooth.Game.Data.Characters;



@@ 66,10 66,10 @@ public record Character
    FactionType? Faction = default,
    short Size = default,
    AuthorityType AuthorityType = default,
    GenderType Gender = default,
    HairStyleType HairStyle = default,
    HairColorType HairColor = default,
    CharacterClassType Class = default,
    SexType Gender = default,
    HairStyle HairStyle = default,
    HairColor HairColor = default,
    PlayerClass Class = default,
    byte? Icon = default,
    short? Compliment = default,
    Morph? Morph = default,

M Core/NosSmooth.Game/Data/Chat/Friend.cs => Core/NosSmooth.Game/Data/Chat/Friend.cs +1 -3
@@ 4,8 4,6 @@
//  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 NosCore.Packets.Enumerations;

namespace NosSmooth.Game.Data.Chat;

/// <summary>


@@ 21,7 19,7 @@ public class Friend
    /// <summary>
    /// The type of the relation.
    /// </summary>
    public CharacterRelationType RelationType { get; internal set; }
    // public CharacterRelationType RelationType { get; internal set; }

    /// <summary>
    /// The name of the character.

M Core/NosSmooth.Game/Data/Dialogs/Dialog.cs => Core/NosSmooth.Game/Data/Dialogs/Dialog.cs +2 -2
@@ 4,7 4,6 @@
//  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 NosCore.Packets.Enumerations;
using OneOf;

namespace NosSmooth.Game.Data.Dialogs;


@@ 18,6 17,7 @@ namespace NosSmooth.Game.Data.Dialogs;
public record Dialog
(
    string AcceptCommand,
    OneOf<Game18NConstString, string> Message,

    // OneOf<Game18NConstString, string> Message,
    IReadOnlyList<string> Parameters
);
\ No newline at end of file

M Core/NosSmooth.Game/Data/Entities/GroundItem.cs => Core/NosSmooth.Game/Data/Entities/GroundItem.cs +2 -2
@@ 4,8 4,8 @@
//  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 NosCore.Shared.Enumerations;
using NosSmooth.Game.Data.Info;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Game.Data.Entities;



@@ 21,5 21,5 @@ public record GroundItem(long Id, long ItemVNum, Position? Position) : IEntity
    public string? Name => null;

    /// <inheritdoc />
    public VisualType Type => VisualType.Object;
    public EntityType Type => EntityType.Object;
}
\ No newline at end of file

M Core/NosSmooth.Game/Data/Entities/IEntity.cs => Core/NosSmooth.Game/Data/Entities/IEntity.cs +2 -2
@@ 4,8 4,8 @@
//  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 NosCore.Shared.Enumerations;
using NosSmooth.Game.Data.Info;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Game.Data.Entities;



@@ 32,5 32,5 @@ public interface IEntity
    /// <summary>
    /// Gets the type of the entity.
    /// </summary>
    public VisualType Type { get; }
    public EntityType Type { get; }
}
\ No newline at end of file

M Core/NosSmooth.Game/Data/Entities/LivingEntity.cs => Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +1 -1
@@ 4,8 4,8 @@
//  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 NosCore.Packets.Enumerations;
using NosSmooth.Game.Data.Info;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Game.Data.Entities;


M Core/NosSmooth.Game/Data/Entities/Monster.cs => Core/NosSmooth.Game/Data/Entities/Monster.cs +2 -3
@@ 4,9 4,8 @@
//  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 NosCore.Packets.Enumerations;
using NosCore.Shared.Enumerations;
using NosSmooth.Game.Data.Info;
using NosSmooth.Packets.Enums;

namespace NosSmooth.Game.Data.Entities;



@@ 40,5 39,5 @@ public record Monster
) : ILivingEntity
{
    /// <inheritdoc/>
    public VisualType Type => VisualType.Monster;
    public EntityType Type => EntityType.Monster;
}
\ No newline at end of file

M Core/NosSmooth.Game/Data/Entities/Player.cs => Core/NosSmooth.Game/Data/Entities/Player.cs +7 -8
@@ 4,10 4,9 @@
//  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 NosCore.Packets.Enumerations;
using NosCore.Shared.Enumerations;
using NosSmooth.Game.Data.Characters;
using NosSmooth.Game.Data.Info;
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Enums.Players;

namespace NosSmooth.Game.Data.Entities;



@@ 48,10 47,10 @@ public record Player
    FactionType? Faction = default,
    short Size = default,
    AuthorityType AuthorityType = default,
    GenderType Gender = default,
    HairStyleType HairStyle = default,
    HairColorType HairColor = default,
    CharacterClassType Class = default,
    SexType Gender = default,
    HairStyle HairStyle = default,
    HairColor HairColor = default,
    PlayerClass Class = default,
    byte? Icon = default,
    short? Compliment = default,
    Morph? Morph = default,


@@ 64,5 63,5 @@ public record Player
    ushort? ILivingEntity.Level => Level?.Lvl;

    /// <inheritdoc />
    public VisualType Type => VisualType.Player;
    public EntityType Type => EntityType.Player;
}
\ No newline at end of file

M Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs => Core/NosSmooth.Game/Extensions/ServiceCollectionExtensions.cs +0 -2
@@ 6,11 6,9 @@

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using NosSmooth.Core.Commands;
using NosSmooth.Core.Extensions;
using NosSmooth.Game.Apis;
using NosSmooth.Game.Events.Core;
using NosSmooth.Game.Events.Players;
using NosSmooth.Game.PacketHandlers.Characters;
using NosSmooth.Game.PacketHandlers.Entities;
using NosSmooth.Game.PacketHandlers.Login;

M Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs => Core/NosSmooth.Game/PacketHandlers/Characters/CharacterInitResponder.cs +5 -6
@@ 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 NosCore.Packets.ServerPackets.Player;
using NosSmooth.Core.Packets;
using NosSmooth.Game.Data.Characters;
using NosSmooth.Game.Data.Info;
using NosSmooth.Game.Data.Social;
using NosSmooth.Game.Events.Characters;
using NosSmooth.Game.Events.Core;
using NosSmooth.Packets.Packets.Server.Players;
using Remora.Results;

namespace NosSmooth.Game.PacketHandlers.Characters;


@@ 45,7 44,7 @@ public class CharacterInitResponder : IPacketResponder<CInfoPacket>, IPacketResp
        {
            _game.Character = character = character with
            {
                Id = packet.CharacterId,
                /*Id = packet.CharacterId,
                AuthorityType = packet.Authority,
                Gender = packet.Gender,
                HairStyle = packet.HairStyle,


@@ 59,7 58,7 @@ public class CharacterInitResponder : IPacketResponder<CInfoPacket>, IPacketResp
                },
                ArenaWinner = packet.ArenaWinner,
                Invisible = packet.Invisible,
                Family = new Family(packet.FamilyId, packet.FamilyName, packet.FamilyLevel)
                Family = new Family(packet.FamilyId, packet.FamilyName, packet.FamilyLevel)*/
            };
        }



@@ 108,7 107,7 @@ public class CharacterInitResponder : IPacketResponder<CInfoPacket>, IPacketResp
        var oldCharacter = _game.Character;
        var character = oldCharacter;

        if (character is null || character.Id != packetArgs.Packet.VisualId)
        if (character is null || character.Id != packetArgs.Packet.EntityId)
        { // Not the current character.
            return Result.FromSuccess();
        }


@@ 118,7 117,7 @@ public class CharacterInitResponder : IPacketResponder<CInfoPacket>, IPacketResp
        {
            Morph = new Morph
            (
                packet.Morph,
                packet.MorphVNum,
                packet.MorphUpgrade,
                packet.MorphDesign,
                packet.MorphBonus,

M Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs => Core/NosSmooth.Game/PacketHandlers/Characters/SkillResponder.cs +7 -7
@@ 4,11 4,11 @@
//  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 NosCore.Packets.ServerPackets.Battle;
using NosSmooth.Core.Packets;
using NosSmooth.Game.Data.Characters;
using NosSmooth.Game.Events.Characters;
using NosSmooth.Game.Events.Core;
using NosSmooth.Packets.Packets.Server.Skills;
using Remora.Results;

namespace NosSmooth.Game.PacketHandlers.Characters;


@@ 41,29 41,29 @@ public class SkillResponder : IPacketResponder<SkiPacket>

        var character = await _game.EnsureCharacterCreatedAsync(false, ct);

        if (packet.PrimarySkill == character.Skills?.PrimarySkill.SkillVNum)
        if (packet.PrimarySkillId == character.Skills?.PrimarySkill.SkillVNum)
        {
            primarySkill = character.Skills.PrimarySkill;
        }
        else
        {
            primarySkill = new Skill(packet.PrimarySkill);
            primarySkill = new Skill(packet.PrimarySkillId);
        }

        if (packet.PrimarySkill == packet.SecondarySkill)
        if (packet.PrimarySkillId == packet.SecondarySkillId)
        {
            secondarySkill = primarySkill;
        }
        else if (packet.SecondarySkill == character.Skills?.SecondarySkill.SkillVNum)
        else if (packet.SecondarySkillId == character.Skills?.SecondarySkill.SkillVNum)
        {
            secondarySkill = character.Skills.SecondarySkill;
        }
        else
        {
            secondarySkill = new Skill(packet.SecondarySkill);
            secondarySkill = new Skill(packet.SecondarySkillId);
        }

        var skillsFromPacket = packet.SkiSubPackets?.Select(x => x.SkillVNum).ToList() ?? new List<long>();
        var skillsFromPacket = packet.SkillSubPackets?.Select(x => x.SkillId).ToList() ?? new List<long>();
        var skillsFromCharacter = character.Skills is null ? new List<long>() : character.Skills.OtherSkills.Select(x => x.SkillVNum).ToList();
        var newSkills = skillsFromPacket.Except(skillsFromCharacter);
        var oldSkills = skillsFromCharacter.Except(skillsFromPacket);

M Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs => Core/NosSmooth.Game/PacketHandlers/Characters/WalkResponder.cs +3 -3
@@ 4,11 4,11 @@
//  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 NosCore.Packets.ClientPackets.Movement;
using NosSmooth.Core.Packets;
using NosSmooth.Game.Data.Info;
using NosSmooth.Game.Events.Core;
using NosSmooth.Game.Events.Entities;
using NosSmooth.Packets.Packets.Client.Movement;
using Remora.Results;

namespace NosSmooth.Game.PacketHandlers.Characters;


@@ 44,8 44,8 @@ public class WalkResponder : IPacketResponder<WalkPacket>
                Y = character.Position.Y
            };

            character.Position.X = packetArgs.Packet.XCoordinate;
            character.Position.Y = packetArgs.Packet.YCoordinate;
            character.Position.X = packetArgs.Packet.PositionX;
            character.Position.Y = packetArgs.Packet.PositionY;

            return await _eventDispatcher.DispatchEvent
            (

M Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs => Core/NosSmooth.Game/PacketHandlers/Entities/SkillUsedResponder.cs +5 -5
@@ 4,14 4,14 @@
//  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 NosCore.Packets.ServerPackets.Battle;
using NosCore.Shared.Enumerations;
using NosSmooth.Core.Packets;
using NosSmooth.Game.Data.Info;
using NosSmooth.Game.Events.Characters;
using NosSmooth.Game.Events.Core;
using NosSmooth.Game.Events.Players;
using NosSmooth.Game.Extensions;
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Packets.Server.Skills;
using Remora.Results;

namespace NosSmooth.Game.PacketHandlers.Entities;


@@ 41,7 41,7 @@ public class SkillUsedResponder : IPacketResponder<SuPacket>, IPacketResponder<S
        var packet = packetArgs.Packet;
        var character = _game.Character;

        if (packet.VisualType != VisualType.Player)
        if (packet.EntityType != EntityType.Player)
        {
            return Result.FromSuccess();
        }


@@ 100,7 100,7 @@ public class SkillUsedResponder : IPacketResponder<SuPacket>, IPacketResponder<S

        if (character is not null && character.Skills is not null)
        {
            var skillResult = character.Skills.TryGetSkill(packet.SkillVnum);
            var skillResult = character.Skills.TryGetSkill(packet.SkillId);

            if (skillResult.IsDefined(out var skillEntity))
            {


@@ 110,7 110,7 @@ public class SkillUsedResponder : IPacketResponder<SuPacket>, IPacketResponder<S
        }
        else
        {
            await _eventDispatcher.DispatchEvent(new SkillReadyEvent(null, packet.SkillVnum), ct);
            await _eventDispatcher.DispatchEvent(new SkillReadyEvent(null, packet.SkillId), ct);
        }

        return Result.FromSuccess();

M Core/NosSmooth.Game/PacketHandlers/Login/CListPacketResponder.cs => Core/NosSmooth.Game/PacketHandlers/Login/CListPacketResponder.cs +0 -2
@@ 4,8 4,6 @@
//  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 NosCore.Packets.ClientPackets.Warehouse;
using NosCore.Packets.ServerPackets.CharacterSelectionScreen;
using NosSmooth.Core.Packets;
using NosSmooth.Game.Events.Core;
using NosSmooth.Game.Events.Login;

Do not follow this link