--- deliantra/server/ext/NPC_Dialogue.pm 2007/08/26 04:07:40 1.8 +++ deliantra/server/ext/NPC_Dialogue.pm 2008/09/22 01:33:09 1.11 @@ -14,12 +14,6 @@ use strict; -sub has_dialogue($) { - my ($ob) = @_; - - $ob->msg =~ /^\@match /; -} - sub parse_message($) { map [split /\n/, $_, 2], grep length, @@ -127,7 +121,7 @@ @match found earhorn @cond grep $_->slaying =~ /Gramp's walking stick/, $who->inv - @eval my @g = grep { $_->slaying =~ /Gramp's walking stick/ } $who->inv; $g[0]->decrease_ob_nr (1); + @eval my @g = grep { $_->slaying =~ /Gramp's walking stick/ } $who->inv; $g[0]->decrease; Thanks for the earhorn! This example is a bit more complex. The C<@eval> statement will search @@ -340,10 +334,6 @@ delete $self->{npc}{$self->{ob}->name}{dialog_state} unless %$state; delete $self->{ob}{dialog_flag} unless %$flag; - # combine lines into paragraphs - $reply =~ s/(?<=\S)\n(?=\w)/ /g; - $reply =~ s/\n\n/\n/g; - # ignores flags and npc from replies $reply = join "\n", (map $_->[1], @replies), $reply;