… | |
… | |
69 | ) { |
69 | ) { |
70 | # if some listener teleported us somewhere else, stop right here |
70 | # if some listener teleported us somewhere else, stop right here |
71 | last unless $map->path == $who->map->path; |
71 | last unless $map->path == $who->map->path; |
72 | |
72 | |
73 | my $dialog = new NPC_Dialogue ob => $who, npc => $npc; |
73 | my $dialog = new NPC_Dialogue ob => $who, npc => $npc; |
74 | my $reply = $dialog->tell ($msg); |
74 | my ($reply, @kw) = $dialog->tell ($msg); |
75 | |
75 | |
76 | if (defined $reply) { |
76 | if (defined $reply) { |
77 | if ($npc->type == cf::MAGIC_EAR) { |
77 | if ($npc->type == cf::MAGIC_EAR) { |
78 | if (length $reply) { |
78 | if (length $reply) { |
79 | $_->ob->message ($reply, cf::NDI_BROWN | cf::NDI_UNIQUE) |
79 | $_->ob->message ($reply, cf::NDI_BROWN | cf::NDI_UNIQUE) |
… | |
… | |
85 | $_->ob->message ($npc->name . " says: $reply", cf::NDI_BROWN | cf::NDI_UNIQUE) |
85 | $_->ob->message ($npc->name . " says: $reply", cf::NDI_BROWN | cf::NDI_UNIQUE) |
86 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
86 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
87 | } |
87 | } |
88 | } |
88 | } |
89 | } |
89 | } |
|
|
90 | |
|
|
91 | if (@kw) { |
|
|
92 | $_->ob->message ("[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN | cf::NDI_UNIQUE) |
|
|
93 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
|
|
94 | } |
90 | } |
95 | } |
91 | |
96 | |
92 | } else { |
97 | } else { |
93 | $who->message ("What do you want to say?", cf::NDI_UNIQUE); |
98 | $who->message ("What do you want to say?", cf::NDI_UNIQUE); |
94 | } |
99 | } |