38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
|
|
namespace GameServer;
|
|
|
|
[ChatCommandAttribute("startbuff", typeof(ChatCommandStartBuff), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
|
internal class ChatCommandStartBuff : ChatCommandBase
|
|
{
|
|
public override async Task invoke(Player player, string token, string[] args)
|
|
{
|
|
await Task.CompletedTask;
|
|
|
|
Log.getLogger().info($"HandleStartBuff");
|
|
|
|
if (args.Length < 1)
|
|
{
|
|
Log.getLogger().error($"Invalid Argument");
|
|
return;
|
|
}
|
|
|
|
if (!uint.TryParse(args[0], out var buff_meta_id))
|
|
{
|
|
Log.getLogger().error($"questcomplete param parsing Error args : {args[0]}");
|
|
return;
|
|
}
|
|
|
|
var buff_action = player.getEntityAction<BuffAction>();
|
|
(var result, var add_buff_attribute, var del_buff_attribute) = buff_action.AddBuffProcess(buff_meta_id);
|
|
if (result.isFail())
|
|
{
|
|
Log.getLogger().error($"Failed to AddBuffProcess() !!! : {result.toBasicString()} - {player.toBasicString()}");
|
|
return;
|
|
}
|
|
|
|
BuffNotifyHelper.send_S2C_NTF_DELETE_BUFF(player, del_buff_attribute);
|
|
BuffNotifyHelper.send_S2C_NTF_START_BUFF(player, add_buff_attribute);
|
|
}
|
|
} |