Crossfire Server, Branches 1.12
R18729
|
#include <global.h>
#include <sproto.h>
#include <spells.h>
#include <treasure.h>
#include <skills.h>
Go to the source code of this file.
Macros | |
#define | STACK_SIZE 50 |
Enumerations | |
enum | { STACK_FROM_NONE = 0, STACK_FROM_TOP = 1, STACK_FROM_STACK = 2, STACK_FROM_NUMBER = 3 } |
Functions | |
static int | checkdm (object *op, const char *pl_name, const char *pl_passwd, const char *pl_host) |
int | command_abil (object *op, char *params) |
int | command_addexp (object *op, char *params) |
int | command_arrest (object *op, char *params) |
int | command_banish (object *op, char *params) |
int | command_create (object *op, char *params) |
int | command_diff (object *op, char *params) |
int | command_dm (object *op, char *params) |
int | command_dmhide (object *op, char *params) |
int | command_dump (object *op, char *params) |
int | command_follow (object *op, char *params) |
int | command_forget_spell (object *op, char *params) |
int | command_free (object *op, char *params) |
int | command_freeze (object *op, char *params) |
int | command_goto (object *op, char *params) |
int | command_hide (object *op, char *params) |
int | command_insert_into (object *op, char *params) |
int | command_inventory (object *op, char *params) |
int | command_invisible (object *op, char *params) |
int | command_kick (object *op, const char *params) |
int | command_learn_special_prayer (object *op, char *params) |
int | command_learn_spell (object *op, char *params) |
static int | command_learn_spell_or_prayer (object *op, char *params, int special_prayer) |
int | command_listplugins (object *op, char *params) |
int | command_loadplugin (object *op, char *params) |
int | command_loadtest (object *op, char *params) |
int | command_mon_aggr (object *op, char *params) |
int | command_nowiz (object *op, char *params) |
int | command_overlay_reset (object *op, char *params) |
int | command_overlay_save (object *op, char *params) |
int | command_patch (object *op, char *params) |
int | command_possess (object *op, char *params) |
int | command_remove (object *op, char *params) |
int | command_reset (object *op, char *params) |
int | command_setgod (object *op, char *params) |
int | command_shutdown (object *op, char *params) |
int | command_skills (object *op, char *params) |
int | command_speed (object *op, char *params) |
int | command_stack_clear (object *op, char *params) |
int | command_stack_list (object *op, char *params) |
int | command_stack_pop (object *op, char *params) |
int | command_stack_push (object *op, char *params) |
int | command_stats (object *op, char *params) |
int | command_style_map_info (object *op, char *params) |
int | command_summon (object *op, char *params) |
int | command_teleport (object *op, char *params) |
int | command_toggle_shout (object *op, char *params) |
int | command_unloadplugin (object *op, char *params) |
object * | dm_stack_peek (player *pl) |
void | dm_stack_pop (player *pl) |
void | dm_stack_push (player *pl, tag_t item) |
int | do_wizard_dm (object *op, char *params, int silent) |
void | do_wizard_hide (object *op, int silent_dm) |
static object * | find_object_both (char *params) |
object * | get_dm_object (player *pl, char **params, int *from) |
static player * | get_other_player_from_name (object *op, const char *name) |
static object * | get_spell_by_name (object *op, const char *spell_name) |
Those functions are used by DMs.
Definition in file c_wiz.c.
#define STACK_SIZE 50 |
anonymous enum |
Values for 'from' field of get_dm_object()
Enumerator | |
---|---|
STACK_FROM_NONE |
Item was not found |
STACK_FROM_TOP |
Item is stack top |
STACK_FROM_STACK |
Item is somewhere in stack |
STACK_FROM_NUMBER |
Item is a number (may be top) |
|
static |
object *op is trying to become dm. pl_name is name supplied by player. Restrictive DM will make it harder for socket users to become DM - in that case, it will check for the players character name.
op | player wishing to become DM. |
pl_name | player's name. |
pl_passwd | entered password. |
pl_host | player's host. |
0 | invalid credentials. |
1 | op can become DM. |
Definition at line 1887 of file c_wiz.c.
References Settings::confdir, DMFILE, llevDebug, llevError, LOG(), MAX_BUF, obj::name, settings, and snprintf().
Referenced by do_wizard_dm().
int command_abil | ( | object * | op, |
char * | params | ||
) |
Changes an object's statistics.
op | wizard. |
params | parameters, should be "player statistic new_value". |
Definition at line 1595 of file c_wiz.c.
References liv::Cha, liv::Con, liv::Dex, draw_ext_info(), draw_ext_info_format(), FALSE, first_player, fix_object(), FLAG_WAS_WIZ, liv::Int, MAX_STAT, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, pl::orig_stats, liv::Pow, Settings::real_wiz, SET_FLAG, settings, obj::stats, liv::Str, and liv::Wis.
int command_addexp | ( | object * | op, |
char * | params | ||
) |
This adds exp to a player. We now allow adding to a specific skill.
op | wizard. |
params | should be "player quantity [skill]". |
Definition at line 1433 of file c_wiz.c.
References calc_perm_exp(), check_exp_adjust(), draw_ext_info(), draw_ext_info_format(), liv::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, player_lvl_adj(), Settings::real_wiz, SET_FLAG, settings, and obj::stats.
int command_arrest | ( | object * | op, |
char * | params | ||
) |
Wizard jails player.
op | wizard. |
params | player to jail. |
Definition at line 619 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), enter_exit(), free_object(), get_jail_exit(), get_other_player_from_name(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and pl::ob.
int command_banish | ( | object * | op, |
char * | params | ||
) |
Add player's IP to ban_file and kick them off the server.
I know most people have dynamic IPs but this is more of a short term solution if they have to get a new IP to play maybe they'll calm down. This uses the banish_file in the local directory *not *the ban_file The action is logged with a ! for easy searching. -tm
op | DM banishing. |
params | player to banish. Must be a complete name match. |
Definition at line 293 of file c_wiz.c.
References BANISHFILE, command_kick(), draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), socket_struct::host, llevDebug, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::ob, settings, snprintf(), and pl::socket.
int command_create | ( | object * | op, |
char * | params | ||
) |
Wizard wants to create an object.
This function is a real mess, because we're stucking getting the entire item description in one block of text, so we just can't simply parse it - we need to look for double quotes for example. This could actually get much simpler with just a little help from the client - if we could get line breaks, it makes parsing much easier, eg, something like:
which is much easier to parse than dragon name "big nasty creature" hp 5 sp 30 for example.
op | wizard. |
params | object description. |
Definition at line 783 of file c_wiz.c.
References obj::arch, arch_to_object(), CLEAR_FLAG, archt::clone, obj::contr, copy_object(), obj::count, pl::count, create_treasure(), mapdef::difficulty, dm_stack_pop(), dm_stack_push(), draw_ext_info(), draw_ext_info_format(), FALSE, find_archetype(), find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_KNOWN_MAGICAL, FLAG_WAS_WIZ, free_object(), give_artifact_abilities(), GT_APPLY, HORN, insert_ob_in_map(), insert_ob_in_map_at(), insert_ob_in_ob(), artifactstruct::item, artifactliststruct::items, llevDebug, LOG(), obj::map, MAX, MAX_BUF, obj::more, archt::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, need_identify(), artifactstruct::next, obj::nrof, object_create_arch(), out_of_map(), QUERY_FLAG, obj::randomitems, Settings::real_wiz, ROD, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, SPELL, SPELLBOOK, obj::type, WAND, obj::x, and obj::y.
int command_diff | ( | object * | op, |
char * | params | ||
) |
Get a diff of specified items. Second item is compared to first, and differences displayed.
Ryo, august 2004
op | wizard. |
params | object specifier. |
Definition at line 2664 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), find_object(), get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, STACK_FROM_NUMBER, STACK_FROM_TOP, pl::stack_items, pl::stack_position, stringbuffer_finish(), and stringbuffer_new().
int command_dm | ( | object * | op, |
char * | params | ||
) |
Actual command to perhaps become dm. Changed around a bit in version 0.92.2 to allow people on sockets to become dm, and allow better dm file
op | player wishing to become wizard. |
params | password. |
Definition at line 1983 of file c_wiz.c.
References do_wizard_dm().
int command_dmhide | ( | object * | op, |
char * | params | ||
) |
A players wants to become DM and hide. Let's see if that's authorized. Make sure to not tell anything to anyone.
op | wizard. |
params | password. |
0 | failure. |
1 | success. |
Definition at line 2333 of file c_wiz.c.
References do_wizard_dm(), and do_wizard_hide().
int command_dump | ( | object * | op, |
char * | params | ||
) |
Dumps the difference between an object and its archetype.
op | wiard. |
params | object to dump. |
Definition at line 1171 of file c_wiz.c.
References obj::contr, draw_ext_info(), dump_object(), FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, stringbuffer_finish(), and stringbuffer_new().
int command_follow | ( | object * | op, |
char * | params | ||
) |
DM wants to follow a player, or stop following a player.
op | wizard. |
params | player to follow. If NULL, stop following player. |
Definition at line 2863 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), find_player_partial_name(), pl::followed_player, FREE_AND_CLEAR_STR, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_UNIQUE, and pl::ob.
int command_forget_spell | ( | object * | op, |
char * | params | ||
) |
Wizard wishes to forget a spell.
op | wizard. |
params | spell name to forget. |
Definition at line 2210 of file c_wiz.c.
References obj::contr, do_forget_spell(), draw_ext_info(), draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.
int command_free | ( | object * | op, |
char * | params | ||
) |
Totally free an object.
op | wizard. |
params | object to free. |
Definition at line 1394 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), FLAG_REMOVED, free_object(), get_dm_object(), obj::head, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, QUERY_FLAG, remove_ob(), and STACK_FROM_STACK.
int command_freeze | ( | object * | op, |
char * | params | ||
) |
Freezes a player for a specified tick count, 100 by default.
op | wizard freezing the player. |
params | optional tick count, followed by player name. |
Definition at line 571 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_RED, NDI_UNIQUE, pl::ob, obj::speed, and obj::speed_left.
int command_goto | ( | object * | op, |
char * | params | ||
) |
Wizard teleports to a map.
op | wizard teleporting. |
params | map to teleport to. Can be absolute or relative path. |
Definition at line 532 of file c_wiz.c.
References add_string(), mapdef::difficulty, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, free_object(), get_object(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.
Referenced by command_loadtest().
int command_hide | ( | object * | op, |
char * | params | ||
) |
Wizard 'hide' command.
op | DM wanting to hide. |
params | ignored. |
Definition at line 197 of file c_wiz.c.
References do_wizard_hide().
int command_insert_into | ( | object * | op, |
char * | params | ||
) |
Puts an object into another.
op | wizard. |
params | object specifier. |
Definition at line 2733 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), esrv_update_item(), find_object(), FLAG_REMOVED, get_dm_object(), insert_ob_in_ob(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), STACK_FROM_NUMBER, STACK_FROM_TOP, pl::stack_items, pl::stack_position, obj::type, UPD_NAME, UPD_NROF, and UPD_WEIGHT.
int command_inventory | ( | object * | op, |
char * | params | ||
) |
Shows the inventory or some item.
op | player. |
params | object count to get the inventory of. If NULL then defaults to op. |
Definition at line 1123 of file c_wiz.c.
References draw_ext_info(), find_object(), inventory(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.
int command_invisible | ( | object * | op, |
char * | params | ||
) |
Wizard wants to become invisible.
op | wizard. |
params | ignored. |
Definition at line 1998 of file c_wiz.c.
References draw_ext_info(), obj::invisible, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, UP_OBJ_FACE, and update_object().
int command_kick | ( | object * | op, |
const char * | params | ||
) |
Kicks a player from the server.
op | DM kicking. |
params | player to kick. Must be a full name match. |
Definition at line 352 of file c_wiz.c.
References check_score(), obj::contr, obj::direction, draw_ext_info_format(), EVENT_KICK, execute_global_event(), first_player, FLAG_FREED, FLAG_REMOVED, pl::killer, obj::map, MAP_TIMEOUT, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, obj::name, NDI_ALL, NDI_RED, NDI_UNIQUE, pl::next, Ns_Dead, pl::ob, mapdef::players, QUERY_FLAG, remove_ob(), save_player(), pl::socket, socket_struct::status, and mapdef::timeout.
Referenced by command_banish(), and command_shutdown().
int command_learn_special_prayer | ( | object * | op, |
char * | params | ||
) |
Wizard wants to learn a god-given spell.
op | wizard. |
params | spell name. |
0 | failure. |
1 | success. |
Definition at line 2196 of file c_wiz.c.
References command_learn_spell_or_prayer().
int command_learn_spell | ( | object * | op, |
char * | params | ||
) |
Wizard wants to learn a regular spell.
op | wizard. |
params | spell name. |
0 | failure. |
1 | success. |
Definition at line 2180 of file c_wiz.c.
References command_learn_spell_or_prayer().
|
static |
Wizards wants to learn a spell.
op | wizard. |
params | spell name to learn. |
special_prayer | if set, special (god-given) prayer. |
0 | spell wasn't learned, or was already learnt. |
1 | spell learned. |
Definition at line 2141 of file c_wiz.c.
References check_spell_known(), obj::contr, do_learn_spell(), draw_ext_info(), draw_ext_info_format(), free_object(), get_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, and NDI_UNIQUE.
Referenced by command_learn_special_prayer(), and command_learn_spell().
int command_listplugins | ( | object * | op, |
char * | params | ||
) |
Lists all plugins currently loaded with their IDs and full names.
op | wizard. |
params | ignored. |
Definition at line 2242 of file c_wiz.c.
References plugins_display_list().
int command_loadplugin | ( | object * | op, |
char * | params | ||
) |
Loads the given plugin. The DM specifies the name of the library to load (no pathname is needed). Do not ever attempt to load the same plugin more than once at a time, or bad things could happen.
op | DM loading a plugin. |
params | should be the plugin's name, eg cfpython.so |
Definition at line 2259 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), LIBDIR, llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and plugins_init_plugin().
int command_loadtest | ( | object * | op, |
char * | params | ||
) |
This command will stress server.
It will basically load all world maps (so 900 maps).
op | DM wanting to test the server. |
params | option, must be "TRUE" for the test to happen. |
Definition at line 108 of file c_wiz.c.
References command_goto(), draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, settings, snprintf(), Settings::worldmapstartx, Settings::worldmapstarty, Settings::worldmaptilesx, and Settings::worldmaptilesy.
int command_mon_aggr | ( | object * | op, |
char * | params | ||
) |
When DM is possessing a monster, flip aggression on and off, to allow better motion.
op | wiard. |
params | ignored. |
Definition at line 1202 of file c_wiz.c.
References CLEAR_FLAG, draw_ext_info(), obj::enemy, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.
int command_nowiz | ( | object * | op, |
char * | params | ||
) |
Steps down from wizard mode.
op | wizard. |
params | ignored. |
Definition at line 1839 of file c_wiz.c.
References CLEAR_FLAG, obj::contr, draw_ext_info(), draw_ext_info_format(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, pl::followed_player, FREE_AND_CLEAR_STR, pl::hidden, obj::invisible, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, mapdef::players, Settings::real_wiz, settings, TRUE, and update_los().
int command_overlay_reset | ( | object * | op, |
char * | params | ||
) |
Removes the overlay for op's current map.
op | DM acting. |
params | ignored. |
Definition at line 430 of file c_wiz.c.
References create_overlay_pathname(), draw_ext_info(), obj::map, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, mapdef::path, and unlink.
int command_overlay_save | ( | object * | op, |
char * | params | ||
) |
Saves the op's map as an overlay - objects are persisted.
op | DM wanting to save. |
params | ignored. |
Definition at line 406 of file c_wiz.c.
References draw_ext_info(), obj::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, save_map(), and SAVE_MODE_OVERLAY.
int command_patch | ( | object * | op, |
char * | params | ||
) |
Wizard wants to altar an object.
op | wizard. |
params | object and what to patch. |
Definition at line 1296 of file c_wiz.c.
References obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), FALSE, FLAG_WAS_WIZ, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, Settings::real_wiz, SET_FLAG, set_variable(), and settings.
int command_possess | ( | object * | op, |
char * | params | ||
) |
DM can possess a monster. Basically, this tricks the client into thinking a given monster, is actually the player it controls. This allows a DM to inhabit a monster's body, and run around the game with it. This function is severely broken - it has tons of hardcoded values,
op | wizard wanting to possess something. |
params | monster to possess. |
Definition at line 1232 of file c_wiz.c.
References obj::body_info, obj::contr, do_some_living(), draw_ext_info(), esrv_new_player(), esrv_send_inventory(), find_object(), find_object_name(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, NUM_BODY_LOCATIONS, pl::ob, PLAYER, SET_FLAG, and obj::type.
int command_remove | ( | object * | op, |
char * | params | ||
) |
Remove an object from its position.
op | wizard. |
params | object to remove. |
Definition at line 1342 of file c_wiz.c.
References obj::contr, dm_stack_pop(), draw_ext_info(), draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), obj::head, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, query_name(), remove_ob(), obj::speed, STACK_FROM_STACK, obj::type, and update_ob_speed().
int command_reset | ( | object * | op, |
char * | params | ||
) |
Resets a map.
op | wizard. |
params | map to reset. Can be "." for current op's map, or a map path. |
Definition at line 1665 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, first_player, flush_old_maps(), free_object(), get_object(), has_been_loaded(), HUGE_BUF, mapdef::in_memory, insert_ob_in_map(), llevDebug, llevError, LOG(), obj::map, MAP_IN_MEMORY, map_remove_unique_files(), MAP_SWAPPED, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_RED, NDI_UNIQUE, pl::next, pl::ob, mapdef::path, path_combine_and_normalize(), remove_ob(), mapdef::reset_time, SAVE_ERROR_PLAYER, snprintf(), swap_map(), pl::transport, mapdef::unique, obj::x, and obj::y.
int command_setgod | ( | object * | op, |
char * | params | ||
) |
Sets the god for some objects.
op | DM wanting to change an object. |
params | command options. Should contain two values, first the object to change, followed by the god to change it to. |
0 | syntax error. |
1 | correct syntax. |
Definition at line 232 of file c_wiz.c.
References become_follower(), draw_ext_info(), draw_ext_info_format(), find_god(), find_object_both(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, PLAYER, and obj::type.
int command_shutdown | ( | object * | op, |
char * | params | ||
) |
Totally shutdowns the server.
op | wizard shutting down the server. |
params | ignored. |
Definition at line 508 of file c_wiz.c.
References check_score(), cleanup(), command_kick(), play_again(), and save_player().
int command_skills | ( | object * | op, |
char * | params | ||
) |
Player is asking for her skills.
Just show player's their skills for now. Dm's can already see skills w/ inventory command - b.t.
op | player. |
params | optional skill restriction. |
Definition at line 1156 of file c_wiz.c.
References show_skills().
int command_speed | ( | object * | op, |
char * | params | ||
) |
Changes the server speed.
op | wizard. |
params | new speed, or NULL to see the speed. |
Definition at line 1493 of file c_wiz.c.
References draw_ext_info_format(), max_time, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, reset_sleep(), and set_max_time().
int command_stack_clear | ( | object * | op, |
char * | params | ||
) |
Empty DM item stack.
op | wizard. |
params | ignored. |
Definition at line 2636 of file c_wiz.c.
References obj::contr, draw_ext_info(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and pl::stack_position.
int command_stack_list | ( | object * | op, |
char * | params | ||
) |
Displays stack contents.
op | wizard. |
params | ignored. |
Definition at line 2600 of file c_wiz.c.
References obj::contr, obj::count, draw_ext_info(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, obj::name, NDI_UNIQUE, pl::stack_items, and pl::stack_position.
int command_stack_pop | ( | object * | op, |
char * | params | ||
) |
Pop the stack top.
op | wizard. |
params | ignored. |
Definition at line 2563 of file c_wiz.c.
References obj::contr, and dm_stack_pop().
int command_stack_push | ( | object * | op, |
char * | params | ||
) |
Push specified item on stack.
op | wizard. |
params | object specifier. |
Definition at line 2578 of file c_wiz.c.
References obj::contr, obj::count, dm_stack_push(), get_dm_object(), and STACK_FROM_NUMBER.
int command_stats | ( | object * | op, |
char * | params | ||
) |
Displays the statistics of a player.
op | wizard. |
params | player's name. |
Definition at line 1528 of file c_wiz.c.
References liv::ac, liv::Cha, liv::Con, liv::dam, liv::Dex, draw_ext_info(), draw_ext_info_format(), liv::exp, find_player_partial_name(), liv::food, liv::grace, liv::hp, liv::Int, liv::maxhp, liv::maxsp, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, liv::Pow, liv::sp, obj::stats, liv::Str, liv::wc, and liv::Wis.
int command_style_map_info | ( | object * | op, |
char * | params | ||
) |
Displays information about styles loaded for random maps.
op | wizard. |
params | ignored. |
Definition at line 2815 of file c_wiz.c.
References obj::above, draw_ext_info(), draw_ext_info_format(), GET_MAP_OB, MAP_HEIGHT, MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapdef::next, and styles.
int command_summon | ( | object * | op, |
char * | params | ||
) |
Summons player near DM.
op | DM. |
params | player to summon. |
Definition at line 661 of file c_wiz.c.
References add_string(), draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), free_object(), freearr_x, freearr_y, get_object(), get_other_player_from_name(), obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.
int command_teleport | ( | object * | op, |
char * | params | ||
) |
Teleport next to target player.
op | DM teleporting. |
params | options sent by player. |
Definition at line 712 of file c_wiz.c.
References add_string(), obj::contr, draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_free_spot(), find_player_partial_name(), free_object(), freearr_x, freearr_y, get_object(), pl::hidden, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::ob, mapdef::path, obj::x, and obj::y.
int command_toggle_shout | ( | object * | op, |
char * | params | ||
) |
A simple toggle for the no_shout field. AKA the MUZZLE command.
op | wizard toggling. |
params | player to mute/unmute. |
Definition at line 459 of file c_wiz.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), EVENT_MUZZLE, execute_global_event(), get_other_player_from_name(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ORANGE, NDI_RED, NDI_UNIQUE, pl::no_shout, and pl::ob.
int command_unloadplugin | ( | object * | op, |
char * | params | ||
) |
Unloads the given plugin. The DM specified the ID of the library to unload. Note that some things may behave strangely if the correct plugins are not loaded.
op | DM unloading a plugin. |
params | should be the plugin's internal name, eg Python |
Definition at line 2298 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, and plugins_remove_plugin().
Get current stack top item for player. Returns NULL if no stacked item. If stacked item disappeared (freed), remove it.
Ryo, august 2004
pl | wizard. |
Definition at line 2373 of file c_wiz.c.
References dm_stack_pop(), draw_ext_info(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.
Referenced by get_dm_object().
void dm_stack_pop | ( | player * | pl | ) |
Remove an item from the wizard's item stack.
pl | wizard. |
Definition at line 2347 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, and pl::stack_position.
Referenced by command_create(), command_diff(), command_free(), command_insert_into(), command_remove(), command_stack_pop(), and dm_stack_peek().
Push specified item on player stack. Inform player of position. Initializes variables if needed.
pl | wizard. |
item | item to put on stack. |
Definition at line 2403 of file c_wiz.c.
References draw_ext_info(), draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, pl::stack_items, pl::stack_position, and STACK_SIZE.
Referenced by command_create(), command_dumpbelow(), command_stack_push(), and get_dm_object().
int do_wizard_dm | ( | object * | op, |
char * | params, | ||
int | silent | ||
) |
Actually changes a player to wizard.
op | player. |
params | password. |
silent | if zero, don't inform players of the mode change. |
0 | no mode change. |
1 | op is now a wizard. |
Definition at line 1932 of file c_wiz.c.
References checkdm(), clear_los(), obj::contr, draw_ext_info(), FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, socket_struct::host, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, QUERY_FLAG, SET_FLAG, pl::socket, and pl::write_buf.
Referenced by command_dm(), and command_dmhide().
void do_wizard_hide | ( | object * | op, |
int | silent_dm | ||
) |
Actually hides or unhides specified player (obviously a DM).
op | DM hiding. |
silent_dm | if non zero, other players are informed of DM entering/leaving, else they just think someone left/entered. |
Definition at line 147 of file c_wiz.c.
References obj::contr, draw_ext_info(), draw_ext_info_format(), pl::hidden, obj::invisible, obj::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, obj::name, NDI_ALL, NDI_DK_ORANGE, NDI_LT_GREEN, NDI_UNIQUE, and mapdef::players.
Referenced by command_dmhide(), and command_hide().
|
static |
This finds and returns the object which matches the name or object number (specified via num #whatever).
params | object to find. |
Definition at line 211 of file c_wiz.c.
References find_object(), and find_object_name().
Referenced by command_setgod().
Checks 'params' for object code.
Can be:
At function exit, params points to first non-object char
'from', if not NULL, contains at exit:
Ryo, august 2004
pl | wizard. |
params | object specified. |
from |
Definition at line 2450 of file c_wiz.c.
References obj::count, dm_stack_peek(), dm_stack_push(), draw_ext_info_format(), find_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pl::ob, STACK_FROM_NONE, STACK_FROM_NUMBER, STACK_FROM_STACK, STACK_FROM_TOP, pl::stack_items, and pl::stack_position.
Referenced by command_diff(), command_dump(), command_free(), command_insert_into(), command_patch(), command_remove(), and command_stack_push().
Enough of the DM functions seem to need this that I broke it out to a seperate function. name is the person being saught, op is who is looking for them. This prints diagnostics messages, and returns the other player, or NULL otherwise.
op | player searching someone. |
name | name to search for. |
Definition at line 67 of file c_wiz.c.
References draw_ext_info(), first_player, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, NDI_UNIQUE, pl::next, pl::ob, ST_PLAYING, and pl::state.
Referenced by command_arrest(), command_banish(), command_freeze(), command_summon(), and command_toggle_shout().
Returns spell object (from archetypes) by name. Used for wizard's learn spell/prayer.
Ignores archetypes "spelldirect_xxx" since these archetypes are not used anymore (but may still be present in some player's inventories and thus cannot be removed). We have to ignore them here since they have the same name than other "spell_xxx" archetypes and would always conflict.
op | player issuing the command. |
spell_name | spell to find. |
Definition at line 2026 of file c_wiz.c.
References arch_to_object(), archt::clone, draw_ext_info_format(), first_archetype, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, obj::name, archt::name, NDI_UNIQUE, archt::next, SPELL, and obj::type.
Referenced by command_learn_spell_or_prayer().