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.13 by root, Thu Jan 8 04:35:04 2009 UTC vs.
Revision 1.14 by root, Thu Jan 8 19:23:44 2009 UTC

201When the state argument is omitted the trigger is stateful and retains an 201When the state argument is omitted the trigger is stateful and retains an
202internal state per connected-id. There is a limitation to the use of this: The 202internal state per connected-id. There is a limitation to the use of this: The
203state won't be changed when the connection is triggered by other triggers. So 203state won't be changed when the connection is triggered by other triggers. So
204be careful when triggering the connection from other objects. 204be careful when triggering the connection from other objects.
205 205
206When a state argument is given it should be either 0 or 1. 1 will 'push' the connection 206When a state argument is given it should be a positive integer. Any value
207and 0 will 'release' the connection. This is useful for example when you want to 207C<!= 0> will 'push' the connection (in general, you should specify C<1>
208let a npc control a door. 208for this) and C<0> will 'release' the connection. This is useful for
209example when you want to let an NPC control a door.
209 210
210Trigger all objects with the given connected-id by 'releasing' the connection. 211Trigger all objects with the given connected-id by 'releasing' the connection.
211 212
212=item @playersound face-name 213=item @playersound face-name
213 214
307 $state->{$name} eq $value 308 $state->{$name} eq $value
308 or next topic; 309 or next topic;
309 310
310 } elsif ($cmd eq "trigger") { 311 } elsif ($cmd eq "trigger") {
311 my ($con, $state) = split /\s+/, $args, 2; 312 my ($con, $state) = split /\s+/, $args, 2;
312 $con = $con * 1;
313 313
314 if (defined $state) { 314 if (defined $state) {
315 $self->{npc}->map->trigger ($args, $state, $self->{npc}, $self->{ob}); 315 $self->{npc}->map->trigger ($con, $state, $self->{npc}, $self->{ob});
316 } else { 316 } else {
317 my $rvalue = \$self->{npc}{dialog_trigger}{$con}; 317 my $rvalue = \$self->{npc}{dialog_trigger}{$con+0};
318 $self->{npc}->map->trigger ($con, $$rvalue = !$$rvalue, $self->{npc}, $self->{ob}); 318 $self->{npc}->map->trigger ($con, $$rvalue = !$$rvalue, $self->{npc}, $self->{ob});
319 } 319 }
320 320
321 } elsif ($cmd eq "addtopic") { 321 } elsif ($cmd eq "addtopic") {
322 push @kw, split /\|/, $args; 322 push @kw, split /\|/, $args;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines