Crossfire Server, Branch 1.12
R12190
|
00001 /* 00002 * static char *rcsid_c_chat_c = 00003 * "$Id: c_chat.c 11578 2009-02-23 22:02:27Z lalo $"; 00004 */ 00005 00006 /* 00007 CrossFire, A Multiplayer game for X-windows 00008 00009 Copyright (C) 2002-2006 Mark Wedel & Crossfire Development Team 00010 Copyright (C) 1992 Frank Tore Johansen 00011 00012 This program is free software; you can redistribute it and/or modify 00013 it under the terms of the GNU General Public License as published by 00014 the Free Software Foundation; either version 2 of the License, or 00015 (at your option) any later version. 00016 00017 This program is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with this program; if not, write to the Free Software 00024 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00025 00026 The authors can be reached via e-mail at crossfire-devel@real-time.com 00027 */ 00028 00034 #include <global.h> 00035 #include <loader.h> 00036 #include <sproto.h> 00037 00047 int command_say(object *op, char *params) { 00048 if (!params) 00049 return 0; 00050 communicate(op, params); 00051 00052 return 0; 00053 } 00054 00064 int command_me(object *op, char *params) { 00065 char buf[MAX_BUF]; 00066 00067 if (!params) 00068 return 0; 00069 snprintf(buf, MAX_BUF-1, "%s %s", op->name, params); 00070 ext_info_map(NDI_UNIQUE|NDI_BLUE, op->map, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, 00071 buf, NULL); 00072 return 0; 00073 } 00074 00084 int command_cointoss(object *op, char *params) { 00085 char buf[MAX_BUF]; 00086 char buf2[MAX_BUF]; 00087 int i; 00088 00089 i = rndm(1, 2); 00090 if (i == 1) { 00091 snprintf(buf, MAX_BUF-1, "%s flips a coin.... Heads!", op->name); 00092 snprintf(buf2, MAX_BUF-1, "You flip a coin.... Heads!"); 00093 } else { 00094 snprintf(buf, MAX_BUF-1, "%s flips a coin.... Tails!", op->name); 00095 snprintf(buf2, MAX_BUF-1, "You flip a coin.... Tails!"); 00096 } 00097 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00098 buf2, NULL); 00099 ext_info_map_except(NDI_WHITE, op->map, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00100 buf, NULL); 00101 return 0; 00102 } 00103 00105 static const char *const orcknuckle[7] = { 00106 "none", 00107 "beholder", 00108 "ghost", 00109 "knight", 00110 "princess", 00111 "dragon", 00112 "orc" 00113 }; 00114 00115 #define DICE 4 00134 int command_orcknuckle(object *op, char *params) { 00135 char buf[MAX_BUF]; 00136 char buf2[MAX_BUF]; 00137 object *dice[DICE]; 00138 object *ob; 00139 int i, j, k, l, dice_count, number_dice; 00140 const char *name; 00141 00142 /* We only use dice if the archetype is present ingame. */ 00143 name = find_string("dice"); 00144 if (name) { 00145 for (dice_count = 0; dice_count < DICE; dice_count++) 00146 dice[dice_count] = NULL; 00147 dice_count = 0; 00148 number_dice = 0; 00149 00150 for (ob = op->inv; ob && dice_count < DICE && number_dice < DICE; ob = ob->below) { 00151 if (ob->name == name) { 00152 number_dice += ob->nrof; 00153 dice[dice_count++] = ob; 00154 } 00155 } 00156 00157 if (number_dice < DICE) { 00158 draw_ext_info_format(NDI_UNIQUE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00159 "You need at least %d dice to play orcknuckle!", 00160 "You need at least %d dice to play orcknuckle!", DICE); 00161 return 0; 00162 } 00163 } 00164 00165 i = rndm(1, 5); 00166 j = rndm(1, 5); 00167 k = rndm(1, 5); 00168 l = rndm(1, 6); 00169 00170 snprintf(buf2, MAX_BUF-1, "%s rolls %s, %s, %s, %s!", op->name, orcknuckle[i], orcknuckle[j], orcknuckle[k], orcknuckle[l]); 00171 snprintf(buf, MAX_BUF-1, "You roll %s, %s, %s, %s!", orcknuckle[i], orcknuckle[j], orcknuckle[k], orcknuckle[l]); 00172 00173 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00174 buf, NULL); 00175 ext_info_map_except(NDI_UNIQUE, op->map, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00176 buf2, NULL); 00177 00178 if (name) { 00179 /* Randomly lose dice */ 00180 if (die_roll(1, 100, op, 1) < 5) { 00181 /* Lose one randomly. */ 00182 decrease_ob(dice[rndm(1, dice_count)-1]); 00183 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, 00184 "Oops, you lost a die!", "Oops, you lost a die!"); 00185 } 00186 } 00187 00188 return 0; 00189 #undef DICE 00190 } 00191 00210 static int command_tell_all(object *op, char *params, int pri, int color, int subtype, const char *desc) { 00211 if (op->contr->no_shout == 1) { 00212 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00213 "You are no longer allowed to shout or chat.", NULL); 00214 return 1; 00215 } else { 00216 if (params == NULL) { 00217 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00218 "Shout/Chat what?", NULL); 00219 return 1; 00220 } 00221 draw_ext_info_format(NDI_UNIQUE|NDI_ALL|color, pri, NULL, MSG_TYPE_COMMUNICATION, subtype, 00222 "%s %s: %s", 00223 "%s %s: %s", 00224 op->name, desc, params); 00225 00226 /* Lauwenmark : Here we handle the SHOUT global event */ 00227 execute_global_event(EVENT_SHOUT, op, params, pri); 00228 return 1; 00229 } 00230 } 00231 00241 int command_shout(object *op, char *params) { 00242 return command_tell_all(op, params, 1, NDI_RED, MSG_TYPE_COMMUNICATION_SHOUT, "shouts"); 00243 } 00244 00254 int command_chat(object *op, char *params) { 00255 return command_tell_all(op, params, 9, NDI_BLUE, MSG_TYPE_COMMUNICATION_CHAT, "chats"); 00256 } 00257 00270 static int do_tell(object *op, char *params, int adjust_listen) { 00271 char buf[MAX_BUF], *name = NULL, *msg = NULL; 00272 player *pl; 00273 uint8 original_listen; 00274 00275 if (params != NULL) { 00276 name = params; 00277 msg = strchr(name, ' '); 00278 if (msg) { 00279 *(msg++) = 0; 00280 if (*msg == 0) 00281 msg = NULL; 00282 } 00283 } 00284 00285 if (name == NULL) { 00286 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00287 "Tell whom what?", NULL); 00288 return 1; 00289 } else if (msg == NULL) { 00290 draw_ext_info_format(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00291 "Tell %s what?", 00292 "Tell %s what?", 00293 name); 00294 return 1; 00295 } 00296 00297 snprintf(buf, MAX_BUF-1, "%s tells you: %s", op->name, msg); 00298 00299 pl = find_player_partial_name(name); 00300 if (pl) { 00301 if (adjust_listen) { 00302 original_listen = pl->listening; 00303 pl->listening = 10; 00304 } 00305 00306 execute_global_event(EVENT_TELL, op, msg, pl->ob); 00307 00308 draw_ext_info(NDI_UNIQUE|NDI_ORANGE, 0, pl->ob, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, 00309 buf, NULL); 00310 00311 if (adjust_listen) 00312 pl->listening = original_listen; 00313 00314 /* Update last_tell value [mids 01/14/2002] */ 00315 snprintf(pl->last_tell, sizeof(pl->last_tell), "%s", op->name); 00316 00317 /* Hidden DMs get the message, but player should think DM isn't online. */ 00318 if (!pl->hidden || QUERY_FLAG(op, FLAG_WIZ)) { 00319 draw_ext_info_format(NDI_UNIQUE|NDI_ORANGE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, 00320 "You tell %s: %s", 00321 "You tell %s: %s", 00322 pl->ob->name, msg); 00323 00324 return 1; 00325 } 00326 } 00327 00328 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00329 "No such player or ambiguous name.", NULL); 00330 return 1; 00331 } 00332 00343 int command_tell(object *op, char *params) { 00344 return do_tell(op, params, 0); 00345 } 00346 00357 int command_dmtell(object *op, char *params) { 00358 return do_tell(op, params, 1); 00359 } 00360 00373 int command_reply(object *op, char *params) { 00374 player *pl; 00375 00376 if (params == NULL) { 00377 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00378 "Reply what?", NULL); 00379 return 1; 00380 } 00381 00382 if (op->contr->last_tell[0] == '\0') { 00383 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00384 "You can't reply to nobody.", NULL); 00385 return 1; 00386 } 00387 00388 /* Find player object of player to reply to and check if player still exists */ 00389 pl = find_player(op->contr->last_tell); 00390 if (pl == NULL) { 00391 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00392 "You can't reply, this player left.", NULL); 00393 return 1; 00394 } 00395 00396 /* Update last_tell value */ 00397 strcpy(pl->last_tell, op->name); 00398 00399 draw_ext_info_format(NDI_UNIQUE|NDI_ORANGE, 0, pl->ob, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, 00400 "%s tells you: %s", 00401 "%s tells you: %s", 00402 op->name, params); 00403 00404 if (pl->hidden && !QUERY_FLAG(op, FLAG_WIZ)) { 00405 draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 00406 "You can't reply, this player left.", NULL); 00407 return 1; 00408 } 00409 00410 draw_ext_info_format(NDI_UNIQUE|NDI_ORANGE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, 00411 "You tell to %s: %s", 00412 "You tell to %s: %s", 00413 pl->ob->name, params); 00414 return 1; 00415 } 00416 00438 static int basic_emote(object *op, char *params, int emotion) { 00439 char buf[MAX_BUF], buf2[MAX_BUF], buf3[MAX_BUF]; 00440 player *pl; 00441 00442 if (!params) { 00443 switch (emotion) { 00444 case EMOTE_NOD: 00445 sprintf(buf, "%s nods solemnly.", op->name); 00446 sprintf(buf2, "You nod solemnly."); 00447 break; 00448 00449 case EMOTE_DANCE: 00450 sprintf(buf, "%s expresses himself through interpretive dance.", op->name); 00451 sprintf(buf2, "You dance with glee."); 00452 break; 00453 00454 case EMOTE_KISS: 00455 sprintf(buf, "%s makes a weird facial contortion", op->name); 00456 sprintf(buf2, "All the lonely people.."); 00457 break; 00458 00459 case EMOTE_BOUNCE: 00460 sprintf(buf, "%s bounces around.", op->name); 00461 sprintf(buf2, "BOIINNNNNNGG!"); 00462 break; 00463 00464 case EMOTE_SMILE: 00465 sprintf(buf, "%s smiles happily.", op->name); 00466 sprintf(buf2, "You smile happily."); 00467 break; 00468 00469 case EMOTE_CACKLE: 00470 sprintf(buf, "%s throws back his head and cackles with insane glee!", op->name); 00471 sprintf(buf2, "You cackle gleefully."); 00472 break; 00473 00474 case EMOTE_LAUGH: 00475 sprintf(buf, "%s falls down laughing.", op->name); 00476 sprintf(buf2, "You fall down laughing."); 00477 break; 00478 00479 case EMOTE_GIGGLE: 00480 sprintf(buf, "%s giggles.", op->name); 00481 sprintf(buf2, "You giggle."); 00482 break; 00483 00484 case EMOTE_SHAKE: 00485 sprintf(buf, "%s shakes his head.", op->name); 00486 sprintf(buf2, "You shake your head."); 00487 break; 00488 00489 case EMOTE_PUKE: 00490 sprintf(buf, "%s pukes.", op->name); 00491 sprintf(buf2, "Bleaaaaaghhhhhhh!"); 00492 break; 00493 00494 case EMOTE_GROWL: 00495 sprintf(buf, "%s growls.", op->name); 00496 sprintf(buf2, "Grrrrrrrrr...."); 00497 break; 00498 00499 case EMOTE_SCREAM: 00500 sprintf(buf, "%s screams at the top of his lungs!", op->name); 00501 sprintf(buf2, "ARRRRRRRRRRGH!!!!!"); 00502 break; 00503 00504 case EMOTE_SIGH: 00505 sprintf(buf, "%s sighs loudly.", op->name); 00506 sprintf(buf2, "You sigh."); 00507 break; 00508 00509 case EMOTE_SULK: 00510 sprintf(buf, "%s sulks in the corner.", op->name); 00511 sprintf(buf2, "You sulk."); 00512 break; 00513 00514 case EMOTE_CRY: 00515 sprintf(buf, "%s bursts into tears.", op->name); 00516 sprintf(buf2, "Waaaaaaahhh.."); 00517 break; 00518 00519 case EMOTE_GRIN: 00520 sprintf(buf, "%s grins evilly.", op->name); 00521 sprintf(buf2, "You grin evilly."); 00522 break; 00523 00524 case EMOTE_BOW: 00525 sprintf(buf, "%s bows deeply.", op->name); 00526 sprintf(buf2, "You bow deeply."); 00527 break; 00528 00529 case EMOTE_CLAP: 00530 sprintf(buf, "%s gives a round of applause.", op->name); 00531 sprintf(buf2, "Clap, clap, clap."); 00532 break; 00533 00534 case EMOTE_BLUSH: 00535 sprintf(buf, "%s blushes.", op->name); 00536 sprintf(buf2, "Your cheeks are burning."); 00537 break; 00538 00539 case EMOTE_BURP: 00540 sprintf(buf, "%s burps loudly.", op->name); 00541 sprintf(buf2, "You burp loudly."); 00542 break; 00543 00544 case EMOTE_CHUCKLE: 00545 sprintf(buf, "%s chuckles politely.", op->name); 00546 sprintf(buf2, "You chuckle politely"); 00547 break; 00548 00549 case EMOTE_COUGH: 00550 sprintf(buf, "%s coughs loudly.", op->name); 00551 sprintf(buf2, "Yuck, try to cover your mouth next time!"); 00552 break; 00553 00554 case EMOTE_FLIP: 00555 sprintf(buf, "%s flips head over heels.", op->name); 00556 sprintf(buf2, "You flip head over heels."); 00557 break; 00558 00559 case EMOTE_FROWN: 00560 sprintf(buf, "%s frowns.", op->name); 00561 sprintf(buf2, "What's bothering you?"); 00562 break; 00563 00564 case EMOTE_GASP: 00565 sprintf(buf, "%s gasps in astonishment.", op->name); 00566 sprintf(buf2, "You gasp in astonishment."); 00567 break; 00568 00569 case EMOTE_GLARE: 00570 sprintf(buf, "%s glares around him.", op->name); 00571 sprintf(buf2, "You glare at nothing in particular."); 00572 break; 00573 00574 case EMOTE_GROAN: 00575 sprintf(buf, "%s groans loudly.", op->name); 00576 sprintf(buf2, "You groan loudly."); 00577 break; 00578 00579 case EMOTE_HICCUP: 00580 sprintf(buf, "%s hiccups.", op->name); 00581 sprintf(buf2, "*HIC*"); 00582 break; 00583 00584 case EMOTE_LICK: 00585 sprintf(buf, "%s licks his mouth and smiles.", op->name); 00586 sprintf(buf2, "You lick your mouth and smile."); 00587 break; 00588 00589 case EMOTE_POUT: 00590 sprintf(buf, "%s pouts.", op->name); 00591 sprintf(buf2, "Aww, don't take it so hard."); 00592 break; 00593 00594 case EMOTE_SHIVER: 00595 sprintf(buf, "%s shivers uncomfortably.", op->name); 00596 sprintf(buf2, "Brrrrrrrrr."); 00597 break; 00598 00599 case EMOTE_SHRUG: 00600 sprintf(buf, "%s shrugs helplessly.", op->name); 00601 sprintf(buf2, "You shrug."); 00602 break; 00603 00604 case EMOTE_SMIRK: 00605 sprintf(buf, "%s smirks.", op->name); 00606 sprintf(buf2, "You smirk."); 00607 break; 00608 00609 case EMOTE_SNAP: 00610 sprintf(buf, "%s snaps his fingers.", op->name); 00611 sprintf(buf2, "PRONTO! You snap your fingers."); 00612 break; 00613 00614 case EMOTE_SNEEZE: 00615 sprintf(buf, "%s sneezes.", op->name); 00616 sprintf(buf2, "Gesundheit!"); 00617 break; 00618 00619 case EMOTE_SNICKER: 00620 sprintf(buf, "%s snickers softly.", op->name); 00621 sprintf(buf2, "You snicker softly."); 00622 break; 00623 00624 case EMOTE_SNIFF: 00625 sprintf(buf, "%s sniffs sadly.", op->name); 00626 sprintf(buf2, "You sniff sadly. *SNIFF*"); 00627 break; 00628 00629 case EMOTE_SNORE: 00630 sprintf(buf, "%s snores loudly.", op->name); 00631 sprintf(buf2, "Zzzzzzzzzzzzzzz."); 00632 break; 00633 00634 case EMOTE_SPIT: 00635 sprintf(buf, "%s spits over his left shoulder.", op->name); 00636 sprintf(buf2, "You spit over your left shoulder."); 00637 break; 00638 00639 case EMOTE_STRUT: 00640 sprintf(buf, "%s struts proudly.", op->name); 00641 sprintf(buf2, "Strut your stuff."); 00642 break; 00643 00644 case EMOTE_TWIDDLE: 00645 sprintf(buf, "%s patiently twiddles his thumbs.", op->name); 00646 sprintf(buf2, "You patiently twiddle your thumbs."); 00647 break; 00648 00649 case EMOTE_WAVE: 00650 sprintf(buf, "%s waves happily.", op->name); 00651 sprintf(buf2, "You wave."); 00652 break; 00653 00654 case EMOTE_WHISTLE: 00655 sprintf(buf, "%s whistles appreciatively.", op->name); 00656 sprintf(buf2, "You whistle appreciatively."); 00657 break; 00658 00659 case EMOTE_WINK: 00660 sprintf(buf, "%s winks suggestively.", op->name); 00661 sprintf(buf2, "Have you got something in your eye?"); 00662 break; 00663 00664 case EMOTE_YAWN: 00665 sprintf(buf, "%s yawns sleepily.", op->name); 00666 sprintf(buf2, "You open up your yap and let out a big breeze of stale air."); 00667 break; 00668 00669 case EMOTE_CRINGE: 00670 sprintf(buf, "%s cringes in terror!", op->name); 00671 sprintf(buf2, "You cringe in terror."); 00672 break; 00673 00674 case EMOTE_BLEED: 00675 sprintf(buf, "%s is bleeding all over the carpet - got a spare tourniquet?", op->name); 00676 sprintf(buf2, "You bleed all over your nice new armour."); 00677 break; 00678 00679 case EMOTE_THINK: 00680 sprintf(buf, "%s closes his eyes and thinks really hard.", op->name); 00681 sprintf(buf2, "Anything in particular that you'd care to think about?"); 00682 break; 00683 00684 default: 00685 sprintf(buf, "%s dances with glee.", op->name); 00686 sprintf(buf2, "You are a nut."); 00687 break; 00688 } /*case*/ 00689 ext_info_map_except(NDI_WHITE, op->map, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 00690 buf, NULL); 00691 draw_ext_info(NDI_UNIQUE|NDI_WHITE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 00692 buf2, NULL); 00693 return(0); 00694 } else { 00695 for (pl = first_player; pl != NULL; pl = pl->next) { 00696 if (strncasecmp(pl->ob->name, params, MAX_NAME) == 0 00697 && pl->ob->map == op->map 00698 && pl->ob != op 00699 && !(QUERY_FLAG(pl->ob, FLAG_WIZ) && pl->ob->contr->hidden)) { 00700 /* Hidden dms are not affected by emotions*/ 00701 switch (emotion) { 00702 case EMOTE_NOD: 00703 sprintf(buf, "You nod solemnly to %s.", pl->ob->name); 00704 sprintf(buf2, "%s nods solemnly to you.", op->name); 00705 sprintf(buf3, "%s nods solemnly to %s.", op->name, pl->ob->name); 00706 break; 00707 00708 case EMOTE_DANCE: 00709 sprintf(buf, "You grab %s and begin doing the Cha-Cha!", pl->ob->name); 00710 sprintf(buf2, "%s grabs you, and begins dancing!", op->name); 00711 sprintf(buf3, "Yipe! %s and %s are doing the Macarena!", op->name, pl->ob->name); 00712 break; 00713 00714 case EMOTE_KISS: 00715 sprintf(buf, "You kiss %s.", pl->ob->name); 00716 sprintf(buf2, "%s kisses you.", op->name); 00717 sprintf(buf3, "%s kisses %s.", op->name, pl->ob->name); 00718 break; 00719 00720 case EMOTE_BOUNCE: 00721 sprintf(buf, "You bounce around the room with %s.", pl->ob->name); 00722 sprintf(buf2, "%s bounces around the room with you.", op->name); 00723 sprintf(buf3, "%s bounces around the room with %s.", op->name, pl->ob->name); 00724 break; 00725 00726 case EMOTE_SMILE: 00727 sprintf(buf, "You smile at %s.", pl->ob->name); 00728 sprintf(buf2, "%s smiles at you.", op->name); 00729 sprintf(buf3, "%s beams a smile at %s.", op->name, pl->ob->name); 00730 break; 00731 00732 case EMOTE_LAUGH: 00733 sprintf(buf, "You take one look at %s and fall down laughing.", pl->ob->name); 00734 sprintf(buf2, "%s looks at you and falls down on the ground laughing.", op->name); 00735 sprintf(buf3, "%s looks at %s and falls down on the ground laughing.", op->name, pl->ob->name); 00736 break; 00737 00738 case EMOTE_SHAKE: 00739 sprintf(buf, "You shake %s's hand.", pl->ob->name); 00740 sprintf(buf2, "%s shakes your hand.", op->name); 00741 sprintf(buf3, "%s shakes %s's hand.", op->name, pl->ob->name); 00742 break; 00743 00744 case EMOTE_PUKE: 00745 sprintf(buf, "You puke on %s.", pl->ob->name); 00746 sprintf(buf2, "%s pukes on your clothes!", op->name); 00747 sprintf(buf3, "%s pukes on %s.", op->name, pl->ob->name); 00748 break; 00749 00750 case EMOTE_HUG: 00751 sprintf(buf, "You hug %s.", pl->ob->name); 00752 sprintf(buf2, "%s hugs you.", op->name); 00753 sprintf(buf3, "%s hugs %s.", op->name, pl->ob->name); 00754 break; 00755 00756 case EMOTE_CRY: 00757 sprintf(buf, "You cry on %s's shoulder.", pl->ob->name); 00758 sprintf(buf2, "%s cries on your shoulder.", op->name); 00759 sprintf(buf3, "%s cries on %s's shoulder.", op->name, pl->ob->name); 00760 break; 00761 00762 case EMOTE_POKE: 00763 sprintf(buf, "You poke %s in the ribs.", pl->ob->name); 00764 sprintf(buf2, "%s pokes you in the ribs.", op->name); 00765 sprintf(buf3, "%s pokes %s in the ribs.", op->name, pl->ob->name); 00766 break; 00767 00768 case EMOTE_ACCUSE: 00769 sprintf(buf, "You look accusingly at %s.", pl->ob->name); 00770 sprintf(buf2, "%s looks accusingly at you.", op->name); 00771 sprintf(buf3, "%s looks accusingly at %s.", op->name, pl->ob->name); 00772 break; 00773 00774 case EMOTE_GRIN: 00775 sprintf(buf, "You grin at %s.", pl->ob->name); 00776 sprintf(buf2, "%s grins evilly at you.", op->name); 00777 sprintf(buf3, "%s grins evilly at %s.", op->name, pl->ob->name); 00778 break; 00779 00780 case EMOTE_BOW: 00781 sprintf(buf, "You bow before %s.", pl->ob->name); 00782 sprintf(buf2, "%s bows before you.", op->name); 00783 sprintf(buf3, "%s bows before %s.", op->name, pl->ob->name); 00784 break; 00785 00786 case EMOTE_FROWN: 00787 sprintf(buf, "You frown darkly at %s.", pl->ob->name); 00788 sprintf(buf2, "%s frowns darkly at you.", op->name); 00789 sprintf(buf3, "%s frowns darkly at %s.", op->name, pl->ob->name); 00790 break; 00791 00792 case EMOTE_GLARE: 00793 sprintf(buf, "You glare icily at %s.", pl->ob->name); 00794 sprintf(buf2, "%s glares icily at you, you feel cold to your bones.", op->name); 00795 sprintf(buf3, "%s glares at %s.", op->name, pl->ob->name); 00796 break; 00797 00798 case EMOTE_LICK: 00799 sprintf(buf, "You lick %s.", pl->ob->name); 00800 sprintf(buf2, "%s licks you.", op->name); 00801 sprintf(buf3, "%s licks %s.", op->name, pl->ob->name); 00802 break; 00803 00804 case EMOTE_SHRUG: 00805 sprintf(buf, "You shrug at %s.", pl->ob->name); 00806 sprintf(buf2, "%s shrugs at you.", op->name); 00807 sprintf(buf3, "%s shrugs at %s.", op->name, pl->ob->name); 00808 break; 00809 00810 case EMOTE_SLAP: 00811 sprintf(buf, "You slap %s.", pl->ob->name); 00812 sprintf(buf2, "You are slapped by %s.", op->name); 00813 sprintf(buf3, "%s slaps %s.", op->name, pl->ob->name); 00814 break; 00815 00816 case EMOTE_SNEEZE: 00817 sprintf(buf, "You sneeze at %s and a film of snot shoots onto him.", pl->ob->name); 00818 sprintf(buf2, "%s sneezes on you, you feel the snot cover you. EEEEEEW.", op->name); 00819 sprintf(buf3, "%s sneezes on %s and a film of snot covers him.", op->name, pl->ob->name); 00820 break; 00821 00822 case EMOTE_SNIFF: 00823 sprintf(buf, "You sniff %s.", pl->ob->name); 00824 sprintf(buf2, "%s sniffs you.", op->name); 00825 sprintf(buf3, "%s sniffs %s", op->name, pl->ob->name); 00826 break; 00827 00828 case EMOTE_SPIT: 00829 sprintf(buf, "You spit on %s.", pl->ob->name); 00830 sprintf(buf2, "%s spits in your face!", op->name); 00831 sprintf(buf3, "%s spits in %s's face.", op->name, pl->ob->name); 00832 break; 00833 00834 case EMOTE_THANK: 00835 sprintf(buf, "You thank %s heartily.", pl->ob->name); 00836 sprintf(buf2, "%s thanks you heartily.", op->name); 00837 sprintf(buf3, "%s thanks %s heartily.", op->name, pl->ob->name); 00838 break; 00839 00840 case EMOTE_WAVE: 00841 sprintf(buf, "You wave goodbye to %s.", pl->ob->name); 00842 sprintf(buf2, "%s waves goodbye to you. Have a good journey.", op->name); 00843 sprintf(buf3, "%s waves goodbye to %s.", op->name, pl->ob->name); 00844 break; 00845 00846 case EMOTE_WHISTLE: 00847 sprintf(buf, "You whistle at %s.", pl->ob->name); 00848 sprintf(buf2, "%s whistles at you.", op->name); 00849 sprintf(buf2, "%s whistles at %s.", op->name, pl->ob->name); 00850 break; 00851 00852 case EMOTE_WINK: 00853 sprintf(buf, "You wink suggestively at %s.", pl->ob->name); 00854 sprintf(buf2, "%s winks suggestively at you.", op->name); 00855 sprintf(buf2, "%s winks at %s.", op->name, pl->ob->name); 00856 break; 00857 00858 case EMOTE_BEG: 00859 sprintf(buf, "You beg %s for mercy.", pl->ob->name); 00860 sprintf(buf2, "%s begs you for mercy! Show no quarter!", op->name); 00861 sprintf(buf2, "%s begs %s for mercy!", op->name, pl->ob->name); 00862 break; 00863 00864 case EMOTE_BLEED: 00865 sprintf(buf, "You slash your wrist and bleed all over %s", pl->ob->name); 00866 sprintf(buf2, "%s slashes his wrist and bleeds all over you.", op->name); 00867 sprintf(buf2, "%s slashes his wrist and bleeds all over %s.", op->name, pl->ob->name); 00868 break; 00869 00870 case EMOTE_CRINGE: 00871 sprintf(buf, "You cringe away from %s.", pl->ob->name); 00872 sprintf(buf2, "%s cringes away from you.", op->name); 00873 sprintf(buf2, "%s cringes away from %s in mortal terror.", op->name, pl->ob->name); 00874 break; 00875 00876 default: 00877 sprintf(buf, "You are still nuts."); 00878 sprintf(buf2, "You get the distinct feeling that %s is nuts.", op->name); 00879 sprintf(buf3, "%s is eyeing %s quizzically.", pl->ob->name, op->name); 00880 break; 00881 } /*case*/ 00882 draw_ext_info(NDI_UNIQUE|NDI_WHITE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 00883 buf, NULL); 00884 draw_ext_info(NDI_UNIQUE|NDI_WHITE, 0, pl->ob, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 00885 buf2, NULL); 00886 ext_info_map_except2(NDI_WHITE, op->map, op, pl->ob, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 00887 buf3, NULL); 00888 return(0); 00889 } 00890 if (strncasecmp(pl->ob->name, params, MAX_NAME) == 0 00891 && pl->ob->map == op->map 00892 && pl->ob == op) { 00893 switch (emotion) { 00894 case EMOTE_DANCE: 00895 sprintf(buf, "You skip and dance around by yourself."); 00896 sprintf(buf2, "%s embraces himself and begins to dance!", op->name); 00897 break; 00898 00899 case EMOTE_LAUGH: 00900 sprintf(buf, "Laugh at yourself all you want, the others won't understand."); 00901 sprintf(buf2, "%s is laughing at something.", op->name); 00902 break; 00903 00904 case EMOTE_SHAKE: 00905 sprintf(buf, "You are shaken by yourself."); 00906 sprintf(buf2, "%s shakes and quivers like a bowlful of jelly.", op->name); 00907 break; 00908 00909 case EMOTE_PUKE: 00910 sprintf(buf, "You puke on yourself."); 00911 sprintf(buf2, "%s pukes on his clothes.", op->name); 00912 break; 00913 00914 case EMOTE_HUG: 00915 sprintf(buf, "You hug yourself."); 00916 sprintf(buf2, "%s hugs himself.", op->name); 00917 break; 00918 00919 case EMOTE_CRY: 00920 sprintf(buf, "You cry to yourself."); 00921 sprintf(buf2, "%s sobs quietly to himself.", op->name); 00922 break; 00923 00924 case EMOTE_POKE: 00925 sprintf(buf, "You poke yourself in the ribs, feeling very silly."); 00926 sprintf(buf2, "%s pokes himself in the ribs, looking very sheepish.", op->name); 00927 break; 00928 00929 case EMOTE_ACCUSE: 00930 sprintf(buf, "You accuse yourself."); 00931 sprintf(buf2, "%s seems to have a bad conscience.", op->name); 00932 break; 00933 00934 case EMOTE_BOW: 00935 sprintf(buf, "You kiss your toes."); 00936 sprintf(buf2, "%s folds up like a jackknife and kisses his own toes.", op->name); 00937 break; 00938 00939 case EMOTE_FROWN: 00940 sprintf(buf, "You frown at yourself."); 00941 sprintf(buf2, "%s frowns at himself.", op->name); 00942 break; 00943 00944 case EMOTE_GLARE: 00945 sprintf(buf, "You glare icily at your feet, they are suddenly very cold."); 00946 sprintf(buf2, "%s glares at his feet, what is bothering him?", op->name); 00947 break; 00948 00949 case EMOTE_LICK: 00950 sprintf(buf, "You lick yourself."); 00951 sprintf(buf2, "%s licks himself - YUCK.", op->name); 00952 break; 00953 00954 case EMOTE_SLAP: 00955 sprintf(buf, "You slap yourself, silly you."); 00956 sprintf(buf2, "%s slaps himself, really strange...", op->name); 00957 break; 00958 00959 case EMOTE_SNEEZE: 00960 sprintf(buf, "You sneeze on yourself, what a mess!"); 00961 sprintf(buf2, "%s sneezes, and covers himself in a slimy substance.", op->name); 00962 break; 00963 00964 case EMOTE_SNIFF: 00965 sprintf(buf, "You sniff yourself."); 00966 sprintf(buf2, "%s sniffs himself.", op->name); 00967 break; 00968 00969 case EMOTE_SPIT: 00970 sprintf(buf, "You drool all over yourself."); 00971 sprintf(buf2, "%s drools all over himself.", op->name); 00972 break; 00973 00974 case EMOTE_THANK: 00975 sprintf(buf, "You thank yourself since nobody else wants to!"); 00976 sprintf(buf2, "%s thanks himself since you won't.", op->name); 00977 break; 00978 00979 case EMOTE_WAVE: 00980 sprintf(buf, "Are you going on adventures as well??"); 00981 sprintf(buf2, "%s waves goodbye to himself.", op->name); 00982 break; 00983 00984 case EMOTE_WHISTLE: 00985 sprintf(buf, "You whistle while you work."); 00986 sprintf(buf2, "%s whistles to himself in boredom.", op->name); 00987 break; 00988 00989 case EMOTE_WINK: 00990 sprintf(buf, "You wink at yourself?? What are you up to?"); 00991 sprintf(buf2, "%s winks at himself - something strange is going on...", op->name); 00992 break; 00993 00994 case EMOTE_BLEED: 00995 sprintf(buf, "Very impressive! You wipe your blood all over yourself."); 00996 sprintf(buf2, "%s performs some satanic ritual while wiping his blood on himself.", op->name); 00997 break; 00998 00999 default: 01000 sprintf(buf, "My god! is that LEGAL?"); 01001 sprintf(buf2, "You look away from %s.", op->name); 01002 break; 01003 }/*case*/ 01004 draw_ext_info(NDI_UNIQUE|NDI_WHITE, 0, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 01005 buf, NULL); 01006 ext_info_map_except(NDI_WHITE, op->map, op, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_EMOTE, 01007 buf2, NULL); 01008 return(0); 01009 }/*if self*/ 01010 }/*for*/ 01011 draw_ext_info_format(NDI_UNIQUE, 0, op, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, 01012 "%s is not around.", 01013 "%s is not around.", 01014 params); 01015 return(1); 01016 } /*else*/ 01017 01018 return(0); 01019 } 01020 01021 /* 01022 * everything from here on out are just wrapper calls to basic_emote 01023 */ 01024 01034 int command_nod(object *op, char *params) { 01035 return(basic_emote(op, params, EMOTE_NOD)); 01036 } 01037 01047 int command_dance(object *op, char *params) { 01048 return(basic_emote(op, params, EMOTE_DANCE)); 01049 } 01050 01060 int command_kiss(object *op, char *params) { 01061 return(basic_emote(op, params, EMOTE_KISS)); 01062 } 01063 01073 int command_bounce(object *op, char *params) { 01074 return(basic_emote(op, params, EMOTE_BOUNCE)); 01075 } 01076 01086 int command_smile(object *op, char *params) { 01087 return(basic_emote(op, params, EMOTE_SMILE)); 01088 } 01089 01099 int command_cackle(object *op, char *params) { 01100 return(basic_emote(op, params, EMOTE_CACKLE)); 01101 } 01102 01112 int command_laugh(object *op, char *params) { 01113 return(basic_emote(op, params, EMOTE_LAUGH)); 01114 } 01115 01125 int command_giggle(object *op, char *params) { 01126 return(basic_emote(op, params, EMOTE_GIGGLE)); 01127 } 01128 01138 int command_shake(object *op, char *params) { 01139 return(basic_emote(op, params, EMOTE_SHAKE)); 01140 } 01141 01151 int command_puke(object *op, char *params) { 01152 return(basic_emote(op, params, EMOTE_PUKE)); 01153 } 01154 01164 int command_growl(object *op, char *params) { 01165 return(basic_emote(op, params, EMOTE_GROWL)); 01166 } 01167 01177 int command_scream(object *op, char *params) { 01178 return(basic_emote(op, params, EMOTE_SCREAM)); 01179 } 01180 01190 int command_sigh(object *op, char *params) { 01191 return(basic_emote(op, params, EMOTE_SIGH)); 01192 } 01193 01203 int command_sulk(object *op, char *params) { 01204 return(basic_emote(op, params, EMOTE_SULK)); 01205 } 01206 01216 int command_hug(object *op, char *params) { 01217 return(basic_emote(op, params, EMOTE_HUG)); 01218 } 01219 01229 int command_cry(object *op, char *params) { 01230 return(basic_emote(op, params, EMOTE_CRY)); 01231 } 01232 01242 int command_poke(object *op, char *params) { 01243 return(basic_emote(op, params, EMOTE_POKE)); 01244 } 01245 01255 int command_accuse(object *op, char *params) { 01256 return(basic_emote(op, params, EMOTE_ACCUSE)); 01257 } 01258 01268 int command_grin(object *op, char *params) { 01269 return(basic_emote(op, params, EMOTE_GRIN)); 01270 } 01271 01281 int command_bow(object *op, char *params) { 01282 return(basic_emote(op, params, EMOTE_BOW)); 01283 } 01284 01294 int command_clap(object *op, char *params) { 01295 return(basic_emote(op, params, EMOTE_CLAP)); 01296 } 01297 01307 int command_blush(object *op, char *params) { 01308 return(basic_emote(op, params, EMOTE_BLUSH)); 01309 } 01310 01320 int command_burp(object *op, char *params) { 01321 return(basic_emote(op, params, EMOTE_BURP)); 01322 } 01323 01333 int command_chuckle(object *op, char *params) { 01334 return(basic_emote(op, params, EMOTE_CHUCKLE)); 01335 } 01336 01346 int command_cough(object *op, char *params) { 01347 return(basic_emote(op, params, EMOTE_COUGH)); 01348 } 01349 01359 int command_flip(object *op, char *params) { 01360 return(basic_emote(op, params, EMOTE_FLIP)); 01361 } 01362 01372 int command_frown(object *op, char *params) { 01373 return(basic_emote(op, params, EMOTE_FROWN)); 01374 } 01375 01385 int command_gasp(object *op, char *params) { 01386 return(basic_emote(op, params, EMOTE_GASP)); 01387 } 01388 01398 int command_glare(object *op, char *params) { 01399 return(basic_emote(op, params, EMOTE_GLARE)); 01400 } 01401 01411 int command_groan(object *op, char *params) { 01412 return(basic_emote(op, params, EMOTE_GROAN)); 01413 } 01414 01424 int command_hiccup(object *op, char *params) { 01425 return(basic_emote(op, params, EMOTE_HICCUP)); 01426 } 01427 01437 int command_lick(object *op, char *params) { 01438 return(basic_emote(op, params, EMOTE_LICK)); 01439 } 01440 01450 int command_pout(object *op, char *params) { 01451 return(basic_emote(op, params, EMOTE_POUT)); 01452 } 01453 01463 int command_shiver(object *op, char *params) { 01464 return(basic_emote(op, params, EMOTE_SHIVER)); 01465 } 01466 01476 int command_shrug(object *op, char *params) { 01477 return(basic_emote(op, params, EMOTE_SHRUG)); 01478 } 01479 01489 int command_slap(object *op, char *params) { 01490 return(basic_emote(op, params, EMOTE_SLAP)); 01491 } 01492 01502 int command_smirk(object *op, char *params) { 01503 return(basic_emote(op, params, EMOTE_SMIRK)); 01504 } 01505 01515 int command_snap(object *op, char *params) { 01516 return(basic_emote(op, params, EMOTE_SNAP)); 01517 } 01518 01528 int command_sneeze(object *op, char *params) { 01529 return(basic_emote(op, params, EMOTE_SNEEZE)); 01530 } 01531 01541 int command_snicker(object *op, char *params) { 01542 return(basic_emote(op, params, EMOTE_SNICKER)); 01543 } 01544 01554 int command_sniff(object *op, char *params) { 01555 return(basic_emote(op, params, EMOTE_SNIFF)); 01556 } 01557 01567 int command_snore(object *op, char *params) { 01568 return(basic_emote(op, params, EMOTE_SNORE)); 01569 } 01570 01580 int command_spit(object *op, char *params) { 01581 return(basic_emote(op, params, EMOTE_SPIT)); 01582 } 01583 01593 int command_strut(object *op, char *params) { 01594 return(basic_emote(op, params, EMOTE_STRUT)); 01595 } 01596 01606 int command_thank(object *op, char *params) { 01607 return(basic_emote(op, params, EMOTE_THANK)); 01608 } 01609 01619 int command_twiddle(object *op, char *params) { 01620 return(basic_emote(op, params, EMOTE_TWIDDLE)); 01621 } 01622 01632 int command_wave(object *op, char *params) { 01633 return(basic_emote(op, params, EMOTE_WAVE)); 01634 } 01635 01645 int command_whistle(object *op, char *params) { 01646 return(basic_emote(op, params, EMOTE_WHISTLE)); 01647 } 01648 01658 int command_wink(object *op, char *params) { 01659 return(basic_emote(op, params, EMOTE_WINK)); 01660 } 01661 01671 int command_yawn(object *op, char *params) { 01672 return(basic_emote(op, params, EMOTE_YAWN)); 01673 } 01674 01684 int command_beg(object *op, char *params) { 01685 return(basic_emote(op, params, EMOTE_BEG)); 01686 } 01687 01697 int command_bleed(object *op, char *params) { 01698 return(basic_emote(op, params, EMOTE_BLEED)); 01699 } 01700 01710 int command_cringe(object *op, char *params) { 01711 return(basic_emote(op, params, EMOTE_CRINGE)); 01712 } 01713 01723 int command_think(object *op, char *params) { 01724 return(basic_emote(op, params, EMOTE_THINK)); 01725 }