Crossfire Server, Trunk  R20513
c_chat.c
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2014 Mark Wedel and the Crossfire Development Team
5  * Copyright (c) 1992 Frank Tore Johansen
6  *
7  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8  * welcome to redistribute it under certain conditions. For details, please
9  * see COPYING and LICENSE.
10  *
11  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
12  */
13 
19 #include "global.h"
20 
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include "loader.h"
25 #include "sproto.h"
26 
34 void command_say(object *op, const char *params) {
35  if (*params == '\0')
36  return;
37  monster_communicate(op, params);
38 }
39 
47 void command_me(object *op, const char *params) {
48  char buf[MAX_BUF];
49 
50  if (*params == '\0')
51  return;
52  snprintf(buf, sizeof(buf), "%s %s", op->name, params);
54  buf);
55 }
56 
64 void command_cointoss(object *op, const char *params) {
65  char buf[MAX_BUF];
66  const char *result;
67 
68  result = rndm(1, 2) == 1 ? "Heads" : "Tails";
69 
71  "You flip a coin.... %s!",
72  result);
73 
74  snprintf(buf, sizeof(buf), "%s flips a coin.... %s!", op->name, result);
76  buf);
77 }
78 
80 static const char *const orcknuckle[7] = {
81  "none",
82  "beholder",
83  "ghost",
84  "knight",
85  "princess",
86  "dragon",
87  "orc"
88 };
89 
90 #define DICE 4
107 void command_orcknuckle(object *op, const char *params) {
108  char buf[MAX_BUF];
109  char buf2[MAX_BUF];
110  object *dice[DICE];
111  int i, j, k, l, dice_count, number_dice;
112  const char *name;
113 
114  /* We only use dice if the archetype is present ingame. */
115  name = find_string("dice");
116  if (name) {
117  for (dice_count = 0; dice_count < DICE; dice_count++)
118  dice[dice_count] = NULL;
119  dice_count = 0;
120  number_dice = 0;
121 
122  FOR_INV_PREPARE(op, ob) {
123  if (dice_count >= DICE || number_dice >= DICE)
124  break;
125  if (ob->name == name) {
126  number_dice += ob->nrof;
127  dice[dice_count++] = ob;
128  }
129  } FOR_INV_FINISH();
130 
131  if (number_dice < DICE) {
133  "You need at least %d dice to play orcknuckle!", DICE);
134  return;
135  }
136  } else {
137  dice_count = 0;
138  }
139 
140  i = rndm(1, 5);
141  j = rndm(1, 5);
142  k = rndm(1, 5);
143  l = rndm(1, 6);
144 
145  snprintf(buf2, sizeof(buf2), "%s rolls %s, %s, %s, %s!", op->name, orcknuckle[i], orcknuckle[j], orcknuckle[k], orcknuckle[l]);
146  snprintf(buf, sizeof(buf), "You roll %s, %s, %s, %s!", orcknuckle[i], orcknuckle[j], orcknuckle[k], orcknuckle[l]);
147 
149  buf);
151  buf2);
152 
153  if (name) {
154  /* Randomly lose dice */
155  if (die_roll(1, 100, op, 1) < 5) {
156  /* Lose one randomly. */
157  object_decrease_nrof_by_one(dice[rndm(1, dice_count)-1]);
159  "Oops, you lost a die!");
160  }
161  }
162 #undef DICE
163 }
164 
181 static void command_tell_all(object *op, const char *params, int pri, int color, int subtype, const char *desc) {
182  if (op->contr->no_shout == 1) {
184  "You are no longer allowed to shout or chat.");
185  return;
186  }
187 
188  if (*params == '\0') {
190  "Shout/Chat what?");
191  return;
192  }
193 
195  "%s %s: %s",
196  op->name, desc, params);
197 
198  /* Lauwenmark : Here we handle the SHOUT global event */
199  execute_global_event(EVENT_SHOUT, op, params, pri);
200 }
201 
209 void command_shout(object *op, const char *params) {
210  command_tell_all(op, params, 1, NDI_RED, MSG_TYPE_COMMUNICATION_SHOUT, "shouts");
211 }
212 
220 void command_chat(object *op, const char *params) {
221  command_tell_all(op, params, 9, NDI_BLUE, MSG_TYPE_COMMUNICATION_CHAT, "chats");
222 }
223 
234 static void do_tell(object *op, const char *params, int adjust_listen) {
235  char buf[MAX_BUF], name[MAX_BUF];
236  char *msg = NULL;
237  player *pl;
238  uint8_t original_listen;
239 
240  snprintf(name, sizeof(name), "%s", params);
241 
242  msg = strchr(name, ' ');
243  if (msg) {
244  (*msg) = '\0';
245  msg++;
246  if ((*msg) == '\0')
247  msg = NULL;
248  }
249 
250  if (strlen(name) == 0) {
252  "Tell whom what?");
253  return;
254  }
255 
256  if (msg == NULL) {
258  "Tell %s what?",
259  name);
260  return;
261  }
262 
263  snprintf(buf, sizeof(buf), "%s tells you: %s", op->name, msg);
264 
265  pl = find_player_partial_name(name);
266  if (pl) {
267  if (adjust_listen) {
268  original_listen = pl->listening;
269  pl->listening = 10;
270  } else {
271  original_listen = 0;
272  }
273 
274  execute_global_event(EVENT_TELL, op, msg, pl->ob);
275 
277  buf);
278 
279  if (adjust_listen)
280  pl->listening = original_listen;
281 
282  /* Update last_tell value [mids 01/14/2002] */
283  snprintf(pl->last_tell, sizeof(pl->last_tell), "%s", op->name);
284 
285  /* Hidden DMs get the message, but player should think DM isn't online. */
286  if (!pl->hidden || QUERY_FLAG(op, FLAG_WIZ)) {
288  "You tell %s: %s",
289  pl->ob->name, msg);
290 
291  return;
292  }
293  }
294 
296  "No such player or ambiguous name.");
297 }
298 
307 void command_tell(object *op, const char *params) {
308  do_tell(op, params, 0);
309 }
310 
319 void command_dmtell(object *op, const char *params) {
320  do_tell(op, params, 1);
321 }
322 
335 void command_reply(object *op, const char *params) {
336  player *pl;
337 
338  if (*params == '\0') {
340  "Reply what?");
341  return;
342  }
343 
344  if (op->contr->last_tell[0] == '\0') {
346  "You can't reply to nobody.");
347  return;
348  }
349 
350  /* Find player object of player to reply to and check if player still exists */
351  pl = find_player(op->contr->last_tell);
352  if (pl == NULL) {
354  "You can't reply, this player left.");
355  return;
356  }
357 
358  /* Update last_tell value */
359  safe_strncpy(pl->last_tell, op->name, MAX_NAME);
360 
362  "%s tells you: %s",
363  op->name, params);
364 
365  if (pl->hidden && !QUERY_FLAG(op, FLAG_WIZ)) {
367  "You can't reply, this player left.");
368  return;
369  }
370 
372  "You tell to %s: %s",
373  pl->ob->name, params);
374 }
375 
380 #define EMOTE_FIRST 0
381 #define EMOTE_NOD 1
382 #define EMOTE_DANCE 2
383 #define EMOTE_KISS 3
384 #define EMOTE_BOUNCE 4
385 #define EMOTE_SMILE 5
386 #define EMOTE_CACKLE 6
387 #define EMOTE_LAUGH 7
388 #define EMOTE_GIGGLE 8
389 #define EMOTE_SHAKE 9
390 #define EMOTE_PUKE 10
391 #define EMOTE_GROWL 11
392 #define EMOTE_SCREAM 12
393 #define EMOTE_SIGH 13
394 #define EMOTE_SULK 14
395 #define EMOTE_HUG 15
396 #define EMOTE_CRY 16
397 #define EMOTE_POKE 17
398 #define EMOTE_ACCUSE 18
399 #define EMOTE_GRIN 19
400 #define EMOTE_BOW 20
401 #define EMOTE_CLAP 21
402 #define EMOTE_BLUSH 22
403 #define EMOTE_BURP 23
404 #define EMOTE_CHUCKLE 24
405 #define EMOTE_COUGH 25
406 #define EMOTE_FLIP 26
407 #define EMOTE_FROWN 27
408 #define EMOTE_GASP 28
409 #define EMOTE_GLARE 29
410 #define EMOTE_GROAN 30
411 #define EMOTE_HICCUP 31
412 #define EMOTE_LICK 32
413 #define EMOTE_POUT 33
414 #define EMOTE_SHIVER 34
415 #define EMOTE_SHRUG 35
416 #define EMOTE_SLAP 36
417 #define EMOTE_SMIRK 37
418 #define EMOTE_SNAP 38
419 #define EMOTE_SNEEZE 39
420 #define EMOTE_SNICKER 40
421 #define EMOTE_SNIFF 41
422 #define EMOTE_SNORE 42
423 #define EMOTE_SPIT 43
424 #define EMOTE_STRUT 44
425 #define EMOTE_THANK 45
426 #define EMOTE_TWIDDLE 46
427 #define EMOTE_WAVE 47
428 #define EMOTE_WHISTLE 48
429 #define EMOTE_WINK 49
430 #define EMOTE_YAWN 50
431 #define EMOTE_BEG 51
432 #define EMOTE_BLEED 52
433 #define EMOTE_CRINGE 53
434 #define EMOTE_THINK 54
435 #define EMOTE_LAST 55
436 
444 static const char* single_emotes[EMOTE_LAST - 1][2] = {
445  { "You nod solemnly.", "%s nods solemnly." },
446  { "You dance with glee.", "%s expresses himself through interpretive dance." },
447  { "All the lonely people...", "%s makes a weird facial contortion" },
448  { "BOIINNNNNNGG!", "%s bounces around." },
449  { "You smile happily.", "%s smiles happily." },
450  { "You cackle gleefully.", "%s throws back his head and cackles with insane glee!" },
451  { "You fall down laughing.", "%s falls down laughing." },
452  { "You giggle.", "%s giggles." },
453  { "You shake your head.", "%s shakes his head." },
454  { "Bleaaaaaghhhhhhh!", "%s pukes." },
455  { "Grrrrrrrrr....", "%s growls." },
456  { "ARRRRRRRRRRGH!!!!!", "%s screams at the top of his lungs!" },
457  { "You sigh.", "%s sighs loudly." },
458  { "You sulk.", "%s sulks in the corner." },
459  { NULL, NULL },
460  { "Waaaaaaahhh...", "%s bursts into tears." },
461  { NULL, NULL },
462  { NULL, NULL },
463  { "You grin evilly.", "%s grins evilly." },
464  { "You bow deeply.", "%s bows deeply." },
465  { "Clap, clap, clap.", "%s gives a round of applause." },
466  { "Your cheeks are burning.", "%s blushes." },
467  { "You burp loudly.", "%s burps loudly." },
468  { "You chuckle politely", "%s chuckles politely." },
469  { "Yuck, try to cover your mouth next time!", "%s coughs loudly." },
470  { "You flip head over heels.", "%s flips head over heels." },
471  { "What's bothering you?", "%s frowns." },
472  { "You gasp in astonishment.", "%s gasps in astonishment." },
473  { "You glare at nothing in particular.", "%s glares around him." },
474  { "You groan loudly.", "%s groans loudly." },
475  { "*HIC*", "%s hiccups." },
476  { "You lick your mouth and smile.", "%s licks his mouth and smiles." },
477  { "Aww, don't take it so hard.", "%s pouts." },
478  { "Brrrrrrrrr.", "%s shivers uncomfortably." },
479  { "You shrug.", "%s shrugs helplessly." },
480  { NULL, NULL },
481  { "You smirk.", "%s smirks." },
482  { "PRONTO! You snap your fingers.", "%s snaps his fingers." },
483  { "Gesundheit!", "%s sneezes." },
484  { "You snicker softly.", "%s snickers softly." },
485  { "You sniff sadly. *SNIFF*", "%s sniffs sadly." },
486  { "Zzzzzzzzzzzzzzz.", "%s snores loudly." },
487  { "You spit over your left shoulder.", "%s spits over his left shoulder." },
488  { "Strut your stuff.", "%s struts proudly." },
489  { NULL, NULL },
490  { "You patiently twiddle your thumbs.", "%s patiently twiddles his thumbs." },
491  { "You wave.", "%s waves happily." },
492  { "You whistle appreciatively.", "%s whistles appreciatively." },
493  { "Have you got something in your eye?", "%s winks suggestively." },
494  { "You open up your yap and let out a big breeze of stale air.", "%s yawns sleepily." },
495  { NULL, NULL },
496  { "You bleed all over your nice new armour.", "%s is bleeding all over the carpet - got a spare tourniquet?" },
497  { "You cringe in terror.", "%s cringes in terror!" },
498  { "Anything in particular that you'd care to think about?", "%s closes his eyes and thinks really hard." },
499 };
506 static const char* self_emotes[EMOTE_LAST - 1][2] = {
507  { "My god! is that LEGAL?", "You look away from %s." },
508  { "You skip and dance around by yourself.", "%s embraces himself and begins to dance!"},
509  { NULL, NULL },
510  { NULL, NULL },
511  { NULL, NULL },
512  { NULL, NULL },
513  { "Laugh at yourself all you want, the others won't understand." "%s is laughing at something." },
514  { NULL, NULL },
515  { "You are shaken by yourself.", "%s shakes and quivers like a bowlful of jelly." },
516  { "You puke on yourself.", "%s pukes on his clothes." },
517  { NULL, NULL },
518  { NULL, NULL },
519  { NULL, NULL },
520  { NULL, NULL },
521  { "You hug yourself.", "%s hugs himself." },
522  { "You cry to yourself.", "%s sobs quietly to himself." },
523  { "You poke yourself in the ribs, feeling very silly.", "%s pokes himself in the ribs, looking very sheepish." },
524  { "You accuse yourself.", "%s seems to have a bad conscience." },
525  { NULL, NULL },
526  { "You kiss your toes.", "%s folds up like a jackknife and kisses his own toes." },
527  { NULL, NULL },
528  { NULL, NULL },
529  { NULL, NULL },
530  { NULL, NULL },
531  { NULL, NULL },
532  { NULL, NULL },
533  { "You frown at yourself.", "%s frowns at himself." },
534  { NULL, NULL },
535  { "You glare icily at your feet, they are suddenly very cold.", "%s glares at his feet, what is bothering him?" },
536  { NULL, NULL },
537  { NULL, NULL },
538  { "You lick yourself.", "%s licks himself - YUCK." },
539  { NULL, NULL },
540  { NULL, NULL },
541  { NULL, NULL },
542  { "You slap yourself, silly you.", "%s slaps himself, really strange..." },
543  { NULL, NULL },
544  { NULL, NULL },
545  { "You sneeze on yourself, what a mess!", "%s sneezes, and covers himself in a slimy substance." },
546  { NULL, NULL },
547  { "You sniff yourself.", "%s sniffs himself." },
548  { NULL, NULL },
549  { "You drool all over yourself.", "%s drools all over himself." },
550  { NULL, NULL },
551  { "You thank yourself since nobody else wants to!", "%s thanks himself since you won't." },
552  { NULL, NULL },
553  { "Are you going on adventures as well??", "%s waves goodbye to himself."},
554  { "You whistle while you work.", "%s whistles to himself in boredom." },
555  { "You wink at yourself?? What are you up to?", "%s winks at himself - something strange is going on..." },
556  { NULL, NULL },
557  { NULL, NULL },
558  { "Very impressive! You wipe your blood all over yourself.", "%s performs some satanic ritual while wiping his blood on himself." },
559  { NULL, NULL },
560  { NULL, NULL },
561 };
570 static const char* other_emotes[EMOTE_LAST - 1][3] = {
571  { "You nod solemnly to %s.", "%s nods solemnly to you.", "%s nods solemnly to %s." },
572  { "You grab %s and begin doing the Cha-Cha!", "%s grabs you, and begins dancing!", "Yipe! %s and %s are doing the Macarena!" },
573  { "You kiss %s.", "%s kisses you.", "%s kisses %s." },
574  { "You bounce around the room with %s.", "%s bounces around the room with you.", "%s bounces around the room with %s." },
575  { "You smile at %s.", "%s smiles at you.", "%s beams a smile at %s." },
576  { NULL, NULL, NULL },
577  { "You take one look at %s and fall down laughing.", "%s looks at you and falls down on the ground laughing.", "%s looks at %s and falls down on the ground laughing." },
578  { NULL, NULL, NULL },
579  { "You shake %s's hand.", "%s shakes your hand.", "%s shakes %s's hand." },
580  { "You puke on %s.", "%s pukes on your clothes!", "%s pukes on %s." },
581  { NULL, NULL, NULL },
582  { NULL, NULL, NULL },
583  { NULL, NULL, NULL },
584  { NULL, NULL, NULL },
585  { "You hug %s.", "%s hugs you.", "%s hugs %s." },
586  { "You cry on %s's shoulder.", "%s cries on your shoulder.", "%s cries on %s's shoulder." },
587  { "You poke %s in the ribs.", "%s pokes you in the ribs.", "%s pokes %s in the ribs." },
588  { "You look accusingly at %s.", "%s looks accusingly at you.", "%s looks accusingly at %s." },
589  { "You grin at %s.", "%s grins evilly at you.", "%s grins evilly at %s." },
590  { "You bow before %s.", "%s bows before you.", "%s bows before %s." },
591  { NULL, NULL, NULL },
592  { NULL, NULL, NULL },
593  { NULL, NULL, NULL },
594  { NULL, NULL, NULL },
595  { NULL, NULL, NULL },
596  { NULL, NULL, NULL },
597  { "You frown darkly at %s.", "%s frowns darkly at you.", "%s frowns darkly at %s." },
598  { NULL, NULL, NULL },
599  { "You glare icily at %s.", "%s glares icily at you, you feel cold to your bones.", "%s glares at %s." },
600  { NULL, NULL, NULL },
601  { NULL, NULL, NULL },
602  { "You lick %s.", "%s licks you.", "%s licks %s." },
603  { NULL, NULL, NULL },
604  { NULL, NULL, NULL },
605  { "You shrug at %s.", "%s shrugs at you.", "%s shrugs at %s." },
606  { "You slap %s.", "You are slapped by %s.", "%s slaps %s." },
607  { NULL, NULL, NULL },
608  { NULL, NULL, NULL },
609  { "You sneeze at %s and a film of snot shoots onto him.", "%s sneezes on you, you feel the snot cover you. EEEEEEW.", "%s sneezes on %s and a film of snot covers him." },
610  { NULL, NULL, NULL },
611  { "You sniff %s.", "%s sniffs you.", "%s sniffs %s" },
612  { NULL, NULL, NULL },
613  { "You spit on %s.", "%s spits in your face!", "%s spits in %s's face." },
614  { NULL, NULL, NULL },
615  { "You thank %s heartily.", "%s thanks you heartily.", "%s thanks %s heartily." },
616  { NULL, NULL, NULL },
617  { "You wave goodbye to %s.", "%s waves goodbye to you. Have a good journey.", "%s waves goodbye to %s." },
618  { "You whistle at %s.", "%s whistles at you.", "%s whistles at %s." },
619  { "You wink suggestively at %s.", "%s winks suggestively at you.", "%s winks at %s." },
620  { NULL, NULL, NULL },
621  { "You beg %s for mercy.", "%s begs you for mercy! Show no quarter!", "%s begs %s for mercy!" },
622  { "You slash your wrist and bleed all over %s", "%s slashes his wrist and bleeds all over you.", "%s slashes his wrist and bleeds all over %s." },
623  { "You cringe away from %s.", "%s cringes away from you.", "%s cringes away from %s in mortal terror." },
624  { NULL, NULL, NULL },
625 };
626 
646 static void basic_emote(object *op, const char *params, int emotion) {
647  char buf[MAX_BUF], buf2[MAX_BUF], buf3[MAX_BUF];
648  player *pl;
649 
650  if (*params == '\0') {
651  const char *self_reply;
652  if (emotion > EMOTE_FIRST && emotion < EMOTE_LAST && single_emotes[emotion - 1][0] != NULL) {
653  self_reply = single_emotes[emotion - 1][0];
654  snprintf(buf2, sizeof(buf2), single_emotes[emotion - 1][1], op->name);
655  } else {
656  self_reply = "You are a nut.";
657  snprintf(buf2, sizeof(buf2), "%s dances with glee.", op->name);
658  }
659 
661  MSG_TYPE_COMMUNICATION_EMOTE, self_reply);
664  return;
665  }
666 
668  if (pl == NULL) {
670  MSG_TYPE_COMMAND_ERROR, "%s is not around.", params);
671  return;
672  }
673 
674  if (pl->ob == op) {
675  /* Player doing self-emote. */
676  const char *self_reply;
677  if (emotion > EMOTE_FIRST && emotion < EMOTE_LAST && self_emotes[emotion - 1][0] != NULL) {
678  self_reply = self_emotes[emotion - 1][0];
679  snprintf(buf2, sizeof(buf2), self_emotes[emotion - 1][1], op->name);
680  } else {
681  self_reply = "My god! is that LEGAL?";
682  snprintf(buf2, sizeof(buf2), "You look away from %s.", op->name);
683  }
684 
686  MSG_TYPE_COMMUNICATION_EMOTE, self_reply);
689  return;
690  }
691 
692  if (emotion > EMOTE_FIRST && emotion < EMOTE_LAST && other_emotes[emotion - 1][0] != NULL) {
693  snprintf(buf, sizeof(buf), other_emotes[emotion - 1][0], pl->ob->name);
694  snprintf(buf2, sizeof(buf2), other_emotes[emotion - 1][1], op->name);
695  snprintf(buf3, sizeof(buf3), other_emotes[emotion - 1][2], op->name, pl->ob->name);
696  } else {
697  snprintf(buf, sizeof(buf), "You are still nuts.");
698  snprintf(buf2, sizeof(buf2), "You get the distinct feeling that %s is nuts.", op->name);
699  snprintf(buf3, sizeof(buf3), "%s is eyeing %s quizzically.", pl->ob->name, op->name);
700  }
701 
703  buf);
705  buf2);
707  buf3);
708 }
709 
710 /*
711  * everything from here on out are just wrapper calls to basic_emote
712  */
713 
721 void command_nod(object *op, const char *params) {
722  basic_emote(op, params, EMOTE_NOD);
723 }
724 
732 void command_dance(object *op, const char *params) {
733  basic_emote(op, params, EMOTE_DANCE);
734 }
735 
743 void command_kiss(object *op, const char *params) {
744  basic_emote(op, params, EMOTE_KISS);
745 }
746 
754 void command_bounce(object *op, const char *params) {
755  basic_emote(op, params, EMOTE_BOUNCE);
756 }
757 
765 void command_smile(object *op, const char *params) {
766  basic_emote(op, params, EMOTE_SMILE);
767 }
768 
776 void command_cackle(object *op, const char *params) {
777  basic_emote(op, params, EMOTE_CACKLE);
778 }
779 
787 void command_laugh(object *op, const char *params) {
788  basic_emote(op, params, EMOTE_LAUGH);
789 }
790 
798 void command_giggle(object *op, const char *params) {
799  basic_emote(op, params, EMOTE_GIGGLE);
800 }
801 
809 void command_shake(object *op, const char *params) {
810  basic_emote(op, params, EMOTE_SHAKE);
811 }
812 
820 void command_puke(object *op, const char *params) {
821  basic_emote(op, params, EMOTE_PUKE);
822 }
823 
831 void command_growl(object *op, const char *params) {
832  basic_emote(op, params, EMOTE_GROWL);
833 }
834 
842 void command_scream(object *op, const char *params) {
843  basic_emote(op, params, EMOTE_SCREAM);
844 }
845 
853 void command_sigh(object *op, const char *params) {
854  basic_emote(op, params, EMOTE_SIGH);
855 }
856 
864 void command_sulk(object *op, const char *params) {
865  basic_emote(op, params, EMOTE_SULK);
866 }
867 
875 void command_hug(object *op, const char *params) {
876  basic_emote(op, params, EMOTE_HUG);
877 }
878 
886 void command_cry(object *op, const char *params) {
887  basic_emote(op, params, EMOTE_CRY);
888 }
889 
897 void command_poke(object *op, const char *params) {
898  basic_emote(op, params, EMOTE_POKE);
899 }
900 
908 void command_accuse(object *op, const char *params) {
909  basic_emote(op, params, EMOTE_ACCUSE);
910 }
911 
919 void command_grin(object *op, const char *params) {
920  basic_emote(op, params, EMOTE_GRIN);
921 }
922 
930 void command_bow(object *op, const char *params) {
931  basic_emote(op, params, EMOTE_BOW);
932 }
933 
941 void command_clap(object *op, const char *params) {
942  basic_emote(op, params, EMOTE_CLAP);
943 }
944 
952 void command_blush(object *op, const char *params) {
953  basic_emote(op, params, EMOTE_BLUSH);
954 }
955 
963 void command_burp(object *op, const char *params) {
964  basic_emote(op, params, EMOTE_BURP);
965 }
966 
974 void command_chuckle(object *op, const char *params) {
975  basic_emote(op, params, EMOTE_CHUCKLE);
976 }
977 
985 void command_cough(object *op, const char *params) {
986  basic_emote(op, params, EMOTE_COUGH);
987 }
988 
996 void command_flip(object *op, const char *params) {
997  basic_emote(op, params, EMOTE_FLIP);
998 }
999 
1007 void command_frown(object *op, const char *params) {
1008  basic_emote(op, params, EMOTE_FROWN);
1009 }
1010 
1018 void command_gasp(object *op, const char *params) {
1019  basic_emote(op, params, EMOTE_GASP);
1020 }
1021 
1029 void command_glare(object *op, const char *params) {
1030  basic_emote(op, params, EMOTE_GLARE);
1031 }
1032 
1040 void command_groan(object *op, const char *params) {
1041  basic_emote(op, params, EMOTE_GROAN);
1042 }
1043 
1051 void command_hiccup(object *op, const char *params) {
1052  basic_emote(op, params, EMOTE_HICCUP);
1053 }
1054 
1062 void command_lick(object *op, const char *params) {
1063  basic_emote(op, params, EMOTE_LICK);
1064 }
1065 
1073 void command_pout(object *op, const char *params) {
1074  basic_emote(op, params, EMOTE_POUT);
1075 }
1076 
1084 void command_shiver(object *op, const char *params) {
1085  basic_emote(op, params, EMOTE_SHIVER);
1086 }
1087 
1095 void command_shrug(object *op, const char *params) {
1096  basic_emote(op, params, EMOTE_SHRUG);
1097 }
1098 
1106 void command_slap(object *op, const char *params) {
1107  basic_emote(op, params, EMOTE_SLAP);
1108 }
1109 
1117 void command_smirk(object *op, const char *params) {
1118  basic_emote(op, params, EMOTE_SMIRK);
1119 }
1120 
1128 void command_snap(object *op, const char *params) {
1129  basic_emote(op, params, EMOTE_SNAP);
1130 }
1131 
1139 void command_sneeze(object *op, const char *params) {
1140  basic_emote(op, params, EMOTE_SNEEZE);
1141 }
1142 
1150 void command_snicker(object *op, const char *params) {
1151  basic_emote(op, params, EMOTE_SNICKER);
1152 }
1153 
1161 void command_sniff(object *op, const char *params) {
1162  basic_emote(op, params, EMOTE_SNIFF);
1163 }
1164 
1172 void command_snore(object *op, const char *params) {
1173  basic_emote(op, params, EMOTE_SNORE);
1174 }
1175 
1183 void command_spit(object *op, const char *params) {
1184  basic_emote(op, params, EMOTE_SPIT);
1185 }
1186 
1194 void command_strut(object *op, const char *params) {
1195  basic_emote(op, params, EMOTE_STRUT);
1196 }
1197 
1205 void command_thank(object *op, const char *params) {
1206  basic_emote(op, params, EMOTE_THANK);
1207 }
1208 
1216 void command_twiddle(object *op, const char *params) {
1217  basic_emote(op, params, EMOTE_TWIDDLE);
1218 }
1219 
1227 void command_wave(object *op, const char *params) {
1228  basic_emote(op, params, EMOTE_WAVE);
1229 }
1230 
1238 void command_whistle(object *op, const char *params) {
1239  basic_emote(op, params, EMOTE_WHISTLE);
1240 }
1241 
1249 void command_wink(object *op, const char *params) {
1250  basic_emote(op, params, EMOTE_WINK);
1251 }
1252 
1260 void command_yawn(object *op, const char *params) {
1261  basic_emote(op, params, EMOTE_YAWN);
1262 }
1263 
1271 void command_beg(object *op, const char *params) {
1272  basic_emote(op, params, EMOTE_BEG);
1273 }
1274 
1282 void command_bleed(object *op, const char *params) {
1283  basic_emote(op, params, EMOTE_BLEED);
1284 }
1285 
1293 void command_cringe(object *op, const char *params) {
1294  basic_emote(op, params, EMOTE_CRINGE);
1295 }
1296 
1304 void command_think(object *op, const char *params) {
1305  basic_emote(op, params, EMOTE_THINK);
1306 }
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
Sends message to player(s).
Definition: main.c:315
One player.
Definition: player.h:92
static const char * other_emotes[EMOTE_LAST-1][3]
Emote texts when the player applies the emote to someone else.
Definition: c_chat.c:570
#define MSG_TYPE_COMMUNICATION_ME
Player me&#39;s a message.
Definition: newclient.h:619
#define EMOTE_SCREAM
Definition: c_chat.c:392
#define EVENT_SHOUT
A player &#39;shout&#39; something.
Definition: plugin.h:94
void command_glare(object *op, const char *params)
&#39;glare&#39; command.
Definition: c_chat.c:1029
void command_clap(object *op, const char *params)
&#39;clap&#39; command.
Definition: c_chat.c:941
void monster_communicate(object *op, const char *txt)
This function looks for an object or creature that is listening to said text.
Definition: monster.c:2118
#define DICE
How many dice to roll for orcknuckle.
Definition: c_chat.c:90
#define EMOTE_THINK
Definition: c_chat.c:434
#define NDI_ALL
Inform all players of this message.
Definition: newclient.h:246
#define EMOTE_POUT
Definition: c_chat.c:413
unsigned char uint8_t
Definition: win32.h:161
#define EMOTE_SMILE
Definition: c_chat.c:385
static void basic_emote(object *op, const char *params, int emotion)
This function covers basic emotions a player can have.
Definition: c_chat.c:646
void command_whistle(object *op, const char *params)
&#39;whistle&#39; command.
Definition: c_chat.c:1238
#define NDI_WHITE
Definition: newclient.h:222
#define EMOTE_BURP
Definition: c_chat.c:403
#define MSG_TYPE_COMMUNICATION_EMOTE
Player emotes.
Definition: newclient.h:621
#define EMOTE_SNAP
Definition: c_chat.c:418
#define EMOTE_GROAN
Definition: c_chat.c:410
#define NDI_ORANGE
Definition: newclient.h:225
static const char * self_emotes[EMOTE_LAST-1][2]
Emote texts when the player applies the emote to herself.
Definition: c_chat.c:506
void command_snore(object *op, const char *params)
&#39;snore&#39; command.
Definition: c_chat.c:1172
void command_dance(object *op, const char *params)
&#39;dance&#39; command.
Definition: c_chat.c:732
#define EMOTE_GASP
Definition: c_chat.c:408
#define EMOTE_STRUT
Definition: c_chat.c:424
void command_shout(object *op, const char *params)
&#39;shout&#39; command.
Definition: c_chat.c:209
void command_chat(object *op, const char *params)
&#39;chat&#39; command.
Definition: c_chat.c:220
#define EMOTE_CHUCKLE
Definition: c_chat.c:404
void command_pout(object *op, const char *params)
&#39;pout&#39; command.
Definition: c_chat.c:1073
#define EMOTE_SHAKE
Definition: c_chat.c:389
#define NDI_BLUE
Actually, it is Dodger Blue.
Definition: newclient.h:226
void command_frown(object *op, const char *params)
&#39;frown&#39; command.
Definition: c_chat.c:1007
void command_kiss(object *op, const char *params)
&#39;kiss&#39; command.
Definition: c_chat.c:743
#define EMOTE_SULK
Definition: c_chat.c:394
void command_burp(object *op, const char *params)
&#39;burp&#39; command.
Definition: c_chat.c:963
void command_growl(object *op, const char *params)
&#39;growl&#39; command.
Definition: c_chat.c:831
#define EMOTE_PUKE
Definition: c_chat.c:390
player * find_player_options(const char *plname, int options, const mapstruct *map)
Find a player.
Definition: player.c:65
player * find_player(const char *plname)
Find a player by her full name.
Definition: player.c:54
void command_laugh(object *op, const char *params)
&#39;laugh&#39; command.
Definition: c_chat.c:787
#define EMOTE_CLAP
Definition: c_chat.c:401
void command_cackle(object *op, const char *params)
&#39;cackle&#39; command.
Definition: c_chat.c:776
static const char *const orcknuckle[7]
Results for the "orcknucle" game.
Definition: c_chat.c:80
void command_think(object *op, const char *params)
&#39;think&#39; command.
Definition: c_chat.c:1304
#define EVENT_TELL
A player &#39;tell&#39; something.
Definition: plugin.h:95
Global type definitions and header inclusions.
#define safe_strncpy
Definition: compat.h:23
uint32_t hidden
If True, player (DM) is hidden from view.
Definition: player.h:132
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Sends message to player(s).
Definition: main.c:310
#define EMOTE_THANK
Definition: c_chat.c:425
#define EMOTE_HICCUP
Definition: c_chat.c:411
#define EMOTE_NOD
Definition: c_chat.c:381
void command_scream(object *op, const char *params)
&#39;scream&#39; command.
Definition: c_chat.c:842
#define EMOTE_WINK
Definition: c_chat.c:429
#define EMOTE_FIRST
Definition: c_chat.c:380
void command_groan(object *op, const char *params)
&#39;groan&#39; command.
Definition: c_chat.c:1040
void command_snap(object *op, const char *params)
&#39;snap&#39; command.
Definition: c_chat.c:1128
uint32_t no_shout
if True, player is *not *able to use shout command.
Definition: player.h:133
#define FIND_PLAYER_PARTIAL_NAME
Find on partial name.
Definition: player.h:212
#define EMOTE_BEG
Definition: c_chat.c:431
int rndm(int min, int max)
Returns a number between min and max.
Definition: utils.c:161
#define EMOTE_KISS
Definition: c_chat.c:383
void command_gasp(object *op, const char *params)
&#39;gasp&#39; command.
Definition: c_chat.c:1018
#define NDI_RED
Definition: newclient.h:224
sstring find_string(const char *str)
Searches a string in the shared strings.
Definition: shstr.c:236
void command_wave(object *op, const char *params)
&#39;wave&#39; command.
Definition: c_chat.c:1227
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
Definition: newclient.h:379
void command_lick(object *op, const char *params)
&#39;lick&#39; command.
Definition: c_chat.c:1062
void command_smirk(object *op, const char *params)
&#39;smirk&#39; command.
Definition: c_chat.c:1117
void command_bow(object *op, const char *params)
&#39;bow&#39; command.
Definition: c_chat.c:930
void command_strut(object *op, const char *params)
&#39;strut&#39; command.
Definition: c_chat.c:1194
#define MSG_TYPE_COMMUNICATION_SHOUT
Party message.
Definition: newclient.h:623
#define MSG_TYPE_COMMAND_ERROR
Bad syntax/can&#39;t use command.
Definition: newclient.h:509
Defines for loader.l / loader.c.
void command_reply(object *op, const char *params)
Reply to last person who told you something [mids 01/14/2002].
Definition: c_chat.c:335
void command_spit(object *op, const char *params)
&#39;spit&#39; command.
Definition: c_chat.c:1183
#define EMOTE_DANCE
Definition: c_chat.c:382
void command_cough(object *op, const char *params)
&#39;cough&#39; command.
Definition: c_chat.c:985
#define EMOTE_SNORE
Definition: c_chat.c:422
struct mapdef * map
Pointer to the map in which this object is present.
Definition: object.h:297
#define snprintf
Definition: win32.h:46
void command_nod(object *op, const char *params)
&#39;nod&#39; command.
Definition: c_chat.c:721
#define EMOTE_FLIP
Definition: c_chat.c:406
#define MSG_TYPE_COMMUNICATION_RANDOM
Random event (coin toss)
Definition: newclient.h:617
void command_snicker(object *op, const char *params)
&#39;snicker&#39; command.
Definition: c_chat.c:1150
#define EMOTE_CRINGE
Definition: c_chat.c:433
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
Definition: define.h:712
#define EMOTE_SHIVER
Definition: c_chat.c:414
int die_roll(int num, int size, const object *op, int goodbad)
Roll a number of dice (2d3, 4d6).
Definition: utils.c:121
static const char * single_emotes[EMOTE_LAST-1][2]
Emote texts when the player does not specify who to apply the emote.
Definition: c_chat.c:444
static void do_tell(object *op, const char *params, int adjust_listen)
Actual function sending a private message.
Definition: c_chat.c:234
const char * name
The name of the object, obviously...
Definition: object.h:311
void command_poke(object *op, const char *params)
&#39;poke&#39; command.
Definition: c_chat.c:897
void command_me(object *op, const char *params)
&#39;me&#39; command.
Definition: c_chat.c:47
void ext_info_map_except(int color, const mapstruct *map, const object *op, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the map except *op.
Definition: info.c:185
#define EMOTE_TWIDDLE
Definition: c_chat.c:426
static void command_tell_all(object *op, const char *params, int pri, int color, int subtype, const char *desc)
Utility function for chat or shout.
Definition: c_chat.c:181
#define EMOTE_COUGH
Definition: c_chat.c:405
void command_flip(object *op, const char *params)
&#39;flip&#39; command.
Definition: c_chat.c:996
#define MSG_TYPE_COMMUNICATION
Communication between players.
Definition: newclient.h:386
int execute_global_event(int eventcode,...)
Definition: main.c:369
char last_tell[MAX_NAME]
last player that told you something [mids 01/14/2002].
Definition: player.h:172
#define MSG_TYPE_COMMUNICATION_TELL
Player tells something.
Definition: newclient.h:620
#define EMOTE_WAVE
Definition: c_chat.c:427
uint8_t listening
Which priority will be used in info_all.
Definition: player.h:120
void command_hiccup(object *op, const char *params)
&#39;hiccup&#39; command.
Definition: c_chat.c:1051
void command_shake(object *op, const char *params)
&#39;shake&#39; command.
Definition: c_chat.c:809
void command_slap(object *op, const char *params)
&#39;slap&#39; command.
Definition: c_chat.c:1106
struct pl * contr
Pointer to the player which control this object.
Definition: object.h:276
void command_hug(object *op, const char *params)
&#39;hug&#39; command.
Definition: c_chat.c:875
void command_wink(object *op, const char *params)
&#39;wink&#39; command.
Definition: c_chat.c:1249
#define EMOTE_GLARE
Definition: c_chat.c:409
#define EMOTE_YAWN
Definition: c_chat.c:430
#define QUERY_FLAG(xyz, p)
Definition: define.h:225
void command_shrug(object *op, const char *params)
&#39;shrug&#39; command.
Definition: c_chat.c:1095
void command_twiddle(object *op, const char *params)
&#39;twiddle&#39; command.
Definition: c_chat.c:1216
#define FLAG_WIZ
Object has special privilegies.
Definition: define.h:231
#define EMOTE_SIGH
Definition: c_chat.c:393
#define MAX_BUF
Used for all kinds of things.
Definition: define.h:35
void command_tell(object *op, const char *params)
Private communication.
Definition: c_chat.c:307
#define EMOTE_BOW
Definition: c_chat.c:400
void command_bleed(object *op, const char *params)
&#39;bleed&#39; command.
Definition: c_chat.c:1282
object * ob
The object representing the player.
Definition: player.h:158
void command_sneeze(object *op, const char *params)
&#39;sneeze&#39; command.
Definition: c_chat.c:1139
#define EMOTE_CRY
Definition: c_chat.c:396
#define EMOTE_FROWN
Definition: c_chat.c:407
void command_cointoss(object *op, const char *params)
&#39;cointoss&#39; command.
Definition: c_chat.c:64
#define EMOTE_BLEED
Definition: c_chat.c:432
#define EMOTE_SHRUG
Definition: c_chat.c:415
void command_puke(object *op, const char *params)
&#39;puke&#39; command.
Definition: c_chat.c:820
void command_giggle(object *op, const char *params)
&#39;giggle&#39; command.
Definition: c_chat.c:798
#define object_decrease_nrof_by_one(xyz)
Definition: compat.h:28
void command_sigh(object *op, const char *params)
&#39;sigh&#39; command.
Definition: c_chat.c:853
void command_cringe(object *op, const char *params)
&#39;cringe&#39; command.
Definition: c_chat.c:1293
#define EMOTE_SNIFF
Definition: c_chat.c:421
#define MSG_TYPE_COMMUNICATION_CHAT
Party message.
Definition: newclient.h:624
#define EMOTE_LICK
Definition: c_chat.c:412
void command_grin(object *op, const char *params)
&#39;grin&#39; command.
Definition: c_chat.c:919
void command_bounce(object *op, const char *params)
&#39;bounce&#39; command.
Definition: c_chat.c:754
#define EMOTE_LAST
Definition: c_chat.c:435
#define EMOTE_BLUSH
Definition: c_chat.c:402
void command_sniff(object *op, const char *params)
&#39;sniff&#39; command.
Definition: c_chat.c:1161
#define EMOTE_HUG
Definition: c_chat.c:395
#define EMOTE_GRIN
Definition: c_chat.c:399
void ext_info_map_except2(int color, const mapstruct *map, const object *op1, const object *op2, int type, int subtype, const char *str1)
Writes to everyone on the map except op1 and op2.
Definition: info.c:211
#define EMOTE_BOUNCE
Definition: c_chat.c:384
#define FIND_PLAYER_NO_HIDDEN_DM
Don&#39;t find hidden DMs.
Definition: player.h:213
#define NDI_UNIQUE
Print immediately, don&#39;t buffer.
Definition: newclient.h:245
void command_sulk(object *op, const char *params)
&#39;sulk&#39; command.
Definition: c_chat.c:864
void command_smile(object *op, const char *params)
&#39;smile&#39; command.
Definition: c_chat.c:765
void command_chuckle(object *op, const char *params)
&#39;chuckle&#39; command.
Definition: c_chat.c:974
void command_cry(object *op, const char *params)
&#39;cry&#39; command.
Definition: c_chat.c:886
#define MAX_NAME
Definition: define.h:41
#define EMOTE_WHISTLE
Definition: c_chat.c:428
#define EMOTE_SNEEZE
Definition: c_chat.c:419
void command_say(object *op, const char *params)
&#39;say&#39; command.
Definition: c_chat.c:34
#define EMOTE_CACKLE
Definition: c_chat.c:386
#define EMOTE_SMIRK
Definition: c_chat.c:417
#define EMOTE_GIGGLE
Definition: c_chat.c:388
#define EMOTE_ACCUSE
Definition: c_chat.c:398
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the specified map.
Definition: main.c:325
void command_blush(object *op, const char *params)
&#39;blush&#39; command.
Definition: c_chat.c:952
#define EMOTE_GROWL
Definition: c_chat.c:391
#define EMOTE_SLAP
Definition: c_chat.c:416
void command_shiver(object *op, const char *params)
&#39;shiver&#39; command.
Definition: c_chat.c:1084
#define EMOTE_SNICKER
Definition: c_chat.c:420
player * find_player_partial_name(const char *plname)
Find a player by a partial name.
Definition: player.c:109
void command_beg(object *op, const char *params)
&#39;beg&#39; command.
Definition: c_chat.c:1271
void command_dmtell(object *op, const char *params)
Private communication, by a DM (can&#39;t be ignored by player).
Definition: c_chat.c:319
const char * name
More definite name, like "generate_kobold".
Definition: object.h:466
void command_thank(object *op, const char *params)
&#39;thank&#39; command.
Definition: c_chat.c:1205
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
Definition: define.h:705
void command_yawn(object *op, const char *params)
&#39;yawn&#39; command.
Definition: c_chat.c:1260
#define EMOTE_POKE
Definition: c_chat.c:397
#define EMOTE_SPIT
Definition: c_chat.c:423
void command_accuse(object *op, const char *params)
&#39;accuse&#39; command.
Definition: c_chat.c:908
#define EMOTE_LAUGH
Definition: c_chat.c:387