//
// NostaleMateSkillsPacketApi.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.Core.Client;
using NosSmooth.Packets.Client.Battle;
using NosSmooth.Packets.Enums.Entities;
using Remora.Results;
namespace NosSmooth.Game.Apis;
///
/// Packet api for using mate skills.
///
public class NostaleMateSkillsPacketApi
{
private readonly INostaleClient _client;
///
/// Initializes a new instance of the class.
///
/// The client.
public NostaleMateSkillsPacketApi(INostaleClient client)
{
_client = client;
}
///
/// Use a pet skill.
///
/// The pet id.
/// The type of the target entity.
/// The id of the target.
/// The x coordinate of the partner.
/// The y coordinate of the partner.
/// A result that may or may not have succeeded.
public Task UsePetSkillAsync
(
long petId,
EntityType targetEntityType,
long targetId,
short? mapX = default,
short? mapY = default
)
{
return _client.SendPacketAsync
(
new UsePetSkillPacket
(
petId,
targetEntityType,
targetId,
1,
mapX,
mapY
)
);
}
///
/// Use a partner skill.
///
/// The pet id.
/// The slot of the skill.
/// The type of the target entity.
/// The id of the target.
/// The x coordinate of the partner.
/// The y coordinate of the partner.
/// A result that may or may not have succeeded.
public Task UsePartnerSkillAsync
(
long partnerId,
byte skillSlot,
EntityType targetEntityType,
long targetId,
short? mapX = default,
short? mapY = default
)
{
return _client.SendPacketAsync
(
new UsePartnerSkillPacket
(
partnerId,
targetEntityType,
targetId,
skillSlot,
mapX,
mapY
)
);
}
}