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

Comparing deliantra/server/ext/chat.ext (file contents):
Revision 1.53 by root, Wed Apr 21 06:11:37 2010 UTC vs.
Revision 1.55 by root, Fri Apr 23 17:56:45 2010 UTC

73 my ($ob, $msg) = @_; 73 my ($ob, $msg) = @_;
74 74
75 my $pl = $ob->contr; 75 my $pl = $ob->contr;
76 my $name = $ob->name; 76 my $name = $ob->name;
77 77
78 my $coin = int rand 2 ? "Heads" : "Tails"; 78 my $coin = (cf::rndm 2) ? "Heads" : "Tails";
79 79
80 send_msg $_, $cf::SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY, "msg_say" 80 send_msg $_, $cf::SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY, "msg_say"
81 for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; 81 for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list;
82 82
83 $pl->send_msg ($cf::SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY); 83 $pl->send_msg ($cf::SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY);
88 88
89 my $pl = $ob->contr; 89 my $pl = $ob->contr;
90 my $name = $ob->name; 90 my $name = $ob->name;
91 91
92 my @orcknuckle = ("beholder", "ghost", "knight", "princess", "dragon", "orc"); 92 my @orcknuckle = ("beholder", "ghost", "knight", "princess", "dragon", "orc");
93 my ($i, $j, $k, $l) = (rand 5, rand 5, rand 5, rand 6); 93 my ($i, $j, $k, $l) = map +(cf::rndm $_), 5, 5, 5, 6;
94 my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; 94 my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]";
95 95
96 send_msg $_, $cf::SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY, "msg_say" 96 send_msg $_, $cf::SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY, "msg_say"
97 for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; 97 for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list;
98 98
819 @npc = grep $_->should_invoke (cf::EVENT_OBJECT_SAY) || $_->has_dialogue, 819 @npc = grep $_->should_invoke (cf::EVENT_OBJECT_SAY) || $_->has_dialogue,
820 $ob->inv; 820 $ob->inv;
821 } 821 }
822 822
823 for my $npc (@npc) { 823 for my $npc (@npc) {
824 return if $npc->invoke (cf::EVENT_OBJECT_SAY); 824 return if $npc->invoke (cf::EVENT_OBJECT_SAY, $ob->contr, $msg);
825 825
826 # if some listener teleported us somewhere else, stop right here 826 # if some listener teleported us somewhere else, stop right here
827 last unless $map->path == $ob->map->path; 827 last unless $map->path == $ob->map->path;
828 828
829 if ($npc->has_dialogue) { 829 if ($npc->has_dialogue) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines