ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/tell.ext
(Generate patch)

Comparing deliantra/maps/perl/tell.ext (file contents):
Revision 1.1 by pippijn, Sat May 6 19:53:22 2006 UTC vs.
Revision 1.2 by pippijn, Sat May 6 20:29:44 2006 UTC

12 delete $other->ob->{ext_ignore_tell}{$name}; 12 delete $other->ob->{ext_ignore_tell}{$name};
13 } 13 }
14 if ($target ne $name and !$other->ob->{ext_ignore_tell}{$name}) { 14 if ($target ne $name and !$other->ob->{ext_ignore_tell}{$name}) {
15 $who->message ("You tell $target: $msg"); 15 $who->message ("You tell $target: $msg");
16 $other->ob->message ("$name tells you: $msg"); 16 $other->ob->message ("$name tells you: $msg");
17 $other->ob->{ext_last_tell} = $name;
17 } elsif ($target eq $name) { 18 } elsif ($target eq $name) {
18 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 19 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
19 } else { 20 } else {
20 $who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE); 21 $who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE);
21 } 22 }
22 } 23 }
23 else 24 else
24 { 25 {
25 $who->message ("No such player or ambiguous name.", 26 $who->message ("No such player or ambiguous name. Your message: ".$msg,
26 cf::NDI_UNIQUE); 27 cf::NDI_UNIQUE);
27 } 28 }
28} 29};
30
31cf::register_command reply => 0, sub
32{
33 my $name = $who->name;
34
35 if (my $other = cf::player::find $who->{ext_last_tell})
36 {
37 if ($other->ob->{ext_ignore_tell}{$name} < time) {
38 delete $other->ob->{ext_ignore_tell}{$name};
39 }
40 if (!$other->ob->{ext_ignore_tell}{$name}) {
41 $who->message ("You tell $target: $_");
42 $other->ob->message ("$name tells you: $_");
43 $who->{ext_last_tell} = $other->ob->name;
44 } else {
45 $who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE);
46 }
47 }
48 else
49 {
50 $who->message ("Can't reply, player left. Your message: ".$_,
51 cf::NDI_UNIQUE);
52 }
53};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines