Crossfire Server, Branches 1.12  R18729
c_misc.c
Go to the documentation of this file.
1 /*
2  * static char *rcsid_c_misc_c =
3  * "$Id: c_misc.c 11869 2009-06-14 14:32:45Z akirschbaum $";
4  */
5 
6 /*
7  CrossFire, A Multiplayer game for X-windows
8 
9  Copyright (C) 2002 Mark Wedel & Crossfire Development Team
10  Copyright (C) 1992 Frank Tore Johansen
11 
12  This program is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 
26  The authors can be reached via e-mail at crossfire-devel@real-time.com
27 */
28 
35 #include <global.h>
36 #include <loader.h>
37 
38 #undef SS_STATISTICS
39 #include <shstr.h>
40 
41 #ifndef __CEXTRACT__
42 #include <sproto.h>
43 #endif
44 #include <assert.h>
45 #include <sounds.h>
46 
55 void map_info(object *op, char *search) {
56  mapstruct *m;
57  char map_path[MAX_BUF];
58  long sec = seconds();
59 
63  (sec%86400)/3600, (sec%3600)/60, sec%60);
64 
68 
69  for (m = first_map; m != NULL; m = m->next) {
70  if (search && strstr(m->path, search) == NULL)
71  continue; /* Skip unwanted maps */
72 
73  /* Print out the last 18 characters of the map name... */
74  if (strlen(m->path) <= 18)
75  strcpy(map_path, m->path);
76  else
77  strcpy(map_path, m->path+strlen(m->path)-18);
78 
82  map_path, m->players, players_on_map(m, FALSE),
83  m->in_memory, m->timeout, m->difficulty,
84  (MAP_WHEN_RESET(m)%86400)/3600, (MAP_WHEN_RESET(m)%3600)/60,
85  MAP_WHEN_RESET(m)%60);
86  }
87 }
88 
97 int command_language(object *op, char *params) {
98  const char *language_str;
99  int language;
100  int i;
101 
102  if (!op->contr)
103  return 0;
104 
105  language_str = language_names[get_language(op)];
106 
107  if (!params || (!strcmp(params, ""))) {
111  language_str);
115  language_str);
116  for (i = 0; i < NUM_LANGUAGES; i++) {
118  "[fixed]%s: %s",
119  "%s: %s",
120  language_codes[i],
121  language_names[i]);
122  }
123  return 0;
124  } else {
125  for (i = 0; i < NUM_LANGUAGES; i++) {
126  if (!strcmp(language_codes[i], params)) {
127  language = i;
128  i = NUM_LANGUAGES;
129  }
130  }
131  op->contr->language = language;
132  language_str = language_names[language];
133 
137  language_str);
138  return 0;
139  }
140 }
141 
157 int command_body(object *op, char *params) {
158  int i;
159 
160  /* Too hard to try and make a header that lines everything up, so just
161  * give a description.
162  */
165 
168 
171 
172  for (i = 0; i < NUM_BODY_LOCATIONS; i++) {
173  /* really debugging - normally body_used should not be set to anything
174  * if body_info isn't also set.
175  */
176  if (op->body_info[i] || op->body_used[i]) {
180  body_locations[i].use_name, op->body_info[i], op->body_used[i]);
181  }
182  }
183  if (!QUERY_FLAG(op, FLAG_USE_ARMOUR))
186  if (!QUERY_FLAG(op, FLAG_USE_WEAPON))
189 
190  return 1;
191 }
192 
203 int command_motd(object *op, char *params) {
204  display_motd(op);
205  return 1;
206 }
207 
218 int command_rules(object *op, char *params) {
219  send_rules(op);
220  return 1;
221 }
222 
233 int command_news(object *op, char *params) {
234  send_news(op);
235  return 1;
236 }
237 
244 void malloc_info(object *op) {
245  int ob_used = count_used(), ob_free = count_free(), players, nrofmaps;
246  int nrm = 0, mapmem = 0, anr, anims, sum_alloc = 0, sum_used = 0, i, tlnr, alnr;
247  treasurelist *tl;
248  player *pl;
249  mapstruct *m;
250  archetype *at;
251  artifactlist *al;
252 
253  for (tl = first_treasurelist, tlnr = 0; tl != NULL; tl = tl->next, tlnr++)
254  ;
255  for (al = first_artifactlist, alnr = 0; al != NULL; al = al->next, alnr++)
256  ;
257 
258  for (at = first_archetype, anr = 0, anims = 0; at != NULL; at = at->more == NULL ? at->next : at->more, anr++)
259  ;
260 
261  for (i = 1; i < num_animations; i++)
262  anims += animations[i].num_animations;
263 
264  for (pl = first_player, players = 0; pl != NULL; pl = pl->next, players++)
265  ;
266 
267  for (m = first_map, nrofmaps = 0; m != NULL; m = m->next, nrofmaps++)
268  if (m->in_memory == MAP_IN_MEMORY) {
269  mapmem += MAP_WIDTH(m)*MAP_HEIGHT(m)*(sizeof(object *)+sizeof(MapSpace));
270  nrm++;
271  }
272 
276  sizeof(object), sizeof(player), sizeof(mapstruct));
277 
281  ob_used, i = (ob_used*sizeof(object)));
282 
283  sum_used += i;
284  sum_alloc += i;
288  ob_free, i = (ob_free*sizeof(object)));
289 
293  count_active(), 0);
294 
295  sum_alloc += i;
299  players, i = (players*sizeof(player)));
300 
301  sum_alloc += i;
302  sum_used += i;
303 
307  nrofmaps, i = (nrofmaps*sizeof(mapstruct)));
308 
309  sum_alloc += i;
310  sum_used += nrm*sizeof(mapstruct);
311 
315  nrm, mapmem);
316 
317  sum_alloc += mapmem;
318  sum_used += mapmem;
319 
323  anr, i = (anr*sizeof(archetype)));
324 
325  sum_alloc += i;
326  sum_used += i;
327 
331  anims, i = (anims*sizeof(Fontindex)));
332 
333  sum_alloc += i;
334  sum_used += i;
335 
339  tlnr, i = (tlnr*sizeof(treasurelist)));
340 
341  sum_alloc += i;
342  sum_used += i;
343 
347  nroftreasures, i = (nroftreasures*sizeof(treasure)));
348 
349  sum_alloc += i;
350  sum_used += i;
351 
355  nrofartifacts, i = (nrofartifacts*sizeof(artifact)));
356 
357  sum_alloc += i;
358  sum_used += i;
359 
363  nrofallowedstr, i = (nrofallowedstr*sizeof(linked_char)));
364 
365  sum_alloc += i;
366  sum_used += i;
367 
371  alnr, i = (alnr*sizeof(artifactlist)));
372 
373  sum_alloc += i;
374  sum_used += i;
375 
379  sum_alloc);
380 
384  sum_used);
385 }
386 
398 void current_region_info(object *op) {
399  /*
400  * Ok I /suppose/ I should write a seperate function for this, but it isn't
401  * going to be /that/ slow, and won't get called much
402  */
404 
405  /* This should only be possible if regions are not operating on this server. */
406  if (!r)
407  return;
408 
413 }
414 
421 void current_map_info(object *op) {
422  mapstruct *m = op->map;
423 
424  if (!m)
425  return;
426 
428  "%s (%s) in %s",
429  "%s (%s) in %s",
431 
432  if (QUERY_FLAG(op, FLAG_WIZ)) {
436  m->players, m->difficulty,
437  MAP_WIDTH(m), MAP_HEIGHT(m),
438  MAP_ENTER_X(m), MAP_ENTER_Y(m),
439  MAP_TIMEOUT(m));
440 
441  }
442  if (m->msg)
444 }
445 
446 #ifdef DEBUG_MALLOC_LEVEL
447 
456 int command_malloc_verify(object *op, char *parms) {
457  extern int malloc_verify(void);
458 
459  if (!malloc_verify())
462  else
465 
466  return 1;
467 }
468 #endif
469 
482 int command_whereabouts(object *op, char *params) {
483  region *reg;
484  player *pl;
485 
486  /*
487  * reset the counter on the region, then use it to store the number of
488  * players there.
489  * I don't know how thread-safe this would be, I suspect not very....
490  */
491  for (reg = first_region; reg != NULL; reg = reg->next) {
492  reg->counter = 0;
493  }
494  for (pl = first_player; pl != NULL; pl = pl->next)
495  if (pl->ob->map != NULL)
496  get_region_by_map(pl->ob->map)->counter++;
497 
498  /* we only want to print out by places with a 'longname' field...*/
499  for (reg = first_region; reg != NULL; reg = reg->next) {
500  if (reg->longname == NULL && reg->counter > 0) {
501  if (reg->parent != NULL) {
502  reg->parent->counter += reg->counter;
503  reg->counter = 0;
504  } else /*uh oh, we shouldn't be here. */
505  LOG(llevError, "command_whereabouts() Region %s with no longname has no parent\n", reg->name);
506  }
507  }
510 
511  for (reg = first_region; reg != NULL; reg = reg->next)
512  if (reg->counter > 0) {
516  reg->counter, get_region_longname(reg));
517  }
518  return 1;
519 }
520 
522 typedef struct {
523  char namebuf[MAX_BUF];
525 } chars_names;
526 
536 static int name_cmp(const chars_names *c1, const chars_names *c2) {
537  return strcasecmp(c1->namebuf, c2->namebuf);
538 }
539 
550 void list_players(object *op, region *reg, partylist *party) {
551  player *pl;
552  uint16 i;
553  char *format;
554  int num_players = 0, num_wiz = 0, num_afk = 0, num_bot = 0;
555  chars_names *chars = NULL;
556 
557  if (op == NULL || QUERY_FLAG(op, FLAG_WIZ))
558  format = settings.who_wiz_format;
559  else
560  format = settings.who_format;
561 
562  for (pl = first_player; pl != NULL; pl = pl->next) {
563  if (pl->ob->map == NULL)
564  continue;
565  if (pl->hidden && !QUERY_FLAG(op, FLAG_WIZ))
566  continue;
567 
568  if (reg && !region_is_child_of_region(get_region_by_map(pl->ob->map), reg))
569  continue;
570  if (party && pl->party != party)
571  continue;
572 
573  if (pl->state == ST_PLAYING || pl->state == ST_GET_PARTY_PASSWORD) {
574 
575  num_players++;
576  chars = (chars_names *)realloc(chars, num_players*sizeof(chars_names));
577  if (chars == NULL) {
580  return;
581  }
582  sprintf(chars[num_players-1].namebuf, "%s", pl->ob->name);
583  chars[num_players-1].login_order = num_players;
584 
585  /* Check for WIZ's & AFK's*/
586  if (QUERY_FLAG(pl->ob, FLAG_WIZ))
587  num_wiz++;
588 
589  if (QUERY_FLAG(pl->ob, FLAG_AFK))
590  num_afk++;
591 
592  if (pl->socket.is_bot)
593  num_bot++;
594  }
595  }
596  if (first_player != (player *)NULL) {
597  if (reg == NULL && party == NULL)
601  num_players, num_wiz, num_afk, num_bot);
602  else if (party == NULL)
606  reg->longname ? reg->longname : reg->name, num_players, num_wiz, num_afk, num_bot);
607  else
611  party->partyname, num_players, num_wiz, num_afk, num_bot);
612  }
613  qsort(chars, num_players, sizeof(chars_names), (int (*)(const void *, const void *))name_cmp);
614  for (i = 0; i < num_players; i++)
615  display_who_entry(op, find_player(chars[i].namebuf), format);
616  free(chars);
617 }
618 
629 int command_who(object *op, char *params) {
630  region *reg;
631 
632  reg = get_region_from_string(params);
633  list_players(op, reg, NULL);
634 
635  return 1;
636 }
637 
648 void display_who_entry(object *op, player *pl, const char *format) {
649  char tmpbuf[MAX_BUF];
650  char outbuf[MAX_BUF], outbuf1[MAX_BUF];
651  size_t i;
652 
653  strcpy(outbuf, "[fixed]");
654  outbuf1[0] = '\0';
655 
656  if (pl == NULL) {
657  LOG(llevError, "display_who_entry(): I was passed a null player\n");
658  return;
659  }
660  for (i = 0; i <= strlen(format); i++) {
661  if (format[i] == '%') {
662  i++;
663  get_who_escape_code_value(tmpbuf, sizeof(tmpbuf), format[i], pl);
664  strcat(outbuf, tmpbuf);
665  strcat(outbuf1, tmpbuf);
666  } else if (format[i] == '_') {
667  strcat(outbuf, " "); /* allow '_' to be used in place of spaces */
668  strcat(outbuf1, " "); /* allow '_' to be used in place of spaces */
669  } else {
670  snprintf(tmpbuf, sizeof(tmpbuf), "%c", format[i]);
671  strcat(outbuf, tmpbuf);
672  strcat(outbuf1, tmpbuf);
673  }
674  }
676 }
677 
709 void get_who_escape_code_value(char *return_val, int size, const char letter, player *pl) {
710 
711  switch (letter) {
712  case 'N':
713  snprintf(return_val, size, "%s", pl->ob->name);
714  break;
715 
716  case 't':
717  snprintf(return_val, size, "%s", (pl->own_title[0] == '\0' ? pl->title : pl->own_title));
718  break;
719 
720  case 'T':
721  if (pl->own_title[0] == '\0')
722  snprintf(return_val, size, "the ");
723  else
724  *return_val = '\0';
725  break;
726 
727  case 'c':
728  snprintf(return_val, size, "%u", pl->ob->count);
729  break;
730 
731  case 'n':
732  snprintf(return_val, size, "\n");
733  break;
734 
735  case 'h':
736  snprintf(return_val, size, "%s", pl->peaceful ? "" : " <Hostile>");
737  break;
738 
739  case 'l':
740  snprintf(return_val, size, "%d", pl->ob->level);
741  break;
742 
743  case 'd':
744  snprintf(return_val, size, "%s", (QUERY_FLAG(pl->ob, FLAG_WIZ) ? " <WIZ>" : ""));
745  break;
746 
747  case 'a':
748  snprintf(return_val, size, "%s", (QUERY_FLAG(pl->ob, FLAG_AFK) ? " <AFK>" : ""));
749  break;
750 
751  case 'b':
752  snprintf(return_val, size, "%s", (pl->socket.is_bot == 1) ? " <BOT>" : "");
753  break;
754 
755  case 'm':
756  snprintf(return_val, size, "%s", pl->ob->map->path);
757  break;
758 
759  case 'M':
760  snprintf(return_val, size, "%s", pl->ob->map->name ? pl->ob->map->name : "Untitled");
761  break;
762 
763  case 'r':
764  snprintf(return_val, size, "%s", get_name_of_region_for_map(pl->ob->map));
765  break;
766 
767  case 'R':
768  snprintf(return_val, size, "%s", get_region_longname(get_region_by_map(pl->ob->map)));
769  break;
770 
771  case 'i':
772  snprintf(return_val, size, "%s", pl->socket.host);
773  break;
774 
775  case '%':
776  snprintf(return_val, size, "%%");
777  break;
778 
779  case '_':
780  snprintf(return_val, size, "_");
781  break;
782  }
783 }
784 
795 int command_afk(object *op, char *params) {
796  if QUERY_FLAG(op, FLAG_AFK) {
797  CLEAR_FLAG(op, FLAG_AFK);
800  } else {
801  SET_FLAG(op, FLAG_AFK);
804  }
805  return 1;
806 }
807 
818 int command_malloc(object *op, char *params) {
819  malloc_info(op);
820  return 1;
821 }
822 
833 int command_mapinfo(object *op, char *params) {
834  current_map_info(op);
835  return 1;
836 }
837 
848 int command_whereami(object *op, char *params) {
850  return 1;
851 }
852 
861 int command_maps(object *op, char *params) {
862  map_info(op, params);
863  return 1;
864 }
865 
876 int command_strings(object *op, char *params) {
877  char stats[HUGE_BUF];
878 
879  ss_dump_statistics(stats, sizeof(stats));
881  "[fixed]%s\n",
882  "%s",
883  stats);
884 
886  ss_dump_table(SS_DUMP_TOTALS, stats, sizeof(stats)), NULL);
887  return 1;
888 }
889 
900 int command_time(object *op, char *params) {
901  time_info(op);
902  return 1;
903 }
904 
915 int command_archs(object *op, char *params) {
916  arch_info(op);
917  return 1;
918 }
919 
930 int command_hiscore(object *op, char *params) {
931  display_high_score(op, op == NULL ? 9999 : 50, params);
932  return 1;
933 }
934 
945 int command_debug(object *op, char *params) {
946  int i;
947 
948  if (params == NULL || !sscanf(params, "%d", &i)) {
952  settings.debug);
953  return 1;
954  }
955  if (op != NULL && !QUERY_FLAG(op, FLAG_WIZ)) {
958  return 1;
959  }
960  settings.debug = (enum LogLevel)FABS(i);
964  i);
965  return 1;
966 }
967 
968 
979 int command_dumpbelow(object *op, char *params) {
980  if (op && op->below) {
981  StringBuffer *sb;
982  char *diff;
983 
984  sb = stringbuffer_new();
985  dump_object(op->below, sb);
986  diff = stringbuffer_finish(sb);
988  free(diff);
989 
990  /* Let's push that item on the dm's stack */
991  dm_stack_push(op->contr, op->below->count);
992  }
993  return 0;
994 }
995 
1006 int command_wizpass(object *op, char *params) {
1007  int i;
1008 
1009  if (!op)
1010  return 0;
1011 
1012  if (!params)
1013  i = (QUERY_FLAG(op, FLAG_WIZPASS)) ? 0 : 1;
1014  else
1015  i = onoff_value(params);
1016 
1017  if (i) {
1020  SET_FLAG(op, FLAG_WIZPASS);
1021  } else {
1024  CLEAR_FLAG(op, FLAG_WIZPASS);
1025  }
1026  return 0;
1027 }
1028 
1039 int command_wizcast(object *op, char *params) {
1040  int i;
1041 
1042  if (!op)
1043  return 0;
1044 
1045  if (!params)
1046  i = (QUERY_FLAG(op, FLAG_WIZCAST)) ? 0 : 1;
1047  else
1048  i = onoff_value(params);
1049 
1050  if (i) {
1053  SET_FLAG(op, FLAG_WIZCAST);
1054  } else {
1057  CLEAR_FLAG(op, FLAG_WIZCAST);
1058  }
1059  return 0;
1060 }
1061 
1072 int command_dumpallobjects(object *op, char *params) {
1073  dump_all_objects();
1074  return 0;
1075 }
1076 
1087 int command_dumpfriendlyobjects(object *op, char *params) {
1089  return 0;
1090 }
1091 
1102 int command_dumpallarchetypes(object *op, char *params) {
1104  return 0;
1105 }
1106 
1117 int command_ssdumptable(object *op, char *params) {
1118  ss_dump_table(SS_DUMP_TABLE, NULL, 0);
1119  return 0;
1120 }
1121 
1132 int command_dumpmap(object *op, char *params) {
1133  if (op)
1134  dump_map(op->map);
1135  return 0;
1136 }
1137 
1148 int command_dumpallmaps(object *op, char *params) {
1149  dump_all_maps();
1150  return 0;
1151 }
1152 
1163 int command_printlos(object *op, char *params) {
1164  if (op)
1165  print_los(op);
1166  return 0;
1167 }
1168 
1169 
1180 int command_version(object *op, char *params) {
1181  version(op);
1182  return 0;
1183 }
1184 
1185 
1196 int command_output_sync(object *op, char *params) {
1197  int val;
1198 
1199  if (!params) {
1203  op->contr->outputs_sync);
1204  return 1;
1205  }
1206  val = atoi(params);
1207  if (val > 0) {
1208  op->contr->outputs_sync = val;
1212  op->contr->outputs_sync);
1213  } else
1216 
1217  return 1;
1218 }
1219 
1230 int command_output_count(object *op, char *params) {
1231  int val;
1232 
1233  if (!params) {
1237  op->contr->outputs_count);
1238  return 1;
1239  }
1240  val = atoi(params);
1241  if (val > 0) {
1242  op->contr->outputs_count = val;
1246  op->contr->outputs_count);
1247  } else
1250 
1251  return 1;
1252 }
1253 
1264 int command_listen(object *op, char *params) {
1265  int i;
1266 
1267  if (params == NULL || !sscanf(params, "%d", &i)) {
1271  op->contr->listening);
1272  return 1;
1273  }
1274  if (i < 0) {
1277  return 1;
1278  }
1279  op->contr->listening = (char)i;
1283  i);
1284  return 1;
1285 }
1286 
1300 int command_statistics(object *pl, char *params) {
1301  char buf[MAX_BUF];
1302  char buf2[MAX_BUF];
1303 
1304  if (!pl->contr)
1305  return 1;
1306  strcpy(buf, i18n_translate(get_language(pl), I18N_MSG_CMISC_108));
1307  strcpy(buf2, i18n_translate(get_language(pl), I18N_MSG_CMISC_109));
1308  strcat(buf, FMT64);
1309  strcat(buf2, FMT64);
1311  buf,
1312  buf2,
1313  pl->stats.exp);
1314  strcpy(buf, i18n_translate(get_language(pl), I18N_MSG_CMISC_110));
1315  strcpy(buf2, i18n_translate(get_language(pl), I18N_MSG_CMISC_111));
1316  strcat(buf, FMT64);
1317  strcat(buf2, FMT64);
1319  buf,
1320  buf2,
1321  level_exp(pl->level+1, pl->expmul));
1322 
1326 
1330  pl->contr->orig_stats.Str, pl->stats.Str, 20+pl->arch->clone.stats.Str);
1334  pl->contr->orig_stats.Dex, pl->stats.Dex, 20+pl->arch->clone.stats.Dex);
1338  pl->contr->orig_stats.Con, pl->stats.Con, 20+pl->arch->clone.stats.Con);
1342  pl->contr->orig_stats.Int, pl->stats.Int, 20+pl->arch->clone.stats.Int);
1346  pl->contr->orig_stats.Wis, pl->stats.Wis, 20+pl->arch->clone.stats.Wis);
1350  pl->contr->orig_stats.Pow, pl->stats.Pow, 20+pl->arch->clone.stats.Pow);
1354  pl->contr->orig_stats.Cha, pl->stats.Cha, 20+pl->arch->clone.stats.Cha);
1358  pl->contr->peaceful ? "Peaceful" : "Hostile");
1359 
1360  /* Can't think of anything else to print right now */
1361  return 0;
1362 }
1363 
1374 int command_fix_me(object *op, char *params) {
1375  sum_weight(op);
1376  fix_object(op);
1377  return 1;
1378 }
1379 
1390 int command_players(object *op, char *params) {
1391  char buf[MAX_BUF];
1392  char *t;
1393  DIR *Dir;
1394 
1395  snprintf(buf, sizeof(buf), "%s/%s/", settings.localdir, settings.playerdir);
1396  t = buf+strlen(buf);
1397  if ((Dir = opendir(buf)) != NULL) {
1398  const struct dirent *Entry;
1399 
1400  while ((Entry = readdir(Dir)) != NULL) {
1401  /* skip '.' , '..' */
1402  if (!((Entry->d_name[0] == '.' && Entry->d_name[1] == '\0')
1403  || (Entry->d_name[0] == '.' && Entry->d_name[1] == '.' && Entry->d_name[2] == '\0'))) {
1404  struct stat Stat;
1405 
1406  strcpy(t, Entry->d_name);
1407  if (stat(buf, &Stat) == 0) {
1408  /* This was not posix compatible
1409  * if ((Stat.st_mode & S_IFMT)==S_IFDIR) {
1410  */
1411  if (S_ISDIR(Stat.st_mode)) {
1412  struct tm *tm = localtime(&Stat.st_mtime);
1413 
1417  Entry->d_name,
1418  1900+tm->tm_year,
1419  1+tm->tm_mon,
1420  tm->tm_mday,
1421  tm->tm_hour,
1422  tm->tm_min,
1423  tm->tm_sec);
1424  }
1425  }
1426  }
1427  }
1428  }
1429  closedir(Dir);
1430  return 0;
1431 }
1432 
1443 int command_applymode(object *op, char *params) {
1444  unapplymode unapply = op->contr->unapply;
1445  static const char *const types[] = {
1446  "nochoice",
1447  "never",
1448  "always"
1449  };
1450 
1451  if (!params) {
1455  types[op->contr->unapply]);
1456  return 1;
1457  }
1458 
1459  if (!strcmp(params, "nochoice"))
1461  else if (!strcmp(params, "never"))
1462  op->contr->unapply = unapply_never;
1463  else if (!strcmp(params, "always"))
1464  op->contr->unapply = unapply_always;
1465  else {
1469  params);
1470  return 0;
1471  }
1475  (unapply == op->contr->unapply ? "" : " now"),
1476  types[op->contr->unapply]);
1477 
1478  return 1;
1479 }
1480 
1491 int command_bowmode(object *op, char *params) {
1492  bowtype_t oldtype = op->contr->bowtype;
1493  static const char *const types[] = {
1494  "normal",
1495  "threewide",
1496  "spreadshot",
1497  "firenorth",
1498  "firene",
1499  "fireeast",
1500  "firese",
1501  "firesouth",
1502  "firesw",
1503  "firewest",
1504  "firenw",
1505  "bestarrow"
1506  };
1507  char buf[MAX_BUF];
1508  int i, found;
1509 
1510  if (!params) {
1514  types[op->contr->bowtype]);
1515  return 1;
1516  }
1517 
1518  for (i = 0, found = 0; i <= bow_bestarrow; i++) {
1519  if (!strcmp(params, types[i])) {
1520  found++;
1521  op->contr->bowtype = i;
1522  break;
1523  }
1524  }
1525  if (!found) {
1526  snprintf(buf, sizeof(buf), "bowmode: Unknown options %s, valid options are:", params);
1527  for (i = 0; i <= bow_bestarrow; i++) {
1528  strcat(buf, " ");
1529  strcat(buf, types[i]);
1530  if (i < bow_nw)
1531  strcat(buf, ",");
1532  else
1533  strcat(buf, ".");
1534  }
1536  return 0;
1537  }
1541  (oldtype == op->contr->bowtype ? "" : "now"),
1542  types[op->contr->bowtype]);
1543  return 1;
1544 }
1545 
1556 int command_petmode(object *op, char *params) {
1557  petmode_t oldtype = op->contr->petmode;
1558  static const char *const types[] = {
1559  "normal",
1560  "sad",
1561  "defend",
1562  "arena"
1563  };
1564 
1565  if (!params) {
1569  types[op->contr->petmode]);
1570  return 1;
1571  }
1572 
1573  if (!strcmp(params, "normal"))
1574  op->contr->petmode = pet_normal;
1575  else if (!strcmp(params, "sad"))
1576  op->contr->petmode = pet_sad;
1577  else if (!strcmp(params, "defend"))
1578  op->contr->petmode = pet_defend;
1579  else if (!strcmp(params, "arena"))
1580  op->contr->petmode = pet_arena;
1581  else {
1585  params);
1586  return 0;
1587  }
1591  (oldtype == op->contr->petmode ? "" : "now"),
1592  types[op->contr->petmode]);
1593  return 1;
1594 }
1595 
1606 int command_showpets(object *op, char *params) {
1607  objectlink *obl, *next;
1608  int counter = 0, target = 0;
1609  int have_shown_pet = 0;
1610  if (params != NULL)
1611  target = atoi(params);
1612 
1613  for (obl = first_friendly_object; obl != NULL; obl = next) {
1614  object *ob = obl->ob;
1615 
1616  next = obl->next;
1617  if (get_owner(ob) == op) {
1618  if (target == 0) {
1619  if (counter == 0)
1625  ++counter, ob->name, ob->level);
1626  } else if (!have_shown_pet && ++counter == target) {
1630  ob->level, ob->name);
1634  ob->stats.hp, ob->stats.maxhp, ob->stats.sp, ob->stats.maxsp);
1635 
1636  /* this is not a nice way to do this, it should be made to be more like the statistics command */
1640  ob->stats.Str);
1644  ob->stats.Dex);
1648  ob->stats.Con);
1652  ob->stats.Int);
1656  ob->stats.Wis);
1660  ob->stats.Cha);
1664  ob->stats.Pow);
1668  ob->stats.wc, ob->stats.dam, ob->stats.ac);
1669  have_shown_pet = 1;
1670  }
1671  }
1672  }
1673  if (counter == 0)
1676  else if (target != 0 && have_shown_pet == 0)
1679  return 0;
1680 }
1681 
1692 int command_usekeys(object *op, char *params) {
1693  usekeytype oldtype = op->contr->usekeys;
1694  static const char *const types[] = {
1695  "inventory",
1696  "keyrings",
1697  "containers"
1698  };
1699 
1700  if (!params) {
1704  types[op->contr->usekeys]);
1705  return 1;
1706  }
1707 
1708  if (!strcmp(params, "inventory"))
1709  op->contr->usekeys = key_inventory;
1710  else if (!strcmp(params, "keyrings"))
1711  op->contr->usekeys = keyrings;
1712  else if (!strcmp(params, "containers"))
1713  op->contr->usekeys = containers;
1714  else {
1718  params);
1719  return 0;
1720  }
1724  (oldtype == op->contr->usekeys ? "" : "now"),
1725  types[op->contr->usekeys]);
1726 
1727  return 1;
1728 }
1729 
1740 int command_resistances(object *op, char *params) {
1741  int i;
1742  if (!op)
1743  return 0;
1744 
1745  for (i = 0; i < NROFATTACKS; i++) {
1746  if (i == ATNR_INTERNAL)
1747  continue;
1748 
1752  attacktype_desc[i], op->resist[i]);
1753  }
1754 
1755  /* If dragon player, let's display natural resistances */
1756  if (is_dragon_pl(op)) {
1757  int attack;
1758  object *tmp;
1759 
1760  for (tmp = op->inv; tmp != NULL; tmp = tmp->below) {
1761  if ((tmp->type == FORCE) && (strcmp(tmp->arch->name, "dragon_skin_force") == 0)) {
1764 
1765  for (attack = 0; attack < NROFATTACKS; attack++) {
1766  if (atnr_is_dragon_enabled(attack)) {
1770  change_resist_msg[attack], tmp->resist[attack]);
1771  }
1772  }
1773  break;
1774  }
1775  }
1776  }
1777 
1778  return 0;
1779 }
1780 
1791 static void help_topics(object *op, int what) {
1792  DIR *dirp;
1793  struct dirent *de;
1794  char filename[MAX_BUF], line[HUGE_BUF];
1795  char suffix[MAX_BUF];
1796  int namelen;
1797  const char *language;
1798 
1799  language = language_codes[get_language(op)];
1800  snprintf(suffix, sizeof(suffix), ".%s", language);
1801 
1802  switch (what) {
1803  case 1:
1804  snprintf(filename, sizeof(filename), "%s/wizhelp", settings.datadir);
1807  break;
1808 
1809  case 3:
1810  snprintf(filename, sizeof(filename), "%s/mischelp", settings.datadir);
1813  break;
1814 
1815  default:
1816  snprintf(filename, sizeof(filename), "%s/help", settings.datadir);
1819  break;
1820  }
1821  if (!(dirp = opendir(filename)))
1822  return;
1823 
1824  line[0] = '\0';
1825  for (de = readdir(dirp); de; de = readdir(dirp)) {
1826  namelen = NAMLEN(de);
1827 
1828  if (namelen <= 2
1829  && *de->d_name == '.'
1830  && (namelen == 1 || de->d_name[1] == '.'))
1831  continue;
1832  if (strstr(de->d_name, suffix)) {
1833  strcat(line, strtok(de->d_name, "."));
1834  strcat(line, " ");
1835  }
1836  }
1838  line, line);
1839  closedir(dirp);
1840 }
1841 
1852 static void show_commands(object *op, int what) {
1853  char line[HUGE_BUF];
1854  int i, size, namelen;
1856 
1857  switch (what) {
1858  case 1:
1859  ap = WizCommands;
1860  size = WizCommandsSize;
1863  break;
1864 
1865  case 2:
1866  ap = CommunicationCommands;
1867  size = CommunicationCommandSize;
1870  break;
1871 
1872  default:
1873  ap = Commands;
1874  size = CommandsSize;
1877  break;
1878  }
1879 
1880  line[0] = '\0';
1881  for (i = 0; i < size; i++) {
1882  namelen = strlen(ap[i].name);
1883 
1884  strcat(line, ap[i].name);
1885  strcat(line, " ");
1886  }
1888 }
1889 
1900 int command_help(object *op, char *params) {
1901  struct stat st;
1902  FILE *fp;
1903  char filename[MAX_BUF], line[MAX_BUF];
1904  int len;
1905  const char *language;
1906 
1907  language = language_codes[get_language(op)];
1908 
1909  /*
1910  * Main help page?
1911  */
1912  if (!params) {
1913  snprintf(filename, sizeof(filename), "%s/def_help", settings.datadir);
1914  if ((fp = fopen(filename, "r")) == NULL) {
1915  LOG(llevError, "Cannot open help file %s: %s\n", filename, strerror_local(errno, line, sizeof(line)));
1916  return 0;
1917  }
1918  while (fgets(line, MAX_BUF, fp)) {
1919  line[MAX_BUF-1] = '\0';
1920  len = strlen(line)-1;
1921  if (line[len] == '\n')
1922  line[len] = '\0';
1924  }
1925  fclose(fp);
1926  return 0;
1927  }
1928 
1929  /*
1930  * Topics list
1931  */
1932  if (!strcmp(params, "topics")) {
1933  help_topics(op, 3);
1934  help_topics(op, 0);
1935  if (QUERY_FLAG(op, FLAG_WIZ))
1936  help_topics(op, 1);
1937  return 0;
1938  }
1939 
1940  /*
1941  * Commands list
1942  */
1943  if (!strcmp(params, "commands")) {
1944  show_commands(op, 0);
1946  show_commands(op, 2); /* show comm commands */
1947  if (QUERY_FLAG(op, FLAG_WIZ)) {
1949  show_commands(op, 1);
1950  }
1951  return 0;
1952  }
1953 
1954  /*
1955  * User wants info about command
1956  */
1957  if (strchr(params, '.') || strchr(params, ' ') || strchr(params, '/')) {
1961  params);
1962  return 0;
1963  }
1964 
1965  snprintf(filename, sizeof(filename), "%s/mischelp/%s.%s", settings.datadir, params, language);
1966  if (stat(filename, &st) || !S_ISREG(st.st_mode)) {
1967  if (op) {
1968  snprintf(filename, sizeof(filename), "%s/help/%s.%s", settings.datadir, params, language);
1969  if (stat(filename, &st) || !S_ISREG(st.st_mode)) {
1970  if (QUERY_FLAG(op, FLAG_WIZ)) {
1971  snprintf(filename, sizeof(filename), "%s/wizhelp/%s.%s", settings.datadir, params, language);
1972  if (stat(filename, &st) || !S_ISREG(st.st_mode))
1973  goto nohelp;
1974  } else
1975  goto nohelp;
1976  }
1977  }
1978  }
1979 
1980  /*
1981  * Found that. Just cat it to screen.
1982  */
1983  if ((fp = fopen(filename, "r")) == NULL) {
1984  LOG(llevError, "Cannot open help file %s: %s\n", filename, strerror_local(errno, line, sizeof(line)));
1985  return 0;
1986  }
1987 
1991  params);
1992 
1993  while (fgets(line, MAX_BUF, fp)) {
1994  line[MAX_BUF-1] = '\0';
1995  len = strlen(line)-1;
1996  if (line[len] == '\n')
1997  line[len] = '\0';
1999  }
2000  fclose(fp);
2001  return 0;
2002 
2003  /*
2004  * No_help -escape
2005  */
2006 
2007 nohelp:
2011  params);
2012 
2013  return 0;
2014 }
2015 
2026 int onoff_value(const char *line) {
2027  int i;
2028 
2029  if (sscanf(line, "%d", &i))
2030  return (i != 0);
2031 
2032  switch (line[0]) {
2033  case 'o':
2034  switch (line[1]) {
2035  case 'n':
2036  return 1; /* on */
2037  default:
2038  return 0; /* o[ff] */
2039  }
2040 
2041  case 'y': /* y[es] */
2042  case 'k': /* k[ylla] */
2043  case 's':
2044  case 'd':
2045  return 1;
2046 
2047  case 'n': /* n[o] */
2048  case 'e': /* e[i] */
2049  case 'u':
2050  default:
2051  return 0;
2052  }
2053 }
2054 
2065 int command_quit(object *op, char *params) {
2068 
2069  op->contr->state = ST_CONFIRM_QUIT;
2070  return 1;
2071 }
2072 
2086 int command_explore(object *op, char *params) {
2087  if (settings.explore_mode == FALSE) {
2090  return 1;
2091  }
2092  /*
2093  * I guess this is the best way to see if we are solo or not. Actually,
2094  * are there any cases when first_player->next==NULL and we are not solo?
2095  */
2096  if ((first_player != op->contr) || (first_player->next != NULL)) {
2099  } else if (op->contr->explore)
2102  else {
2103  op->contr->explore = 1;
2106  }
2107  return 1;
2108 }
2109 
2120 int command_sound(object *op, char *params) {
2121  if (!(op->contr->socket.sound&SND_MUTE)) {
2122  op->contr->socket.sound = op->contr->socket.sound|SND_MUTE;
2125  } else {
2126  op->contr->socket.sound = op->contr->socket.sound&~SND_MUTE;
2129  }
2130  return 1;
2131 }
2132 
2142 void receive_player_name(object *op) {
2143  if (!check_name(op->contr, op->contr->write_buf+1)) {
2144  get_name(op);
2145  return;
2146  }
2147  FREE_AND_COPY(op->name, op->contr->write_buf+1);
2148  FREE_AND_COPY(op->name_pl, op->contr->write_buf+1);
2150  op->contr->name_changed = 1;
2151  get_password(op);
2152 }
2153 
2160 void receive_player_password(object *op) {
2161  unsigned int pwd_len = strlen(op->contr->write_buf);
2162 
2163  if (pwd_len <= 1 || pwd_len > 17) {
2164  if (op->contr->state == ST_CHANGE_PASSWORD_OLD
2166  || op->contr->state == ST_CHANGE_PASSWORD_CONFIRM) {
2169  op->contr->state = ST_PLAYING;
2170  } else
2171  get_name(op);
2172  return;
2173  }
2174  /* To hide the password better */
2175  /* With currently clients, not sure if this is really the case - MSW */
2177 
2178  if (checkbanned(op->name, op->contr->socket.host)) {
2179  LOG(llevInfo, "Banned player tried to add: [%s@%s]\n", op->name, op->contr->socket.host);
2182  get_name(op);
2183  return;
2184  }
2185 
2186  if (op->contr->state == ST_CONFIRM_PASSWORD) {
2187  if (!check_password(op->contr->write_buf+1, op->contr->password)) {
2190  get_name(op);
2191  return;
2192  }
2193  LOG(llevInfo, "LOGIN: New player named %s from ip %s\n", op->name, op->contr->socket.host);
2194  display_motd(op);
2197  roll_again(op);
2198  op->contr->state = ST_ROLL_STAT;
2199  return;
2200  }
2201 
2202  if (op->contr->state == ST_CHANGE_PASSWORD_OLD) {
2203  if (!check_password(op->contr->write_buf+1, op->contr->password)) {
2206  op->contr->state = ST_PLAYING;
2207  } else {
2210  }
2211  return;
2212  }
2213 
2214  if (op->contr->state == ST_CHANGE_PASSWORD_NEW) {
2215  strcpy(op->contr->new_password, crypt_string(op->contr->write_buf+1, NULL));
2218  return;
2219  }
2220 
2221  if (op->contr->state == ST_CHANGE_PASSWORD_CONFIRM) {
2222  if (strcmp(crypt_string(op->contr->write_buf+1, op->contr->new_password), op->contr->new_password)) {
2225  } else {
2228  strncpy(op->contr->password, op->contr->new_password, 13);
2229  }
2230  op->contr->state = ST_PLAYING;
2231  return;
2232  }
2233 
2234  strcpy(op->contr->password, crypt_string(op->contr->write_buf+1, NULL));
2235  op->contr->state = ST_ROLL_STAT;
2236  check_login(op);
2237  return;
2238 }
2239 
2250 int command_title(object *op, char *params) {
2251  char buf[MAX_BUF];
2252 
2253  if (settings.set_title == FALSE) {
2256  return 1;
2257  }
2258 
2259  /* dragon players cannot change titles */
2260  if (is_dragon_pl(op)) {
2263  return 1;
2264  }
2265 
2266  if (params == NULL) {
2267  if (op->contr->own_title[0] == '\0')
2268  snprintf(buf, sizeof(buf), i18n_translate(get_language(op), I18N_MSG_CMISC_199), op->contr->title);
2269  else
2270  snprintf(buf, sizeof(buf), i18n_translate(get_language(op), I18N_MSG_CMISC_200), op->contr->own_title);
2272  return 1;
2273  }
2274  if (strcmp(params, "clear") == 0 || strcmp(params, "default") == 0) {
2275  if (op->contr->own_title[0] == '\0')
2278  else
2281  op->contr->own_title[0] = '\0';
2282  return 1;
2283  }
2284 
2285  if ((int)strlen(params) >= MAX_NAME) {
2288  return 1;
2289  }
2290  strcpy(op->contr->own_title, params);
2292  return 1;
2293 }
2294 
2305 int command_save(object *op, char *params) {
2306  if (get_map_flags(op->map, NULL, op->x, op->y, NULL, NULL)&P_NO_CLERIC) {
2309  } else if (!op->stats.exp) {
2312  } else {
2313  if (save_player(op, 1))
2316  else
2319  }
2320  return 1;
2321 }
2322 
2333 int command_peaceful(object *op, char *params) {
2334  if ((op->contr->peaceful = !op->contr->peaceful))
2337  else
2340  return 1;
2341 }
2342 
2353 int command_wimpy(object *op, char *params) {
2354  int i;
2355 
2356  if (params == NULL || !sscanf(params, "%d", &i)) {
2360  op->run_away);
2361  return 1;
2362  }
2363 
2367  i);
2368  op->run_away = i;
2369  return 1;
2370 }
2371 
2382 int command_brace(object *op, char *params) {
2383  if (!params)
2384  op->contr->braced = !op->contr->braced;
2385  else
2386  op->contr->braced = onoff_value(params);
2387 
2388  if (op->contr->braced)
2391  else
2394 
2395  fix_object(op);
2396 
2397  return 0;
2398 }
2399 
2410 int command_kill_pets(object *op, char *params) {
2411  objectlink *obl, *next;
2412  int counter = 0, removecount = 0;
2413 
2414  if (params == NULL) {
2415  terminate_all_pets(op);
2418  } else {
2419  int target = atoi(params);
2420  for (obl = first_friendly_object; obl != NULL; obl = next) {
2421  object *ob = obl->ob;
2422  next = obl->next;
2423  if (get_owner(ob) == op)
2424  if (++counter == target || (target == 0 && !strcasecmp(ob->name, params))) {
2425  if (!QUERY_FLAG(ob, FLAG_REMOVED))
2426  remove_ob(ob);
2428  free_object(ob);
2429  removecount++;
2430  }
2431  }
2432  if (removecount != 0)
2436  removecount);
2437  else
2440  }
2441  return 0;
2442 }
2443 
2454 int command_passwd(object *pl, char *params) {
2456 
2458  return 1;
2459 }
2460 
2472 int do_harvest(object *pl, int dir, object *skill) {
2473  sint16 x, y;
2474  int count = 0, proba; /* Probability to get the item, 100 based. */
2475  int level, exp;
2476  object *found[10]; /* Found items that can be harvested. */
2477  mapstruct *map;
2478  object *item, *inv;
2479  sstring trace, ttool, tspeed, race, tool, slevel, sexp;
2480  float speed;
2481 
2482  x = pl->x+freearr_x[dir];
2483  y = pl->y+freearr_y[dir];
2484  map = pl->map;
2485 
2486  if (!pl->type == PLAYER)
2487  return 0;
2488 
2489  if (!map)
2490  return 0;
2491 
2492  if (get_map_flags(map, &map, x, y, &x, &y)&P_OUT_OF_MAP) {
2493  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You can't %s anything here.", NULL, skill->slaying);
2494  return 0;
2495  }
2496 
2497  if (!pl->chosen_skill || pl->chosen_skill->skill != skill->skill)
2498  return 0;
2499 
2500  trace = get_ob_key_value(pl->chosen_skill, "harvest_race");
2501  ttool = get_ob_key_value(pl->chosen_skill, "harvest_tool");
2502  tspeed = get_ob_key_value(pl->chosen_skill, "harvest_speed");
2503  if (!trace || strcmp(trace, "") == 0 || !ttool || strcmp(ttool, "") == 0 || !tspeed || strcmp(tspeed, "") == 0) {
2504  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You can't %s anything here.", NULL, skill->slaying);
2505  LOG(llevError, "do_harvest: tool %s without harvest_[race|tool|speed]\n", pl->chosen_skill->name);
2506  return 0;
2507  }
2508 
2509  item = GET_MAP_OB(map, x, y);
2510  while (item && count < 10) {
2511  for (inv = item->inv; inv; inv = inv->below) {
2512  if (get_ob_key_value(inv, "harvestable") == NULL)
2513  continue;
2514  race = get_ob_key_value(inv, "harvest_race");
2515  tool = get_ob_key_value(inv, "harvest_tool");
2516  slevel = get_ob_key_value(inv, "harvest_level");
2517  sexp = get_ob_key_value(inv, "harvest_exp");
2518  if (race && (!slevel || !sexp)) {
2519  LOG(llevError, "do_harvest: item %s without harvest_[level|exp]\n", inv->name);
2520  continue;
2521  }
2522  if (race == trace && (!tool || tool == ttool))
2523  found[count++] = inv;
2524  }
2525  item = item->above;
2526  }
2527  if (count == 0) {
2528  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You can't %s anything here.", NULL, skill->slaying);
2529  return 0;
2530  }
2531 
2532  inv = found[rndm(0, count-1)];
2533  assert(inv);
2534 
2535  slevel = get_ob_key_value(inv, "harvest_level");
2536  sexp = get_ob_key_value(inv, "harvest_exp");
2537  level = atoi(slevel);
2538  exp = atoi(sexp);
2539 
2540  speed = atof(tspeed);
2541  if (speed < 0)
2542  speed = -speed*pl->speed;
2543  pl->speed_left -= speed;
2544 
2545 
2546  /* Now we found something to harvest, randomly try to get it. */
2547  if (level > skill->level+10) {
2548  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You fail to %s anything.", NULL, skill->slaying);
2549  return 0;
2550  }
2551 
2552  if (level >= skill->level)
2553  /* Up to 10 more levels, 1 to 11 percent probability. */
2554  proba = 10+skill->level-level;
2555  else if (skill->level <= level+10)
2556  proba = 10+(skill->level-level)*2;
2557  else
2558  proba = 30;
2559 
2560  if (proba <= random_roll(0, 100, pl, 1)) {
2561  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You fail to %s anything.", NULL, skill->slaying);
2562  return 0;
2563  }
2564 
2565  /* Ok, got it. */
2566  item = get_object();
2567  copy_object_with_inv(inv, item);
2568  set_ob_key_value(item, "harvestable", NULL, 0);
2569  if (QUERY_FLAG(item, FLAG_MONSTER)) {
2570  int spot = find_free_spot(item, pl->map, pl->x, pl->y, 0, SIZEOFFREE);
2571  if (spot == -1) {
2572  /* Better luck next time...*/
2573  remove_ob(item);
2574  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You fail to %s anything.", NULL, skill->slaying);
2575  return 0;
2576  }
2577  item->x = pl->x+freearr_x[spot];
2578  item->y = pl->y+freearr_y[spot];
2579  insert_ob_in_map(item, pl->map, NULL, 0);
2580  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You %s a %s!", NULL, skill->slaying, item->name);
2581  } else {
2582  item = insert_ob_in_ob(item, pl);
2583  draw_ext_info_format(NDI_WHITE, 0, pl, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, "You %s some %s", NULL, skill->slaying, item->name);
2584  }
2585 
2586  /* Get exp */
2587  change_exp(pl, exp, skill->name, SK_EXP_ADD_SKILL);
2588 
2589  return 0;
2590 }
int command_whereami(object *op, char *params)
Definition: c_misc.c:848
int command_petmode(object *op, char *params)
Definition: c_misc.c:1556
char path[HUGE_BUF]
Definition: map.h:384
#define I18N_MSG_CMISC_014
Definition: languages.h:53
#define I18N_MSG_CMISC_124
Definition: languages.h:163
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny)
Definition: map.c:330
#define I18N_MSG_CMISC_148
Definition: languages.h:187
#define I18N_MSG_CMISC_160
Definition: languages.h:199
sint8 Int
Definition: living.h:78
#define I18N_MSG_CMISC_175
Definition: languages.h:214
#define NUM_BODY_LOCATIONS
Definition: object.h:41
int check_password(char *typed, char *crypted)
Definition: server.c:162
#define I18N_MSG_CMISC_017
Definition: languages.h:56
Definition: player.h:146
#define I18N_MSG_CMISC_006
Definition: languages.h:45
sint8 ac
Definition: living.h:79
#define I18N_MSG_CMISC_049
Definition: languages.h:88
#define ST_GET_PARTY_PASSWORD
Definition: define.h:894
void display_who_entry(object *op, player *pl, const char *format)
Definition: c_misc.c:648
int count_free(void)
Definition: object.c:1433
struct mapdef mapstruct
command_array_struct Commands[]
Definition: commands.c:49
#define FALSE
Definition: exp.c:42
const char * get_ob_key_value(const object *op, const char *const key)
Definition: object.c:3701
signed short sint16
Definition: global.h:72
#define I18N_MSG_CMISC_111
Definition: languages.h:150
const int WizCommandsSize
Definition: commands.c:272
Definition: player.h:76
void roll_again(object *op)
Definition: player.c:1006
void change_exp(object *op, sint64 exp, const char *skill_name, int flag)
Definition: living.c:2015
#define MSG_SUBTYPE_NONE
Definition: newclient.h:339
#define I18N_MSG_CMISC_163
Definition: languages.h:202
#define I18N_MSG_CMISC_034
Definition: languages.h:73
#define I18N_MSG_CMISC_121
Definition: languages.h:160
#define I18N_MSG_CMISC_029
Definition: languages.h:68
int check_name(player *me, const char *name)
Definition: login.c:173
#define I18N_MSG_CMISC_001
Definition: languages.h:40
Definition: object.h:298
int command_news(object *op, char *params)
Definition: c_misc.c:233
int command_applymode(object *op, char *params)
Definition: c_misc.c:1443
int count_active(void)
Definition: object.c:1465
#define I18N_MSG_CMISC_003
Definition: languages.h:42
#define I18N_MSG_CMISC_217
Definition: languages.h:256
#define I18N_MSG_CMISC_144
Definition: languages.h:183
#define SET_FLAG(xyz, p)
Definition: define.h:510
int command_sound(object *op, char *params)
Definition: c_misc.c:2120
int command_dumpbelow(object *op, char *params)
Definition: c_misc.c:979
char title[BIG_NAME]
Definition: player.h:216
region * get_region_by_name(const char *region_name)
Definition: region.c:57
#define FABS(x)
Definition: define.h:61
#define I18N_MSG_CMISC_198
Definition: languages.h:237
uint32 name_changed
Definition: player.h:184
#define NDI_WHITE
Definition: newclient.h:196
int command_motd(object *op, char *params)
Definition: c_misc.c:203
EXTERN int num_animations
Definition: global.h:242
#define I18N_MSG_CMISC_002
Definition: languages.h:41
#define FLAG_USE_ARMOUR
Definition: define.h:592
int command_time(object *op, char *params)
Definition: c_misc.c:900
#define I18N_MSG_CMISC_200
Definition: languages.h:239
char who_wiz_format[MAX_BUF]
Definition: global.h:365
#define MSG_TYPE_COMMAND_MALLOC
Definition: newclient.h:440
#define I18N_MSG_CMISC_109
Definition: languages.h:148
int region_is_child_of_region(const region *child, const region *r)
Definition: region.c:201
EXTERN objectlink * first_friendly_object
Definition: global.h:196
#define I18N_MSG_CMISC_048
Definition: languages.h:87
int command_listen(object *op, char *params)
Definition: c_misc.c:1264
#define I18N_MSG_CMISC_162
Definition: languages.h:201
#define I18N_MSG_CMISC_050
Definition: languages.h:89
#define I18N_MSG_CMISC_128
Definition: languages.h:167
#define I18N_MSG_CMISC_168
Definition: languages.h:207
unapplymode
Definition: player.h:99
#define I18N_MSG_CMISC_136
Definition: languages.h:175
#define I18N_MSG_CMISC_139
Definition: languages.h:178
int login_order
Definition: c_misc.c:524
int save_player(object *op, int flag)
Definition: login.c:223
StringBuffer * stringbuffer_new(void)
Definition: stringbuffer.c:64
const char * playerdir
Definition: global.h:336
#define I18N_MSG_CMISC_120
Definition: languages.h:159
#define MAP_ENTER_X(m)
Definition: map.h:104
#define I18N_MSG_CMISC_199
Definition: languages.h:238
#define I18N_MSG_CMISC_212
Definition: languages.h:251
#define HUGE_BUF
Definition: define.h:83
#define MSG_TYPE_SKILL_FAILURE
Definition: newclient.h:504
#define I18N_MSG_CMISC_026
Definition: languages.h:65
sint16 players
Definition: map.h:365
#define SND_MUTE
Definition: sounds.h:48
#define SS_DUMP_TOTALS
Definition: shstr.h:47
#define ST_CHANGE_PASSWORD_CONFIRM
Definition: define.h:897
#define MAP_HEIGHT(m)
Definition: map.h:99
#define I18N_MSG_CMISC_031
Definition: languages.h:70
char new_password[16]
Definition: player.h:228
int command_explore(object *op, char *params)
Definition: c_misc.c:2086
object clone
Definition: object.h:326
uint8 set_title
Definition: global.h:353
struct treasureliststruct * next
Definition: treasure.h:118
#define I18N_MSG_CMISC_197
Definition: languages.h:236
socket_struct socket
Definition: player.h:148
short freearr_x[SIZEOFFREE]
Definition: object.c:75
#define ST_CONFIRM_PASSWORD
Definition: define.h:893
#define I18N_MSG_CMISC_167
Definition: languages.h:206
#define MSG_TYPE_COMMAND_BODY
Definition: newclient.h:439
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
Definition: standalone.c:171
const char * slaying
Definition: object.h:172
region * get_region_by_map(mapstruct *m)
Definition: region.c:85
sint64 level_exp(int level, double expmul)
Definition: living.c:1788
#define I18N_MSG_CMISC_190
Definition: languages.h:229
#define I18N_MSG_CMISC_195
Definition: languages.h:234
DIR * opendir(const char *)
Definition: win32.c:78
void dump_all_archetypes(void)
Definition: arch.c:252
void malloc_info(object *op)
Definition: c_misc.c:244
#define FLAG_USE_WEAPON
Definition: define.h:593
int checkbanned(const char *login, const char *host)
Definition: ban.c:38
sint64 exp
Definition: living.h:88
uint32 in_memory
Definition: map.h:366
struct obj * above
Definition: object.h:146
#define I18N_MSG_CMISC_134
Definition: languages.h:173
#define I18N_MSG_CMISC_151
Definition: languages.h:190
#define I18N_MSG_CMISC_009
Definition: languages.h:48
int command_showpets(object *op, char *params)
Definition: c_misc.c:1606
double expmul
Definition: object.h:246
#define ST_CHANGE_PASSWORD_NEW
Definition: define.h:896
int command_resistances(object *op, char *params)
Definition: c_misc.c:1740
#define I18N_MSG_CMISC_108
Definition: languages.h:147
int language
Definition: player.h:255
#define FLAG_AFK
Definition: define.h:673
player * find_player(const char *plname)
Definition: player.c:62
LogLevel debug
Definition: global.h:327
#define I18N_MSG_CMISC_016
Definition: languages.h:55
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
Definition: item.c:64
#define I18N_MSG_CMISC_095
Definition: languages.h:134
sint16 x
Definition: object.h:179
#define I18N_MSG_CMISC_178
Definition: languages.h:217
void remove_friendly_object(object *op)
Definition: friend.c:69
void check_login(object *op)
Definition: login.c:473
signed long sum_weight(object *op)
Definition: object.c:317
int command_afk(object *op, char *params)
Definition: c_misc.c:795
sint16 sp
Definition: living.h:83
int command_peaceful(object *op, char *params)
Definition: c_misc.c:2333
const char * language_names[]
Definition: languages.c:43
#define SS_DUMP_TABLE
Definition: shstr.h:46
int command_help(object *op, char *params)
Definition: c_misc.c:1900
Definition: win32.h:128
void map_info(object *op, char *search)
Definition: c_misc.c:55
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
Definition: standalone.c:175
char * partyname
Definition: player.h:124
int command_usekeys(object *op, char *params)
Definition: c_misc.c:1692
#define I18N_MSG_CMISC_005
Definition: languages.h:44
uint8 explore_mode
Definition: global.h:361
void terminate_all_pets(object *owner)
Definition: pets.c:250
#define ST_ROLL_STAT
Definition: define.h:888
int command_archs(object *op, char *params)
Definition: c_misc.c:915
Definition: object.h:321
#define ST_PLAYING
Definition: define.h:886
char * host
Definition: newserver.h:125
#define I18N_MSG_CMISC_185
Definition: languages.h:224
uint16 outputs_sync
Definition: player.h:245
const int CommunicationCommandSize
Definition: commands.c:208
uint16 outputs_count
Definition: player.h:246
#define PLAYER
Definition: define.h:113
#define I18N_MSG_CMISC_042
Definition: languages.h:81
sint16 maxsp
Definition: living.h:84
sint8 Con
Definition: living.h:78
#define FLAG_REMOVED
Definition: define.h:528
sint16 hp
Definition: living.h:81
#define I18N_MSG_CMISC_102
Definition: languages.h:141
#define MAP_WHEN_RESET(m)
Definition: map.h:81
char namebuf[MAX_BUF]
Definition: c_misc.c:523
sint32 timeout
Definition: map.h:362
region * get_region_from_string(const char *name)
Definition: region.c:132
short freearr_y[SIZEOFFREE]
Definition: object.c:81
partylist * party
Definition: player.h:237
void version(object *op)
Definition: server.c:81
#define I18N_MSG_CMISC_192
Definition: languages.h:231
#define I18N_MSG_CMISC_024
Definition: languages.h:63
void get_name(object *op)
Definition: player.c:786
void current_region_info(object *op)
Definition: c_misc.c:398
object * ob
Definition: object.h:299
#define I18N_MSG_CMISC_191
Definition: languages.h:230
#define I18N_MSG_CMISC_112
Definition: languages.h:151
#define I18N_MSG_CMISC_007
Definition: languages.h:46
#define I18N_MSG_CMISC_113
Definition: languages.h:152
#define I18N_MSG_CMISC_180
Definition: languages.h:219
#define I18N_MSG_CMISC_012
Definition: languages.h:51
int rndm(int min, int max)
Definition: utils.c:174
#define NAMLEN(dirent)
Definition: global.h:308
const char * get_region_longname(const region *r)
Definition: region.c:229
#define I18N_MSG_CMISC_202
Definition: languages.h:241
const char * name
Definition: map.h:299
#define I18N_MSG_CMISC_051
Definition: languages.h:90
char * name
Definition: map.h:349
#define I18N_MSG_CMISC_159
Definition: languages.h:198
#define MAP_IN_MEMORY
Definition: map.h:151
struct obj * chosen_skill
Definition: object.h:237
int command_dumpfriendlyobjects(object *op, char *params)
Definition: c_misc.c:1087
#define I18N_MSG_CMISC_020
Definition: languages.h:59
uint32 sound
Definition: newserver.h:139
void remove_ob(object *op)
Definition: object.c:1515
#define NDI_RED
Definition: newclient.h:198
sint16 maxhp
Definition: living.h:82
#define I18N_MSG_CMISC_025
Definition: languages.h:64
#define I18N_MSG_CMISC_155
Definition: languages.h:194
#define I18N_MSG_CMISC_096
Definition: languages.h:135
int command_whereabouts(object *op, char *params)
Definition: c_misc.c:482
Definition: win32.h:138
#define I18N_MSG_CMISC_055
Definition: languages.h:94
#define I18N_MSG_CMISC_187
Definition: languages.h:226
struct artifactliststruct * next
Definition: artifact.h:51
int command_wizcast(object *op, char *params)
Definition: c_misc.c:1039
#define I18N_MSG_CMISC_023
Definition: languages.h:62
const char * name_pl
Definition: object.h:168
#define I18N_MSG_CMISC_173
Definition: languages.h:212
usekeytype
Definition: player.h:89
#define I18N_MSG_CMISC_188
Definition: languages.h:227
int do_harvest(object *pl, int dir, object *skill)
Definition: c_misc.c:2472
#define I18N_MSG_CMISC_141
Definition: languages.h:180
#define I18N_MSG_CMISC_131
Definition: languages.h:170
float speed_left
Definition: object.h:182
unapplymode unapply
Definition: player.h:162
uint32 hidden
Definition: player.h:186
#define I18N_MSG_CMISC_193
Definition: languages.h:232
#define I18N_MSG_CMISC_047
Definition: languages.h:86
enum _petmode petmode_t
int command_bowmode(object *op, char *params)
Definition: c_misc.c:1491
#define I18N_MSG_CMISC_153
Definition: languages.h:192
uint32 peaceful
Definition: player.h:185
#define I18N_MSG_CMISC_094
Definition: languages.h:133
int command_statistics(object *pl, char *params)
Definition: c_misc.c:1300
sint8 Wis
Definition: living.h:78
#define ST_CONFIRM_QUIT
Definition: define.h:890
void get_password(object *op)
Definition: player.c:798
struct mapdef * map
Definition: object.h:155
int is_dragon_pl(const object *op)
Definition: player.c:125
struct regiondef * next
Definition: map.h:298
void receive_player_password(object *op)
Definition: c_misc.c:2160
Definition: map.h:297
#define I18N_MSG_CMISC_146
Definition: languages.h:185
#define I18N_MSG_CMISC_164
Definition: languages.h:203
#define I18N_MSG_CMISC_043
Definition: languages.h:82
int command_malloc(object *op, char *params)
Definition: c_misc.c:818
void dump_object(object *op, StringBuffer *sb)
Definition: object.c:372
#define I18N_MSG_CMISC_027
Definition: languages.h:66
#define MAP_TIMEOUT(m)
Definition: map.h:85
#define I18N_MSG_CMISC_215
Definition: languages.h:254
void dump_all_maps(void)
Definition: map.c:298
int count_used(void)
Definition: object.c:1449
#define I18N_MSG_CMISC_015
Definition: languages.h:54
char * msg
Definition: map.h:380
#define I18N_MSG_CMISC_145
Definition: languages.h:184
#define I18N_MSG_CMISC_092
Definition: languages.h:131
#define I18N_MSG_CMISC_039
Definition: languages.h:78
type_definition ** types
#define I18N_MSG_CMISC_105
Definition: languages.h:144
sint16 dam
Definition: living.h:87
int command_output_count(object *op, char *params)
Definition: c_misc.c:1230
#define I18N_MSG_CMISC_176
Definition: languages.h:215
int command_dumpallarchetypes(object *op, char *params)
Definition: c_misc.c:1102
#define I18N_MSG_CMISC_165
Definition: languages.h:204
const char * name
Definition: object.h:167
int command_strings(object *op, char *params)
Definition: c_misc.c:876
living orig_stats
Definition: player.h:203
long seconds(void)
Definition: time.c:417
#define I18N_MSG_CMISC_205
Definition: languages.h:244
#define I18N_MSG_CMISC_053
Definition: languages.h:92
uint8 state
Definition: player.h:172
#define ATNR_INTERNAL
Definition: attack.h:100
uint16 run_away
Definition: object.h:235
#define I18N_MSG_CMISC_052
Definition: languages.h:91
uint32 is_bot
Definition: newserver.h:137
object * get_owner(object *op)
Definition: object.c:524
struct obj * below
Definition: object.h:145
struct archt * more
Definition: object.h:325
#define I18N_MSG_CMISC_204
Definition: languages.h:243
static void show_commands(object *op, int what)
Definition: c_misc.c:1852
uint16 difficulty
Definition: map.h:364
#define I18N_MSG_CMISC_181
Definition: languages.h:220
#define I18N_MSG_CMISC_119
Definition: languages.h:158
void send_query(socket_struct *ns, uint8 flags, const char *text)
Definition: request.c:727
#define I18N_MSG_CMISC_021
Definition: languages.h:60
#define CS_QUERY_SINGLECHAR
Definition: newclient.h:77
#define MSG_TYPE_LAST
Definition: newclient.h:337
#define I18N_MSG_CMISC_037
Definition: languages.h:76
#define I18N_MSG_CMISC_018
Definition: languages.h:57
#define MAP_ENTER_Y(m)
Definition: map.h:106
int command_who(object *op, char *params)
Definition: c_misc.c:629
sint8 Cha
Definition: living.h:78
EXTERN const char *const change_resist_msg[NROFATTACKS]
Definition: attack.h:163
#define I18N_MSG_CMISC_101
Definition: languages.h:140
#define I18N_MSG_CMISC_103
Definition: languages.h:142
int command_fix_me(object *op, char *params)
Definition: c_misc.c:1374
#define SIZEOFFREE
Definition: define.h:441
#define P_OUT_OF_MAP
Definition: map.h:272
#define I18N_MSG_CMISC_171
Definition: languages.h:210
#define I18N_MSG_CMISC_004
Definition: languages.h:43
EXTERN Animations * animations
Definition: global.h:241
#define I18N_MSG_CMISC_174
Definition: languages.h:213
int command_kill_pets(object *op, char *params)
Definition: c_misc.c:2410
sint16 y
Definition: object.h:179
struct pl * contr
Definition: object.h:134
char * ss_dump_table(int what, char *buf, size_t size)
Definition: shstr.c:346
int command_dumpallmaps(object *op, char *params)
Definition: c_misc.c:1148
#define I18N_MSG_CMISC_114
Definition: languages.h:153
#define I18N_MSG_CMISC_010
Definition: languages.h:49
#define I18N_MSG_CMISC_129
Definition: languages.h:168
#define I18N_MSG_CMISC_203
Definition: languages.h:242
#define I18N_MSG_CMISC_216
Definition: languages.h:255
int command_version(object *op, char *params)
Definition: c_misc.c:1180
EXTERN treasurelist * first_treasurelist
Definition: global.h:193
#define I18N_MSG_CMISC_038
Definition: languages.h:77
void dm_stack_push(player *pl, tag_t item)
Definition: c_wiz.c:2403
void time_info(object *op)
Definition: time.c:353
char d_name[_MAX_FNAME+1]
Definition: win32.h:132
const char * language_codes[]
Definition: languages.c:34
#define MSG_TYPE_SKILL
Definition: newclient.h:329
float speed
Definition: object.h:181
int command_output_sync(object *op, char *params)
Definition: c_misc.c:1196
struct regiondef * parent
Definition: map.h:307
#define QUERY_FLAG(xyz, p)
Definition: define.h:514
const char * longname
Definition: map.h:312
#define CLEAR_FLAG(xyz, p)
Definition: define.h:512
EXTERN artifactlist * first_artifactlist
Definition: global.h:194
EXTERN const char *const attacktype_desc[NROFATTACKS]
Definition: attack.h:165
#define I18N_MSG_CMISC_132
Definition: languages.h:171
#define FLAG_WIZ
Definition: define.h:527
#define I18N_MSG_CMISC_137
Definition: languages.h:176
object * insert_ob_in_ob(object *op, object *where)
Definition: object.c:2510
void dump_map(const mapstruct *m)
Definition: map.c:275
#define MAX_BUF
Definition: define.h:81
#define I18N_MSG_CMISC_152
Definition: languages.h:191
#define I18N_MSG_CMISC_135
Definition: languages.h:174
command_array_struct WizCommands[]
Definition: commands.c:211
#define I18N_MSG_CMISC_054
Definition: languages.h:93
#define I18N_MSG_CMISC_149
Definition: languages.h:188
LogLevel
Definition: logger.h:37
#define I18N_MSG_CMISC_127
Definition: languages.h:166
char who_format[MAX_BUF]
Definition: global.h:364
object * get_object(void)
Definition: object.c:921
enum _bowtype bowtype_t
char own_title[MAX_NAME]
Definition: player.h:214
int players_on_map(mapstruct *m, int show_all)
Definition: swap.c:287
void replace_unprintable_chars(char *buf)
Definition: utils.c:516
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
Definition: object.c:1992
#define I18N_MSG_CMISC_118
Definition: languages.h:157
unsigned short uint16
Definition: global.h:67
const char * skill
Definition: object.h:174
int command_dumpallobjects(object *op, char *params)
Definition: c_misc.c:1072
sint8 wc
Definition: living.h:79
#define I18N_MSG_CMISC_209
Definition: languages.h:248
#define I18N_MSG_CMISC_210
Definition: languages.h:249
#define I18N_MSG_CMISC_177
Definition: languages.h:216
uint32 explore
Definition: player.h:187
#define I18N_MSG_CMISC_196
Definition: languages.h:235
#define I18N_MSG_CMISC_211
Definition: languages.h:250
sint8 Str
Definition: living.h:78
#define I18N_MSG_CMISC_115
Definition: languages.h:154
#define I18N_MSG_CMISC_000
Definition: languages.h:39
sint16 resist[NROFATTACKS]
Definition: object.h:192
object * ob
Definition: player.h:207
EXTERN long nrofartifacts
Definition: global.h:224
const char * sstring
Definition: global.h:84
int command_mapinfo(object *op, char *params)
Definition: c_misc.c:833
const char * datadir
Definition: global.h:334
int command_players(object *op, char *params)
Definition: c_misc.c:1390
sint8 body_info[NUM_BODY_LOCATIONS]
Definition: object.h:223
EXTERN long nrofallowedstr
Definition: global.h:225
int snprintf(char *dest, int max, const char *format,...)
Definition: porting.c:498
int command_title(object *op, char *params)
Definition: c_misc.c:2250
sint8 body_used[NUM_BODY_LOCATIONS]
Definition: object.h:224
bowtype_t bowtype
Definition: player.h:155
#define I18N_MSG_CMISC_117
Definition: languages.h:156
#define FORCE
Definition: define.h:296
#define I18N_MSG_CMISC_179
Definition: languages.h:218
#define I18N_MSG_CMISC_022
Definition: languages.h:61
#define I18N_MSG_CMISC_186
Definition: languages.h:225
#define I18N_MSG_CMISC_028
Definition: languages.h:67
#define I18N_MSG_CMISC_107
Definition: languages.h:146
int get_language(object *op)
Definition: languages.c:59
void print_los(object *op)
Definition: los.c:614
Definition: map.h:279
int command_rules(object *op, char *params)
Definition: c_misc.c:218
#define I18N_MSG_CMISC_130
Definition: languages.h:169
#define FREE_AND_COPY(sv, nv)
Definition: global.h:288
int set_ob_key_value(object *op, const char *key, const char *value, int add_key)
Definition: object.c:3826
#define I18N_MSG_CMISC_182
Definition: languages.h:221
#define I18N_MSG_CMISC_099
Definition: languages.h:138
int command_ssdumptable(object *op, char *params)
Definition: c_misc.c:1117
const int CommandsSize
Definition: commands.c:137
#define I18N_MSG_CMISC_019
Definition: languages.h:58
const char * localdir
Definition: global.h:335
char password[16]
Definition: player.h:227
tag_t count
Definition: object.h:157
living stats
Definition: object.h:219
#define FLAG_WIZCAST
Definition: define.h:586
sint8 Dex
Definition: living.h:78
struct archt * arch
Definition: object.h:263
#define I18N_MSG_CMISC_040
Definition: languages.h:79
struct oblnk * next
Definition: object.h:300
int command_maps(object *op, char *params)
Definition: c_misc.c:861
int command_debug(object *op, char *params)
Definition: c_misc.c:945
#define MAP_WIDTH(m)
Definition: map.h:97
#define MSG_TYPE_COMMAND_INFO
Definition: newclient.h:444
#define I18N_MSG_CMISC_057
Definition: languages.h:96
#define I18N_MSG_CMISC_208
Definition: languages.h:247
#define I18N_MSG_CMISC_150
Definition: languages.h:189
#define I18N_MSG_CMISC_213
Definition: languages.h:252
int command_passwd(object *pl, char *params)
Definition: c_misc.c:2454
struct Settings settings
Definition: init.c:48
#define MSG_TYPE_COMMAND_STATISTICS
Definition: newclient.h:442
#define I18N_MSG_CMISC_214
Definition: languages.h:253
void arch_info(object *op)
Definition: arch.c:209
#define I18N_MSG_CMISC_011
Definition: languages.h:50
#define SK_EXP_ADD_SKILL
Definition: skills.h:103
#define I18N_MSG_CMISC_097
Definition: languages.h:136
#define I18N_MSG_CMISC_036
Definition: languages.h:75
#define MSG_TYPE_COMMAND_WHO
Definition: newclient.h:437
struct archt * next
Definition: object.h:323
void dump_all_objects(void)
Definition: object.c:416
#define NROFATTACKS
Definition: attack.h:45
struct dirent * readdir(DIR *)
Definition: win32.c:116
#define I18N_MSG_CMISC_032
Definition: languages.h:71
command_array_struct CommunicationCommands[]
Definition: commands.c:140
int command_save(object *op, char *params)
Definition: c_misc.c:2305
#define ST_CHANGE_PASSWORD_OLD
Definition: define.h:895
#define MSG_TYPE_COMMAND
Definition: newclient.h:326
void ss_dump_statistics(char *buf, size_t size)
Definition: shstr.c:315
#define I18N_MSG_CMISC_201
Definition: languages.h:240
static void help_topics(object *op, int what)
Definition: c_misc.c:1791
#define I18N_MSG_CMISC_183
Definition: languages.h:222
#define I18N_MSG_CMISC_098
Definition: languages.h:137
#define I18N_MSG_CMISC_161
Definition: languages.h:200
void send_news(const object *op)
Definition: player.c:176
#define NUM_LANGUAGES
Definition: languages.h:33
#define I18N_MSG_CMISC_104
Definition: languages.h:143
#define I18N_MSG_CMISC_035
Definition: languages.h:74
int command_body(object *op, char *params)
Definition: c_misc.c:157
void send_rules(const object *op)
Definition: player.c:142
#define I18N_MSG_CMISC_125
Definition: languages.h:164
const char * get_name_of_region_for_map(const mapstruct *m)
Definition: region.c:103
EXTERN player * first_player
Definition: global.h:190
void get_who_escape_code_value(char *return_val, int size, const char letter, player *pl)
Definition: c_misc.c:709
#define I18N_MSG_CMISC_206
Definition: languages.h:245
struct pl * next
Definition: player.h:147
#define I18N_MSG_CMISC_194
Definition: languages.h:233
void copy_object_with_inv(object *src_ob, object *dest_ob)
Definition: object.c:862
#define GET_MAP_OB(M, X, Y)
Definition: map.h:193
int strcasecmp(const char *s1, const char *s2)
Definition: porting.c:434
int command_hiscore(object *op, char *params)
Definition: c_misc.c:930
#define I18N_MSG_CMISC_056
Definition: languages.h:95
int find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
Definition: object.c:3200
#define I18N_MSG_CMISC_133
Definition: languages.h:172
char * crypt_string(char *str, char *salt)
Definition: server.c:130
#define FLAG_MONSTER
Definition: define.h:541
int command_printlos(object *op, char *params)
Definition: c_misc.c:1163
sint8 Pow
Definition: living.h:78
int closedir(DIR *)
Definition: win32.c:149
struct obj * inv
Definition: object.h:148
petmode_t petmode
Definition: player.h:156
#define NDI_UNIQUE
Definition: newclient.h:219
#define I18N_MSG_CMISC_154
Definition: languages.h:193
#define I18N_MSG_CMISC_045
Definition: languages.h:84
#define I18N_MSG_CMISC_013
Definition: languages.h:52
#define I18N_MSG_CMISC_033
Definition: languages.h:72
#define S_ISDIR(x)
Definition: win32.h:80
usekeytype usekeys
Definition: player.h:161
Definition: player.h:83
void display_high_score(object *op, int max, const char *match)
Definition: hiscore.c:402
void LOG(LogLevel logLevel, const char *format,...)
Definition: logger.c:63
#define CS_QUERY_HIDEINPUT
Definition: newclient.h:78
void receive_player_name(object *op)
Definition: c_misc.c:2142
#define I18N_MSG_CMISC_166
Definition: languages.h:205
#define I18N_MSG_CMISC_138
Definition: languages.h:177
#define I18N_MSG_CMISC_158
Definition: languages.h:197
EXTERN region * first_region
Definition: global.h:192
int command_quit(object *op, char *params)
Definition: c_misc.c:2065
#define MAX_NAME
Definition: define.h:87
#define I18N_MSG_CMISC_169
Definition: languages.h:208
#define I18N_MSG_CMISC_100
Definition: languages.h:139
#define I18N_MSG_CMISC_044
Definition: languages.h:83
struct mapdef * next
Definition: map.h:347
uint8 listening
Definition: player.h:174
int command_brace(object *op, char *params)
Definition: c_misc.c:2382
#define I18N_MSG_CMISC_172
Definition: languages.h:211
int command_dumpmap(object *op, char *params)
Definition: c_misc.c:1132
void dump_friendly_objects(void)
Definition: friend.c:113
void free_object(object *ob)
Definition: object.c:1238
#define I18N_MSG_CMISC_116
Definition: languages.h:155
#define MSG_TYPE_COMMAND_CONFIG
Definition: newclient.h:443
#define I18N_MSG_CMISC_140
Definition: languages.h:179
Definition: map.h:346
#define I18N_MSG_CMISC_207
Definition: languages.h:246
char * strerror_local(int errnum, char *buf, size_t size)
Definition: porting.c:525
uint32 braced
Definition: player.h:178
int random_roll(int min, int max, const object *op, int goodbad)
Definition: utils.c:51
#define I18N_MSG_CMISC_189
Definition: languages.h:228
#define I18N_MSG_CMISC_046
Definition: languages.h:85
int command_language(object *op, char *params)
Definition: c_misc.c:97
uint32 counter
Definition: map.h:315
unsigned short Fontindex
Definition: global.h:86
int command_wimpy(object *op, char *params)
Definition: c_misc.c:2353
char write_buf[MAX_BUF]
Definition: player.h:225
#define I18N_MSG_CMISC_143
Definition: languages.h:182
const char * i18n_translate(int language, int id)
Definition: languages.c:73
#define MSG_TYPE_COMMAND_MAPS
Definition: newclient.h:438
#define I18N_MSG_CMISC_106
Definition: languages.h:145
int onoff_value(const char *line)
Definition: c_misc.c:2026
#define FLAG_WIZPASS
Definition: define.h:611
#define I18N_MSG_CMISC_110
Definition: languages.h:149
#define S_ISREG(x)
Definition: win32.h:81
#define I18N_MSG_CMISC_170
Definition: languages.h:209
sint16 level
Definition: object.h:202
#define I18N_MSG_CMISC_122
Definition: languages.h:161
void fix_object(object *op)
Definition: living.c:900
#define I18N_MSG_CMISC_142
Definition: languages.h:181
void list_players(object *op, region *reg, partylist *party)
Definition: c_misc.c:550
EXTERN mapstruct * first_map
Definition: global.h:191
EXTERN archetype * first_archetype
Definition: global.h:195
#define I18N_MSG_CMISC_147
Definition: languages.h:186
#define I18N_MSG_CMISC_030
Definition: languages.h:69
#define I18N_MSG_CMISC_184
Definition: languages.h:223
const char * name
Definition: object.h:322
#define I18N_MSG_CMISC_157
Definition: languages.h:196
char * stringbuffer_finish(StringBuffer *sb)
Definition: stringbuffer.c:78
#define I18N_MSG_CMISC_156
Definition: languages.h:195
#define I18N_MSG_CMISC_041
Definition: languages.h:80
#define P_NO_CLERIC
Definition: map.h:259
uint8 type
Definition: object.h:189
const char * get_region_msg(const region *r)
Definition: region.c:250
#define I18N_MSG_CMISC_123
Definition: languages.h:162
#define I18N_MSG_CMISC_093
Definition: languages.h:132
#define I18N_MSG_CMISC_126
Definition: languages.h:165
#define I18N_MSG_CMISC_008
Definition: languages.h:47
int atnr_is_dragon_enabled(int attacknr)
Definition: player.c:106
void current_map_info(object *op)
Definition: c_misc.c:421
static int name_cmp(const chars_names *c1, const chars_names *c2)
Definition: c_misc.c:536
void display_motd(const object *op)
Definition: player.c:112
EXTERN long nroftreasures
Definition: global.h:223
int command_wizpass(object *op, char *params)
Definition: c_misc.c:1006