fix(talknpc): bind server-started dialogs to the packet NPC

Open
#4,383 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@baphomello is already working on this.

Since Nov 19, 2026.

  • #4384 by @baphomello — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
1/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
perl
Domain
backend

Research direction

Start with autoNpcTalk and Task::TalkNPC's NOT_STARTED stage, then trace how the 00B4/00B5/00B7 packet handlers supply the NPC ID and how talk cont and talk resp find the queued action. Reproduce the listed cases by replaying packets through Network::Receive. Done means server-started dialogs stay bound to the packet NPC ID despite movement or absence from the actor list, and both commands send their responses; issue #4384 already has an open linked pull request.

Written by the indexing model from the issue text.

Description

Openkore version git

3125ca761 (master), Windows, Perl 5.12.

XKore Mode

Not tied to a mode. Reproduced by replaying the packets through the real Network::Receive handlers, without a client.

RO Server Name

ROla

Result

When the server opens a dialog by itself (for example an event NPC triggered by walking into an area), OpenKore prints the dialog and the menu, but talk cont and talk resp do nothing.

autoNpcTalk creates a Task::TalkNPC with type => 'autotalk'. In the NOT_STARTED stage the task first waits for the character to stop moving, then checks timeOut($self->{time}, ...), and only then looks at %talk. If the character keeps walking for more than 5 seconds after the dialog opened, the task ends with NPC_NOT_FOUND while the dialog is still open. Later talk commands then find no NPC action in the AI queue. This happens with or without the NPC in the actor list.

If the NPC is not in the actor list and the task does start, it also reports Talking to wrong npc., because the placeholder target has no nameID. That clears the steps a plugin added in npc_autotalk.

Relevant Log Output
Could not find an NPC with id (3031).
Error in function 'talk' (Talk to NPC)
You are not talking to an npc
Expected Result

A conversation started by the server is bound to the NPC ID in the dialog packet. The task does not wait for movement or for the actor list, and talk cont and talk resp are answered.

How to Reproduce
  1. Let the server open a dialog (00B4, then 00B5 or 00B7) with an NPC ID that is not in $npcsList, while the character is still walking a path longer than 5 seconds.
  2. Wait until the walk ends, then enter talk cont or talk resp 0.
  3. Replay result on master, per scenario:
NPC listed, character stopped             talk cont -> TalkContinue sent
NPC not listed, character stopped         err "Talking to wrong npc.", still sends
NPC listed, walk ended after 6 s          task DONE "Could not find an NPC with id (3031)", nothing sent
NPC not listed, walk ended after 6 s      task DONE "Could not find an NPC with id (3031)", nothing sent
Dominant language
Perl
Stars
1.5k
Forks
1.2k
Avg merge
11h
Merged PRs (30d)
110

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenKore/openkore

All issues in OpenKore/openkore

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.