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.88 by root, Fri Jan 27 22:00:40 2012 UTC vs.
Revision 1.91 by root, Wed Nov 21 12:12:03 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,2011,2012 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
10 * Free Software Foundation, either version 3 of the License, or (at your 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 11 * option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the Affero GNU General Public License 18 * You should have received a copy of the Affero GNU General Public License
19 * and the GNU General Public License along with this program. If not, see 19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>. 20 * <http://www.gnu.org/licenses/>.
21 * 21 *
22 * The authors can be reached via e-mail to <support@deliantra.net> 22 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 23 */
24 24
25#include <global.h> 25#include <global.h>
26#include <sproto.h> 26#include <sproto.h>
1033/**************************************************************************/ 1033/**************************************************************************/
1034 1034
1035int 1035int
1036command_stats (object *op, char *params) 1036command_stats (object *op, char *params)
1037{ 1037{
1038 char thing[20];
1039 char buf[MAX_BUF]; 1038 char buf[MAX_BUF];
1040 1039
1041 thing[0] = '\0'; 1040 if (params == NULL || params[0] == '\0')
1042 if (params == NULL || !sscanf (params, "%s", thing) || thing == NULL)
1043 { 1041 {
1044 new_draw_info (NDI_UNIQUE, 0, op, "Who?"); 1042 new_draw_info (NDI_UNIQUE, 0, op, "Who?");
1045 return 1; 1043 return 1;
1046 } 1044 }
1047 1045
1048 for_all_players (pl) 1046 for_all_players (pl)
1049 if (!strcmp (&pl->ob->name, thing)) 1047 if (!strcmp (&pl->ob->name, params))
1050 { 1048 {
1051 sprintf (buf, "Str : %-2d H.P. : %-4d MAX : %d", pl->ob->stats.Str, pl->ob->stats.hp, pl->ob->stats.maxhp); 1049 sprintf (buf, "Str : %-2d H.P. : %-4d MAX : %d", pl->ob->stats.Str, pl->ob->stats.hp, pl->ob->stats.maxhp);
1052 new_draw_info (NDI_UNIQUE, 0, op, buf); 1050 new_draw_info (NDI_UNIQUE, 0, op, buf);
1053 sprintf (buf, "Dex : %-2d S.P. : %-4d MAX : %d", pl->ob->stats.Dex, pl->ob->stats.sp, pl->ob->stats.maxsp); 1051 sprintf (buf, "Dex : %-2d S.P. : %-4d MAX : %d", pl->ob->stats.Dex, pl->ob->stats.sp, pl->ob->stats.maxsp);
1054 new_draw_info (NDI_UNIQUE, 0, op, buf); 1052 new_draw_info (NDI_UNIQUE, 0, op, buf);
1347 { 1345 {
1348 new_draw_info (NDI_UNIQUE, 0, op, "Which spell do you want to forget?"); 1346 new_draw_info (NDI_UNIQUE, 0, op, "Which spell do you want to forget?");
1349 return 0; 1347 return 0;
1350 } 1348 }
1351 1349
1352 spell = lookup_spell_by_name (op, params); 1350 spell = op->find_spell (params);
1353 if (spell == NULL) 1351 if (spell == NULL)
1354 { 1352 {
1355 new_draw_info_format (NDI_UNIQUE, 0, op, "You do not know the spell %s.", params); 1353 new_draw_info_format (NDI_UNIQUE, 0, op, "You do not know the spell %s.", params);
1356 return 0; 1354 return 0;
1357 } 1355 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines