server-master/srcs/_plugins/WingsEmu.Plugins.BasicImplementation/BCards/Handlers/BCardMoveHandler.cs
2026-02-10 18:21:30 +01:00

35 lines
No EOL
860 B
C#

// WingsEmu
//
// Developed by NosWings Team
using System;
using WingsEmu.Game.Buffs;
using WingsEmu.Game.Characters;
using WingsEmu.Game.Entities;
using WingsEmu.Game.Extensions;
using WingsEmu.Game.Networking;
namespace WingsEmu.Plugins.BasicImplementations.BCards.Handlers;
public class BCardMoveHandler : IBCardEffectAsyncHandler
{
public BCardType HandledType => BCardType.Move;
public void Execute(IBCardEffectContext ctx)
{
if (ctx.Sender is IMonsterEntity monsterEntity)
{
monsterEntity.RefreshStats();
}
IClientSession session = (ctx.Sender as IPlayerEntity)?.Session;
if (session?.PlayerEntity == null)
{
return;
}
session.PlayerEntity.LastSpeedChange = DateTime.UtcNow;
session.RefreshStat();
session.SendCondPacket();
}
}