feat(ADAMU-CUSTOM): port remote-NPC (open NPC window from anywhere via 0x8000 marker)
This commit is contained in:
@@ -29,6 +29,17 @@ internal abstract class TalkNpcHandlerPlugInBase : IPacketHandlerPlugIn
|
||||
public async ValueTask HandlePacketAsync(Player player, Memory<byte> packet)
|
||||
{
|
||||
TalkToNpcRequest message = packet;
|
||||
|
||||
// ADAMU-CUSTOM: remote NPC ("NPC list" mobile feature). Object id'leri her zaman <= 0x7FFF
|
||||
// (GameMap IdGenerator), o yüzden yüksek bit serbest marker. Set edilmişse alt 15 bit bir
|
||||
// NPC *definition number*'dır — o NPC'nin penceresini konum/harita bağımsız aç.
|
||||
if ((message.NpcId & 0x8000) != 0)
|
||||
{
|
||||
await this.TalkNpcAction.TalkToNpcByNumberAsync(player, (short)(message.NpcId & 0x7FFF)).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
// ADAMU-CUSTOM end
|
||||
|
||||
if (player.CurrentMap?.GetObject(message.NpcId) is NonPlayerCharacter npc)
|
||||
{
|
||||
await this.TalkNpcAction.TalkToNpcAsync(player, npc).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user