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

17 lines
No EOL
626 B
C#

using System.Threading;
using System.Threading.Tasks;
using PhoenixLib.Events;
using WingsEmu.Game.Networking;
using WingsEmu.Game.Shops.Event;
namespace WingsEmu.Plugins.BasicImplementations.CharacterLifetimeStats;
public class TotalGoldSpentInNpcShopEventHandler : IAsyncEventProcessor<ShopNpcBoughtItemEvent>
{
public async Task HandleAsync(ShopNpcBoughtItemEvent e, CancellationToken cancellation)
{
IClientSession session = e.Sender;
session.PlayerEntity.LifetimeStats.TotalGoldSpentInNpcShop += e.TotalPrice;
session.PlayerEntity.LifetimeStats.TotalGoldSpent += e.TotalPrice;
}
}