ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/NPC_Dialogue.pm
(Generate patch)

Comparing deliantra/server/ext/NPC_Dialogue.pm (file contents):
Revision 1.2 by elmex, Thu Jan 4 15:20:11 2007 UTC vs.
Revision 1.5 by root, Sat Jun 16 23:22:59 2007 UTC

3NPC_Dialogue 3NPC_Dialogue
4 4
5=head1 DESCRIPTION 5=head1 DESCRIPTION
6 6
7NPC dialogue support module. 7NPC dialogue support module.
8
9=over 4
8 10
9=cut 11=cut
10 12
11package NPC_Dialogue; 13package NPC_Dialogue;
12 14
25 $_[0] 27 $_[0]
26} 28}
27 29
28sub new { 30sub new {
29 my ($class, %arg) = @_; 31 my ($class, %arg) = @_;
32
33 $arg{ob} = $arg{pl}->ob;
30 34
31 my $self = bless { 35 my $self = bless {
32 %arg, 36 %arg,
33 }, $class; 37 }, $class;
34 38
196 my $lcmsg = lc $msg; 200 my $lcmsg = lc $msg;
197 201
198 topic: 202 topic:
199 for my $match (@{ $self->{match} }) { 203 for my $match (@{ $self->{match} }) {
200 for (split /\|/, $match->[0]) { 204 for (split /\|/, $match->[0]) {
201 if ($_ eq "*" || $lcmsg eq lc) { 205 if ($_ eq "*" || $lcmsg =~ /\b\Q$_\E\b/i) {
202 my $reply = $match->[1]; 206 my $reply = $match->[1];
203 my @kw; 207 my @kw;
204 208
205 my @replies; 209 my @replies;
206 my @match; # @match/@parse command results 210 my @match; # @match/@parse command results

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines