CTT/Server/Hotfix/Game/Handler/UI/Skill/C2M_ReSetSkillHandler.cs

26 lines
747 B
C#
Raw Permalink Normal View History

2021-04-08 20:09:59 +08:00
using System;
using System.Collections.Generic;
using System.Net.Sockets;
namespace ET
{
[ActorMessageHandler]
public class C2M_ReSetSkillHandler : AMActorLocationRpcHandler<Unit, C2M_ReSetSkill, M2C_ReSetSkill>
{
public const int RESET_Price = 500;
protected override async ETTask Run(Unit unit, C2M_ReSetSkill request, M2C_ReSetSkill response, Action reply)
{
2021-04-11 19:50:39 +08:00
string ret = CharacterHelper.ReduceMoney(unit, CharacterHelper.MoneyType.Voucher, RESET_Price);
2021-04-08 20:09:59 +08:00
if (ret != null)
{
response.Message = ret;
reply();
return;
}
2021-04-11 19:50:39 +08:00
UnitSkillComponent skill = unit.GetComponent<UnitSkillComponent>();
2021-04-08 20:09:59 +08:00
await skill.ResetSkill();
reply();
await ETTask.CompletedTask;
}
}
}