ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_wiz.C
(Generate patch)

Comparing deliantra/server/server/c_wiz.C (file contents):
Revision 1.84 by root, Thu Apr 15 02:51:39 2010 UTC vs.
Revision 1.88 by root, Fri Jan 27 22:00:40 2012 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
436 436
437int 437int
438command_summon (object *op, char *params) 438command_summon (object *op, char *params)
439{ 439{
440 int i; 440 int i;
441 object *dummy;
442 player *pl; 441 player *pl;
443 442
444 if (!op) 443 if (!op)
445 return 0; 444 return 0;
446 445
452 451
453 pl = get_other_player_from_name (op, params); 452 pl = get_other_player_from_name (op, params);
454 if (!pl) 453 if (!pl)
455 return 1; 454 return 1;
456 455
457 i = find_free_spot (op, op->map, op->x, op->y, 1, 9); 456 maptile *m = op->map;
457 sint16 nx = op->x;
458 sint16 ny = op->y;
459
460 i = find_free_spot (op, m, nx, ny, 1, SIZEOFFREE1+1);
458 if (i == -1) 461 if (i == -1)
459 { 462 {
460 new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player."); 463 new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player.");
461 return 1; 464 return 1;
462 } 465 }
463 466
464 pl->ob->player_goto (op->map->path, op->x + freearr_x[i], op->y + freearr_y[i]); 467 nx += freearr_x [i];
468 ny += freearr_y [i];
469
470 if (!xy_normalise (m, nx, ny))
471 {
472 new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player.");
473 return 1;
474 }
475
476 pl->ob->player_goto (m->path, nx, ny);
465 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned."); 477 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned.");
466 new_draw_info (NDI_UNIQUE, 0, op, "OK."); 478 new_draw_info (NDI_UNIQUE, 0, op, "OK.");
467 479
468 return 1; 480 return 1;
469} 481}
486int 498int
487command_create (object *op, char *params) 499command_create (object *op, char *params)
488{ 500{
489 object *tmp = NULL; 501 object *tmp = NULL;
490 int nrof, i, magic, set_magic = 0, set_nrof = 0, gotquote, gotspace; 502 int nrof, i, magic, set_magic = 0, set_nrof = 0, gotquote, gotspace;
491 char buf[MAX_BUF], *cp, *bp = buf, *bp2, *bp3, *bp4, *endline; 503 char buf[MAX_BUF], *cp, *bp = buf, *bp2, *bp3, *endline;
492 archetype *at, *at_spell = NULL; 504 archetype *at, *at_spell = NULL;
493 artifact *art = NULL; 505 artifact *art = NULL;
494 506
495 if (!op) 507 if (!op)
496 return 0; 508 return 0;
644 * is we want to find two spaces, but if we got a quote, 656 * is we want to find two spaces, but if we got a quote,
645 * any spaces there don't count. 657 * any spaces there don't count.
646 */ 658 */
647 while (*bp2 && bp2 <= endline) 659 while (*bp2 && bp2 <= endline)
648 { 660 {
649 bp4 = NULL;
650 gotspace = 0; 661 gotspace = 0;
651 gotquote = 0; 662 gotquote = 0;
652 663
653 /* find the first quote */ 664 /* find the first quote */
654 for (bp3 = bp2; *bp3 && gotspace < 2 && gotquote < 2; bp3++) 665 for (bp3 = bp2; *bp3 && gotspace < 2 && gotquote < 2; bp3++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines