70 lines
1.8 KiB
C#
70 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Org.BouncyCastle.Asn1.Ocsp;
|
|
|
|
|
|
using ServerCore; using ServerBase;
|
|
using ServerCommon;
|
|
|
|
|
|
using SESSION_ID = System.Int32;
|
|
using WORLD_META_ID = System.UInt32;
|
|
using META_ID = System.UInt32;
|
|
using ENTITY_GUID = System.String;
|
|
using ACCOUNT_ID = System.String;
|
|
using OWNER_GUID = System.String;
|
|
using USER_GUID = System.String;
|
|
using CHARACTER_GUID = System.String;
|
|
using ITEM_GUID = System.String;
|
|
using NPC_UNIQUE_ID = System.String;
|
|
using UGC_NPC_META_GUID = System.String;
|
|
using ENTITY_INSTANCE_GUID = System.String;
|
|
|
|
|
|
|
|
namespace GameServer
|
|
{
|
|
public class NpcInteractionAction : EntityActionBase
|
|
{
|
|
public NpcInteractionAction(Player owner)
|
|
: base(owner)
|
|
{
|
|
}
|
|
|
|
public override async Task<Result> onInit()
|
|
{
|
|
await Task.CompletedTask;
|
|
|
|
var result = new Result();
|
|
|
|
return result;
|
|
}
|
|
|
|
public override void onClear()
|
|
{
|
|
return;
|
|
}
|
|
|
|
public async Task<(Result, EntityBase?, EntityBase?)> findNpc(EntityType targetNpcType, NPC_UNIQUE_ID npcUniqueId, OWNER_GUID ownerGuid)
|
|
{
|
|
var owner = getOwner();
|
|
ArgumentNullException.ThrowIfNull(owner, $"owner is null !!!");
|
|
|
|
return await NpcHelper.findNpc(targetNpcType, npcUniqueId, ownerGuid);
|
|
}
|
|
|
|
public async Task<(Result, EntityBase?)> findInstanceNpc(EntityType targetNpcType, ENTITY_INSTANCE_GUID entityInstanceGuid)
|
|
{
|
|
var owner = getOwner();
|
|
ArgumentNullException.ThrowIfNull(owner, $"owner is null !!!");
|
|
|
|
return await NpcHelper.findInstanceNpc(targetNpcType, entityInstanceGuid);
|
|
}
|
|
}
|
|
}
|