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 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * 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 |
… | |
… | |
178 | command_kick (object *op, char *params) |
178 | command_kick (object *op, char *params) |
179 | { |
179 | { |
180 | for_all_players (pl) |
180 | for_all_players (pl) |
181 | if ((params == NULL || !strcmp (&pl->ob->name, params)) && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params))) |
181 | if ((params == NULL || !strcmp (&pl->ob->name, params)) && !INVOKE_PLAYER (KICK, pl, ARG_STRING (params))) |
182 | { |
182 | { |
183 | object *op = pl->ob; |
183 | object *plop = pl->ob; |
184 | |
184 | |
185 | if (!QUERY_FLAG (op, FLAG_REMOVED) && !QUERY_FLAG (op, FLAG_FREED)) |
185 | if (!QUERY_FLAG (plop, FLAG_REMOVED) && !QUERY_FLAG (plop, FLAG_FREED)) |
186 | { |
186 | { |
187 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s is kicked out of the game.", &op->name); |
187 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_RED, 5, op, "%s is kicked out of the game.", &plop->name); |
188 | strcpy (op->contr->killer, "kicked"); |
188 | plop->contr->killer = op; |
189 | } |
189 | } |
190 | |
190 | |
191 | pl->ns->destroy (); |
191 | pl->ns->destroy (); |
192 | } |
192 | } |
193 | |
193 | |
… | |
… | |
279 | /* we have nowhere to send the prisoner.... */ |
279 | /* we have nowhere to send the prisoner.... */ |
280 | new_draw_info (NDI_UNIQUE, 0, op, "can't jail player, there is no map to hold them"); |
280 | new_draw_info (NDI_UNIQUE, 0, op, "can't jail player, there is no map to hold them"); |
281 | return 0; |
281 | return 0; |
282 | } |
282 | } |
283 | |
283 | |
284 | pl->ob->enter_exit (dummy); |
284 | pl->ob->player_goto (dummy->slaying, dummy->stats.hp, dummy->stats.sp);//TODO |
285 | dummy->destroy (); |
285 | dummy->destroy (); |
|
|
286 | |
286 | new_draw_info (NDI_UNIQUE, 0, pl->ob, "You have been arrested."); |
287 | new_draw_info (NDI_UNIQUE, 0, pl->ob, "You have been arrested."); |
287 | new_draw_info (NDI_UNIQUE, 0, op, "OK."); |
288 | new_draw_info (NDI_UNIQUE, 0, op, "OK."); |
288 | LOG (llevInfo, "Player %s arrested by %s\n", &pl->ob->name, &op->name); |
289 | LOG (llevInfo, "Player %s arrested by %s\n", &pl->ob->name, &op->name); |
289 | return 1; |
290 | return 1; |
290 | } |
291 | } |
… | |
… | |
314 | { |
315 | { |
315 | new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player."); |
316 | new_draw_info (NDI_UNIQUE, 0, op, "Can not find a free spot to place summoned player."); |
316 | return 1; |
317 | return 1; |
317 | } |
318 | } |
318 | |
319 | |
319 | dummy = object::create (); |
320 | pl->ob->player_goto (op->map->path, op->x + freearr_x[i], op->y + freearr_y[i]); |
320 | EXIT_PATH (dummy) = op->map->path; |
|
|
321 | EXIT_X (dummy) = op->x + freearr_x[i]; |
|
|
322 | EXIT_Y (dummy) = op->y + freearr_y[i]; |
|
|
323 | pl->ob->enter_exit (dummy); |
|
|
324 | dummy->destroy (); |
|
|
325 | new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned."); |
321 | new_draw_info (NDI_UNIQUE, 0, pl->ob, "You are summoned."); |
326 | new_draw_info (NDI_UNIQUE, 0, op, "OK."); |
322 | new_draw_info (NDI_UNIQUE, 0, op, "OK."); |
327 | |
323 | |
328 | return 1; |
324 | return 1; |
329 | } |
325 | } |
… | |
… | |
1055 | * Remove setting flying here - that won't work, because next |
1051 | * Remove setting flying here - that won't work, because next |
1056 | * fix_player() is called that will get cleared - proper solution |
1052 | * fix_player() is called that will get cleared - proper solution |
1057 | * is probably something like a wiz_force which gives that and any |
1053 | * is probably something like a wiz_force which gives that and any |
1058 | * other desired abilities. |
1054 | * other desired abilities. |
1059 | */ |
1055 | */ |
1060 | clear_los (op->contr); |
1056 | op->contr->clear_los (0); |
1061 | op->contr->write_buf[0] = '\0'; |
1057 | op->contr->write_buf[0] = '\0'; |
1062 | |
1058 | |
1063 | if (!silent) |
1059 | if (!silent) |
1064 | new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master has arrived!"); |
1060 | new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master has arrived!"); |
1065 | |
1061 | |