--- deliantra/server/ext/NPC_Dialogue.pm 2007/01/04 15:20:11 1.2 +++ deliantra/server/ext/NPC_Dialogue.pm 2007/08/08 07:55:57 1.6 @@ -6,6 +6,8 @@ NPC dialogue support module. +=over 4 + =cut package NPC_Dialogue; @@ -28,6 +30,8 @@ sub new { my ($class, %arg) = @_; + $arg{ob} = $arg{pl}->ob; + my $self = bless { %arg, }, $class; @@ -105,6 +109,22 @@ The environment is that standard "map scripting environment", which is limited in the type of constructs allowed (no loops, for example). +Here is a example: + +=over 4 + +=item B + + @match hi + @cond grep $_->name =~ /royalty/, $who->inv + You got royalties there! Wanna have! + +You may want to change the C method there to something like C, +C<slaying> or any other method that is allowed to be called on a +C<cf::object> here. + +=back + =item @eval perl Like C<@cond>, but proceed regardless of the outcome. @@ -198,7 +218,7 @@ topic: for my $match (@{ $self->{match} }) { for (split /\|/, $match->[0]) { - if ($_ eq "*" || $lcmsg eq lc) { + if ($_ eq "*" || $lcmsg =~ /\b\Q$_\E\b/i) { my $reply = $match->[1]; my @kw;