1 | /* |
1 | /* |
2 | * static char *rcsid_c_wiz_c = |
2 | * static char *rcsid_c_wiz_c = |
3 | * "$Id: c_wiz.C,v 1.5 2006/08/31 17:54:15 root Exp $"; |
3 | * "$Id: c_wiz.C,v 1.6 2006/09/03 00:18:42 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
115 | op->contr->hidden = 0; |
115 | op->contr->hidden = 0; |
116 | op->invisible = 1; |
116 | op->invisible = 1; |
117 | new_draw_info(NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
117 | new_draw_info(NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
118 | op->map->players++; |
118 | op->map->players++; |
119 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
119 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
120 | "%s has entered the game.", op->name); |
120 | "%s has entered the game.", &op->name); |
121 | if (!silent_dm) { |
121 | if (!silent_dm) { |
122 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, |
122 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, |
123 | "The Dungeon Master has arrived!"); |
123 | "The Dungeon Master has arrived!"); |
124 | } |
124 | } |
125 | } else { |
125 | } else { |
… | |
… | |
129 | if (!silent_dm) { |
129 | if (!silent_dm) { |
130 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, |
130 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, |
131 | "The Dungeon Master is gone.."); |
131 | "The Dungeon Master is gone.."); |
132 | } |
132 | } |
133 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
133 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
134 | "%s leaves the game.", op->name); |
134 | "%s leaves the game.", &op->name); |
135 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
135 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
136 | "%s left the game.", op->name); |
136 | "%s left the game.", &op->name); |
137 | } |
137 | } |
138 | } |
138 | } |
139 | |
139 | |
140 | int command_hide(object *op, char *params) |
140 | int command_hide(object *op, char *params) |
141 | { |
141 | { |
… | |
… | |
179 | /* |
179 | /* |
180 | * Perhaps this is overly restrictive? Should we perhaps be able |
180 | * Perhaps this is overly restrictive? Should we perhaps be able |
181 | * to rebless altars and the like? |
181 | * to rebless altars and the like? |
182 | */ |
182 | */ |
183 | if (ob->type != PLAYER) { |
183 | if (ob->type != PLAYER) { |
184 | new_draw_info_format(NDI_UNIQUE, 0, op, "%s is not a player - can not change its god", ob->name); |
184 | new_draw_info_format(NDI_UNIQUE, 0, op, "%s is not a player - can not change its god", &ob->name); |
185 | return 1; |
185 | return 1; |
186 | } |
186 | } |
187 | |
187 | |
188 | god = find_god(str); |
188 | god = find_god(str); |
189 | if (god==NULL) { |
189 | if (god==NULL) { |
… | |
… | |
228 | now = time(NULL); |
228 | now = time(NULL); |
229 | /* |
229 | /* |
230 | * Record this as a comment - then we don't have to worry about changing |
230 | * Record this as a comment - then we don't have to worry about changing |
231 | * the parsing code. |
231 | * the parsing code. |
232 | */ |
232 | */ |
233 | fprintf(banishfile, "# %s (%s) banned by %s at %s\n", pl->ob->name, |
233 | fprintf(banishfile, "# %s (%s) banned by %s at %s\n", &pl->ob->name, |
234 | pl->socket.host, op->name, ctime(&now)); |
234 | pl->socket.host, &op->name, ctime(&now)); |
235 | fprintf(banishfile, "*@%s\n", pl->socket.host); |
235 | fprintf(banishfile, "*@%s\n", pl->socket.host); |
236 | fclose(banishfile); |
236 | fclose(banishfile); |
237 | |
237 | |
238 | LOG(llevDebug, "! %s banned %s from IP: %s.\n", op->name, pl->ob->name, pl->socket.host); |
238 | LOG(llevDebug, "! %s banned %s from IP: %s.\n", &op->name, &pl->ob->name, pl->socket.host); |
239 | new_draw_info_format(NDI_UNIQUE|NDI_RED, 0, op, "You banish %s", pl->ob->name); |
239 | new_draw_info_format(NDI_UNIQUE|NDI_RED, 0, op, "You banish %s", &pl->ob->name); |
240 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_RED, 5, op, |
240 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_RED, 5, op, |
241 | "%s banishes %s from the land!", op->name, pl->ob->name); |
241 | "%s banishes %s from the land!", &op->name, &pl->ob->name); |
242 | command_kick(op, (char *) pl->ob->name); |
242 | command_kick(op, (char *) &pl->ob->name); |
243 | return 1; |
243 | return 1; |
244 | } |
244 | } |
245 | |
245 | |
246 | int command_kick (object *op, char *params) { |
246 | int command_kick (object *op, char *params) { |
247 | struct pl *pl; |
247 | struct pl *pl; |
248 | |
248 | |
249 | for (pl = first_player; pl != NULL; pl = pl->next) |
249 | for (pl = first_player; pl != NULL; pl = pl->next) |
250 | if ((params == NULL || !strcmp (pl->ob->name, params)) |
250 | if ((params == NULL || !strcmp (&pl->ob->name, params)) |
251 | && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params))) |
251 | && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params))) |
252 | { |
252 | { |
253 | object *op = pl->ob; |
253 | object *op = pl->ob; |
254 | |
254 | |
255 | if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED)) |
255 | if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED)) |
256 | { |
256 | { |
257 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, |
257 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, |
258 | "%s is kicked out of the game.", |
258 | "%s is kicked out of the game.", |
259 | op->name); |
259 | &op->name); |
260 | strcpy (op->contr->killer, "kicked"); |
260 | strcpy (op->contr->killer, "kicked"); |
261 | } |
261 | } |
262 | |
262 | |
263 | pl->socket.status = Ns_Dead; |
263 | pl->socket.status = Ns_Dead; |
264 | } |
264 | } |
… | |
… | |
323 | } |
323 | } |
324 | |
324 | |
325 | name = params; |
325 | name = params; |
326 | dummy=get_object(); |
326 | dummy=get_object(); |
327 | dummy->map = op->map; |
327 | dummy->map = op->map; |
328 | EXIT_PATH(dummy) = add_string (name); |
328 | EXIT_PATH(dummy) = name; |
329 | dummy->name = add_string(name); |
329 | dummy->name = name; |
330 | |
330 | |
331 | enter_exit(op, dummy); |
331 | enter_exit(op, dummy); |
332 | free_object(dummy); |
332 | free_object(dummy); |
333 | if (op->contr->loading == NULL) { |
333 | if (op->contr->loading == NULL) { |
334 | new_draw_info_format(NDI_UNIQUE, 0, op, |
334 | new_draw_info_format(NDI_UNIQUE, 0, op, |
… | |
… | |
387 | if (!pl) |
387 | if (!pl) |
388 | return 1; |
388 | return 1; |
389 | |
389 | |
390 | new_draw_info(NDI_UNIQUE|NDI_RED, 0, pl->ob, "You have been frozen by the DM!"); |
390 | new_draw_info(NDI_UNIQUE|NDI_RED, 0, pl->ob, "You have been frozen by the DM!"); |
391 | new_draw_info_format(NDI_UNIQUE, 0, op, |
391 | new_draw_info_format(NDI_UNIQUE, 0, op, |
392 | "You freeze %s for %d ticks", pl->ob->name, ticks); |
392 | "You freeze %s for %d ticks", &pl->ob->name, ticks); |
393 | pl->ob->speed_left = -(pl->ob->speed*ticks); |
393 | pl->ob->speed_left = -(pl->ob->speed*ticks); |
394 | return 0; |
394 | return 0; |
395 | } |
395 | } |
396 | |
396 | |
397 | int command_arrest(object *op, char *params) { |
397 | int command_arrest(object *op, char *params) { |
… | |
… | |
412 | } |
412 | } |
413 | enter_exit(pl->ob, dummy); |
413 | enter_exit(pl->ob, dummy); |
414 | free_object(dummy); |
414 | free_object(dummy); |
415 | new_draw_info(NDI_UNIQUE, 0,pl->ob,"You have been arrested."); |
415 | new_draw_info(NDI_UNIQUE, 0,pl->ob,"You have been arrested."); |
416 | new_draw_info(NDI_UNIQUE, 0,op,"OK."); |
416 | new_draw_info(NDI_UNIQUE, 0,op,"OK."); |
417 | LOG(llevInfo, "Player %s arrested by %s\n", pl->ob->name, op->name); |
417 | LOG(llevInfo, "Player %s arrested by %s\n", &pl->ob->name, &op->name); |
418 | return 1; |
418 | return 1; |
419 | } |
419 | } |
420 | |
420 | |
421 | int command_summon(object *op, char *params) { |
421 | int command_summon(object *op, char *params) { |
422 | int i; |
422 | int i; |
… | |
… | |
440 | new_draw_info(NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player."); |
440 | new_draw_info(NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player."); |
441 | return 1; |
441 | return 1; |
442 | } |
442 | } |
443 | |
443 | |
444 | dummy = get_object(); |
444 | dummy = get_object(); |
445 | EXIT_PATH(dummy) = add_string(op->map->path); |
445 | EXIT_PATH(dummy) = op->map->path; |
446 | EXIT_X(dummy) = op->x+freearr_x[i]; |
446 | EXIT_X(dummy) = op->x+freearr_x[i]; |
447 | EXIT_Y(dummy) = op->y+freearr_y[i]; |
447 | EXIT_Y(dummy) = op->y+freearr_y[i]; |
448 | enter_exit(pl->ob, dummy); |
448 | enter_exit(pl->ob, dummy); |
449 | free_object(dummy); |
449 | free_object(dummy); |
450 | new_draw_info(NDI_UNIQUE, 0, pl->ob, "You are summoned."); |
450 | new_draw_info(NDI_UNIQUE, 0, pl->ob, "You are summoned."); |
… | |
… | |
479 | new_draw_info(NDI_UNIQUE, 0, op, "Can not find a free spot to teleport to."); |
479 | new_draw_info(NDI_UNIQUE, 0, op, "Can not find a free spot to teleport to."); |
480 | return 1; |
480 | return 1; |
481 | } |
481 | } |
482 | |
482 | |
483 | dummy = get_object(); |
483 | dummy = get_object(); |
484 | EXIT_PATH(dummy) = add_string(pl->ob->map->path); |
484 | EXIT_PATH(dummy) = pl->ob->map->path; |
485 | EXIT_X(dummy) = pl->ob->x + freearr_x[i]; |
485 | EXIT_X(dummy) = pl->ob->x + freearr_x[i]; |
486 | EXIT_Y(dummy) = pl->ob->y + freearr_y[i]; |
486 | EXIT_Y(dummy) = pl->ob->y + freearr_y[i]; |
487 | enter_exit(op, dummy); |
487 | enter_exit(op, dummy); |
488 | free_object(dummy); |
488 | free_object(dummy); |
489 | if (!op->contr->hidden) |
489 | if (!op->contr->hidden) |
… | |
… | |
535 | " [variable_to_patch setting]"); |
535 | " [variable_to_patch setting]"); |
536 | return 1; |
536 | return 1; |
537 | } |
537 | } |
538 | bp++; |
538 | bp++; |
539 | set_nrof = 1; |
539 | set_nrof = 1; |
540 | LOG(llevDebug, "%s creates: (%d) %s\n", op->name, nrof, bp); |
540 | LOG(llevDebug, "%s creates: (%d) %s\n", &op->name, nrof, bp); |
541 | } |
541 | } |
542 | if (sscanf(bp, "%d ", &magic)) { |
542 | if (sscanf(bp, "%d ", &magic)) { |
543 | if ((bp = strchr(bp, ' ')) == NULL) { |
543 | if ((bp = strchr(bp, ' ')) == NULL) { |
544 | new_draw_info(NDI_UNIQUE, 0, op, |
544 | new_draw_info(NDI_UNIQUE, 0, op, |
545 | "Usage: create [nr] [magic] <archetype> [ of <artifact>]" |
545 | "Usage: create [nr] [magic] <archetype> [ of <artifact>]" |
546 | " [variable_to_patch setting]"); |
546 | " [variable_to_patch setting]"); |
547 | return 1; |
547 | return 1; |
548 | } |
548 | } |
549 | bp++; |
549 | bp++; |
550 | set_magic = 1; |
550 | set_magic = 1; |
551 | LOG(llevDebug, "%s creates: (%d) (%d) %s\n", op->name, nrof, magic, bp); |
551 | LOG(llevDebug, "%s creates: (%d) (%d) %s\n", &op->name, nrof, magic, bp); |
552 | } |
552 | } |
553 | if ((cp = strstr(bp, " of ")) != NULL) { |
553 | if ((cp = strstr(bp, " of ")) != NULL) { |
554 | *cp = '\0'; |
554 | *cp = '\0'; |
555 | cp += 4; |
555 | cp += 4; |
556 | } |
556 | } |
… | |
… | |
613 | if (!art) { |
613 | if (!art) { |
614 | new_draw_info_format(NDI_UNIQUE, 0, op, |
614 | new_draw_info_format(NDI_UNIQUE, 0, op, |
615 | "No such artifact ([%d] of %s)", at->clone.type, cp); |
615 | "No such artifact ([%d] of %s)", at->clone.type, cp); |
616 | } |
616 | } |
617 | } |
617 | } |
618 | LOG(llevDebug, "%s creates: (%d) (%d) (%s) of (%s)\n", op->name, |
618 | LOG(llevDebug, "%s creates: (%d) (%d) (%s) of (%s)\n", &op->name, |
619 | set_nrof ? nrof : 0, set_magic ? magic : 0, bp, cp); |
619 | set_nrof ? nrof : 0, set_magic ? magic : 0, bp, cp); |
620 | } |
620 | } |
621 | } /* if cp */ |
621 | } /* if cp */ |
622 | |
622 | |
623 | if ((at->clone.type == ROD || at->clone.type == WAND || at->clone.type == SCROLL || |
623 | if ((at->clone.type == ROD || at->clone.type == WAND || at->clone.type == SCROLL || |
… | |
… | |
706 | if (set_variable(tmp, bp2) == -1) |
706 | if (set_variable(tmp, bp2) == -1) |
707 | new_draw_info_format(NDI_UNIQUE, 0, op, |
707 | new_draw_info_format(NDI_UNIQUE, 0, op, |
708 | "Unknown variable %s", bp2); |
708 | "Unknown variable %s", bp2); |
709 | else |
709 | else |
710 | new_draw_info_format(NDI_UNIQUE, 0, op, |
710 | new_draw_info_format(NDI_UNIQUE, 0, op, |
711 | "(%s#%d)->%s", tmp->name, tmp->count, bp2); |
711 | "(%s#%d)->%s", &tmp->name, tmp->count, bp2); |
712 | bp2 = bp3+1; |
712 | bp2 = bp3+1; |
713 | } |
713 | } |
714 | |
714 | |
715 | if (at->clone.nrof) { |
715 | if (at->clone.nrof) { |
716 | if (at_spell) |
716 | if (at_spell) |
… | |
… | |
971 | SET_FLAG(tmp, FLAG_WAS_WIZ); /* To avoid cheating */ |
971 | SET_FLAG(tmp, FLAG_WAS_WIZ); /* To avoid cheating */ |
972 | if (set_variable(tmp, arg) == -1) |
972 | if (set_variable(tmp, arg) == -1) |
973 | new_draw_info_format(NDI_UNIQUE, 0, op, "Unknown variable %s", arg); |
973 | new_draw_info_format(NDI_UNIQUE, 0, op, "Unknown variable %s", arg); |
974 | else { |
974 | else { |
975 | new_draw_info_format(NDI_UNIQUE, 0, op, |
975 | new_draw_info_format(NDI_UNIQUE, 0, op, |
976 | "(%s#%d)->%s=%s", tmp->name, tmp->count, arg, arg2); |
976 | "(%s#%d)->%s=%s", &tmp->name, tmp->count, arg, arg2); |
977 | } |
977 | } |
978 | |
978 | |
979 | return 1; |
979 | return 1; |
980 | } |
980 | } |
981 | |
981 | |
… | |
… | |
1045 | int i, q; |
1045 | int i, q; |
1046 | object *skillob = NULL; |
1046 | object *skillob = NULL; |
1047 | player *pl; |
1047 | player *pl; |
1048 | |
1048 | |
1049 | skill[0] = '\0'; |
1049 | skill[0] = '\0'; |
1050 | if ((params == NULL) || (strlen(params) > MAX_BUF) || ((q = sscanf(params, "%s %d %s", buf, &i, &skill)) < 2)) { |
1050 | if ((params == NULL) || (strlen(params) > MAX_BUF) || ((q = sscanf(params, "%s %d %s", buf, &i, skill)) < 2)) { |
1051 | new_draw_info(NDI_UNIQUE, 0, op, "Usage: addexp <who> <how much> [<skill>]."); |
1051 | new_draw_info(NDI_UNIQUE, 0, op, "Usage: addexp <who> <how much> [<skill>]."); |
1052 | return 1; |
1052 | return 1; |
1053 | } |
1053 | } |
1054 | |
1054 | |
1055 | for (pl = first_player; pl != NULL; pl = pl->next) |
1055 | for (pl = first_player; pl != NULL; pl = pl->next) |
… | |
… | |
1111 | pl->ob->stats.Con, pl->ob->stats.ac, pl->ob->stats.wc) ; |
1111 | pl->ob->stats.Con, pl->ob->stats.ac, pl->ob->stats.wc) ; |
1112 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1112 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1113 | sprintf(buf, "Int : %-2d Damage : %d", |
1113 | sprintf(buf, "Int : %-2d Damage : %d", |
1114 | pl->ob->stats.Int, pl->ob->stats.dam); |
1114 | pl->ob->stats.Int, pl->ob->stats.dam); |
1115 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1115 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1116 | #ifndef WIN32 |
|
|
1117 | sprintf(buf, "Wis : %-2d EXP : %lld", |
1116 | sprintf(buf, "Wis : %-2d EXP : %lld", |
1118 | pl->ob->stats.Wis, pl->ob->stats.exp); |
1117 | pl->ob->stats.Wis, (long long)pl->ob->stats.exp); |
1119 | #else |
|
|
1120 | sprintf(buf, "Wis : %-2d EXP : %I64d", |
|
|
1121 | pl->ob->stats.Wis, pl->ob->stats.exp); |
|
|
1122 | #endif |
|
|
1123 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1118 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1124 | sprintf(buf, "Pow : %-2d Grace : %d", |
1119 | sprintf(buf, "Pow : %-2d Grace : %d", |
1125 | pl->ob->stats.Pow, pl->ob->stats.grace); |
1120 | pl->ob->stats.Pow, pl->ob->stats.grace); |
1126 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1121 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1127 | sprintf(buf, "Cha : %-2d Food : %d", |
1122 | sprintf(buf, "Cha : %-2d Food : %d", |
… | |
… | |
1175 | pl->ob->stats.Cha = iii, pl->orig_stats.Cha = iii; |
1170 | pl->ob->stats.Cha = iii, pl->orig_stats.Cha = iii; |
1176 | if (!strcmp("int", thing2)) |
1171 | if (!strcmp("int", thing2)) |
1177 | pl->ob->stats.Int = iii, pl->orig_stats.Int = iii; |
1172 | pl->ob->stats.Int = iii, pl->orig_stats.Int = iii; |
1178 | if (!strcmp("pow", thing2)) |
1173 | if (!strcmp("pow", thing2)) |
1179 | pl->ob->stats.Pow = iii, pl->orig_stats.Pow = iii; |
1174 | pl->ob->stats.Pow = iii, pl->orig_stats.Pow = iii; |
1180 | sprintf(buf, "%s has been altered.", pl->ob->name); |
1175 | sprintf(buf, "%s has been altered.", &pl->ob->name); |
1181 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1176 | new_draw_info(NDI_UNIQUE, 0, op, buf); |
1182 | fix_player(pl->ob); |
1177 | fix_player(pl->ob); |
1183 | return 1; |
1178 | return 1; |
1184 | } |
1179 | } |
1185 | } |
1180 | } |
… | |
… | |
1218 | if (op->map == m) { |
1213 | if (op->map == m) { |
1219 | dummy = get_object(); |
1214 | dummy = get_object(); |
1220 | dummy->map = NULL; |
1215 | dummy->map = NULL; |
1221 | EXIT_X(dummy) = op->x; |
1216 | EXIT_X(dummy) = op->x; |
1222 | EXIT_Y(dummy) = op->y; |
1217 | EXIT_Y(dummy) = op->y; |
1223 | EXIT_PATH(dummy) = add_string(op->map->path); |
1218 | EXIT_PATH(dummy) = op->map->path; |
1224 | remove_ob(op); |
1219 | remove_ob(op); |
1225 | op->map = NULL; |
1220 | op->map = NULL; |
1226 | tmp = op; |
1221 | tmp = op; |
1227 | } |
1222 | } |
1228 | swap_map(m); |
1223 | swap_map(m); |
… | |
… | |
1252 | |
1247 | |
1253 | new_draw_info(NDI_UNIQUE, 0, op, |
1248 | new_draw_info(NDI_UNIQUE, 0, op, |
1254 | "Reset failed, couldn't swap map, the following players are on it:"); |
1249 | "Reset failed, couldn't swap map, the following players are on it:"); |
1255 | for (pl = first_player; pl != NULL; pl = pl->next) { |
1250 | for (pl = first_player; pl != NULL; pl = pl->next) { |
1256 | if (pl->ob->map == m && pl->ob != op) { |
1251 | if (pl->ob->map == m && pl->ob != op) { |
1257 | new_draw_info_format(NDI_UNIQUE, 0, op, "%s", pl->ob->name); |
1252 | new_draw_info_format(NDI_UNIQUE, 0, op, "%s", &pl->ob->name); |
1258 | playercount++; |
1253 | playercount++; |
1259 | } |
1254 | } |
1260 | } |
1255 | } |
1261 | if (!playercount) |
1256 | if (!playercount) |
1262 | new_draw_info(NDI_UNIQUE, 0, op, |
1257 | new_draw_info(NDI_UNIQUE, 0, op, |
… | |
… | |
1274 | CLEAR_FLAG(op, FLAG_WAS_WIZ); |
1269 | CLEAR_FLAG(op, FLAG_WAS_WIZ); |
1275 | if (op->contr->hidden) { |
1270 | if (op->contr->hidden) { |
1276 | new_draw_info(NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
1271 | new_draw_info(NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
1277 | op->map->players++; |
1272 | op->map->players++; |
1278 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
1273 | new_draw_info_format(NDI_UNIQUE|NDI_ALL|NDI_DK_ORANGE, 5, NULL, |
1279 | "%s has entered the game.", op->name); |
1274 | "%s has entered the game.", &op->name); |
1280 | op->contr->hidden = 0; |
1275 | op->contr->hidden = 0; |
1281 | op->invisible = 1; |
1276 | op->invisible = 1; |
1282 | } else |
1277 | } else |
1283 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, "The Dungeon Master is gone.."); |
1278 | new_draw_info(NDI_UNIQUE|NDI_ALL|NDI_LT_GREEN, 1, NULL, "The Dungeon Master is gone.."); |
1284 | return 1; |
1279 | return 1; |
… | |
… | |
1415 | |
1410 | |
1416 | if (found != NULL) { |
1411 | if (found != NULL) { |
1417 | if (!conflict_found) { |
1412 | if (!conflict_found) { |
1418 | conflict_found = 1; |
1413 | conflict_found = 1; |
1419 | new_draw_info_format(NDI_UNIQUE, 0, op, "More than one archetype matches the spell name %s:", spell_name); |
1414 | new_draw_info_format(NDI_UNIQUE, 0, op, "More than one archetype matches the spell name %s:", spell_name); |
1420 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", found->name); |
1415 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", &found->name); |
1421 | } |
1416 | } |
1422 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", ar->name); |
1417 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", &ar->name); |
1423 | continue; |
1418 | continue; |
1424 | } |
1419 | } |
1425 | |
1420 | |
1426 | found = ar; |
1421 | found = ar; |
1427 | } |
1422 | } |
… | |
… | |
1450 | |
1445 | |
1451 | if (found != NULL) { |
1446 | if (found != NULL) { |
1452 | if (!conflict_found) { |
1447 | if (!conflict_found) { |
1453 | conflict_found = 1; |
1448 | conflict_found = 1; |
1454 | new_draw_info_format(NDI_UNIQUE, 0, op, "More than one spell matches %s:", spell_name); |
1449 | new_draw_info_format(NDI_UNIQUE, 0, op, "More than one spell matches %s:", spell_name); |
1455 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", found->clone.name); |
1450 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", &found->clone.name); |
1456 | } |
1451 | } |
1457 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", ar->clone.name); |
1452 | new_draw_info_format(NDI_UNIQUE, 0, op, "- %s", &ar->clone.name); |
1458 | continue; |
1453 | continue; |
1459 | } |
1454 | } |
1460 | |
1455 | |
1461 | found = ar; |
1456 | found = ar; |
1462 | } |
1457 | } |
… | |
… | |
1487 | if (tmp == NULL) { |
1482 | if (tmp == NULL) { |
1488 | return 0; |
1483 | return 0; |
1489 | } |
1484 | } |
1490 | |
1485 | |
1491 | if (check_spell_known(op, tmp->name)) { |
1486 | if (check_spell_known(op, tmp->name)) { |
1492 | new_draw_info_format(NDI_UNIQUE, 0, op, "You already know the spell %s.", tmp->name); |
1487 | new_draw_info_format(NDI_UNIQUE, 0, op, "You already know the spell %s.", &tmp->name); |
1493 | return 0; |
1488 | return 0; |
1494 | } |
1489 | } |
1495 | |
1490 | |
1496 | do_learn_spell(op, tmp, special_prayer); |
1491 | do_learn_spell(op, tmp, special_prayer); |
1497 | free_object(tmp); |
1492 | free_object(tmp); |
… | |
… | |
1795 | new_draw_info(NDI_UNIQUE, 0, op, "Item stack contents:"); |
1790 | new_draw_info(NDI_UNIQUE, 0, op, "Item stack contents:"); |
1796 | |
1791 | |
1797 | for (item = 0; item < pl->stack_position; item++) { |
1792 | for (item = 0; item < pl->stack_position; item++) { |
1798 | display = find_object(pl->stack_items[item]); |
1793 | display = find_object(pl->stack_items[item]); |
1799 | if (display) |
1794 | if (display) |
1800 | new_draw_info_format(NDI_UNIQUE, 0, op, " %d : %s [%d]", item, display->name, display->count); |
1795 | new_draw_info_format(NDI_UNIQUE, 0, op, " %d : %s [%d]", item, &display->name, display->count); |
1801 | else |
1796 | else |
1802 | /* Item was freed */ |
1797 | /* Item was freed */ |
1803 | new_draw_info_format(NDI_UNIQUE, 0, op, " %d : (lost item: %d)", item, pl->stack_items[item]); |
1798 | new_draw_info_format(NDI_UNIQUE, 0, op, " %d : (lost item: %d)", item, pl->stack_items[item]); |
1804 | } |
1799 | } |
1805 | |
1800 | |