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.28 by root, Sat Dec 30 10:16:11 2006 UTC vs.
Revision 1.31 by root, Sun Jan 14 02:10:41 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 CrossFire, A Multiplayer game for X-windows
3 3
4 Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 Copyright (C) 2002 Mark Wedel & Crossfire Development Team
5 Copyright (C) 1992 Frank Tore Johansen 6 Copyright (C) 1992 Frank Tore Johansen
6 7
7 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
20 21
21 The authors can be reached via e-mail at <crossfire@schmorp.de> 22 The authors can be reached via e-mail at <crossfire@schmorp.de>
22*/ 23*/
23 24
24#include <global.h> 25#include <global.h>
25#ifndef __CEXTRACT__
26# include <sproto.h> 26#include <sproto.h>
27#endif
28#include <spells.h> 27#include <spells.h>
29#include <treasure.h> 28#include <treasure.h>
30#include <skills.h> 29#include <skills.h>
31 30
32/** Defines for DM item stack **/ 31/** Defines for DM item stack **/
271#endif 270#endif
272 271
273int 272int
274command_shutdown (object *op, char *params) 273command_shutdown (object *op, char *params)
275{ 274{
276 if (op != NULL && !QUERY_FLAG (op, FLAG_WIZ)) 275 if (op && !QUERY_FLAG (op, FLAG_WIZ))
277 { 276 {
278 new_draw_info (NDI_UNIQUE, 0, op, "Sorry, you can't shutdown the server."); 277 new_draw_info (NDI_UNIQUE, 0, op, "Sorry, you can't shutdown the server.");
279 return 1; 278 return 1;
280 } 279 }
281 280
282 cleanup (0); 281 cleanup ("dm initiated shutdown", 0);
283 282
284 /* not reached */ 283 /* not reached */
285 return 1; 284 return 1;
286} 285}
287 286
390 pl->ob->enter_exit (dummy); 389 pl->ob->enter_exit (dummy);
391 dummy->destroy (); 390 dummy->destroy ();
392 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned."); 391 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned.");
393 new_draw_info (NDI_UNIQUE, 0, op, "OK."); 392 new_draw_info (NDI_UNIQUE, 0, op, "OK.");
394 393
395 return 1;
396}
397
398/**
399 * Teleport next to target player.
400 */
401
402/* mids 01/16/2002 */
403int
404command_teleport (object *op, char *params)
405{
406 int i;
407 object *dummy;
408 player *pl;
409
410 if (!op)
411 return 0;
412
413 if (params == NULL)
414 {
415 new_draw_info (NDI_UNIQUE, 0, op, "Usage: teleport <player>.");
416 return 1;
417 }
418
419 pl = get_other_player_from_name (op, params);
420 if (!pl)
421 return 1;
422
423 i = find_free_spot (pl->ob, pl->ob->map, pl->ob->x, pl->ob->y, 1, 9);
424 if (i == -1)
425 {
426 new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to teleport to.");
427 return 1;
428 }
429
430 dummy = object::create ();
431 EXIT_PATH (dummy) = pl->ob->map->path;
432 EXIT_X (dummy) = pl->ob->x + freearr_x[i];
433 EXIT_Y (dummy) = pl->ob->y + freearr_y[i];
434 op->enter_exit (dummy);
435 dummy->destroy ();
436 if (!op->contr->hidden)
437 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You see a portal open.");
438 new_draw_info (NDI_UNIQUE, 0, op, "OK.");
439 return 1; 394 return 1;
440} 395}
441 396
442/** 397/**
443 * This function is a real mess, because we're stucking getting 398 * This function is a real mess, because we're stucking getting

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines