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

Comparing deliantra/maps/perl/chat.ext (file contents):
Revision 1.8 by root, Sun May 7 09:18:37 2006 UTC vs.
Revision 1.9 by pippijn, Sun May 7 10:46:07 2006 UTC

53 my ($who, $args) = @_; 53 my ($who, $args) = @_;
54 my ($target, $msg) = split /\s+/, $args, 2; 54 my ($target, $msg) = split /\s+/, $args, 2;
55 55
56 my $name = $who->name; 56 my $name = $who->name;
57 57
58 if ($msg) {
58 if (my $other = cf::player::find $target) { 59 if (my $other = cf::player::find $target) {
59 60
60 if ($target ne $name and $other->ob->{ext_ignore_tell}{$name} < time) { 61 if ($target ne $name and $other->ob->{ext_ignore_tell}{$name} < time) {
61 $who->message ("You tell $target: $msg"); 62 $who->message ("You tell $target: $msg");
62 $other->ob->message ("$name tells you: $msg"); 63 $other->ob->message ("$name tells you: $msg");
63 $other->ob->{ext_last_tell} = $name; 64 $other->ob->{ext_last_tell} = $name;
64 } elsif ($target eq $name) { 65 } elsif ($target eq $name) {
65 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 66 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
67 } else {
68 $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE);
69 }
70
66 } else { 71 } else {
67 $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); 72 $who->message ("No such player or ambiguous name. Your message: $msg", cf::NDI_UNIQUE);
68 } 73 }
69
70 } else { 74 } else {
71 $who->message ("No such player or ambiguous name. Your message: $msg", cf::NDI_UNIQUE); 75 $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE);
72 } 76 }
73}; 77};
74 78
75cf::register_command reply => 0, sub { 79cf::register_command reply => 0, sub {
76 my ($who, $args) = @_; 80 my ($who, $args) = @_;
77 my $name = $who->name; 81 my $name = $who->name;
78 82
83 if ($args) {
79 if (my $other = cf::player::find $who->{ext_last_tell}) { 84 if (my $other = cf::player::find $who->{ext_last_tell}) {
80 85
81 $other->ob->{ext_ignore_tell}{$name} >= time 86 $other->ob->{ext_ignore_tell}{$name} >= time
82 or delete $other->ob->{ext_ignore_tell}{$name}; 87 or delete $other->ob->{ext_ignore_tell}{$name};
83 88
84 if ($other->ob->{ext_ignore_tell}{$name} < time) { 89 if ($other->ob->{ext_ignore_tell}{$name} < time) {
85 $who->message ("You tell " . $other->ob->name . ": $args"); 90 $who->message ("You tell " . $other->ob->name . ": $args");
86 $other->ob->message ("$name tells you: $args"); 91 $other->ob->message ("$name tells you: $args");
87 $who->{ext_last_tell} = $other->ob->name; 92 $who->{ext_last_tell} = $other->ob->name;
93 } else {
94 $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE);
95 }
96
88 } else { 97 } else {
89 $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); 98 $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE);
90 } 99 }
91
92 } else { 100 } else {
93 $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); 101 $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE);
94 } 102 }
95}; 103};
96 104
97cf::register_command ignore => 0, sub { 105cf::register_command ignore => 0, sub {
98 my ($who, $args) = @_; 106 my ($who, $args) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines