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.46 by root, Thu Dec 18 02:49:22 2008 UTC vs.
Revision 1.51 by root, Sun Jul 19 18:15:07 2009 UTC

218 }, 218 },
219 }, 219 },
220 kiss => { 220 kiss => {
221 noparams => { 221 noparams => {
222 other => "<self> makes a weird facial contortion", 222 other => "<self> makes a weird facial contortion",
223 self => "All the lonely people..", 223 self => "All the lonely people...",
224 }, 224 },
225 params => { 225 params => {
226 target => "<self> kisses you.", 226 target => "<self> kisses you.",
227 other => "<self> kisses <other>.", 227 other => "<self> kisses <other>.",
228 self => "You kiss <other>.", 228 self => "You kiss <other>.",
229 }, 229 },
230 self => { 230 self => {
231 }, 231 },
232 }, 232 },
233 hug => {
234 noparams => {
235 other => "<self> makes weird body movements.",
236 self => "All the lonely people...",
237 },
238 params => {
239 target => "<self> suddenly grabs you and gives you a bear hug.",
240 other => "<self> hugs <other>.",
241 self => "You hug <other>.",
242 },
243 self => {
244 other => "<self> tries to hug G<himself|herself>, but stumbles and now feels stupid.",
245 self => "You try and fail to hug yourself.",
246 },
247 },
233 smother => { 248 smother => {
234 noparams => { 249 noparams => {
235 other => "<self> makes weird facial contortions", 250 other => "<self> makes weird facial contortions",
236 self => "All the lonely people..", 251 self => "All the lonely people...",
237 }, 252 },
238 params => { 253 params => {
239 target => "<self> smothers you with kisses.", 254 target => "<self> smothers you with kisses.",
240 other => "<self> smothers <other> with kisses.", 255 other => "<self> smothers <other> with kisses.",
241 self => "You smother <other> with kisses.", 256 self => "You smother <other> with kisses.",
759 $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); 774 $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM);
760 } 775 }
761 }; 776 };
762 }; 777 };
763} 778}
764
765cf::register_command me => sub {
766 my ($pl, $msg) = @_;
767
768 my $name = $pl->name;
769
770 send_msg $_, $cf::SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_say"
771 for grep $pl->on_same_map_as ($_->ob), cf::player::list;
772};
773 779
774cf::register_command say => sub { 780cf::register_command say => sub {
775 my ($ob, $msg) = @_; 781 my ($ob, $msg) = @_;
776 782
777 utf8::decode $msg; 783 utf8::decode $msg;
824 } else { 830 } else {
825 $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); 831 $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY);
826 } 832 }
827}; 833};
828 834
829cf::register_command chat => sub { 835
836sub _chat {
830 my ($ob, $msg) = @_; 837 my ($ob, $msg) = @_;
831
832 utf8::decode $msg;
833 838
834 my $pl = $ob->contr; 839 my $pl = $ob->contr;
835 840
836 return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); 841 return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg);
837 842
838 if ($msg) { 843 if ($msg) {
839 my $name = $ob->name; 844 my $name = $ob->name;
840 my $NOW = time; 845 my $NOW = time;
841 846
842 cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; 847 cf::LOG cf::llevDebug, sprintf "QBERT %s\n", $msg;
843 send_irc ("[%s] %s", $name, $msg); 848 send_irc ("%s", $msg);
844 849
845 send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" 850 send_msg $_, $cf::CHAT_CHANNEL => $msg, cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat"
846 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; 851 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list;
847 852
848 } else { 853 } else {
849 $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); 854 $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY);
850 } 855 }
856}
857
858cf::register_command chat => sub {
859 my ($ob, $msg) = @_;
860
861 utf8::decode $msg;
862 _chat $ob, $ob->name . " chats: $msg";
863};
864
865cf::register_command me => sub {
866 my ($ob, $msg) = @_;
867
868 utf8::decode $msg;
869 _chat $ob, "* " . $ob->name . " $msg";
851}; 870};
852 871
853cf::register_command shout => sub { 872cf::register_command shout => sub {
854 my ($ob, $msg) = @_; 873 my ($ob, $msg) = @_;
855 874

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines