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

22 lines
No EOL
660 B
C#

using System.Threading;
using System.Threading.Tasks;
using PhoenixLib.Events;
using WingsEmu.Game._enum;
using WingsEmu.Game.Inventory.Event;
using WingsEmu.Game.Networking;
namespace WingsEmu.Plugins.BasicImplementations.CharacterLifetimeStats;
public class TotalGoldDroppedEventHandler : IAsyncEventProcessor<InventoryPickedUpItemEvent>
{
public async Task HandleAsync(InventoryPickedUpItemEvent e, CancellationToken cancellation)
{
if (e.ItemVnum != (int)ItemVnums.GOLD)
{
return;
}
IClientSession session = e.Sender;
session.PlayerEntity.LifetimeStats.TotalGoldDropped += e.Amount;
}
}