--- deliantra/server/ext/NPC_Dialogue.pm 2007/08/25 16:51:38 1.7 +++ deliantra/server/ext/NPC_Dialogue.pm 2008/04/21 06:35:26 1.9 @@ -127,7 +127,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 @@ -215,6 +215,17 @@ Trigger all objects with the given connected-id by 'releasing' the connection. +=item @playersound face-name + +Plays the given sound face (either an alias or sound file path) so that +only the player talking to the npc can hear it. + +=item @npcsound face-name + +Plays the given sound face (either an alias or sound file path) as if +the npc had made that sound, i.e. it will be located at the npc and all +players near enough can hear it. + =item @addtopic topic Adds the given topic names (separated by C<|>) to the list of topics @@ -265,6 +276,12 @@ } elsif ($cmd eq "comment") { # nop + } elsif ($cmd eq "playersound") { + $self->{ob}->contr->play_sound (cf::sound::find $args); + + } elsif ($cmd eq "npcsound") { + $self->{npc}->play_sound (cf::sound::find $args); + } elsif ($cmd eq "cond") { cf::safe_eval $args, %vars or next topic;