--- deliantra/server/ext/NPC_Dialogue.pm 2007/08/08 07:55:57 1.6 +++ deliantra/server/ext/NPC_Dialogue.pm 2008/04/21 06:35:26 1.9 @@ -123,6 +123,20 @@ C or any other method that is allowed to be called on a C here. +=item B + + @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; + Thanks for the earhorn! + +This example is a bit more complex. The C<@eval> statement will search +the players inventory for the same term as the C<@cond> and then +decreases the number of objects used there. + +(See also the map: C for an example how this is +used in the real world :-) + =back =item @eval perl @@ -201,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 @@ -251,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;