Crossfire Server, Trunk  1.75.0
sproto.h File Reference

Go to the source code of this file.

Functions

int account_change_password (const char *account_name, const char *current_password, const char *new_password)
 Change an account password. More...
 
void account_char_add (Account_Chars *chars, player *pl)
 This adds a player to the list of accounts. More...
 
void account_char_free (Account_Chars *chars)
 This frees all data associated with the character information. More...
 
Account_Charsaccount_char_load (const char *account_name)
 For a given account name, load the character information and return it. More...
 
void account_char_remove (Account_Chars *chars, const char *pl_name)
 This removes a character on this account. More...
 
void account_char_save (Account_Chars *chars)
 Saves the character information for the given account. More...
 
int account_check_string (const char *str)
 Checks a string to make sure it does not have any invalid characters. More...
 
const char * account_exists (const char *account_name)
 Checks the existing accounts, and see if this account exists. More...
 
const char * account_get_account_for_char (const char *charname)
 This looks at all the accounts and sees if charname is associated with any of them. More...
 
linked_characcount_get_additional_chars (const char *account_name, const Account_Chars *chars, int *count)
 Get a list of character names linked to the specified account which are not listed in chars. More...
 
char ** account_get_players_for_account (const char *account_name)
 Returns an array of strings for the characters on this account - the array is null terminated. More...
 
int account_is_logged_in (const char *name)
 This checkes if an account is logged in. More...
 
int account_link (const char *account_name, const char *player_name)
 Adds a player name to an account. More...
 
int account_login (const char *account_name, const char *account_password)
 Check if the given account exists, and whether the password is correct. More...
 
void account_logout (const char *account_name)
 Remove 'account_name' from the list of logged in accounts. More...
 
int account_new (const char *account_name, const char *account_password)
 Adds an account. More...
 
int account_remove_player (const char *account_name, const char *player_name)
 Removes a player name from an account. More...
 
void accounts_clear (void)
 This is used purely by the test harness - by clearing the accounts, it can then verify that the data is added is loaded back into memory properly. More...
 
void accounts_load (void)
 This loads all the account entries into memory. More...
 
void accounts_save (void)
 Save all the account information. More...
 
playeradd_player (socket_struct *ns, int flags)
 Tries to add player on the connection passwd in ns. More...
 
void add_server_collect_hooks ()
 
int alchemy (object *op, object *caster, object *spell_ob)
 Change items to gold nuggets. More...
 
int animate_weapon (object *op, object *caster, object *spell, int dir)
 Generalization of staff_to_snake(). More...
 
int apply_auto (object *op)
 Map was just loaded, handle op's initialization. More...
 
void apply_auto_fix (mapstruct *m)
 Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff). More...
 
void apply_builder_remove (object *pl, int dir)
 Item remover. More...
 
int apply_by_living (object *pl, object *op, int aflag, int quiet)
 Living thing is applying an object. More...
 
void apply_by_living_below (object *pl)
 Attempt to apply the object 'below' the player. More...
 
int apply_can_apply_object (const object *who, const object *op)
 Checks to see if 'who' can apply object 'op'. More...
 
void apply_changes_to_player (object *pl, object *change, int limit_stats)
 Applies (race) changes to a player. More...
 
int apply_check_weapon_power (const object *who, int improves)
 This checks to see of the player (who) is sufficient level to use a weapon with improves improvements (typically last_eat). More...
 
int apply_container (object *op, object *sack, int aflags)
 Handle apply on containers. More...
 
void apply_handle_yield (object *tmp)
 This checks whether the object has a "on_use_yield" field, and if so generated and drops matching item. More...
 
int apply_manual (object *op, object *tmp, int aflag)
 Main apply handler. More...
 
void apply_map_builder (object *pl, int dir)
 Global building function. More...
 
int apply_race_and_class (object *op, archetype *race, archetype *opclass, living *stats)
 This is somewhat like key_change_class() above, except we know the race to change to, but we still basically need to do the same work (apply bonuses, update archetype, etc.) More...
 
int apply_special (object *who, object *op, int aflags)
 Apply an object. More...
 
int attack_ob (object *op, object *hitter)
 Simple wrapper for attack_ob_simple(), will use hitter's values. More...
 
int become_follower (object *op, const object *new_god)
 This function is called whenever a player has switched to a new god. More...
 
void blind_living (object *op, object *hitter, int dam)
 Blind a living thing. More...
 
int64_t calc_skill_exp (const object *who, const object *op, const object *skill)
 Calculates amount of experience can be gained for successful use of a skill. More...
 
bool can_follow (object *op, player *other)
 
int cast_bless (object *op, object *caster, object *spell_ob, int dir)
 Improve statistics of some living object. More...
 
int cast_cause_disease (object *op, object *caster, object *spell, int dir)
 Let's try to infect something. More...
 
int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent)
 Cast some stat-improving spell. More...
 
int cast_change_map_lightlevel (object *op, object *spell)
 This changes the light level for the entire map. More...
 
int cast_cone (object *op, object *caster, int dir, object *spell)
 Casts a cone spell. More...
 
int cast_consecrate (object *op, object *caster, object *spell)
 A spell to make an altar your god's. More...
 
int cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 Create food. More...
 
int cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg)
 Create a missile (nonmagic - magic +4). More...
 
int cast_create_obj (object *op, object *new_op, int dir)
 Creates object new_op in direction dir or if that is blocked, beneath the player (op). More...
 
int cast_create_town_portal (object *op, object *caster, object *spell)
 This function cast the spell of town portal for op. More...
 
int cast_curse (object *op, object *caster, object *spell_ob, int dir)
 Curse an object, reducing its statistics. More...
 
int cast_destruction (object *op, object *caster, object *spell_ob)
 Hit all monsters around the caster. More...
 
int cast_detection (object *op, object *caster, object *spell)
 Detect magic or invisible items. More...
 
void cast_dust (object *op, object *throw_ob, int dir)
 Handles op throwing objects of type 'DUST'. More...
 
int cast_earth_to_dust (object *op, object *caster, object *spell_ob)
 Basically destroys earthwalls in the area. More...
 
int cast_heal (object *op, object *caster, object *spell, int dir)
 Heals something. More...
 
int cast_identify (object *op, object *caster, object *spell)
 Identifies objects in the players inventory/on the ground. More...
 
int cast_invisible (object *op, object *caster, object *spell_ob)
 Makes the player or character invisible. More...
 
int cast_item_curse_or_bless (object *op, object *spell_ob)
 This alters player's marked item's cursed or blessed status, based on the spell_ob's fields. More...
 
int cast_light (object *op, object *caster, object *spell, int dir)
 Illuminates something on a map, or try to blind a living thing. More...
 
void cast_magic_storm (object *op, object *tmp, int lvl)
 This is really used mostly for spell fumbles and the like. More...
 
int cast_polymorph (object *op, object *caster, object *spell_ob, int dir)
 Polymorph spell casting. More...
 
int cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg)
 This handles the raise dead / resurrection spells. More...
 
int cast_smite_spell (object *op, object *caster, int dir, object *spell)
 The priest points to a creature and causes a 'godly curse' to descend. More...
 
int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg)
 Main dispatch when someone casts a spell. More...
 
int cast_transfer (object *op, object *caster, object *spell, int dir)
 This spell transfers sp from the player to another person. More...
 
int cast_wonder (object *op, object *caster, int dir, object *spell_ob)
 wonder is really just a spell that will likely cast another spell. More...
 
int cast_word_of_recall (object *op, object *caster, object *spell_ob)
 Word of recall causes the player to return 'home'. More...
 
int caster_level (const object *caster, const object *spell)
 This function returns the effective level the spell is being cast at. More...
 
int cftimer_create (int id, long delay, object *ob, int mode)
 Creates a new timer. More...
 
int cftimer_destroy (int id)
 Destroys an existing timer. More...
 
int cftimer_find_free_id (void)
 Finds a free ID for a new timer. More...
 
void cftimer_init (void)
 Initialize timers. More...
 
void cftimer_process_timers (void)
 Processes all timers. More...
 
void change_object (object *op)
 Replaces op with its other_arch if it has reached its end of life. More...
 
int change_skill (object *who, object *new_skill, int flag)
 This changes the object's skill to new_skill. More...
 
void check_active_maps (void)
 Finds maps in memory to swap. More...
 
void check_bullet (object *op)
 Checks to see what op should do, given the space it is on (eg, explode, damage player, etc). More...
 
void check_login (object *op, const char *password)
 Actually login a player, load from disk and such. More...
 
int check_name (player *me, const char *name)
 Ensure player's name is valid. More...
 
bool check_password (const char *typed, const char *crypted)
 Hash a password and compare it to the stored version. More...
 
void check_physically_infect (object *victim, object *hitter)
 Possibly infect due to direct physical contact i.e., AT_PHYSICAL. More...
 
int check_pick (object *op)
 Sees if there is stuff to be picked up/picks up stuff, for players only. More...
 
int check_race_and_class (living *stats, archetype *race, archetype *opclass)
 This checks to see if the race and class are legal. More...
 
void check_spell_expiry (object *spell)
 Checks if player should be warned of soon expiring spell. More...
 
objectcheck_spell_known (object *op, const char *name)
 Checks to see if player knows the spell. More...
 
int checkbanned (const char *login, const char *host)
 Check if a player and/or host is banned. More...
 
void clean_tmp_files (void)
 Save unique maps and clean up temporary map files unless recycling temporary maps. More...
 
void cleanup (void)
 Clean up everything and exit. More...
 
void cleanupPlugins (void)
 Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown. More...
 
void clear_skill (object *who)
 This function just clears the chosen_skill and range_skill values in the player. More...
 
void close_modules ()
 Clean up all modules which are not disabled. More...
 
void command_abil (object *op, const char *params)
 Changes an object's statistics. More...
 
void command_accountpasswd (object *op, const char *params)
 
void command_accuse (object *op, const char *params)
 'accuse' command. More...
 
void command_addexp (object *op, const char *params)
 This adds exp to a player. More...
 
void command_afk (object *op, const char *params)
 Toggles the afk status of a player. More...
 
void command_apply (object *op, const char *params)
 'apply' command. More...
 
void command_applymode (object *op, const char *params)
 Players wants to change the apply mode, ie how to handle applying an item when no body slot available. More...
 
void command_archs (object *op, const char *params)
 
void command_arrest (object *op, const char *params)
 Wizard jails player. More...
 
void command_banish (object *op, const char *params)
 Add player's IP to ban_file and kick them off the server. More...
 
void command_beg (object *op, const char *params)
 'beg' command. More...
 
void command_bleed (object *op, const char *params)
 'bleed' command. More...
 
void command_blush (object *op, const char *params)
 'blush' command. More...
 
void command_body (object *op, const char *params)
 This command dumps the body information for object *op. More...
 
void command_bounce (object *op, const char *params)
 'bounce' command. More...
 
void command_bow (object *op, const char *params)
 'bow' command. More...
 
void command_bowmode (object *op, const char *params)
 Player wants to change the bowmode, how arrows are fired. More...
 
void command_brace (object *op, const char *params)
 Player toggles her braced status. More...
 
void command_burp (object *op, const char *params)
 'burp' command. More...
 
void command_cackle (object *op, const char *params)
 'cackle' command. More...
 
void command_cast (object *op, const char *params)
 'cast' command, prepares a spell for laster casting. More...
 
void command_cast_spell (object *op, const char *params, int cast_now)
 Sets up to cast a spell. More...
 
void command_chat (object *op, const char *params)
 'chat' command. More...
 
void command_chuckle (object *op, const char *params)
 'chuckle' command. More...
 
void command_clap (object *op, const char *params)
 'clap' command. More...
 
void command_cointoss (object *op, const char *params)
 'cointoss' command. More...
 
void command_cough (object *op, const char *params)
 'cough' command. More...
 
void command_create (object *op, const char *params)
 Wizard wants to create an object. More...
 
void command_cringe (object *op, const char *params)
 'cringe' command. More...
 
void command_cry (object *op, const char *params)
 'cry' command. More...
 
void command_dance (object *op, const char *params)
 'dance' command. More...
 
void command_debug (object *op, const char *params)
 Player wants to see/change the debug level. More...
 
void command_delete (object *op, const char *params)
 Player wants to totally delete her character. More...
 
void command_diff (object *op, const char *params)
 Get a diff of specified items. More...
 
void command_disarm (object *op, const char *params)
 'disarm' command. More...
 
void command_dm (object *op, const char *params)
 Actual command to perhaps become dm. More...
 
void command_dmhide (object *op, const char *params)
 A players wants to become DM and hide. More...
 
void command_dmtell (object *op, const char *params)
 Private communication, by a DM (can't be ignored by player). More...
 
void command_drop (object *op, const char *params)
 'drop' command. More...
 
void command_dropall (object *op, const char *params)
 Command to drop all items that have not been locked. More...
 
void command_dump (object *op, const char *params)
 Dumps the difference between an object and its archetype. More...
 
void command_dumpabove (object *op, const char *params)
 Player wants to dump object above her. More...
 
void command_dumpallarchetypes (object *op, const char *params)
 Various archetypes-related statistics. More...
 
void command_dumpallmaps (object *op, const char *params)
 Various map-related statistics. More...
 
void command_dumpallobjects (object *op, const char *params)
 Various object-related statistics. More...
 
void command_dumpbelow (object *op, const char *params)
 Player wants to dump object below her. More...
 
void command_dumpfriendlyobjects (object *op, const char *params)
 Various friendly object-related statistics. More...
 
void command_dumpmap (object *op, const char *params)
 Various map-related statistics. More...
 
void command_east (object *op, const char *params)
 'east' command. More...
 
void command_empty (object *op, const char *params)
 'empty' command. More...
 
void command_examine (object *op, const char *params)
 'examine' command. More...
 
void command_execute (object *pl, char *command)
 Handle a player-issued command. More...
 
void command_face (object *op, const char *params)
 Player wants to face a given direction. More...
 
void command_fire (object *op, const char *params)
 Player wants to start firing. More...
 
void command_fire_stop (object *op, const char *params)
 Player wants to stop firing. More...
 
void command_fix_me (object *op, const char *params)
 Wrapper to fix a player. More...
 
void command_flip (object *op, const char *params)
 'flip' command. More...
 
void command_follow (object *op, const char *params)
 Follow a player, or stop following a player. More...
 
void command_forget_spell (object *op, const char *params)
 Command for players to forget a spell. More...
 
void command_free (object *op, const char *params)
 Totally free an object. More...
 
void command_freeze (object *op, const char *params)
 Freezes a player for a specified tick count, 100 by default. More...
 
void command_frown (object *op, const char *params)
 'frown' command. More...
 
void command_gasp (object *op, const char *params)
 'gasp' command. More...
 
void command_giggle (object *op, const char *params)
 'giggle' command. More...
 
void command_glare (object *op, const char *params)
 'glare' command. More...
 
void command_goto (object *op, const char *params)
 Wizard teleports to a map. More...
 
void command_grin (object *op, const char *params)
 'grin' command. More...
 
void command_groan (object *op, const char *params)
 'groan' command. More...
 
void command_growl (object *op, const char *params)
 'growl' command. More...
 
void command_gsay (object *op, const char *params)
 'gsay' command, talks to party. More...
 
void command_help (object *op, const char *params)
 Player is asking for some help. More...
 
void command_hiccup (object *op, const char *params)
 'hiccup' command. More...
 
void command_hide (object *op, const char *params)
 Wizard 'hide' command. More...
 
void command_hiscore (object *op, const char *params)
 Player is asking for the hiscore. More...
 
void command_hug (object *op, const char *params)
 'hug' command. More...
 
void command_insert_into (object *op, const char *params)
 Puts an object into another. More...
 
void command_inventory (object *op, const char *params)
 Shows the inventory or some item. More...
 
void command_invisible (object *op, const char *params)
 Wizard wants to become invisible. More...
 
void command_invoke (object *op, const char *params)
 'invoke' command, fires a spell immediately. More...
 
void command_kick (object *op, const char *params)
 Kicks a player from the server. More...
 
void command_kill_pets (object *op, const char *params)
 Player wants to get rid of pets. More...
 
void command_kiss (object *op, const char *params)
 'kiss' command. More...
 
void command_knowledge (object *pl, const char *params)
 Handle the 'knowledge' for a player. More...
 
void command_language (object *op, const char *params)
 This is the 'language' command. More...
 
void command_laugh (object *op, const char *params)
 'laugh' command. More...
 
void command_learn_special_prayer (object *op, const char *params)
 Wizard wants to learn a god-given spell. More...
 
void command_learn_spell (object *op, const char *params)
 Wizard wants to learn a regular spell. More...
 
void command_lick (object *op, const char *params)
 'lick' command. More...
 
void command_list (object *pl, bool is_dm)
 Display the list of commands to a player. More...
 
void command_listen (object *op, const char *params)
 Change the player's listen level. More...
 
void command_listplugins (object *op, const char *params)
 Lists all plugins currently loaded with their IDs and full names. More...
 
void command_loadplugin (object *op, const char *params)
 Loads the given plugin. More...
 
void command_loadtest (object *op, const char *params)
 This command will stress server. More...
 
void command_lock_item (object *op, const char *params)
 Alternate way to lock/unlock items (command line). More...
 
void command_malloc (object *op, const char *params)
 Display memory information. More...
 
void command_mapinfo (object *op, const char *params)
 'mapinfo' command. More...
 
void command_maps (object *op, const char *params)
 'maps' command. More...
 
void command_mark (object *op, const char *params)
 'mark' command, to mark an item for some effects (enchant armor, ...). More...
 
void command_me (object *op, const char *params)
 'me' command. More...
 
void command_mon_aggr (object *op, const char *params)
 When DM is possessing a monster, flip aggression on and off, to allow better motion. More...
 
void command_motd (object *op, const char *params)
 Display the message of the day. More...
 
void command_news (object *op, const char *params)
 Display the server news. More...
 
void command_nod (object *op, const char *params)
 'nod' command. More...
 
void command_north (object *op, const char *params)
 'north' command. More...
 
void command_northeast (object *op, const char *params)
 'northeast' command. More...
 
void command_northwest (object *op, const char *params)
 'northwest' command. More...
 
void command_nowiz (object *op, const char *params)
 Steps down from wizard mode. More...
 
void command_orcknuckle (object *op, const char *params)
 Plays the "orcknucke" game. More...
 
void command_overlay_reset (object *op, const char *params)
 Removes the overlay for op's current map. More...
 
void command_overlay_save (object *op, const char *params)
 Saves the op's map as an overlay - objects are persisted. More...
 
void command_party (object *op, const char *params)
 'party' command, subdivided in different sub commands. More...
 
void command_party_rejoin (object *op, const char *params)
 Handles the 'party_rejoin' command. More...
 
void command_passwd (object *pl, const char *params)
 Player is asking to change password. More...
 
void command_patch (object *op, const char *params)
 Wizard wants to altar an object. More...
 
void command_peaceful (object *op, const char *params)
 Player toggles her peaceful status. More...
 
void command_petmode (object *op, const char *params)
 Player wants to change how her pets behave. More...
 
void command_pickup (object *op, const char *params)
 'pickup' command. More...
 
void command_players (object *op, const char *params)
 Display all known players. More...
 
void command_poke (object *op, const char *params)
 'poke' command. More...
 
void command_possess (object *op, const char *params)
 DM can possess a monster. More...
 
void command_pout (object *op, const char *params)
 'pout' command. More...
 
void command_printlos (object *op, const char *params)
 Various LOS-related statistics. More...
 
void command_puke (object *op, const char *params)
 'puke' command. More...
 
void command_purge_quest (object *op, const char *param)
 
void command_purge_quest_definitions (object *op, const char *param)
 
void command_quest (object *op, const char *params)
 Command handler for 'quest'. More...
 
void command_quit (object *op, const char *params)
 Tell players to use the 'delete' command. More...
 
void command_recollect (object *op, const char *params)
 
command_registration command_register (const char *name, uint8_t type, command_function func, float time)
 Register a player-issued command. More...
 
command_registration command_register_extra (const char *name, const char *extra, uint8_t type, command_function_extra func, float time)
 Register a player-issued command with an extra parameter. More...
 
void command_remove (object *op, const char *params)
 Remove an object from its position. More...
 
void command_rename_item (object *op, const char *params)
 Changing the custom name of an item. More...
 
void command_reply (object *op, const char *params)
 Reply to last person who told you something [mids 01/14/2002]. More...
 
void command_reset (object *op, const char *params)
 Resets a map. More...
 
void command_resistances (object *op, const char *params)
 Players wants to know her resistances. More...
 
void command_rotateshoottype (object *op, const char *params)
 'rotateshoottype' command, switch range attack. More...
 
void command_rskill (object *pl, const char *params)
 'ready_skill' command. More...
 
void command_rules (object *op, const char *params)
 Display the server rules. More...
 
void command_run (object *op, const char *params)
 Player wants to start running. More...
 
void command_run_stop (object *op, const char *params)
 Player wants to stop running. More...
 
void command_save (object *op, const char *params)
 Player wants to get saved. More...
 
void command_say (object *op, const char *params)
 'say' command. More...
 
void command_scream (object *op, const char *params)
 'scream' command. More...
 
void command_search (object *op, const char *params)
 'search' command. More...
 
void command_search_items (object *op, const char *params)
 'search-items' command. More...
 
void command_setgod (object *op, const char *params)
 Sets the god for some objects. More...
 
void command_settings (object *op, const char *ignored)
 Wizard wants to know some server settings, so display. More...
 
void command_shake (object *op, const char *params)
 'shake' command. More...
 
void command_shiver (object *op, const char *params)
 'shiver' command. More...
 
void command_shoottype (object *op, const char *params)
 'shoottype' command, set range attack. More...
 
void command_shout (object *op, const char *params)
 'shout' command. More...
 
void command_showpets (object *op, const char *params)
 Players wants to know her pets. More...
 
void command_shrug (object *op, const char *params)
 'shrug' command. More...
 
void command_shutdown (object *op, const char *params)
 Totally shutdowns the server. More...
 
void command_sigh (object *op, const char *params)
 'sigh' command. More...
 
void command_skills (object *op, const char *params)
 Player is asking for her skills. More...
 
void command_slap (object *op, const char *params)
 'slap' command. More...
 
void command_smile (object *op, const char *params)
 'smile' command. More...
 
void command_smirk (object *op, const char *params)
 'smirk' command. More...
 
void command_snap (object *op, const char *params)
 'snap' command. More...
 
void command_sneeze (object *op, const char *params)
 'sneeze' command. More...
 
void command_snicker (object *op, const char *params)
 'snicker' command. More...
 
void command_sniff (object *op, const char *params)
 'sniff' command. More...
 
void command_snore (object *op, const char *params)
 'snore' command. More...
 
void command_sound (object *op, const char *params)
 Player wants to change sound status. More...
 
void command_south (object *op, const char *params)
 'south' command. More...
 
void command_southeast (object *op, const char *params)
 'southeast' command. More...
 
void command_southwest (object *op, const char *params)
 'southwest' command. More...
 
void command_speed (object *op, const char *params)
 Changes the server speed. More...
 
void command_spit (object *op, const char *params)
 'spit' command. More...
 
void command_ssdumptable (object *op, const char *params)
 Various string-related statistics. More...
 
void command_stack_clear (object *op, const char *params)
 Empty DM item stack. More...
 
void command_stack_list (object *op, const char *params)
 Displays stack contents. More...
 
void command_stack_pop (object *op, const char *params)
 Pop the stack top. More...
 
void command_stack_push (object *op, const char *params)
 Push specified item on stack. More...
 
void command_statistics (object *pl, const char *params)
 Prints out some useful information for the character. More...
 
void command_stats (object *op, const char *params)
 Displays the statistics of a player. More...
 
void command_stay (object *op, const char *params)
 'stay' command. More...
 
void command_strings (object *op, const char *params)
 Various string-related statistics. More...
 
void command_strut (object *op, const char *params)
 'strut' command. More...
 
void command_style_map_info (object *op, const char *params)
 Displays information about styles loaded for random maps. More...
 
void command_sulk (object *op, const char *params)
 'sulk' command. More...
 
void command_summon (object *op, const char *params)
 Summons player near DM. More...
 
void command_swap (object *op, const char *params)
 Mark a map as ready for swapping. More...
 
void command_take (object *op, const char *params)
 This takes (picks up) an item. More...
 
void command_teleport (object *op, const char *params)
 Teleport next to target player. More...
 
void command_tell (object *op, const char *params)
 Private communication. More...
 
void command_thank (object *op, const char *params)
 'thank' command. More...
 
void command_think (object *op, const char *params)
 'think' command. More...
 
void command_throw (object *op, const char *params)
 'throw' command. More...
 
void command_time (object *op, const char *params)
 Players asks for the time. More...
 
void command_title (object *op, const char *params)
 Player wishes to change her title. More...
 
void command_toggle_shout (object *op, const char *params)
 A simple toggle for the no_shout field. More...
 
void command_twiddle (object *op, const char *params)
 'twiddle' command. More...
 
void command_unarmed_skill (object *op, const char *params)
 Player wants to change prefered unarmed skill. More...
 
void command_unloadplugin (object *op, const char *params)
 Unloads the given plugin. More...
 
void command_unregister (command_registration command)
 Unregister a previously registered command. More...
 
void command_use (object *op, const char *params)
 Try to use an item on another. More...
 
void command_usekeys (object *op, const char *params)
 Player wants to change how keys are used. More...
 
void command_uskill (object *pl, const char *params)
 'use_skill' command. More...
 
void command_version (object *op, const char *params)
 Server version. More...
 
void command_wave (object *op, const char *params)
 'wave' command. More...
 
void command_west (object *op, const char *params)
 'west' command. More...
 
void command_whereabouts (object *op, const char *params)
 'whereabouts' command. More...
 
void command_whereami (object *op, const char *params)
 'whereami' command. More...
 
void command_whistle (object *op, const char *params)
 'whistle' command. More...
 
void command_who (object *op, const char *params)
 'who' command. More...
 
void command_wimpy (object *op, const char *params)
 Player wants to change how soon she'll flee. More...
 
void command_wink (object *op, const char *params)
 'wink' command. More...
 
void command_wizcast (object *op, const char *params)
 Wizard toggling "cast everywhere" ability. More...
 
void command_wizpass (object *op, const char *params)
 Wizard toggling wall-crossing. More...
 
void command_yawn (object *op, const char *params)
 'yawn' command. More...
 
void commands_clear ()
 Clear all registered commands. More...
 
void commands_init (void)
 Init standard commands. More...
 
void cone_drop (object *op)
 Drops an object based on what is in the cone's "other_arch". More...
 
void confirm_password (object *op)
 Ask the player to confirm her password during creation. More...
 
void confuse_living (object *op, object *hitter, int dam)
 Confuse a living thing. More...
 
void counterspell (object *op, int dir)
 Nullifies spell effects. More...
 
int create_aura (object *op, object *caster, object *spell)
 Create an aura spell object and put it in the player's inventory. More...
 
int create_bomb (object *op, object *caster, int dir, object *spell)
 Create a bomb. More...
 
int cure_disease (object *sufferer, object *caster, sstring skill)
 Do the cure disease stuff, from the spell "cure disease". More...
 
void dead_player (object *op)
 Kill a player on a permanent death server with resurrection. More...
 
void delete_character (const char *name)
 Totally deletes a character. More...
 
void destroy_object (object *op)
 Recursively object_free_drop_inventory() op and its inventory. More...
 
int detect_curse_on_item (object *pl, object *tmp, object *skill)
 Runs a 'detect curse' check on a given item. More...
 
int detect_magic_on_item (object *pl, object *tmp, object *skill)
 Runs a 'detect magic' check on a given item. More...
 
const char * determine_god (object *op)
 Determines if op worships a god. More...
 
archetypedetermine_holy_arch (const object *god, const char *type)
 Determines the archetype for holy servant and god avatar. More...
 
int dimension_door (object *op, object *caster, object *spob, int dir)
 Teleport through some doors and space. More...
 
int dispel_rune (object *op, object *skill, int dir)
 Someone is trying to disarm a rune. More...
 
void display_motd (const object *op)
 Sends the message of the day to the player. More...
 
void do_dump (object *who, object *what)
 
void do_forget_spell (object *op, const char *spell)
 Erases spell from player's inventory. More...
 
void do_goto (object *op, const char *name, int x, int y)
 
void do_harvest (object *pl, int dir, object *skill)
 Player is trying to harvest something. More...
 
void do_hidden_move (object *op)
 For hidden creatures - a chance of becoming 'unhidden' every time they move - as we subtract off 'invisibility' AND, for players, if they move into a ridiculously unhideable spot (surrounded by clear terrain in broad daylight). More...
 
void do_learn_spell (object *op, object *spell, int special_prayer)
 Actually makes op learn spell. More...
 
int do_skill (object *op, object *part, object *skill, int dir, const char *string)
 Main skills use function-similar in scope to cast_spell(). More...
 
void do_some_living (object *op)
 Regenerate hp/sp/gr, decreases food. More...
 
void dragon_ability_gain (object *who, int atnr, int level)
 When a dragon-player gains a new stage of evolution, he gets some treasure. More...
 
void drain_rod_charge (object *rod)
 Drain charges from a rod. More...
 
void drain_wand_charge (object *wand)
 Drains a charge from a wand. More...
 
void drop (object *op, object *tmp)
 Drop an item, either on the floor or in a container. More...
 
objectdrop_object (object *op, object *tmp, uint32_t nrof)
 Try to drop an object on the floor. More...
 
void dump_quests (void)
 Dump all of the quests, then calls exit() - useful in terms of debugging to make sure that quests are set up and recognised correctly. More...
 
void dump_races (void)
 Dumps all race information to stderr. More...
 
void dump_spells (void)
 Dumps all the spells - now also dumps skill associated with the spell. More...
 
void emergency_save (int flag)
 Save all players. More...
 
void enter_exit (object *op, object *exit_ob)
 Tries to move 'op' to exit_ob. More...
 
void enter_player_maplevel (object *op)
 Move a player to its stored map level. More...
 
void enter_player_savebed (object *op)
 This is a basic little function to put the player back to his savebed. More...
 
void examine (object *op, object *tmp)
 Player examines some object. More...
 
void examine_monster (object *op, object *tmp, int level)
 Player examine a monster. More...
 
void explode_bullet (object *op)
 Causes an object to explode, eg, a firebullet, poison cloud ball, etc. More...
 
int face_player (object *op, int dir)
 Face player in the given direction. More...
 
objectfind_applied_skill_by_name (const object *op, const char *name)
 Find a skill by name using the last_skill_ob list. More...
 
objectfind_key (object *pl, object *container, object *door)
 We try to find a key for the door as passed. More...
 
objectfind_marked_object (object *op)
 Return the object the player has marked with the 'mark' command below. More...
 
playerfind_player (const char *plname)
 Find a player by her full name. More...
 
playerfind_player_options (const char *plname, int options, const mapstruct *map)
 Find a player. More...
 
playerfind_player_partial_name (const char *plname)
 Find a player by a partial name. More...
 
playerfind_player_socket (const socket_struct *ns)
 Return a player for a socket structure. More...
 
objectfind_random_spell_in_ob (object *ob, const char *skill)
 This returns a random spell from 'ob'. More...
 
objectfind_skill_by_name (object *who, const char *name)
 This returns the skill pointer of the given name (the one that accumulates exp, has the level, etc). More...
 
objectfind_skill_by_number (object *who, int skillno)
 This returns the first skill pointer of the given subtype (the one that accumulates exp, has the level, etc). More...
 
objectfind_target_for_friendly_spell (object *op, int dir)
 This function is commonly used to find a friendly target for spells such as heal or protection or armour. More...
 
int find_traps (object *pl, object *skill)
 Checks for traps on the spaces around the player or in certain objects. More...
 
void finish_races ()
 
void fire (object *op, int dir)
 Received a fire command for the player - go and do it. More...
 
int fire_arch_from_position (object *op, object *caster, int16_t x, int16_t y, int dir, object *spell)
 Fires an archetype. More...
 
int fire_bolt (object *op, object *caster, int dir, object *spob)
 Cast a bolt-like spell. More...
 
int fire_bow (object *op, object *arrow, int dir, int wc_mod, int16_t sx, int16_t sy)
 Creature (monster or player) fires a bow. More...
 
int fire_swarm (object *op, object *caster, object *spell, int dir)
 The following routine creates a swarm of objects. More...
 
void fix_luck (void)
 Fixes luck of players, slowly move it towards 0. More...
 
objectfix_stopped_arrow (object *op)
 An ARROW stops moving. More...
 
void fix_stopped_item (object *op, mapstruct *map, object *originator)
 Put stopped item where stop_item() had found it. More...
 
void fix_weight (void)
 Check recursively the weight of all players, and fix what needs to be fixed. More...
 
void flush_old_maps (void)
 Reset maps that need to, remove their swap file. More...
 
int forbid_play (void)
 Checks if server should be started. More...
 
void free_knowledge (void)
 Free all knowledge data. More...
 
int free_no_drop (object *op)
 Check whether the given object is FLAG_NO_DROP. More...
 
void free_quest (void)
 Free all quest status structures. More...
 
void free_quest_definitions (void)
 
void free_races (void)
 Frees all race-related information. More...
 
void free_server (void)
 Frees all memory allocated around here: More...
 
int friendly_fire (object *op, object *hitter)
 Find out if this is friendly fire (PVP and attacker is peaceful) or not. More...
 
void get_attack_message_for_attack_type (int dam, uint8_t atm_type, const char *victim_name, char *buf1, char *buf2)
 Get the attack message for a damage and a type. More...
 
void get_name (object *op)
 Waiting for the player's name. More...
 
objectget_nearest_criminal (object *mon)
 
objectget_nearest_player (object *mon)
 Finds the nearest visible player or player-friendly for some object. More...
 
int get_party_password (object *op, partylist *party)
 Ask the player for the password of the party she wants to join. More...
 
void get_password (object *op)
 Waiting for the player's password. More...
 
playerget_player (player *p)
 Create a player's object, initialize a player's structure. More...
 
const char * get_reply_text_own (reply_type rt)
 Return the verb for the player's dialog type. More...
 
void give_initial_items (object *pl, treasurelist *items)
 Gives a new player her initial items. More...
 
int handle_newcs_player (object *op)
 Handles commands the player can send us, and various checks on invisibility, golem and such. More...
 
int hide (object *op, object *skill)
 Main hide handling. More...
 
int hideability (object *ob)
 Look at the surrounding terrain to determine the hideability of this object. More...
 
void hiscore_check (object *op, int quiet)
 Checks if player should enter the hiscore, and if so writes her into the list. More...
 
void hiscore_display (object *op, int max, const char *match)
 Displays the high score file. More...
 
void hiscore_init (void)
 Initializes the module. More...
 
int hit_map (object *op, int dir, uint32_t type, int full_hit)
 Attack a spot on the map. More...
 
int hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit)
 Object is attacked by something. More...
 
objecthit_with_arrow (object *op, object *victim)
 hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile. More...
 
int identify_object_with_skill (object *tmp, object *pl, object *skill, int print_on_success)
 Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently. More...
 
int infect_object (object *victim, object *disease, int force)
 Try to infect something with a disease. More...
 
void init (int argc, char **argv)
 This is the main server initialization function. More...
 
void init_ob_methods (void)
 Initializes the ob_method system. More...
 
void init_signals ()
 Setup our signal handlers. More...
 
void init_skills (void)
 This just sets up the skill_names table above. More...
 
void initPlugins (void)
 Plugins initialization. More...
 
void inventory (object *op, object *inv)
 Prints object's inventory. More...
 
int is_true_undead (object *op)
 Is the object a true undead? More...
 
int jump (object *pl, int dir, object *skill)
 Jump skill handling. More...
 
void key_change_class (object *op, char key)
 This function takes the key that is passed, and does the appropriate action with it (change race, or other things). More...
 
void key_confirm_quit (object *op, char key)
 We receive the reply to the 'quit confirmation' message. More...
 
void key_roll_stat (object *op, char key)
 Player is currently swapping stats. More...
 
void kill_player (object *op, const object *killer)
 Handle a player's death. More...
 
void knowledge_add_probe_monster (object *op, object *mon)
 Display monster details, then add to a player's knowledge if not already. More...
 
void knowledge_first_player_save (player *pl)
 Ensure the knowledge state is correctly saved for the player. More...
 
void knowledge_give (player *pl, const char *marker, const object *book)
 Give a knowledge item from its code. More...
 
void knowledge_item_can_be_used_alchemy (object *op, const object *item)
 Displays known alchemy recipes an item can be used in. More...
 
int knowledge_player_knows (const player *pl, const char *knowledge)
 Determines whether a player knows a specific knowledge or not. More...
 
void knowledge_process_incremental (void)
 Incrementally send knowledge information to players, and remove information for players who left. More...
 
void knowledge_read (player *pl, object *book)
 Player is reading a book, give knowledge if needed, warn player, and such. More...
 
void knowledge_send_info (socket_struct *ns)
 Send the reply_info for 'knowledge_info'. More...
 
void knowledge_send_known (player *pl)
 Send initial known knowledge to player, if requested. More...
 
int learn_skill (object *pl, object *scroll)
 Player is trying to learn a skill. More...
 
void leave (player *pl, int draw_exit)
 Player logs out, or was disconnected. More...
 
void legacy_animate_trigger (object *op)
 
void legacy_move_hole (object *op)
 
void legacy_remove_force (object *op)
 
int legal_range (object *op, int r)
 Check for the validity of a player range. More...
 
void list_players (object *op, region *reg, partylist *party)
 Displays the players in a region or party. More...
 
void load_races (BufferReader *reader, const char *filename)
 Reads the races file in the lib/ directory, then overwrites old 'race' entries. More...
 
objectlookup_spell_by_name (object *op, const char *spname)
 Look at object 'op' and see if they know the spell spname. More...
 
int magic_wall (object *op, object *caster, int dir, object *spell_ob)
 This creates magic walls. More...
 
void make_visible (object *op)
 Makes an object visible again. More...
 
int makes_invisible_to (object *pl, object *mon)
 This checks to see if 'pl' is invisible to 'mon'. More...
 
bool map_can_reset (const mapstruct *map, long current_time)
 Returns whether a map can be reset, including all other maps in the same reset group. More...
 
void meditate (object *pl, object *skill)
 Meditation skill handling. More...
 
int min_casting_level (const object *caster, const object *spell)
 This function takes a caster and spell and presents the effective level the caster needs to be to cast the spell. More...
 
int monster_can_detect_enemy (object *op, object *enemy, rv_vector *rv)
 Determine if we can 'detect' the enemy. More...
 
int monster_can_see_enemy (object *op, object *enemy)
 Assuming no walls/barriers, lets check to see if its possible to see an enemy. More...
 
void monster_check_apply_all (object *monster)
 Calls monster_check_apply() for all inventory objects. More...
 
void monster_check_doors (object *op, mapstruct *m, int x, int y)
 Living creature attempts to open a door. More...
 
void monster_check_earthwalls (object *op, mapstruct *m, int x, int y)
 Living creature attempts to hit an earthwall. More...
 
objectmonster_check_enemy (object *npc, rv_vector *rv)
 Checks npc->enemy and returns that enemy if still valid, NULL otherwise. More...
 
void monster_communicate (object *op, const char *txt)
 This function looks for an object or creature that is listening to said text. More...
 
int monster_compute_path (object *source, object *target, int default_dir)
 Computes a path from source to target. More...
 
void monster_do_living (object *op)
 For a monster, regenerate hp and sp, potentially clear scared status. More...
 
void monster_do_say (const mapstruct *map, const char *message)
 Output a NPC message on a map. More...
 
objectmonster_find_nearest_enemy (object *npc, object *owner)
 Returns the nearest enemy (monster or generator) which is visible to npc. More...
 
objectmonster_find_throw_ob (object *op)
 Find an item for the monster to throw. More...
 
int monster_move (object *op)
 Main monster processing routine. More...
 
void monster_npc_call_help (object *op)
 A monster calls for help against its enemy. More...
 
void monster_npc_say (object *npc, const char *cp)
 Simple function to have some NPC say something. More...
 
int monster_stand_in_light (object *op)
 Cache monster_stand_in_light_internal(). More...
 
int mood_change (object *op, object *caster, object *spell)
 This covers the various spells that change the moods of monsters - makes them angry, peaceful, friendly, etc. More...
 
int move_disease (object *disease)
 Ticks the clock for disease: infect, aggravate symptoms, ... More...
 
void move_firewall (object *op)
 Move for FIREWALL. More...
 
int move_ob (object *op, int dir, object *originator)
 Op is trying to move in direction dir. More...
 
int move_object (object *op, int dir)
 Try to move op in the direction "dir". More...
 
int move_player (object *op, int dir)
 Move player in the given direction. More...
 
void move_player_attack (object *op, int dir)
 The player is also actually going to try and move (not fire weapons). More...
 
void move_player_mover (object *op)
 This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is: More...
 
void move_symptom (object *symptom)
 Make the symptom do the nasty things it does. More...
 
int move_to (object *op, int x, int y)
 Move an object one square toward a specified destination on the same map. More...
 
char const * newhash (char const *password)
 
int object_teleport (object *op, mapstruct *map, int x, int y)
 Move the specified object in a free spot around the map's x & y. More...
 
int ok_to_put_more (mapstruct *m, int16_t x, int16_t y, object *op, uint32_t immune_stop)
 Returns true if it is ok to put spell op on the space/may provided. More...
 
int op_on_battleground (object *op, int *x, int *y, archetype **trophy)
 Check if the given object (usually a player) is standing on a battleground tile. More...
 
void paralyze_living (object *op, int dam)
 Paralyze a living thing. More...
 
int party_confirm_password (const partylist *party, const char *password)
 Checks whether a given password matches the party's password. More...
 
partylistparty_find (const char *partyname)
 Find a party by name. More...
 
partylistparty_form (object *op, const char *partyname)
 Forms the party struct for a party called 'partyname'. More...
 
partylistparty_get_first (void)
 Returns the first party from the list of all parties. More...
 
const char * party_get_leader (const partylist *party)
 Returns the name of the party's leader. More...
 
partylistparty_get_next (const partylist *party)
 Returns the next party from the list of all parties. More...
 
const char * party_get_password (const partylist *party)
 Returns the party's password. More...
 
void party_join (object *op, partylist *party)
 Makes a player join a party. More...
 
void party_leave (object *op)
 Makes a player leave his party. More...
 
void party_obsolete_parties (void)
 Remove unused parties (no players). More...
 
void party_remove (partylist *party)
 Removes and frees a party. More...
 
void party_send_message (object *op, const char *message)
 Send a message to all party members except the speaker. More...
 
void party_set_password (partylist *party, const char *password)
 Sets a party's password. More...
 
int path_to_player (object *mon, object *pl, unsigned mindiff)
 Returns the direction to the player, if valid. More...
 
int perceive_self (object *op)
 Living thing wants to know information. More...
 
void pets_attempt_follow (object *for_owner, int force)
 Check pets so they try to follow their master around the world. More...
 
void pets_control_golem (object *op, int dir)
 Makes the golem go in specified direction. More...
 
void pets_follow_owner (object *ob, object *owner)
 A pet is trying to follow its owner. More...
 
objectpets_get_enemy (object *pet, rv_vector *rv)
 Given that 'pet' is a friendly object, this function returns a monster the pet should attack, NULL if nothing appropriate is found. More...
 
void pets_move (object *ob)
 Handles a pet's movement. More...
 
void pets_move_golem (object *op)
 Handles a golem's movement. More...
 
int pets_should_arena_attack (object *pet, object *owner, object *target)
 Determines if checks so pets don't attack players or other pets should be overruled by the arena petmode. More...
 
int pets_summon_golem (object *op, object *caster, int dir, object *spob)
 Summons a monster. More...
 
int pets_summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg)
 General purpose summoning function. More...
 
void pets_terminate_all (object *owner)
 Removes all pets someone owns. More...
 
int pick_lock (object *pl, int dir, object *skill)
 Lock pick handling. More...
 
void pick_up (object *op, object *alt)
 Try to pick up an item. More...
 
void play_again (object *op)
 Ask the player whether to play again or disconnect. More...
 
int player_arrest (object *who)
 Put a player into jail, taking into account cursed exits and player's region. More...
 
bool player_can_find (object *op, object *ob)
 Return true if player 'op' can see object 'op' for purpose of locating items for partial item matching or searching by tag. More...
 
int player_can_view (object *pl, object *op)
 Check the player los field for viewability of the object op. More...
 
SockListplayer_get_delayed_buffer (player *pl)
 Get a delayed socket buffer, that will be sent after the player's tick is complete. More...
 
void player_set_state (player *pl, uint8_t state)
 Set the player's state to the specified one. More...
 
void player_unready_range_ob (player *pl, object *ob)
 Unready an object for a player. More...
 
int playername_ok (const char *cp)
 Is the player name valid. More...
 
int players_on_map (mapstruct *m, int show_all)
 Returns the count of players on a map, calculated from player list. More...
 
void plugins_display_list (object *op)
 Displays a list of loaded plugins (keystrings and description) in the game log window. More...
 
int plugins_init_plugin (const char *libfile)
 Try to load the specified plugin. More...
 
int plugins_remove_plugin (const char *id)
 Unload the specified plugin. More...
 
void polymorph (object *op, object *who, int level)
 Handles polymorphing an object, living or not. More...
 
int pray (object *pl, object *skill)
 Praying skill handling. More...
 
void pray_at_altar (object *pl, object *altar, object *skill)
 Player prays at altar. More...
 
int probe (object *op, object *caster, object *spell_ob, int dir, int level)
 Try to get information about a living thing. More...
 
void process_events (void)
 Process all active objects. More...
 
void process_object (object *op)
 Main object move function. More...
 
int push_ob (object *who, int dir, object *pusher)
 Something is pushing some other object. More...
 
void put_object_in_sack (object *op, object *sack, object *tmp, uint32_t nrof)
 Something tries to put an object into another. More...
 
void quest_first_player_save (player *pl)
 Ensure the quest state is correctly saved for a player. More...
 
int quest_get_player_state (player *pl, sstring quest_code)
 Get the quest state for a player. More...
 
void quest_load_definitions (void)
 
void quest_send_initial_states (player *pl)
 Send the current quest states for the specified player, if the client supports those notifications. More...
 
void quest_set_player_state (player *pl, sstring quest_code, int state)
 Set the state of a quest for a player. More...
 
void quest_start (player *pl, sstring quest_code, int state)
 Start a quest for a player. More...
 
int quest_was_completed (player *pl, sstring quest_code)
 Check if a quest was completed once for a player, without taking account the current state. More...
 
objectraces_get_random_monster (const char *race, int level)
 Get a random monster of specified race and level at most the specified one. More...
 
void read_map_log (void)
 Reads temporary maps information from disk. More...
 
void receive_party_password (object *op, const char *password)
 Player entered a party password. More...
 
void receive_play_again (object *op, char key)
 Player replied to play again / disconnect. More...
 
void receive_player_name (object *op, const char *name)
 A player just entered her name. More...
 
void receive_player_password (object *op, const char *password)
 A player just entered her password, including for changing it. More...
 
int recharge (object *op, object *caster, object *spell_ob)
 Recharge wands. More...
 
void recursive_roll (object *op, int dir, object *pusher)
 An object is pushed by another which is trying to take its place. More...
 
int reflwall (mapstruct *m, int x, int y, object *sp_op)
 Decides weither the (spell-)object sp_op will be reflected from the given mapsquare. More...
 
void regenerate_rod (object *rod)
 Regenerates a rod's charges. More...
 
void register_all_ob_types (void)
 Calls the intialization functions for all individual types. More...
 
int remove_curse (object *op, object *caster, object *spell)
 This function removes the cursed/damned status on equipped items. More...
 
void remove_door (object *op)
 Remove non locked doors. More...
 
void remove_locked_door (object *op)
 Same as remove_door() but for locked doors. More...
 
int remove_trap (object *op, object *skill)
 This skill will disarm any previously discovered trap. More...
 
void remove_unpaid_objects (object *op, object *env, int free_items)
 This goes throws the inventory and removes unpaid objects, and puts them back in the map (location and map determined by values of env) or frees them. More...
 
void rod_adjust (object *rod)
 Adjusts rod attributes. More...
 
void roll_again (object *op)
 Ask the player what to do with the statistics. More...
 
int roll_stat (void)
 This rolls four 1-6 rolls and sums the best 3 of the 4. More...
 
void roll_stats (object *op)
 Roll the initial player's statistics. More...
 
int sack_can_hold (const object *pl, const object *sack, const object *op, uint32_t nrof)
 Check if an item op can be put into a sack. More...
 
int save_player (object *op, int flag)
 Saves a player to disk. More...
 
void save_throw_object (object *op, uint32_t type, object *originator)
 Object is attacked with some attacktype (fire, ice, ...). More...
 
void scroll_failure (object *op, int failure, int power)
 op made some mistake with a scroll, this takes care of punishment. More...
 
void send_delayed_buffers (player *pl)
 Send all delayed buffers for a player. More...
 
void send_news (const object *op)
 Send the news to a player. More...
 
void send_rules (const object *op)
 Send the rules to a player. More...
 
void server_main (int argc, char *argv[])
 Server main function. More...
 
void set_darkness_map (mapstruct *m)
 Set the darkness level for a map, based on the time of the day. More...
 
void set_first_map (object *op)
 This loads the first map an puts the player on it. More...
 
void set_map_timeout (mapstruct *oldmap)
 Enable swapping for the given map. More...
 
int set_object_face_main (object *op)
 Makes an object's face the main face, which is supposed to be the "closed" one. More...
 
void set_player_socket (player *p, socket_struct *ns)
 This copies the data from the socket into the player structure. More...
 
void set_spell_skill (object *op, object *caster, object *spob, object *dest)
 Utility function to assign the correct skill when casting. More...
 
int should_director_abort (const object *op, const object *victim)
 Check if op should abort moving victim because of it's race or slaying. More...
 
void show_skills (object *op, const char *search)
 Displays a player's skill list, and some other non skill related info (god, max weapon improvements, item power). More...
 
void shuffle_attack (object *op)
 This routine shuffles the attack of op to one of the ones in the list. More...
 
int singing (object *pl, int dir, object *skill)
 Singing skill handling. More...
 
void skill_attack (object *tmp, object *pl, int dir, const char *string, object *skill)
 Core routine for use when we attack using a skills system. More...
 
int skill_ident (object *pl, object *skill)
 Main identification skill handling. More...
 
int skill_throw (object *op, object *part, int dir, object *skill)
 Throwing skill handling. More...
 
int slow_living_by (object *op, const int speed_penalty)
 
int SP_level_dam_adjust (const object *caster, const object *spob)
 Returns adjusted damage based on the caster. More...
 
int SP_level_duration_adjust (const object *caster, const object *spob)
 Adjust the duration of the spell based on level. More...
 
int SP_level_range_adjust (const object *caster, const object *spob)
 Adjust the range of the spell based on level. More...
 
int16_t SP_level_spellpoint_cost (object *caster, object *spell, int flags)
 Scales the spellpoint cost of a spell by it's increased effectiveness. More...
 
int SP_level_wc_adjust (const object *caster, const object *spob)
 Returns adjusted wc based on the caster and the spell. More...
 
void spell_effect (object *spob, int x, int y, mapstruct *map, object *originator)
 Inserts into map a spell effect based on other_arch. More...
 
void spell_failure (object *op, int failure, int power, object *skill)
 Handles the various effects for differing degrees of failure badness. More...
 
int spell_find_dir (mapstruct *m, int x, int y, object *exclude)
 Search what direction a spell should go in, first the center square then some close squares in the given map at the given coordinates for live objects. More...
 
void spring_trap (object *trap, object *victim)
 This function generalizes attacks by runes/traps. More...
 
int stand_near_hostile (object *who)
 Determine if who is standing near a hostile creature. More...
 
int steal (object *op, int dir, object *skill)
 Main stealing function. More...
 
objectstop_item (object *op)
 An item (ARROW or such) stops moving. More...
 
void store_spell_expiry (object *spell)
 Stores in the spell when to warn player of expiration. More...
 
int summon_hostile_monsters (object *op, int n, const char *monstername)
 Summons hostile monsters and places them in nearby squares. More...
 
int swap_map (mapstruct *map)
 Swaps a map to disk. More...
 
int tailor_god_spell (object *spellop, object *caster)
 Changes the attributes of cone, smite, and ball spells as needed by the code. More...
 
int teleport (object *teleporter, uint8_t tele_type, object *user)
 Teleport an item around a nearby random teleporter of specified type. More...
 
void tick_the_clock (void)
 This performs the basic function of advancing the clock one tick forward. More...
 
int transfer_ob (object *op, int x, int y, int randomly, object *originator)
 Move an object (even linked objects) to another spot on the same map. More...
 
int transport_can_hold (const object *transport, const object *op, int nrof)
 Can transport hold object op? This is a pretty trivial function, but in the future, possible transport may have more restrictions or weight reduction like containers. More...
 
int trap_disarm (object *disarmer, object *trap, int risk, object *skill)
 Try to disarm a trap/rune. More...
 
int trap_see (object *op, object *trap)
 Should op see trap? More...
 
int trap_show (object *trap, object *where)
 Handles showing a trap/rune detonation. More...
 
int use_alchemy (object *op)
 Handle use_skill for alchemy-like items. More...
 
int use_oratory (object *pl, int dir, object *skill)
 Oratory skill handling. More...
 
int use_skill (object *op, const char *string)
 Similar to invoke command, it executes the skill in the direction that the user is facing. More...
 
int verify_player (const char *name, char *password)
 This verify that a character of name exits, and that it matches password. More...
 
int write_mark (object *op, object *spell, const char *msg)
 This writes a rune that contains the appropriate message. More...
 
int write_on_item (object *pl, const char *params, object *skill)
 Implement the 'inscription' skill, which checks for the required skills and marked items before running either write_note() or write_scroll(). More...
 
int write_rune (object *op, object *caster, object *spell, int dir, const char *runename)
 Player is attempting to write a magical rune. More...
 

Function Documentation

◆ account_change_password()

int account_change_password ( const char *  account_name,
const char *  current_password,
const char *  new_password 
)

Change an account password.

It does error checking, but the caller might want to do checking before getting here.

Parameters
account_nameaccount name we are changing
current_passwordcurrent password for the account or NULL. This is the unencrypted password (password as entered by user). If NULL, the current password is not checked, suitable for resetting lost passwords.
new_passwordnew password to set, unencrypted.
Return values
0password changed successfully.
1account name, old or new password has invalid character.
2account does not exist.
3current password is invalid.

Definition at line 627 of file account.cpp.

References account_check_string(), accounts, check_password(), newhash(), strcasecmp(), and strdup_local.

Referenced by account_password(), and command_accountpasswd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_char_add()

void account_char_add ( Account_Chars chars,
player pl 
)

This adds a player to the list of accounts.

We check to see if the player has already been added to this account - if so, we just update the infromation. Note that all strings are filled in, even if that may just be a blank field. This simplifies a lot of the code instead of having to deal with NULL values. Note that this routine is also used to update existing entries - if the character already exists, we update it, otherwise it is added.

Parameters
charsExisting list of characters for account. May be NULL.
plPlayer structure to add

Definition at line 207 of file account_char.cpp.

References add_string(), object::arch, Account_Char::character_class, Account_Chars::chars, archetype::clone, Account_Char::face, object::face, free_string(), Account_Char::isDead, Account_Char::level, object::level, Account_Char::map, object::map, player::maplevel, Account_Char::name, Face::name, mapstruct::name, object::name, player::ob, Account_Char::party, player::party, partylist::partyname, and Account_Char::race.

Referenced by save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_char_free()

void account_char_free ( Account_Chars chars)

This frees all data associated with the character information.

Parameters
charsData to free. The caller should make sure it no longer uses any data in this list.

Definition at line 345 of file account_char.cpp.

References Account_Chars::account_name, Account_Chars::chars, chars_loaded, free_string(), and Account_Chars::ref_count.

Referenced by account_add_player_cmd(), free_newsocket(), init_connection(), key_confirm_quit(), kill_player_permadeath(), make_perma_dead(), send_account_players(), set_player_socket(), and unmake_perma_dead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_char_load()

Account_Chars* account_char_load ( const char *  account_name)

For a given account name, load the character information and return it.

It is the responsibility of the caller to call account_char_free() on the returned value to free it.

Parameters
account_nameName of the account. The name should be validated before this routine is called (eg, passed checks for legitimate characters and logged in)
Returns
Character data.

Definition at line 135 of file account_char.cpp.

References account_char_load_from_file(), Account_Chars::account_name, add_string(), chars_loaded, and Account_Chars::ref_count.

Referenced by account_add_player_cmd(), make_perma_dead(), send_account_players(), and unmake_perma_dead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_char_remove()

void account_char_remove ( Account_Chars chars,
const char *  pl_name 
)

This removes a character on this account.

This is typically used when a character has been deleted, and not for general cleanup

Parameters
charsExisting list of characters for account.
pl_nameThe name of the character
Returns
Returns new list of characters for account.

Definition at line 313 of file account_char.cpp.

References Account_Char::character_class, Account_Chars::chars, Account_Char::face, free_string(), Account_Char::map, Account_Char::name, Account_Char::party, and Account_Char::race.

+ Here is the call graph for this function:

◆ account_char_save()

void account_char_save ( Account_Chars chars)

Saves the character information for the given account.

Parameters
charspreviously loaded/generated list of character information for this account.

Definition at line 158 of file account_char.cpp.

References ACCOUNT_DIR, Account_Chars::account_name, Account_Chars::chars, Settings::localdir, MAX_BUF, of_close(), of_open(), and settings.

Referenced by account_add_player_cmd(), free_newsocket(), key_confirm_quit(), kill_player_permadeath(), make_perma_dead(), save_player(), and unmake_perma_dead().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_check_string()

int account_check_string ( const char *  str)

Checks a string to make sure it does not have any invalid characters.

We are fairly permissive on character here. String must start with alphanumeric String must not contain :;/'[ String can not end if a space This string will get used for file/directory names, but so long as as characters are not included that are not illegal, one can still manipulate the file/directory by putting it in quotes. If one starts to block all characters that may get interperted by shells, a large number of characters now get blocked (|*]()!, etc), and deciding which should be allowed and not just becomes a judgement call, so easier to just allow all and have the user put it in quotes.

Parameters
strstring to check
Returns
0 if ok, 1 if we have an invalid character, 2 if string is too long.

Definition at line 360 of file account.cpp.

References MAX_NAME.

Referenced by account_change_password(), account_new(), account_new_cmd(), account_password(), and create_player_cmd().

+ Here is the caller graph for this function:

◆ account_exists()

const char* account_exists ( const char *  account_name)

Checks the existing accounts, and see if this account exists.

This can also be used to get the official name for the account (eg, as user first entered, so Mark instead of mARk)

Parameters
account_nameaccount name we are looking for.
Returns
returns official name on match, NULL on no match.

Definition at line 296 of file account.cpp.

References accounts, and strcasecmp().

Referenced by account_login_cmd(), account_new(), and account_new_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_get_account_for_char()

const char* account_get_account_for_char ( const char *  charname)

This looks at all the accounts and sees if charname is associated with any of them.

Parameters
charnamecharacter name to check for.
Returns
Account name the character is associated with, NULL if none.

Definition at line 579 of file account.cpp.

References accounts.

Referenced by account_add_player_cmd(), and save_player().

+ Here is the caller graph for this function:

◆ account_get_additional_chars()

linked_char* account_get_additional_chars ( const char *  account_name,
const Account_Chars chars,
int *  count 
)

Get a list of character names linked to the specified account which are not listed in chars.

Parameters
account_nameaccount name.
charsknown character names.
[out]countwill be incremented by the number of items returned. Not initialized before use.
Returns
list of character names not in chars, the caller should free it after use.

Definition at line 550 of file account.cpp.

References accounts, char_in_list(), Account_Chars::chars, linked_char::name, linked_char::next, and strcasecmp().

Referenced by send_account_players().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_get_players_for_account()

char** account_get_players_for_account ( const char *  account_name)

Returns an array of strings for the characters on this account - the array is null terminated.

In fact, it just returns the ac->character_names.

Parameters
account_namename of the account to get the players for.
Returns
array of character names for this account. This will return NULL in the case where we can not find the account. It will return an array with the first entry being NULL in the case of a valid account with no characters added. This returned data should not be altered in any way.

Definition at line 519 of file account.cpp.

References accounts, and strcasecmp().

Referenced by account_play_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_is_logged_in()

int account_is_logged_in ( const char *  name)

This checkes if an account is logged in.

It is mainly used because some operations should not be done on logged in accounts (keeping everything synchronized is harder.)

Parameters
namename to look for.
Returns
0 if not logged in, 1 if logged in.

Definition at line 604 of file account.cpp.

References accounts_logged_in, and name.

Referenced by account_add_player_cmd().

+ Here is the caller graph for this function:

◆ account_link()

int account_link ( const char *  account_name,
const char *  player_name 
)

Adds a player name to an account.

Player corresponds to the names used in the pl object, not the person sitting at the computer. This function presumes that the caller has done the work to verify that the player does in fact exist, and does any related work to update the player. What this function does is simply update the account structure.

Parameters
account_namename of the account we are adding this player to.
player_namename of this player.
Return values
0player name added successfully.
1could not find account of that name.

Definition at line 444 of file account.cpp.

References accounts, ensure_available_characters(), strcasecmp(), and strdup_local.

Referenced by account_add_player_cmd(), and save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_login()

int account_login ( const char *  account_name,
const char *  account_password 
)

Check if the given account exists, and whether the password is correct.

Note - if we do get a match, we update the last_login value - it is presumed that if someone knows the right accountname/password, that the account is effectively getting logged in.

Parameters
account_nameaccount name we are looking for.
account_passwordpassword for the account. This is the unencrypted password (password as entered by user)
Returns
0 if no match/wrong password, 1 if a match is found and password matches.

Definition at line 318 of file account.cpp.

References account_password(), accounts, accounts_logged_in, check_password(), strcasecmp(), and time.

Referenced by account_login_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_logout()

void account_logout ( const char *  account_name)

Remove 'account_name' from the list of logged in accounts.

Definition at line 337 of file account.cpp.

References accounts_logged_in.

Referenced by free_newsocket().

+ Here is the caller graph for this function:

◆ account_new()

int account_new ( const char *  account_name,
const char *  account_password 
)

Adds an account.

It does error checking, but the caller might want to do checking before getting here.

Parameters
account_nameaccount name we are adding
account_passwordpassword for the account. This is the unencrypted password (password as entered by user)
Return values
0account added successfully.
1name or password has invalid character.
2account already exists.

Definition at line 399 of file account.cpp.

References account_alloc(), account_check_string(), account_exists(), account_password(), accounts, accounts_loaded, account_struct::name, newhash(), account_struct::password, and strdup_local.

Referenced by account_new_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_remove_player()

int account_remove_player ( const char *  account_name,
const char *  player_name 
)

Removes a player name from an account.

Player corresponds to the names used in the pl object, not the person sitting at the computer. This function presumes that the caller has done the work to verify that the player does in fact exist, and does any related work to update the player. What this function does is simply update the account structure.

Parameters
account_namename of the account we are removing this player from.
player_namename of this player.
Return values
0player name removed successfully.
1could not find account of that name.
2player of this name not on account.

Definition at line 474 of file account.cpp.

References accounts, and strcasecmp().

Referenced by account_add_player_cmd(), key_confirm_quit(), and kill_player_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accounts_clear()

void accounts_clear ( void  )

This is used purely by the test harness - by clearing the accounts, it can then verify that the data is added is loaded back into memory properly.

As such, we don't worry about memory cleanup, etc.

Definition at line 152 of file account.cpp.

References accounts, and accounts_loaded.

◆ accounts_load()

void accounts_load ( void  )

This loads all the account entries into memory.

It is presumed to only be called once during the program startup.

Definition at line 161 of file account.cpp.

References account_alloc(), ACCOUNT_FILE, accounts, accounts_loaded, buf, bufferreader_destroy(), bufferreader_init_from_file(), bufferreader_next_line(), account_struct::character_names, account_struct::created, ensure_available_characters(), fields, account_struct::last_login, llevError, llevInfo, Settings::localdir, LOG(), MAX_BUF, account_struct::name, NUM_ACCOUNT_FIELDS, account_struct::num_characters, account_struct::password, settings, split_string(), and strdup_local.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accounts_save()

void accounts_save ( void  )

Save all the account information.

Since the data is stored in a flat file, if an update is needed for an account, the only way to save updates is to save all the data - there isn't an easy way to just add another player name for an account.

Definition at line 255 of file account.cpp.

References ACCOUNT_FILE, account_write_entry(), accounts, accounts_loaded, Settings::localdir, MAX_BUF, of_close(), of_open(), settings, and time.

Referenced by account_new_cmd(), cleanup(), and do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_player()

player* add_player ( socket_struct ns,
int  flags 
)

Tries to add player on the connection passwd in ns.

Player object is created and put on the first map, rules/news/motd are sent.

Parameters
nsconnection.
flagsflag values are define in player.h: ADD_PLAYER_NEW - If set, go right to new character creation - used in case of new account code. We don't display motd and other bits in this case either. ADD_PLAYER_NO_MAP - Do not set up map information - used in character login method >2 where we do not use the same starting map.
Returns
player returns pointer to newly created player structure.

Definition at line 468 of file player.cpp.

References add_friendly_object(), ADD_PLAYER_NEW, ADD_PLAYER_NO_MAP, ADD_PLAYER_NO_STATS_ROLL, CLEAR_FLAG, display_motd(), FLAG_FRIENDLY, flags, get_name(), get_player(), Ns_Avail, player::ob, player_set_state(), roll_again(), send_news(), send_rules(), set_first_map(), set_player_socket(), ST_ROLL_STAT, and socket_struct::status.

Referenced by add_me_cmd(), and create_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_server_collect_hooks()

void add_server_collect_hooks ( )

Definition at line 1084 of file init.cpp.

References Settings::add_hook(), load_materials(), load_races(), and settings.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alchemy()

int alchemy ( object op,
object caster,
object spell_ob 
)

Change items to gold nuggets.

Only works for players.

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
Return values
0op isn't a player.
1op is a player.

Definition at line 2306 of file spell_effect.cpp.

References alchemy_object(), object::contr, object::duration, FLAG_ALIVE, FLAG_IS_CAULDRON, FLAG_NO_PICK, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, socket_struct::look_position, object::map, MOVE_WALK, P_NO_MAGIC, P_OUT_OF_MAP, place_alchemy_objects(), PLAYER, QUERY_FLAG, player::socket, SP_level_dam_adjust(), SP_level_duration_adjust(), object::type, weight, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ animate_weapon()

int animate_weapon ( object op,
object caster,
object spell,
int  dir 
)

Generalization of staff_to_snake().

Makes a golem out of the caster's weapon. The golem is based on the archetype specified, modified by the caster's level and the attributes of the weapon. The weapon is inserted in the golem's inventory so that it falls to the ground when the golem dies. This code was very odd - code early on would only let players use the spell, yet the code was full of player checks. I've presumed that the code that only let players use it was correct, and removed all the other player checks. MSW 2003-01-06

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
dircasting direction.
Return values
0spell failure.
1spell was successful.

Definition at line 3065 of file spell_effect.cpp.

References a(), add_friendly_object(), add_string(), object::anim_speed, object::animation, object::arch, arch_to_object(), AT_PHYSICAL, ATNR_BLIND, ATNR_CONFUSION, ATNR_DEATH, ATNR_DEPLETE, ATNR_FEAR, ATNR_PARALYZE, ATNR_PHYSICAL, ATNR_POISON, ATNR_SLOW, ATNR_TURN_UNDEAD, object::attacktype, buf, caster_level(), CLEAR_FLAG, living::Con, object::contr, object::count, living::dam, living::Dex, object::direction, draw_ext_info, draw_ext_info_format(), esrv_update_item(), living::exp, object::face, find_marked_object(), fix_object(), FLAG_ANIMATE, FLAG_APPLIED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_REMOVED, FLAG_UNPAID, FLAG_USE_WEAPON, free_string(), freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GOLEM, player::golem_count, living::hp, object::last_anim, llevError, LOG(), m, object::magic, object::map, object::materialname, MAX, MAX_BUF, living::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, archetype::name, name_to_material(), NDI_BLACK, NDI_UNIQUE, object::nrof, NROFATTACKS, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_owner(), object_split(), object_update_speed(), P_OUT_OF_MAP, pets_control_golem(), PLAYER, QUERY_FLAG, query_name(), range_golem, player::ranges, object::resist, materialtype_t::save, SET_FLAG, set_spell_skill(), player::shoottype, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::speed, object::speed_left, spell, object::state, object::stats, living::Str, object::type, UPD_NROF, living::wc, WEAPON, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_auto()

int apply_auto ( object op)

◆ apply_auto_fix()

void apply_auto_fix ( mapstruct m)

Go through the entire map (only the first time when an original map is loaded) and performs special actions for certain objects (most initialization of chests and creation of treasures and stuff).

Calls apply_auto() if appropriate.

Parameters
mmap to fix.

Definition at line 258 of file main.cpp.

References apply_auto(), auto_apply_fix_inventory(), check_trigger(), CLASS, CONTAINER, create_treasure(), FLAG_AUTO_APPLY, FLAG_IS_LINKED, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, HAS_RANDOM_ITEMS, HEAD, m, MAP_HEIGHT, MAP_WIDTH, monster_check_apply_all(), object_update_speed(), PLAYER, PLAYER_CHANGER, QUERY_FLAG, SPELL, TIMED_GATE, TREASURE, TRIGGER_BUTTON, and TRIGGER_PEDESTAL.

Referenced by enter_unique_map(), generate_random_map(), and mapfile_load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_builder_remove()

void apply_builder_remove ( object pl,
int  dir 
)

Item remover.

Removes first buildable item, either under or above the floor

Parameters
plplayer removing an item.
dirdirection the player is trying to remove.

Definition at line 890 of file build_map.cpp.

References object::above, BUTTON, CF_HANDLE, DETECTOR, DOOR, draw_ext_info, draw_ext_info_format(), FLAG_IS_FLOOR, FLAG_IS_LINKED, FLOOR, freearr_x, freearr_y, GATE, GET_MAP_OB, llevError, LOG(), MAGIC_EAR, object::map, MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_BUILD, name, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), mapstruct::path, PEDESTAL, QUERY_FLAG, query_name(), remove_button_link(), SIGN, TIMED_GATE, object::type, WALL, object::x, and object::y.

Referenced by apply_map_builder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_by_living()

int apply_by_living ( object pl,
object op,
int  aflag,
int  quiet 
)

Living thing is applying an object.

Parameters
plobject causing op to be applied.
opobject being applied.
aflagspecial (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special().
quietif 1, suppresses the "don't know how to apply" and "you must get it first" messages as needed by apply_by_living_below(). There can still be "but you are floating high above the ground" messages.
Returns
  • 0: player or monster can't apply objects of that type
  • 1: has been applied, or there was an error applying the object
  • 2: objects of that type can't be applied if not in inventory

Definition at line 637 of file apply.cpp.

References object::anim_suffix, apply_anim_suffix(), apply_manual(), draw_ext_info, draw_ext_info_format(), object::env, FLAG_WAS_WIZ, FLAG_WIZ, MAX_BUF, METHOD_ERROR, METHOD_OK, METHOD_SILENT_ERROR, METHOD_UNHANDLED, MOVE_FLYING, object::move_type, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, name, NDI_UNIQUE, object_free(), object_remove(), play_sound_map(), PLAYER, QUERY_FLAG, query_name(), SOUND_TYPE_ITEM, and object::type.

Referenced by apply_by_living_below(), apply_cmd(), and command_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_by_living_below()

void apply_by_living_below ( object pl)

Attempt to apply the object 'below' the player.

If the player has an open container, we use that for below, otherwise we use the ground.

Parameters
plplayer.

Definition at line 695 of file apply.cpp.

References apply_by_living(), object::below, object::container, object::contr, FLAG_IS_FLOOR, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, object::inv, object::invisible, METHOD_OK, object::move_on, object::move_type, ob_apply(), QUERY_FLAG, TRANSPORT, player::transport, and object::type.

Referenced by cfapi_object_apply_below(), command_apply(), and knowledge_alchemy_attempt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_can_apply_object()

int apply_can_apply_object ( const object who,
const object op 
)

Checks to see if 'who' can apply object 'op'.

Parameters
wholiving thing trying to apply op.
opobject applied.
Returns
0 if apply can be done without anything special. Otherwise returns a bitmask of CAN_APPLY_xxx - potentially several of these may be set, but largely depends on circumstance - in the future, processing may be pruned once we know some status (eg, once CAN_APPLY_NEVER is set, do we really are what the other flags may be?) See include/define.h for detailed description of the meaning of these return values.

Definition at line 1016 of file apply.cpp.

References object::body_info, object::body_used, BOW, CAN_APPLY_NEVER, CAN_APPLY_RESTRICTION, CAN_APPLY_UNAPPLY, CAN_APPLY_UNAPPLY_CHOICE, CAN_APPLY_UNAPPLY_MULT, FABS, FLAG_USE_ARMOUR, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_RING, FLAG_USE_SHIELD, FLAG_USE_WEAPON, get_item_from_body_location(), object::inv, IS_ARMOR, IS_SHIELD, IS_WEAPON, NUM_BODY_LOCATIONS, object_find_by_type_applied(), PLAYER, QUERY_FLAG, RING, ROD, SHIELD, object::type, WAND, and WEAPON.

Referenced by apply_check_apply_restrictions(), and monster_check_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_changes_to_player()

void apply_changes_to_player ( object pl,
object change,
int  limit_stats 
)

Applies (race) changes to a player.

Parameters
plobject to change.
changewhat kind of changes to apply. Should be of type CLASS.
limit_statsuses the AC_PLAYER_STAT defines from define.h: AC_PLAYER_STAT_LIMIT: Limit stats to racial maximum AC_PLAYER_STAT_NO_CHANGE: Do not make any stat adjustments

Definition at line 1672 of file apply.cpp.

References AC_PLAYER_STAT_LIMIT, AC_PLAYER_STAT_NO_CHANGE, object::anim_speed, object::anim_suffix, animate_object(), object::animation, object::arch, buf, change_attr_value(), CHARISMA, CLASS, CLEAR_FLAG, archetype::clone, object::contr, object::face, object::facing, FLAG_ANIMATE, FLAG_USE_WEAPON, FORCE, GET_ANIM, get_attr_value(), give_initial_items(), MAX_BUF, Animations::name, NUM_STATS, object_find_by_name(), object_present_in_ob_by_name(), player::orig_stats, QUERY_FLAG, object::randomitems, rndm(), set_attr_value(), SET_FLAG, object::stats, try_find_animation(), and object::type.

Referenced by apply_race_and_class(), and player_changer_type_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_check_weapon_power()

int apply_check_weapon_power ( const object who,
int  improves 
)

This checks to see of the player (who) is sufficient level to use a weapon with improves improvements (typically last_eat).

We take an int here instead of the object so that the improvement code can pass along the increased value to see if the object is usable. we return 1 (true) if the player can use the weapon. See ../types/weapon_improver/weapon_improver.c

Parameters
wholiving to check
improvesimprovement level.
Returns
1 if who can use the item, 0 else.

Definition at line 1131 of file apply.cpp.

References object::level.

Referenced by apply_special(), and improve_weapon().

+ Here is the caller graph for this function:

◆ apply_container()

int apply_container ( object op,
object sack,
int  aflags 
)

Handle apply on containers.

This is for containers that are applied by a player, whether in inventory or on the ground: eg, sacks, luggage, etc.

Moved to own function and added many features [Tero.Haatanen(at)lut.fi] This version is for client/server mode.

Reminder - there are three states for any container - closed (non applied), applied (not open, but objects that match get tossed into it), and open (applied flag set, and op->container points to the open container)

Parameters
opplayer.
sackcontainer the player is opening or closing.
aflagscombination of Flags for apply_special(). flags.
Returns
1 if an object is applied somehow or another, 0 if error/no apply
Author
Eneq(at)(csd.uu.se)

Definition at line 222 of file apply.cpp.

References AP_APPLY, AP_NULL, AP_OPEN, AP_UNAPPLY, CLEAR_FLAG, CONTAINER, object::container, socket_struct::container_position, object::contr, object::count, draw_ext_info_format(), object::env, esrv_send_inventory(), esrv_send_item(), esrv_update_item(), EVENT_CLOSE, events_execute_object_event(), find_key(), FLAG_APPLIED, object::head, INS_NO_MERGE, llevError, LOG(), object::map, MAX_BUF, object::more, MOVE_ALL, object::move_off, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, object::name, NDI_UNIQUE, object::nrof, object_insert_in_map_at(), object_insert_in_ob(), object_split(), object_was_destroyed, PLAYER, QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, set_object_face_main(), set_object_face_other(), object::slaying, player::socket, object::type, UPD_FACE, UPD_FLAGS, object::x, and object::y.

Referenced by container_type_move_on(), legacy_ob_apply(), and loot_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_handle_yield()

void apply_handle_yield ( object tmp)

This checks whether the object has a "on_use_yield" field, and if so generated and drops matching item.

Parameters
tmpitem that was applied.

Definition at line 122 of file apply.cpp.

References create_archetype(), drop(), object::env, INS_BELOW_ORIGINATOR, object::map, object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), object::x, and object::y.

Referenced by food_type_apply(), poison_type_apply(), and potion_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_manual()

int apply_manual ( object op,
object tmp,
int  aflag 
)

Main apply handler.

Checks for unpaid items before applying.

Parameters
opobject causing tmp to be applied.
tmpobject being applied.
aflagspecial (always apply/unapply) flags. Nothing is done with them in this function - they are passed to apply_special().
Returns
  • 0: player or monster can't apply objects of that type
  • 1: has been applied, or there was an error applying the object
  • 2: objects of that type can't be applied if not in inventory

Definition at line 597 of file apply.cpp.

References apply_check_race_restrictions(), object::contr, draw_ext_info, FLAG_APPLIED, FLAG_UNPAID, HEAD, METHOD_SILENT_ERROR, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, NDI_UNIQUE, ob_apply(), play_sound_player_only(), PLAYER, QUERY_FLAG, SOUND_TYPE_ITEM, and object::type.

Referenced by apply_by_living(), cfapi_object_apply(), give_initial_items(), lightable_type_apply(), monster_apply_below(), monster_check_apply(), monster_use_scroll(), polymorph_living(), transmute_item_to_flower(), and write_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_map_builder()

void apply_map_builder ( object pl,
int  dir 
)

◆ apply_race_and_class()

int apply_race_and_class ( object op,
archetype race,
archetype opclass,
living stats 
)

This is somewhat like key_change_class() above, except we know the race to change to, but we still basically need to do the same work (apply bonuses, update archetype, etc.)

Parameters
opPlayer object
racerace to use - caller should do sanity checking that this is a valid race.
opclassclass to use - like race, caller should do sanity checking.
statsIf set, use these stats for the character, do not apply new ones. Note: It is required that the caller only use valid stat values (generated by check_race_and_class() for example), as this function will not do checking on the stats.
Returns
0 on success, non zero on failure (may be extended with unique error codes). It is the responsibility of the caller to notify the client of this failure.

Definition at line 1488 of file player.cpp.

References AC_PLAYER_STAT_NO_CHANGE, add_statbonus(), add_string(), allowed_class(), apply_changes_to_player(), object::arch, buf, object::carrying, CLEAR_FLAG, archetype::clone, object::contr, create_treasure(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, events_execute_global_event(), find_treasurelist(), fix_object(), FLAG_WIZ, free_string(), get_attr_value(), give_initial_items(), living::grace, socket_struct::host, living::hp, object::inv, player::is_wraith, link_player_skills(), Settings::localdir, make_path_to_file(), MAX_BUF, living::maxhp, living::maxsp, name, object::name, object::name_pl, NUM_STATS, object_copy(), object_find_by_name(), object_free(), object_remove(), object_set_msg(), object_update(), player::orig_stats, Settings::playerdir, pticks, object::randomitems, SET_ANIMATION, set_attr_value(), settings, player::socket, living::sp, stats, object::stats, strlcpy(), player::title, UP_OBJ_FACE, UPD_FACE, and object::weight.

Referenced by create_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_special()

int apply_special ( object who,
object op,
int  aflags 
)

Apply an object.

This function doesn't check for unpaid items, but check other restrictions.

Usage example: apply_special (who, op, AP_UNAPPLY | AP_IGNORE_CURSE)

Parameters
whoobject using op. It can be a monster.
opobject being used. Should be an equipment type item, eg, one which you put on and keep on for a while, and not something like a potion or scroll.
aflagscombination of AP_xxx flags.
Returns
1 if the action could not be completed, 0 on success. However, success is a matter of meaning - if the user passes the 'apply' flag to an object already applied, nothing is done, and 0 is returned.

Definition at line 1156 of file apply.cpp.

References AMULET, AP_APPLY, AP_BASIC_FLAGS, AP_IGNORE_CURSE, AP_NOPRINT, AP_UNAPPLY, apply_check_apply_restrictions(), apply_check_item_power(), apply_check_owner(), apply_check_personalized_blessings(), apply_check_weapon_power(), apply_update_ranged_skill(), ARMOUR, BOOTS, BOW, BRACERS, BUILDER, change_abil(), change_skill(), object::chosen_skill, CLOAK, object::contr, draw_ext_info, draw_ext_info_format(), object::env, esrv_update_item(), find_skill_by_name(), fix_object(), FLAG_APPLIED, FLAG_BEEN_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SKILL, FLAG_READY_WEAPON, GIRDLE, GLOVES, HELMET, object::last_eat, llevError, LOG(), MAX_BUF, MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_SUCCESS, MSG_TYPE_APPLY_UNAPPLY, NDI_UNIQUE, object::nrof, object_insert_in_ob(), object_split(), PLAYER, QUERY_FLAG, query_name(), object::race, range_bow, range_builder, range_misc, player::ranges, RING, ROD, SET_FLAG, SHIELD, player::shoottype, SKILL, object::skill, SKILL_TOOL, object::type, unapply_special(), UPD_FLAGS, UPD_NAME, UPD_NROF, UPD_WEIGHT, WAND, and WEAPON.

Referenced by adjust_skill_tool(), attack_hth(), change_skill(), drop_object(), find_throw_ob(), improve_armour(), improve_weapon(), legacy_ob_apply(), put_object_in_sack(), and stop_using_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attack_ob()

int attack_ob ( object op,
object hitter 
)

Simple wrapper for attack_ob_simple(), will use hitter's values.

Parameters
opvictim.
hitterattacker.
Returns
dealt damage.

Definition at line 937 of file attack.cpp.

References attack_ob_simple(), living::dam, HEAD, object::stats, and living::wc.

Referenced by do_skill_attack(), and pets_move_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ become_follower()

int become_follower ( object op,
const object new_god 
)

This function is called whenever a player has switched to a new god.

It handles basically all the stat changes that happen to the player, including the removal of godgiven items (from the former cult). Handles race restrictions on god, and will punish player if needed.

Parameters
opplayer switching cults.
new_godnew god to worship.
Returns
1 if successfully converted, 0 if the god doesn't like the race, or something else.
Todo:
split the check to make this function only actually become follower

Definition at line 414 of file gods.cpp.

References add_string(), ARMOUR, ATNR_COLD, ATNR_ELECTRICITY, ATNR_FIRE, ATNR_POISON, BOOK, BOOTS, cast_magic_storm(), change_abil(), CLEAR_FLAG, object::contr, create_archetype(), determine_god(), draw_ext_info_format(), find_god(), FLAG_APPLIED, FLAG_BLIND, FLAG_MAKE_INVIS, FLAG_REFL_MISSILE, FLAG_REFL_SPELL, FLAG_SEE_IN_DARK, FLAG_STARTEQUIP, FLAG_STEALTH, FLAG_UNDEAD, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FLAG_XRAYS, follower_remove_given_items(), living::food, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, free_string(), get_archetype_by_type_subtype(), give_skill_by_name(), GLOVES, god_gives_present(), living::grace, HELMET, living::hp, treasurelist::items, object::last_eat, object::last_grace, object::last_heal, object::last_sp, object::level, link_player_skills(), LOOSE_MANA, living::luck, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, object::name, NDI_NAVY, NDI_UNIQUE, treasure::next, NROFATTACKS, object_find_by_type_subtype(), object_free_drop_inventory(), object_present_in_ob_by_name(), object_remove(), object::path_attuned, object::path_denied, object::path_repelled, player_unready_range_ob(), PREFER_LOW, QUERY_FLAG, object::race, random_roll(), object::randomitems, remove_special_prayers(), object::resist, SET_FLAG, SHIELD, SK_PRAYING, SKILL, object::slaying, living::sp, SPELL, SPELLBOOK, object::stats, stop_using_item(), object::title, update_priest_flag(), WEAPON, and worship_forbids_use().

Referenced by command_setgod(), and pray_at_altar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blind_living()

void blind_living ( object op,
object hitter,
int  dam 
)

Blind a living thing.

Parameters
opvictim.
hitterwho is attacking.
damdamage to deal.

Definition at line 2358 of file attack.cpp.

References ATNR_BLIND, BLINDNESS, change_abil(), create_archetype(), draw_ext_info_format(), fix_object(), FLAG_APPLIED, FLAG_BLIND, living::food, MAX_BUF, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, NDI_UNIQUE, object_get_owner(), object_insert_in_ob(), object_present_in_ob(), query_name(), object::resist, SET_FLAG, object::speed, and object::stats.

Referenced by hit_with_one_attacktype(), and scroll_failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calc_skill_exp()

int64_t calc_skill_exp ( const object who,
const object op,
const object skill 
)

Calculates amount of experience can be gained for successful use of a skill.

Here we take the view that a player must 'overcome an opponent' in order to gain experience. Examples include foes killed combat, finding/disarming a trap, stealing from somebeing, etc.

The gained experience is based primarily on the difference in levels, exp point value of vanquished foe, the relevant stats of the skill being used and modifications in the skills[] table.

For now, monsters and players will be treated differently. Below I give the algorithm for *PLAYER *experience gain. Monster exp gain is simpler. Monsters just get 10% of the exp of the opponent.

Players get a ratio, eg, opponent lvl / player level. This is then multiplied by various things. If simple exp is true, then this multiplier, include the level difference, is always 1. This revised method prevents some cases where there are big gaps in the amount you get just because you are now equal level vs lower level

Note that the experience is calculated for one "instance" of op, whatever its count.

Parameters
whoplayer/creature that used the skill.
opobject that was 'defeated'.
skillused skill. If none, it should just point back to who or be NULL.
Returns
experience for the skill use.

Definition at line 667 of file skill_util.cpp.

References living::Cha, mapstruct::difficulty, living::exp, FLAG_ALIVE, object::level, llevDebug, LOG(), object::magic, object::map, MAX, object::name, PLAYER, QUERY_FLAG, RUNE, settings, Settings::simple_exp, SKILL, skill, object::stats, TRAP, and object::type.

Referenced by book_type_apply(), detect_curse_on_item(), detect_magic_on_item(), do_hidden_move(), find_traps(), hide(), identify_object_with_skill(), kill_object(), pick_lock(), remove_trap(), scroll_type_apply(), singing(), spellbook_type_apply(), steal(), use_oratory(), and write_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ can_follow()

bool can_follow ( object op,
player other 
)

Definition at line 2796 of file c_wiz.cpp.

References object::contr, player::ob, and player::party.

Referenced by command_follow().

+ Here is the caller graph for this function:

◆ cast_bless()

◆ cast_cause_disease()

int cast_cause_disease ( object op,
object caster,
object spell,
int  dir 
)

◆ cast_change_ability()

int cast_change_ability ( object op,
object caster,
object spell_ob,
int  dir,
int  silent 
)

Cast some stat-improving spell.

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
dircasting direction.
silentif non zero, don't say when the spell is already is effect.
Return values
0spell failed.
1spell was successful.
Todo:
weird check on duration? since you'll never get there since a force would have been found?

Definition at line 1902 of file spell_effect.cpp.

References living::ac, add_refcount(), arch_to_object(), object::attacktype, change_abil(), CLEAR_FLAG, create_archetype(), draw_ext_info, draw_ext_info_format(), object::duration, living::exp, find_target_for_friendly_spell(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_SEE_IN_DARK, FLAG_XRAYS, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), get_attr_value(), living::hp, INS_ON_TOP, object::map, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_UNIQUE, no_gain_msgs, NROFATTACKS, NUM_STATS, object_insert_in_map_at(), object_insert_in_ob(), object::other_arch, PLAYER, QUERY_FLAG, object::race, object::resist, rndm(), set_attr_value(), SET_FLAG, SP_level_dam_adjust(), SP_level_duration_adjust(), object::speed, object::speed_left, object::stats, store_spell_expiry(), object::subtype, object::type, living::wc, object::x, and object::y.

Referenced by cast_spell(), and god_intervention().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_change_map_lightlevel()

int cast_change_map_lightlevel ( object op,
object spell 
)

This changes the light level for the entire map.

Parameters
opwho is casting.
spellactual spell object.
Return values
0light not affected.
1light changed.

Definition at line 3295 of file spell_effect.cpp.

References change_map_light(), draw_ext_info, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, and spell.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_cone()

int cast_cone ( object op,
object caster,
int  dir,
object spell 
)

Casts a cone spell.

Parameters
opperson firing the object.
casterobject casting the spell.
dirdirection to fire in.
spellspell that is being fired. It uses other_arch for the archetype to fire.
Return values
0couldn't cast.
1successful cast.

Definition at line 297 of file spell_attack.cpp.

References arch_to_object(), AT_FEAR, AT_GODPOWER, AT_HOLYWORD, AT_TURN_UNDEAD, object::attacktype, caster_level(), living::Cha, cone_drop(), object::count, d, living::dam, draw_ext_info, object::duration, FLAG_UNDEAD, freearr_x, freearr_y, get_fear_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_turn_bonus(), object::level, llevDebug, LOG(), m, object::map, living::maxhp, MOVE_FLY_LOW, object::move_on, object::move_type, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object_insert_in_map_at(), object_set_owner(), object::other_arch, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, RUNE, set_spell_skill(), living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), spell, object::stats, tailor_god_spell(), object::type, living::Wis, object::x, and object::y.

Referenced by cast_spell(), cast_wonder(), prayer_failure(), and spell_failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_consecrate()

int cast_consecrate ( object op,
object caster,
object spell 
)

A spell to make an altar your god's.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Return values
0no consecration happened.
1an altar waas consecrated.

Definition at line 2987 of file spell_effect.cpp.

References arch_to_object(), buf, caster_level(), determine_god(), draw_ext_info, draw_ext_info_format(), find_god(), FLAG_IS_BUILDABLE, FLAG_IS_FLOOR, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, HOLY_ALTAR, INS_BELOW_ORIGINATOR, letter, object::level, llevError, LOG(), object::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, object_insert_in_map_at(), object_remove(), QUERY_FLAG, SET_FLAG, spell, tolower, and try_find_archetype().

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_create_food()

int cast_create_food ( object op,
object caster,
object spell_ob,
int  dir,
const char *  stringarg 
)

Create food.

Allows the choice of what sort of food object to make. If stringarg is NULL, it will create food dependent on level –PeterM

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
dircasting direction.
stringargoptional parameter specifying what kind of items to create.
Return values
0no food created.
foodwas created.

Definition at line 627 of file spell_effect.cpp.

References archetypes_for_each(), cast_create_obj(), archetype::clone, draw_ext_info, DRINK, find_archetype_by_object_type_name(), living::food, FOOD, food_choice, food_each(), food_value_choice, identify(), is_identified(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, object::nrof, object_copy(), object_new(), SP_level_duration_adjust(), object::stats, and object::value.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_create_missile()

int cast_create_missile ( object op,
object caster,
object spell,
int  dir,
const char *  stringarg 
)

Create a missile (nonmagic - magic +4).

Will either create bolts or arrows based on whether a crossbow or bow is equiped. If neither, it defaults to arrows. Sets the plus based on the casters level. It is also settable with the invoke command. If the caster attempts to create missiles with too great a plus, the default is used. The # of arrows created also goes up with level, so if a 30th level mage wants LOTS of arrows, and doesn't care what the plus is he could create nonnmagic arrows, or even -1, etc...

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
dircasting direction.
stringargoptional parameter specifying what kind of items to create.
Return values
0no missile created.
missileswere created.

Definition at line 493 of file spell_effect.cpp.

References BOW, cast_create_obj(), object::count, create_archetype(), draw_ext_info_format(), find_artifactlist(), FLAG_IDENTIFIED, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), artifact::item, artifactlist::items, llevDebug, LOG(), object::magic, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object::nrof, object_find_by_type_applied(), object_free(), object_was_destroyed, pick_up(), PLAYER, object::race, SET_FLAG, object::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), spell, try_find_archetype(), object::type, and object::value.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_create_obj()

int cast_create_obj ( object op,
object new_op,
int  dir 
)

Creates object new_op in direction dir or if that is blocked, beneath the player (op).

This is really just a simple wrapper function .

Parameters
opwho is casting.
new_opobject to insert.
dirdirection to insert into. Can be 0 to insert below.
Returns
direction that the object was actually placed in.

Definition at line 494 of file spell_util.cpp.

References draw_ext_info, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, INS_BELOW_ORIGINATOR, m, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_INFO, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), P_OUT_OF_MAP, object::x, and object::y.

Referenced by cast_create_food(), cast_create_missile(), cast_create_town_portal(), and cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_create_town_portal()

int cast_create_town_portal ( object op,
object caster,
object spell 
)

This function cast the spell of town portal for op.

The spell operates in two passes. During the first one a place is marked as a destination for the portal. During the second one, 2 portals are created, one in the position the player cast it and one in the destination place. The portal are synchronized and 2 forces are inserted in the player to destruct the portal next time player creates a new portal pair. This spell has a side effect that it allows people to meet each other in a permanent, private, apartments by making a town portal from it to the town or another public place. So, check if the map is unique and if so return an error

Code by Tchize (david.nosp@m..del.nosp@m.becq@.nosp@m.usa..nosp@m.net)

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Return values
0spell was insuccessful for some reason.
1spell worked.

Definition at line 1241 of file spell_effect.cpp.

References add_string(), ARCH_PORTAL_FAILED, cast_create_obj(), caster_level(), object::contr, create_archetype(), Settings::create_home_portals, draw_ext_info, EXIT_PATH, EXIT_X, EXIT_Y, FREE_AND_COPY, HUGE_BUF, mapstruct::last_reset_time, llevError, LOG(), object::map, map_path_unique(), MAP_PLAYER_UNIQUE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_NAVY, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_msg(), mapstruct::path, object::race, ready_map_name(), settings, spell, town_portal_destroy_existing(), town_portal_find_force(), player::transport, mapstruct::unique, object::weapontype, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_curse()

int cast_curse ( object op,
object caster,
object spell_ob,
int  dir 
)

◆ cast_destruction()

int cast_destruction ( object op,
object caster,
object spell_ob 
)

Hit all monsters around the caster.

Parameters
opwho is casting.
casterwhat object is casting.
spell_obspell object to cast.
Returns
1.

Definition at line 707 of file spell_attack.cpp.

References arch_to_object(), ATNR_MAGIC, object::attacktype, change_skill(), living::dam, object::duration, find_skill_by_name(), FLAG_ALIVE, FLAG_FRIENDLY, FOR_MAP_FINISH, FOR_MAP_PREPARE, friendly, get_map_flags(), HEAD, hit_player(), m, make_object_glow(), object::map, object_insert_in_map_at(), object::other_arch, P_IS_ALIVE, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, object::resist, object::skill, skill, SP_DESTRUCTION, SP_FAERY_FIRE, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, object::subtype, object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_detection()

int cast_detection ( object op,
object caster,
object spell 
)

◆ cast_dust()

void cast_dust ( object op,
object throw_ob,
int  dir 
)

Handles op throwing objects of type 'DUST'.

This is much simpler in the new spell code - we basically just treat this as any other spell casting object.

Parameters
opobject throwing.
throw_obwhat to throw.
dirdirection to throw into.

Definition at line 3948 of file player.cpp.

References cast_spell(), draw_ext_info_format(), find_skill_by_name(), FLAG_REMOVED, object::inv, llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, object::name, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), PLAYER, POTION, QUERY_FLAG, object::skill, and object::type.

Referenced by do_throw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_earth_to_dust()

int cast_earth_to_dust ( object op,
object caster,
object spell_ob 
)

Basically destroys earthwalls in the area.

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
Return values
0op isn't a player.
1op is a player.

Definition at line 855 of file spell_effect.cpp.

References AT_PHYSICAL, FLAG_TEAR_DOWN, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), m, object::map, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::range, SP_level_range_adjust(), object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_heal()

int cast_heal ( object op,
object caster,
object spell,
int  dir 
)

Heals something.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
dircasting direction.
Todo:
check spurious cure_disease call (shouldn't the spell's level be sent?) and return check value (always 1).

Definition at line 1747 of file spell_effect.cpp.

References arch_present_in_ob(), arch_to_object(), AT_BLIND, AT_CONFUSION, AT_DISEASE, AT_POISON, cure_disease(), draw_ext_info, find_target_for_friendly_spell(), living::food, FORCE, living::grace, living::hp, INS_ON_TOP, object::map, MAX_FOOD, living::maxgrace, living::maxhp, living::maxsp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, object_insert_in_map_at(), object_present_in_ob_by_name(), PLAYER, poison, PREFER_HIGH, random_roll(), object::skill, living::sp, spell, object::stats, try_find_archetype(), object::type, object::x, and object::y.

Referenced by cast_spell(), and god_intervention().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_identify()

int cast_identify ( object op,
object caster,
object spell 
)

Identifies objects in the players inventory/on the ground.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Return values
0nothing was identified.
1at least one object was identified.

Definition at line 2505 of file spell_effect.cpp.

References draw_ext_info, draw_ext_info_format(), esrv_update_item(), FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, identify(), is_identified(), object::map, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_describe(), PLAYER, SP_level_dam_adjust(), spell, spell_effect(), object::type, UPD_FLAGS, UPD_NAME, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_invisible()

int cast_invisible ( object op,
object caster,
object spell_ob 
)

Makes the player or character invisible.

Note the spells to 'stack', but perhaps in odd ways. the duration for all is cumulative. In terms of invis undead/normal invis, it is the last one cast that will determine if you are invisible to undead or normal monsters. For improved invis, if you cast it with a one of the others, you lose the improved part of it, and the above statement about undead/ normal applies.

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
Return values
0invisibility was already in action.
1op is now invisible.

Definition at line 803 of file spell_effect.cpp.

References add_refcount(), object::contr, draw_ext_info, object::duration, FLAG_MAKE_INVIS, FREE_AND_CLEAR_STR, player::hidden, player::invis_race, object::invisible, makes_invisible_to(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_update(), PLAYER, QUERY_FLAG, object::race, SP_level_duration_adjust(), player::tmp_invis, object::type, and UP_OBJ_FACE.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_item_curse_or_bless()

int cast_item_curse_or_bless ( object op,
object spell_ob 
)

This alters player's marked item's cursed or blessed status, based on the spell_ob's fields.

Parameters
opplayer casting the spell.
spell_obspell itself.
Returns
1 if item was changed, 0 else.

Definition at line 2454 of file spell_effect.cpp.

References CLEAR_FLAG, draw_ext_info, draw_ext_info_format(), esrv_update_item(), find_marked_object(), FLAG_BLESSED, FLAG_CURSED, FLAG_IDENTIFIED, FLAG_KNOWN_BLESSED, FLAG_KNOWN_CURSED, FLAG_STARTEQUIP, HUGE_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, name, NDI_UNIQUE, QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_light()

int cast_light ( object op,
object caster,
object spell,
int  dir 
)

Illuminates something on a map, or try to blind a living thing.

See the spells documentation file for why this is its own function.

Parameters
opwho is casting.
casterwhat object is casting.
spellspell object to cast.
dircast direction.
Return values
0no effect.
1lighting successful.

Definition at line 1136 of file spell_attack.cpp.

References arch_to_object(), draw_ext_info, FLAG_MONSTER, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), llevError, LOG(), m, object::map, map_find_by_flag(), MAX_LIGHT_RADII, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), P_IS_ALIVE, P_OUT_OF_MAP, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), spell, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_magic_storm()

void cast_magic_storm ( object op,
object tmp,
int  lvl 
)

This is really used mostly for spell fumbles and the like.

Parameters
opwhat is casting this.
tmpobject to propagate.
lvlhow nasty should the propagation be.

Definition at line 49 of file spell_effect.cpp.

References object::count, living::dam, object::duration, object::level, object::map, living::maxhp, object_insert_in_map_at(), object::range, object::stats, object::x, and object::y.

Referenced by alchemy_failure_effect(), become_follower(), god_examines_priest(), pray_at_altar(), prayer_failure(), and scroll_failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_polymorph()

int cast_polymorph ( object op,
object caster,
object spell_ob,
int  dir 
)

Polymorph spell casting.

Parameters
opwho is casting the spell.
casterobject used to cast spell.
spell_obspell itself.
dircasting direction. 0 won't have any effect.
Returns
Returns 0 on illegal cast, otherwise 1.

Definition at line 425 of file spell_effect.cpp.

References object::above, arch_to_object(), caster_level(), FLAG_IS_FLOOR, living::food, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, level, m, object::map, MOVE_FLY_LOW, object_insert_in_map_at(), object::other_arch, P_NO_MAGIC, P_OUT_OF_MAP, polymorph(), QUERY_FLAG, object::range, SP_level_range_adjust(), object::speed_left, object::stats, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_raise_dead_spell()

int cast_raise_dead_spell ( object op,
object caster,
object spell,
int  dir,
const char *  arg 
)

This handles the raise dead / resurrection spells.

So try to revive a player.

Author
peterm and mehlh.nosp@m.aff@.nosp@m.soda..nosp@m.berk.nosp@m.eley..nosp@m.edu
Parameters
opwho is doing the resurrecting.
casterwhat is casting the spell (op or a scroll/rod).
spellspell object.
dirdirection the spell is cast.
argname of the player to revive.
Return values
0spell had no effect, or player couldn't revive.
1player revived, or some nasty things happened.

Definition at line 181 of file resurrection.cpp.

References arch_to_object(), CALLOC, caster_level(), CORPSE, draw_ext_info, draw_ext_info_format(), find_archetype(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), object::level, m, object::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), P_OUT_OF_MAP, resurrect_player(), resurrection_fails(), safe_strncpy, object::slaying, spell, summon_hostile_monsters(), t, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_smite_spell()

int cast_smite_spell ( object op,
object caster,
int  dir,
object spell 
)

The priest points to a creature and causes a 'godly curse' to descend.

Parameters
opwho is casting.
casterwhat object is casting.
dircast direction.
spellspell object to cast.
Return values
0spell had no effect.
1something was affected by the spell.

Definition at line 546 of file spell_attack.cpp.

References arch_to_object(), AT_DEATH, AT_GODPOWER, AT_HOLYWORD, object::attacktype, caster_level(), living::dam, determine_god(), draw_ext_info, draw_ext_info_format(), object::duration, find_god(), FLAG_REFL_SPELL, FLAG_UNDEAD, get_pointed_target(), living::hp, HUGE_BUF, object::level, object::map, living::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, object::name, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), object_set_owner(), PREFER_LOW, QUERY_FLAG, query_name(), object::race, random_roll(), object::range, set_spell_skill(), SP_EXPLOSION, SP_level_dam_adjust(), SP_level_range_adjust(), spell, SPELL_EFFECT, SPELL_GRACE, SPELL_MANA, object::stats, object::subtype, tailor_god_spell(), object::title, object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_spell()

int cast_spell ( object op,
object caster,
int  dir,
object spell_ob,
char *  stringarg 
)

Main dispatch when someone casts a spell.

Will decrease mana/gr points, check for skill, confusion and such.

Note that this function is really a dispatch routine that calls other functions - it just blindly returns what ever value those functions return. So if your writing a new function that is called from this, it should also return 1 on success, 0 on failure.

if it is a player casting the spell (op->type == PLAYER, op == caster), this function will decrease the mana/grace appropriately. For other objects, the caller should do what it considers appropriate.

Parameters
opcreature that is owner of the object that is casting the spell - eg, the player or monster.
casteractual object (wand, potion) casting the spell. can be same as op.
dirdirection to cast in. Note in some cases, if the spell is self only, dir really doesn't make a difference.
spell_obspell object that is being cast. From that, we can determine what to do. *
stringargany options that are being used. It can be NULL. Almost certainly, only players will set it. It is basically used as optional parameters to a spell (eg, item to create, information for marking runes, etc.
Returns
1 on successful cast, or 0 on error. These values should really be swapped, so that 0 is successful, and non zero is failure, with a code of what it failed.
Todo:
return a failure value?

Definition at line 1424 of file spell_util.cpp.

References alchemy(), object::anim_suffix, animate_weapon(), apply_anim_suffix(), object::arch, ARCH_SPELL_BLOCKED, ARCH_SPELL_BUNGLE, cast_bless(), cast_cause_disease(), cast_change_ability(), cast_change_map_lightlevel(), cast_cone(), cast_consecrate(), cast_create_food(), cast_create_missile(), cast_create_obj(), cast_create_town_portal(), cast_curse(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_heal(), cast_identify(), cast_invisible(), cast_item_curse_or_bless(), cast_light(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_transfer(), cast_wonder(), cast_word_of_recall(), caster_level(), Settings::casting_time, object::casting_time, change_skill(), object::contr, create_archetype(), create_aura(), create_bomb(), determine_god(), dimension_door(), dispel_rune(), draw_ext_info, draw_ext_info_format(), draw_magic_map(), player::encumbrance, FABS, find_random_spell_in_ob(), find_skill_by_name(), fire_arch_from_position(), fire_bolt(), fire_swarm(), FIREWALL, FLAG_ALIVE, FLAG_CONFUSED, FLAG_MONSTER, FLAG_WIZ, FLAG_WIZCAST, freearr_x, freearr_y, get_cleric_chance(), get_map_flags(), living::grace, handle_spell_confusion(), object::level, llevError, LOG(), magic_wall(), object::map, MAX, MAX_BUF, living::maxgrace, min_casting_level(), mood_change(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_MISSING, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_INFO, name, object::name, NDI_UNIQUE, object_get_owner(), P_NO_CLERIC, P_NO_MAGIC, object::path_attuned, object::path_denied, object::path_repelled, PATH_TIME_MULT, perceive_self(), pets_summon_golem(), pets_summon_object(), play_sound_map(), play_sound_player_only(), PLAYER, POTION, prayer_failure(), PREFER_HIGH, PREFER_LOW, probe(), QUERY_FLAG, query_name(), random_roll(), range_golem, range_magic, range_misc, range_none, recharge(), remove_curse(), rndm(), ROD, RUNE, SCROLL, settings, player::shoottype, object::skill, skill, SOUND_TYPE_SPELL, living::sp, SP_ALCHEMY, SP_ANIMATE_WEAPON, SP_AURA, SP_BLESS, SP_BOLT, SP_BOMB, SP_BULLET, SP_CAUSE_DISEASE, SP_CHANGE_ABILITY, SP_CHANGE_MANA, SP_CHANGE_MAP_LIGHT, SP_CHARGING, SP_CONE, SP_CONSECRATE, SP_CREATE_FOOD, SP_CREATE_MISSILE, SP_CURSE, SP_DESTRUCTION, SP_DETECTION, SP_DIMENSION_DOOR, SP_DISPEL_RUNE, SP_EARTH_TO_DUST, SP_ELEM_SHIELD, SP_FAERY_FIRE, SP_HEALING, SP_IDENTIFY, SP_INVISIBLE, SP_ITEM_CURSE_BLESS, SP_level_spellpoint_cost(), SP_LIGHT, SP_MAGIC_MAPPING, SP_MAGIC_MISSILE, SP_MAGIC_WALL, SP_MAKE_MARK, SP_MOOD_CHANGE, SP_MOVING_BALL, SP_PERCEIVE_SELF, SP_POLYMORPH, SP_PROBE, SP_RAISE_DEAD, SP_REMOVE_CURSE, SP_RUNE, SP_SMITE, SP_SUMMON_GOLEM, SP_SUMMON_MONSTER, SP_SWARM, SP_TOWN_PORTAL, SP_WONDER, SP_WORD_OF_RECALL, object::speed, object::speed_left, SPELL, object::spell, spell_consume_items(), spell_effect(), spell_failure(), Settings::spell_failure_effects, SPELL_GRACE, SPELL_MANA, object::spellarg, object::stats, strdup_local, object::subtype, TRUE, object::type, WAND, living::Wis, write_mark(), write_rune(), object::x, and object::y.

Referenced by altar_type_move_on(), cast_dust(), cast_wonder(), cfapi_object_cast(), command_cast_spell(), fire(), fire_misc_object(), monster_cast_spell(), monster_use_range(), move_aura(), move_firewall(), potion_type_apply(), scroll_type_apply(), and spring_trap().

+ Here is the caller graph for this function:

◆ cast_transfer()

int cast_transfer ( object op,
object caster,
object spell,
int  dir 
)

This spell transfers sp from the player to another person.

We let the target go above their normal maximum SP.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
dircasting direction.
Return values
0no transfer happened.
1transfer happened.

Definition at line 2838 of file spell_effect.cpp.

References caster_level(), charge_mana_effect(), draw_ext_info, FLAG_ALIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_BLACK, P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, living::sp, SP_level_dam_adjust(), spell, object::stats, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_wonder()

int cast_wonder ( object op,
object caster,
int  dir,
object spell_ob 
)

wonder is really just a spell that will likely cast another spell.

Parameters
opwho is casting.
casterwhat is casting.
dircasting direction.
spell_obactual spell object.
Todo:
doesn't it decrease sp without checking?

Definition at line 968 of file spell_effect.cpp.

References cast_cone(), cast_spell(), generate_treasure(), object::level, llevError, LOG(), object::name, object::randomitems, rndm(), SP_WONDER, SPELL, object::subtype, and object::type.

Referenced by cast_spell(), and scroll_failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cast_word_of_recall()

int cast_word_of_recall ( object op,
object caster,
object spell_ob 
)

Word of recall causes the player to return 'home'.

we put a force into the player object, so that there is a time delay effect.

Parameters
opwho is casting.
casterwhat is casting.
spell_obactual spell object.
Return values
0op isn't a player.
1word of recall initiated.

Definition at line 906 of file spell_effect.cpp.

References add_string(), player::bed_x, player::bed_y, object::contr, create_archetype(), draw_ext_info, object::duration, EXIT_PATH, EXIT_X, EXIT_Y, FORCE_NAME, llevError, LOG(), MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type_subtype(), object_insert_in_ob(), object_update_speed(), PLAYER, player::savebed_map, SP_level_duration_adjust(), SP_WORD_OF_RECALL, object::speed, object::speed_left, SPELL_EFFECT, object::subtype, time, and object::type.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ caster_level()

int caster_level ( const object caster,
const object spell 
)

This function returns the effective level the spell is being cast at.

Note that I changed the repelled/attuned bonus to 2 from 5. This is because the new code compares casting_level against min_caster_level, so the difference is effectively 4

Parameters
casterperson casting the spell.
spellspell object.
Returns
adjusted level.

Definition at line 194 of file spell_util.cpp.

References find_applied_skill_by_name(), object::level, level, object::path_attuned, object::path_repelled, PLAYER, skill, spell, and object::type.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_consecrate(), cast_create_town_portal(), cast_detection(), cast_polymorph(), cast_raise_dead_spell(), cast_smite_spell(), cast_spell(), cast_transfer(), charge_mana_effect(), create_aura(), fire_arch_from_position(), fire_swarm(), magic_wall(), mood_change(), pets_summon_golem(), pets_summon_object(), remove_curse(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_level_spellpoint_cost(), SP_level_wc_adjust(), and write_rune().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cftimer_create()

int cftimer_create ( int  id,
long  delay,
object ob,
int  mode 
)

Creates a new timer.

Parameters
iddesired timer identifier.
delaydesired timer delay.
obobject that will be linked to this timer. Should have an EVENT_TIMER handler.
modeunit for delay, should be TIMER_MODE_SECONDS or TIMER_MODE_CYCLES. See timers.h.
Return values
TIMER_ERR_NONEtimer was successfully created.
TIMER_ERR_IDinvalid ID.
TIMER_ERR_MODEinvalid mode.
TIMER_ERR_OBJob is NULL or has no EVENT_TIMER handler.

Definition at line 97 of file timers.cpp.

References object::count, cftimer::delay, EVENT_CONNECTOR, EVENT_TIMER, MAX_TIMERS, cftimer::mode, cftimer::ob_tag, object_find_by_type_subtype(), seconds(), TIMER_ERR_ID, TIMER_ERR_MODE, TIMER_ERR_NONE, TIMER_ERR_OBJ, TIMER_MODE_CYCLES, TIMER_MODE_DEAD, TIMER_MODE_SECONDS, and timers_table.

Referenced by cfapi_timer_create().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cftimer_destroy()

int cftimer_destroy ( int  id)

Destroys an existing timer.

Parameters
ididentifier of the timer to destroy.
Return values
TIMER_ERR_NONEno problem encountered.
TIMER_ERR_IDunknown id - timer not found or invalid.

Definition at line 128 of file timers.cpp.

References MAX_TIMERS, cftimer::mode, TIMER_ERR_ID, TIMER_ERR_NONE, TIMER_MODE_DEAD, and timers_table.

Referenced by cfapi_timer_destroy().

+ Here is the caller graph for this function:

◆ cftimer_find_free_id()

int cftimer_find_free_id ( void  )

Finds a free ID for a new timer.

Return values
TIMER_ERR_IDno free ID available.
>=0an available ID.

Definition at line 144 of file timers.cpp.

References MAX_TIMERS, TIMER_ERR_ID, TIMER_MODE_DEAD, and timers_table.

Referenced by cfapi_timer_create().

+ Here is the caller graph for this function:

◆ cftimer_init()

void cftimer_init ( void  )

Initialize timers.

Definition at line 157 of file timers.cpp.

References MAX_TIMERS, and timers_table.

Referenced by init().

+ Here is the caller graph for this function:

◆ cftimer_process_timers()

void cftimer_process_timers ( void  )

Processes all timers.

Definition at line 44 of file timers.cpp.

References cftimer_process_event(), cftimer::delay, MAX_TIMERS, cftimer::mode, seconds(), TIMER_MODE_CYCLES, TIMER_MODE_DEAD, TIMER_MODE_SECONDS, and timers_table.

Referenced by server_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_object()

void change_object ( object op)

Replaces op with its other_arch if it has reached its end of life.

This routine doesnt seem to work for "inanimate" objects that are being carried, ie a held torch leaps from your hands!. Modified this routine to allow held objects. b.t.

Parameters
opobject to change. Will be removed and replaced.
Note
Now handles multipart objects! If it fails to insert a multipart object, it re-inserts the original object. So, FLAG_FREED and FLAG_REMOVED will not be set in op if it is put back.

Definition at line 592 of file time.cpp.

References add_friendly_object(), object::arch, arch_to_object(), object::attack_movement, archetype::clone, object::env, env, FLAG_ALIVE, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, living::food, friendly, living::hp, INS_ABOVE_FLOOR_ONLY, INS_NO_MERGE, INS_NO_WALK_ON, LAMP, llevError, llevInfo, LOG(), object::map, archetype::more, object::name, object_find_multi_free_spot_around(), object_fix_multipart(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map(), object_insert_in_ob(), object_insert_to_free_spot_or_free(), object_remove(), object_set_owner(), object::other_arch, PETMOVE, QUERY_FLAG, remove_friendly_object(), SET_FLAG, SIZEOFFREE1, object::stats, object::type, object::x, and object::y.

Referenced by hit_player(), and process_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_skill()

int change_skill ( object who,
object new_skill,
int  flag 
)

This changes the object's skill to new_skill.

Note that this function doesn't always need to get used - you can now add skill exp to the player without the chosen_skill being set. This function is of most interest to players to update the various range information.

Parameters
wholiving to change skill for.
new_skillskill to use. If NULL, this just unapplies the current skill.
flaghas the current meaning:
  • 0x1: If set, don't update the range pointer. This is useful when we need to ready a new skill, but don't want to clobber range.
Return values
0change failure.
1success

Definition at line 359 of file skill_util.cpp.

References AP_APPLY, AP_NOPRINT, AP_UNAPPLY, apply_special(), object::chosen_skill, object::contr, PLAYER, range_skill, player::shoottype, object::skill, and object::type.

Referenced by apply_special(), cast_destruction(), cast_spell(), command_rskill(), do_skill_attack(), and fire_bow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_active_maps()

void check_active_maps ( void  )

Finds maps in memory to swap.

Definition at line 201 of file swap.cpp.

References first_map, mapstruct::in_memory, MAP_IN_MEMORY, mapstruct::next, swap_map(), and mapstruct::timeout.

Referenced by server_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_bullet()

void check_bullet ( object op)

Checks to see what op should do, given the space it is on (eg, explode, damage player, etc).

Parameters
opobject to check.

Definition at line 217 of file spell_attack.cpp.

References object::attacktype, object::count, living::dam, explode_bullet(), FLAG_ALIVE, FLAG_REMOVED, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, hit_player(), m, object::map, OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_remove(), object_was_destroyed, object::other_arch, P_IS_ALIVE, QUERY_FLAG, object::stats, object::x, and object::y.

Referenced by fire_arch_from_position(), and move_bullet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_login()

void check_login ( object op,
const char *  password 
)

Actually login a player, load from disk and such.

Parameters
opplayer.
passwordif not NULL, the uncrypted password the user entered. If NULL, no password check is done, coming from the account code which already does authentication.
Todo:
describe connect/login/logout/disconnect process.

Definition at line 511 of file login.cpp.

References add_string(), object::arch, player::bed_x, player::bed_y, player::bowtype, buf, object::carrying, living::Cha, check_password(), check_path(), CLEAR_FLAG, archetype::clone, living::Con, confirm_password(), containers, object::contr, living::Dex, player::digestion, draw_ext_info, draw_ext_info_format(), enter_player_maplevel(), esrv_add_spells(), esrv_new_player(), esrv_send_inventory(), esrv_send_pickup(), EVENT_LOGIN, events_execute_global_event(), final_free_player(), first_map_path, first_player, fix_object(), FLAG_FRIENDLY, FLAG_NO_FIX_PLAYER, FLAG_REMOVED, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FORCE, player::gen_grace, player::gen_hp, player::gen_sp, has_been_loaded(), player::has_directory, socket_struct::host, living::hp, i18n_get_language_by_code(), if(), living::Int, object::inv, is_dragon_pl(), player::is_old_wraith, player::is_wraith, key_inventory, keyrings, kill_player(), knowledge_send_known(), player::language, leave(), legal_range(), player::levgrace, player::levhp, player::levsp, link_player_skills(), player::listening, llevDebug, llevError, llevInfo, LO_NEWFILE, load_object(), Settings::localdir, LOG(), login_check_shutdown(), player::maplevel, MAX_BUF, player::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, object::name, player::name_changed, NDI_ALL, NDI_DK_ORANGE, NDI_UNIQUE, player::next, player::no_shout, Ns_Dead, player::ob, object_find_by_name(), object_find_by_type_and_arch_name(), object_remove(), object_reset(), object_sum_weight(), object_update_speed(), player::orig_stats, player::partial_commands, player::party, party_confirm_password(), party_find(), party_form(), party_join(), party_rejoin_always, party_rejoin_no, party_set_password(), partylist::partyname, player::password, player::peaceful, player::petmode, PLAYER, player_set_own_title(), player_set_state(), Settings::playerdir, living::Pow, PROFILE_BEGIN, PROFILE_END, pticks, QUERY_FLAG, quest_send_initial_states(), range_none, player::rejoin_party, remove_unpaid_objects(), Settings::reset_loc_time, save_player(), player::savebed_map, Settings::search_items, player::search_str, set_dragon_name(), SET_FLAG, Settings::set_title, settings, player::shoottype, player::socket, object::speed, player::spellparam, ST_PLAYING, player::state, object::stats, living::Str, strdup_local, strlcpy(), player::ticks_played, time, player::title, TRUE, object::type, player::unapply, unapply_always, unapply_never, unapply_nochoice, player::unarmed_skill, socket_struct::update_look, player::usekeys, object::weight, living::Wis, wrong_password(), object::x, and object::y.

Referenced by account_play_cmd(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_name()

int check_name ( player me,
const char *  name 
)

Ensure player's name is valid.

Parameters
meplayer to report to.
namename to check.
Return values
0invalid name.
1valid name.

Definition at line 181 of file login.cpp.

References draw_ext_info, draw_ext_info_format(), MAX_NAME, me, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, name, NDI_UNIQUE, player::ob, and playername_ok().

Referenced by receive_player_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_password()

bool check_password ( const char *  typed,
const char *  crypted 
)

Hash a password and compare it to the stored version.

Parameters
typedPassword entered by the user (not hashed).
cryptedStored password to check against (hashed).
Returns
True if the passwords match, false otherwise.

Definition at line 114 of file server.cpp.

References crypt_string(), llevError, and LOG().

Referenced by account_change_password(), account_login(), check_login(), receive_player_password(), and verify_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_physically_infect()

void check_physically_infect ( object victim,
object hitter 
)

Possibly infect due to direct physical contact i.e., AT_PHYSICAL.

Parameters
victimpotential victim.
hitterwho is hitting.

Definition at line 663 of file disease.cpp.

References DISEASE, FOR_INV_FINISH, FOR_INV_PREPARE, and infect_object().

Referenced by hit_with_one_attacktype().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_pick()

◆ check_race_and_class()

int check_race_and_class ( living stats,
archetype race,
archetype opclass 
)

This checks to see if the race and class are legal.

Legal in this contexts means that after apply the race/class stat modifiers, the race is still in legal range.

Parameters
statsThe statistics to modify - this data is modified, so the caller can use it on the next update.
raceThe race to try and apply. It can be NULL, in which case no race will be applied.
opclassThe class to apply. It can be NULL, in which case no class will be applied.
Returns
0 on success, 1 on failure. Note that no distinction is made on whether the failure is from race or class, as it is the final statistics which are important. For example, if race is -2 Str, and class is +2 Str, if the starting strength is 1, that is still legal (as final result is 1)

Definition at line 1438 of file player.cpp.

References archetype::clone, get_attr_value(), Settings::max_stat, MIN_STAT, NUM_STATS, set_attr_value(), settings, stats, and object::stats.

Referenced by create_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_spell_expiry()

void check_spell_expiry ( object spell)

Checks if player should be warned of soon expiring spell.

Should be called at each move of the spell. Will use key stored by store_spell_expiry(). If the spell effect/force isn't in a player's inventory, won't do anything.

Parameters
spellforce or spell whose effects will expire.

Definition at line 2006 of file spell_util.cpp.

References draw_ext_info_format(), IS_PLAYER(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN, NDI_NAVY, NDI_UNIQUE, object_get_value(), and spell.

Referenced by move_aura(), and remove_force().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_spell_known()

object* check_spell_known ( object op,
const char *  name 
)

Checks to see if player knows the spell.

If the name is the same as an existing spell, we presume they know it.

Parameters
opobject we're looking into.
namespell name. Doesn't need to be a shared string.
Returns
1 if op knows the spell, 0 if it don't.

Definition at line 394 of file spell_util.cpp.

References name, object_find_by_type_and_name(), and SPELL.

Referenced by cfapi_object_check_spell(), command_learn_spell_or_prayer(), do_forget_spell(), do_learn_spell(), dragon_ability_gain(), god_intervention(), and spellbook_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkbanned()

int checkbanned ( const char *  login,
const char *  host 
)

Check if a player and/or host is banned.

Wildcards can be used.

Parameters
loginplayer name to check; NULL to check only the host name.
hosthost name to check.
Returns
1=player/host is banned; 0=player/host is not banned

Definition at line 32 of file ban.cpp.

References BANFILE, BANISHFILE, buf, Settings::confdir, llevDebug, Settings::localdir, LOG(), login, MAX_BUF, and settings.

Referenced by new_connection(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clean_tmp_files()

void clean_tmp_files ( void  )

Save unique maps and clean up temporary map files unless recycling temporary maps.

The function name is somewhat misleading.

Definition at line 351 of file main.cpp.

References clean_tmp_map(), first_map, m, MAP_IN_MEMORY, Settings::recycle_tmp_maps, save_map(), SAVE_MODE_NORMAL, settings, swap_map(), and write_todclock().

Referenced by cleanup(), fatal(), and LOG().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

◆ cleanupPlugins()

void cleanupPlugins ( void  )

Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown.

Will not unload plugins. Free all items of plugins_list.

Definition at line 4618 of file plugins.cpp.

References plugins_list.

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ clear_skill()

void clear_skill ( object who)

This function just clears the chosen_skill and range_skill values in the player.

Parameters
wholiving to clear.

Definition at line 398 of file skill_util.cpp.

References object::chosen_skill, CLEAR_FLAG, object::contr, FLAG_READY_SKILL, PLAYER, range_none, range_skill, player::ranges, player::shoottype, and object::type.

Referenced by unapply_special().

+ Here is the caller graph for this function:

◆ close_modules()

void close_modules ( )

Clean up all modules which are not disabled.

Definition at line 80 of file init.cpp.

References module_information::close, module_information::description, module_information::enabled, llevInfo, LOG(), modules, and module_information::name.

Referenced by cleanup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_abil()

void command_abil ( object op,
const char *  params 
)

Changes an object's statistics.

Parameters
opwizard.
paramsparameters, should be "player statistic new_value".
Todo:
use get_other_player_from_name(). Isn't this useless with the command_patch()?

Definition at line 1819 of file c_wiz.cpp.

References living::Cha, living::Con, living::Dex, draw_ext_info, draw_ext_info_format(), FALSE, first_player, fix_object(), FLAG_WAS_WIZ, living::Int, Settings::max_stat, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, player::next, player::ob, player::orig_stats, living::Pow, Settings::real_wiz, SET_FLAG, settings, object::stats, living::Str, and living::Wis.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_accountpasswd()

void command_accountpasswd ( object op,
const char *  params 
)

Definition at line 1638 of file c_wiz.cpp.

References account_change_password(), draw_ext_info, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_accuse()

void command_accuse ( object op,
const char *  params 
)

'accuse' command.

Parameters
opplayer.
paramsmessage.

Definition at line 909 of file c_chat.cpp.

References basic_emote(), and EMOTE_ACCUSE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_addexp()

void command_addexp ( object op,
const char *  params 
)

This adds exp to a player.

We now allow adding to a specific skill.

Parameters
opwizard.
paramsshould be "player quantity [skill]".

Definition at line 1676 of file c_wiz.cpp.

References buf, calc_perm_exp(), check_exp_adjust(), draw_ext_info, draw_ext_info_format(), living::exp, FALSE, find_skill_by_name(), first_player, FLAG_WAS_WIZ, MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, player::next, player::ob, player_lvl_adj(), Settings::real_wiz, SET_FLAG, settings, skill, and object::stats.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_afk()

void command_afk ( object op,
const char *  params 
)

Toggles the afk status of a player.

'afk' command.

Parameters
opplayer to toggle status for.
paramsunused.

Definition at line 775 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info, FLAG_AFK, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_apply()

void command_apply ( object op,
const char *  params 
)

'apply' command.

Parameters
opplayer.
paramswhat to apply.

Definition at line 251 of file c_object.cpp.

References object::above, AP_APPLY, AP_NULL, AP_OPEN, AP_UNAPPLY, apply_by_living(), apply_by_living_below(), object::container, draw_ext_info_format(), find_best_apply_object_match(), object::inv, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_applymode()

void command_applymode ( object op,
const char *  params 
)

Players wants to change the apply mode, ie how to handle applying an item when no body slot available.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1277 of file c_misc.cpp.

References object::contr, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, player::unapply, unapply_always, unapply_never, and unapply_nochoice.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_archs()

void command_archs ( object op,
const char *  params 
)

◆ command_arrest()

void command_arrest ( object op,
const char *  params 
)

Wizard jails player.

Parameters
opwizard.
paramsplayer to jail.

Definition at line 821 of file c_wiz.cpp.

References draw_ext_info, draw_ext_info_format(), 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, object::name, NDI_UNIQUE, player::ob, and player_arrest().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_banish()

void command_banish ( object op,
const 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

Parameters
opDM banishing.
paramsplayer to banish. Must be a complete name match.
Returns
1.

Definition at line 502 of file c_wiz.cpp.

References BANISHFILE, buf, command_kick2(), 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, object::name, NDI_ALL, NDI_RED, NDI_UNIQUE, player::ob, settings, player::socket, and time.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_beg()

void command_beg ( object op,
const char *  params 
)

'beg' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1272 of file c_chat.cpp.

References basic_emote(), and EMOTE_BEG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_bleed()

void command_bleed ( object op,
const char *  params 
)

'bleed' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1283 of file c_chat.cpp.

References basic_emote(), and EMOTE_BLEED.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_blush()

void command_blush ( object op,
const char *  params 
)

'blush' command.

Parameters
opplayer.
paramsmessage.

Definition at line 953 of file c_chat.cpp.

References basic_emote(), and EMOTE_BLUSH.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_body()

void command_body ( object op,
const char *  params 
)

This command dumps the body information for object *op.

it doesn't care what the params are.

This is mostly meant as a debug command.

This is the 'body' command.

Parameters
opplayer to display body info for.
paramsunused

Definition at line 175 of file c_misc.cpp.

References object::body_info, body_locations, object::body_used, draw_ext_info, draw_ext_info_format(), FLAG_USE_ARMOUR, FLAG_USE_WEAPON, i18n(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_BODY, NDI_UNIQUE, NUM_BODY_LOCATIONS, and QUERY_FLAG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_bounce()

void command_bounce ( object op,
const char *  params 
)

'bounce' command.

Parameters
opplayer.
paramsmessage.

Definition at line 755 of file c_chat.cpp.

References basic_emote(), and EMOTE_BOUNCE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_bow()

void command_bow ( object op,
const char *  params 
)

'bow' command.

Parameters
opplayer.
paramsmessage.

Definition at line 931 of file c_chat.cpp.

References basic_emote(), and EMOTE_BOW.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_bowmode()

void command_bowmode ( object op,
const char *  params 
)

Player wants to change the bowmode, how arrows are fired.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1318 of file c_misc.cpp.

References bow_bestarrow, bow_nw, player::bowtype, buf, object::contr, draw_ext_info, draw_ext_info_format(), is_valid_types_gen::found, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), and types.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_brace()

void command_brace ( object op,
const char *  params 
)

Player toggles her braced status.

Parameters
opplayer.
paramsbrace status (on/off).

Definition at line 2172 of file c_misc.cpp.

References player::braced, object::contr, draw_ext_info, fix_object(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and onoff_value().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_burp()

void command_burp ( object op,
const char *  params 
)

'burp' command.

Parameters
opplayer.
paramsmessage.

Definition at line 964 of file c_chat.cpp.

References basic_emote(), and EMOTE_BURP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cackle()

void command_cackle ( object op,
const char *  params 
)

'cackle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 777 of file c_chat.cpp.

References basic_emote(), and EMOTE_CACKLE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cast()

void command_cast ( object op,
const char *  params 
)

'cast' command, prepares a spell for laster casting.

Parameters
opplayer.
paramsspell.

Definition at line 50 of file c_range.cpp.

References command_cast_spell().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cast_spell()

void command_cast_spell ( object op,
const char *  params,
int  cast_now 
)

Sets up to cast a spell.

Invoke casts a spell immediately, whereas cast just set up the range type.

Parameters
opcaster.
paramsspell name.
cast_now0 to ready the spell, 1 to cast it immediately
Todo:
present the list nicely instead of comma-separated simply

Definition at line 146 of file c_range.cpp.

References cast_spell(), object::contr, object::count, draw_ext_info_format(), object::facing, find_skill_by_name(), player::golem_count, lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, object::name, NDI_UNIQUE, object_find_by_tag(), object_free_drop_inventory(), object_get_value(), object_remove(), range_golem, range_magic, player::ranges, remove_friendly_object(), safe_strncpy, player::shoottype, show_matching_spells(), object::skill, SPELL, object::spell, player::spellparam, sstring, and object::type.

Referenced by command_cast(), and command_invoke().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_chat()

void command_chat ( object op,
const char *  params 
)

'chat' command.

Parameters
opplayer.
paramsmessage.

Definition at line 221 of file c_chat.cpp.

References command_tell_all(), MSG_TYPE_COMMUNICATION_CHAT, and NDI_BLUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_chuckle()

void command_chuckle ( object op,
const char *  params 
)

'chuckle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 975 of file c_chat.cpp.

References basic_emote(), and EMOTE_CHUCKLE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_clap()

void command_clap ( object op,
const char *  params 
)

'clap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 942 of file c_chat.cpp.

References basic_emote(), and EMOTE_CLAP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cointoss()

void command_cointoss ( object op,
const char *  params 
)

'cointoss' command.

Parameters
opplayer.
paramsmessage.

Definition at line 64 of file c_chat.cpp.

References buf, draw_ext_info_format(), ext_info_map_except(), object::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_RANDOM, object::name, NDI_UNIQUE, NDI_WHITE, and rndm().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cough()

void command_cough ( object op,
const char *  params 
)

'cough' command.

Parameters
opplayer.
paramsmessage.

Definition at line 986 of file c_chat.cpp.

References basic_emote(), and EMOTE_COUGH.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_create()

void command_create ( object op,
const 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:

  • arch dragon
  • name big nasty creature
  • hp 5
  • sp 30

which is much easier to parse than dragon name "big nasty creature" hp 5 sp 30 for example.

Parameters
opwizard.
paramsobject description.
Todo:
enable line breaks in command.

Definition at line 999 of file c_wiz.cpp.

References object::arch, arch_to_object(), archetype::clone, object::contr, player::count, object::count, create_treasure(), mapstruct::difficulty, dm_stack_pop(), dm_stack_push(), draw_ext_info, draw_ext_info_format(), FALSE, find_archetype_by_object_name(), find_artifactlist(), FLAG_ALIVE, FLAG_IDENTIFIED, FLAG_MONSTER, FLAG_WAS_WIZ, FREE_OBJ_NO_DESTROY_CALLBACK, give_artifact_abilities(), is_identifiable_type(), artifact::item, artifactlist::items, llevDebug, LOG(), object::map, MAX, MAX_BUF, monster_check_apply_all(), object::more, archetype::more, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, object::nrof, object_copy(), object_create_arch(), object_free(), object_give_identified_properties(), object_insert_in_map_at(), object_insert_in_ob(), object::other_arch, out_of_map(), POTION, QUERY_FLAG, object::randomitems, Settings::real_wiz, ROD, safe_strncpy, SCROLL, set_abs_magic(), SET_FLAG, set_magic(), set_variable(), settings, SPELL, SPELLBOOK, try_find_archetype(), object::type, WAND, object::x, and object::y.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cringe()

void command_cringe ( object op,
const char *  params 
)

'cringe' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1294 of file c_chat.cpp.

References basic_emote(), and EMOTE_CRINGE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_cry()

void command_cry ( object op,
const char *  params 
)

'cry' command.

Parameters
opplayer.
paramsmessage.

Definition at line 887 of file c_chat.cpp.

References basic_emote(), and EMOTE_CRY.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dance()

void command_dance ( object op,
const char *  params 
)

'dance' command.

Parameters
opplayer.
paramsmessage.

Definition at line 733 of file c_chat.cpp.

References basic_emote(), and EMOTE_DANCE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_debug()

void command_debug ( object op,
const char *  params 
)

Player wants to see/change the debug level.

Parameters
opplayer asking for information.
paramsnew debug value.

Definition at line 893 of file c_misc.cpp.

References Settings::debug, draw_ext_info_format(), FABS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, and settings.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_delete()

void command_delete ( object op,
const char *  params 
)

Player wants to totally delete her character.

Parameters
opplayer wanting to delete her character.
paramsunused.

Definition at line 1889 of file c_misc.cpp.

References object::contr, CS_QUERY_SINGLECHAR, draw_ext_info, FLAG_WIZ, i18n(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, NDI_UNIQUE, player_set_state(), QUERY_FLAG, send_query(), player::socket, and ST_CONFIRM_QUIT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_diff()

void command_diff ( object op,
const char *  params 
)

Get a diff of specified items.

Second item is compared to first, and differences displayed.

Note
get_ob_diff() works the opposite way (first compared to 2nd), but it's easier with stack functions to do it this way, so you can do:
  • stack_push <base>
  • stack_push <object to be compared>
  • diff
  • patch xxx <-— applies to object compared to base, easier :)

Ryo, august 2004

Parameters
opwizard.
paramsobject specifier.

Definition at line 2622 of file c_wiz.cpp.

References object::contr, dm_stack_pop(), draw_ext_info, get_dm_object(), get_ob_diff(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_by_tag_global(), STACK_FROM_NUMBER, STACK_FROM_TOP, player::stack_items, player::stack_position, stringbuffer_finish(), and stringbuffer_new().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_disarm()

void command_disarm ( object op,
const char *  params 
)

'disarm' command.

Parameters
opplayer.
paramsunused.

Definition at line 224 of file c_object.cpp.

References do_skill_by_number(), and SK_DISARM_TRAPS.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dm()

void command_dm ( object op,
const 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

Parameters
opplayer wishing to become wizard.
paramspassword.
Returns
0 unless op isn't a player.

Definition at line 2214 of file c_wiz.cpp.

References do_wizard_dm().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dmhide()

void command_dmhide ( object op,
const 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.

Parameters
opwizard.
paramspassword.

Definition at line 2519 of file c_wiz.cpp.

References do_wizard_dm(), and do_wizard_hide().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dmtell()

void command_dmtell ( object op,
const char *  params 
)

Private communication, by a DM (can't be ignored by player).

Parameters
opplayer trying to tell something to someone.
paramswho to tell, and message.

Definition at line 320 of file c_chat.cpp.

References do_tell().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_drop()

void command_drop ( object op,
const char *  params 
)

'drop' command.

Parameters
opplayer.
paramswhat to drop.

Definition at line 1354 of file c_object.cpp.

References CLEAR_FLAG, object::contr, player::count, draw_ext_info, draw_ext_info_format(), drop(), esrv_update_item(), fix_object(), FLAG_INV_LOCKED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FOR_INV_FINISH, FOR_INV_PREPARE, make_matcher(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, QUERY_FLAG, SET_FLAG, object::type, and UPD_WEIGHT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dropall()

void command_dropall ( object op,
const char *  params 
)

Command to drop all items that have not been locked.

Parameters
opplayer.
paramsoptional specifier, like 'armour', 'weapon' and such.

Definition at line 1230 of file c_object.cpp.

References AMULET, ARMOUR, ARMOUR_IMPROVER, ARROW, BOOK, BOOTS, BOW, BRACERS, CLEAR_FLAG, CLOAK, CONTAINER, object::container, object::contr, player::count, draw_ext_info, DRINK, drop(), esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_INV_LOCKED, FLAG_NO_FIX_PLAYER, FLESH, FOOD, FOR_INV_FINISH, FOR_INV_PREPARE, GEM, GIRDLE, GLOVES, HELMET, object::inv, KEY, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, PLAYER, POTION, QUERY_FLAG, RING, ROD, SCROLL, SET_FLAG, SHIELD, player::socket, SPECIAL_KEY, SPELLBOOK, object::type, UPD_WEIGHT, socket_struct::update_look, WAND, WEAPON, and WEAPON_IMPROVER.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dump()

void command_dump ( object op,
const char *  params 
)

Dumps the difference between an object and its archetype.

Parameters
opwiard.
paramsobject to dump.

Definition at line 1377 of file c_wiz.cpp.

References object::contr, draw_ext_info, FLAG_OBJ_ORIGINAL, get_dm_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_dump(), QUERY_FLAG, stringbuffer_finish(), and stringbuffer_new().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpabove()

void command_dumpabove ( object op,
const char *  params 
)

Player wants to dump object above her.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 2902 of file c_wiz.cpp.

References object::above, and do_dump().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpallarchetypes()

void command_dumpallarchetypes ( object op,
const char *  params 
)

Various archetypes-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1005 of file c_misc.cpp.

References dump_all_archetypes().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpallmaps()

void command_dumpallmaps ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1047 of file c_misc.cpp.

References dump_all_maps().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpallobjects()

void command_dumpallobjects ( object op,
const char *  params 
)

Various object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 977 of file c_misc.cpp.

References object_dump_all().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpbelow()

void command_dumpbelow ( object op,
const char *  params 
)

Player wants to dump object below her.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 2887 of file c_wiz.cpp.

References object::below, and do_dump().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpfriendlyobjects()

void command_dumpfriendlyobjects ( object op,
const char *  params 
)

Various friendly object-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 991 of file c_misc.cpp.

References dump_friendly_objects().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_dumpmap()

void command_dumpmap ( object op,
const char *  params 
)

Various map-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1033 of file c_misc.cpp.

References dump_map(), and object::map.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_east()

void command_east ( object op,
const char *  params 
)

'east' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 57 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_empty()

void command_empty ( object op,
const char *  params 
)

'empty' command.

Parameters
opplayer.
paramsitem specifier.

Definition at line 1450 of file c_object.cpp.

References CONTAINER, draw_ext_info, empty_container(), find_best_object_match(), FOR_INV_FINISH, FOR_INV_PREPARE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and object::type.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_examine()

void command_examine ( object op,
const char *  params 
)

'examine' command.

Parameters
opplayer.
paramsoptional item specifier.

Definition at line 1489 of file c_object.cpp.

References draw_ext_info_format(), examine(), find_best_object_match(), FOR_BELOW_FINISH, FOR_BELOW_PREPARE, LOOK_OBJ, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_execute()

void command_execute ( object pl,
char *  command 
)

Handle a player-issued command.

Parameters
plplayer who is issuing the command
commandthe actual command with its arguments. Will be modified in-place.

Definition at line 456 of file commands.cpp.

References command, command_find(), object::contr, registered_command::extra, registered_command::func_extra, registered_command::func_std, player::has_hit, llevDebug, LOG(), object::speed_left, registered_command::time, and tolower.

Referenced by new_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_face()

void command_face ( object op,
const char *  params 
)

Player wants to face a given direction.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 111 of file c_new.cpp.

References draw_ext_info, draw_ext_info_format(), face_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_fire()

void command_fire ( object op,
const char *  params 
)

Player wants to start firing.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 77 of file c_new.cpp.

References object::contr, draw_ext_info, player::fire_on, move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_fire_stop()

void command_fire_stop ( object op,
const char *  params 
)

Player wants to stop firing.

Parameters
opplayer.
paramsignored.

Definition at line 98 of file c_new.cpp.

References object::contr, and player::fire_on.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_fix_me()

void command_fix_me ( object op,
const char *  params 
)

Wrapper to fix a player.

Parameters
opplayer asking to be fixed.
paramsunused.

Definition at line 1213 of file c_misc.cpp.

References fix_object(), and object_sum_weight().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_flip()

void command_flip ( object op,
const char *  params 
)

'flip' command.

Parameters
opplayer.
paramsmessage.

Definition at line 997 of file c_chat.cpp.

References basic_emote(), and EMOTE_FLIP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_follow()

void command_follow ( object op,
const char *  params 
)

Follow a player, or stop following a player.

Parameters
opPlayer follower
paramsplayer to follow. If NULL, stop following player.

Definition at line 2809 of file c_wiz.cpp.

References add_string(), can_follow(), object::contr, rv_vector::distance, draw_ext_info, draw_ext_info_format(), find_player_partial_name(), FLAG_WIZ, player::followed_player, FREE_AND_CLEAR_STR, get_rangevector(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, object::name, NDI_UNIQUE, player::ob, and QUERY_FLAG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_forget_spell()

void command_forget_spell ( object op,
const char *  params 
)

Command for players to forget a spell.

This command used to be available only to DMs.

Parameters
opplayer
paramsspell name to forget.

Definition at line 2415 of file c_wiz.cpp.

References object::contr, do_forget_spell(), draw_ext_info, draw_ext_info_format(), lookup_spell_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and spell.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_free()

void command_free ( object op,
const char *  params 
)

Totally free an object.

Parameters
opwizard.
paramsobject to free.

Definition at line 1612 of file c_wiz.cpp.

References object::contr, dm_stack_pop(), draw_ext_info, FLAG_REMOVED, get_dm_object(), HEAD, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), QUERY_FLAG, and STACK_FROM_STACK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_freeze()

void command_freeze ( object op,
const char *  params 
)

Freezes a player for a specified tick count, 100 by default.

Parameters
opwizard freezing the player.
paramsoptional tick count, followed by player name.

Definition at line 745 of file c_wiz.cpp.

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, object::name, NDI_RED, NDI_UNIQUE, player::ob, object::speed, and object::speed_left.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_frown()

void command_frown ( object op,
const char *  params 
)

'frown' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1008 of file c_chat.cpp.

References basic_emote(), and EMOTE_FROWN.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_gasp()

void command_gasp ( object op,
const char *  params 
)

'gasp' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1019 of file c_chat.cpp.

References basic_emote(), and EMOTE_GASP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_giggle()

void command_giggle ( object op,
const char *  params 
)

'giggle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 799 of file c_chat.cpp.

References basic_emote(), and EMOTE_GIGGLE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_glare()

void command_glare ( object op,
const char *  params 
)

'glare' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1030 of file c_chat.cpp.

References basic_emote(), and EMOTE_GLARE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_goto()

void command_goto ( object op,
const char *  params 
)

Wizard teleports to a map.

Parameters
opwizard teleporting.
paramsmap to teleport to. Can be absolute or relative path.

Definition at line 724 of file c_wiz.cpp.

References do_goto(), draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by command_loadtest(), and commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_grin()

void command_grin ( object op,
const char *  params 
)

'grin' command.

Parameters
opplayer.
paramsmessage.

Definition at line 920 of file c_chat.cpp.

References basic_emote(), and EMOTE_GRIN.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_groan()

void command_groan ( object op,
const char *  params 
)

'groan' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1041 of file c_chat.cpp.

References basic_emote(), and EMOTE_GROAN.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_growl()

void command_growl ( object op,
const char *  params 
)

'growl' command.

Parameters
opplayer.
paramsmessage.

Definition at line 832 of file c_chat.cpp.

References basic_emote(), and EMOTE_GROWL.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_gsay()

void command_gsay ( object op,
const char *  params 
)

'gsay' command, talks to party.

Parameters
opplayer.
paramsmessage.

Definition at line 75 of file c_party.cpp.

References command_party(), draw_ext_info, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_help()

void command_help ( object op,
const char *  params 
)

Player is asking for some help.

Parameters
opplayer asking for information.
paramswhat kind of help to ask for.

Definition at line 1772 of file c_misc.cpp.

References command_list(), object::contr, Settings::datadir, display_help_file(), draw_ext_info_format(), find_help_file(), FLAG_WIZ, help_topics(), i18n_get_language_code(), player::language, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, QUERY_FLAG, and settings.

Referenced by command_knowledge(), command_party(), command_quest(), command_shutdown(), and commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_hiccup()

void command_hiccup ( object op,
const char *  params 
)

'hiccup' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1052 of file c_chat.cpp.

References basic_emote(), and EMOTE_HICCUP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_hide()

void command_hide ( object op,
const char *  params 
)

Wizard 'hide' command.

Parameters
opDM wanting to hide.
paramsignored.

Definition at line 389 of file c_wiz.cpp.

References do_wizard_hide().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_hiscore()

void command_hiscore ( object op,
const char *  params 
)

Player is asking for the hiscore.

Parameters
opplayer asking for information.
paramsoptions for the hiscore command (typically a match for the names)

Definition at line 881 of file c_misc.cpp.

References hiscore_display().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_hug()

void command_hug ( object op,
const char *  params 
)

'hug' command.

Parameters
opplayer.
paramsmessage.

Definition at line 876 of file c_chat.cpp.

References basic_emote(), and EMOTE_HUG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_insert_into()

void command_insert_into ( object op,
const char *  params 
)

Puts an object into another.

Parameters
opwizard.
paramsobject specifier.

Definition at line 2686 of file c_wiz.cpp.

References object::contr, dm_stack_pop(), draw_ext_info, draw_ext_info_format(), esrv_update_item(), FLAG_REMOVED, get_dm_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_find_by_tag_global(), object_insert_in_ob(), object_remove(), PLAYER, QUERY_FLAG, query_name(), STACK_FROM_NUMBER, STACK_FROM_TOP, player::stack_items, player::stack_position, object::type, UPD_NAME, UPD_NROF, and UPD_WEIGHT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_inventory()

void command_inventory ( object op,
const char *  params 
)

Shows the inventory or some item.

Parameters
opplayer.
paramsobject count to get the inventory of. If NULL then defaults to op.

Definition at line 1335 of file c_wiz.cpp.

References draw_ext_info, inventory(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and object_find_by_tag_global().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_invisible()

void command_invisible ( object op,
const char *  params 
)

Wizard wants to become invisible.

Parameters
opwizard.
paramsignored.

Definition at line 2226 of file c_wiz.cpp.

References draw_ext_info, object::invisible, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_update(), and UP_OBJ_FACE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_invoke()

void command_invoke ( object op,
const char *  params 
)

'invoke' command, fires a spell immediately.

Parameters
opplayer.
paramsspell.

Definition at line 38 of file c_range.cpp.

References command_cast_spell().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_kick()

void command_kick ( object op,
const char *  params 
)

Kicks a player from the server.

Parameters
opDM kicking.
paramsplayer to kick. Must be a full name match.

Definition at line 556 of file c_wiz.cpp.

References command_kick2().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_kill_pets()

void command_kill_pets ( object op,
const char *  params 
)

Player wants to get rid of pets.

Parameters
opplayer.
paramsunused.

Definition at line 2196 of file c_misc.cpp.

References draw_ext_info, draw_ext_info_format(), FLAG_REMOVED, free_objectlink(), get_friends_of(), list, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, object::name, NDI_UNIQUE, objectlink::next, objectlink::ob, object_free_drop_inventory(), object_get_owner(), object_remove(), pets_terminate_all(), QUERY_FLAG, remove_friendly_object(), and strcasecmp().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_kiss()

void command_kiss ( object op,
const char *  params 
)

'kiss' command.

Parameters
opplayer.
paramsmessage.

Definition at line 744 of file c_chat.cpp.

References basic_emote(), and EMOTE_KISS.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_knowledge()

void command_knowledge ( object pl,
const char *  params 
)

Handle the 'knowledge' for a player.

Parameters
plwho is using the command.
paramsadditional parameters.

Definition at line 1213 of file knowledge.cpp.

References command_help(), object::contr, knowledge_display(), knowledge_do_attempt(), knowledge_do_display(), knowledge_show(), llevError, LOG(), and object::name.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_language()

void command_language ( object op,
const char *  params 
)

This is the 'language' command.

Parameters
opplayer requesting the information.
paramsoptional language code ("en", "fr", etc.)

Definition at line 132 of file c_misc.cpp.

References object::contr, draw_ext_info, draw_ext_info_format(), i18n_find_language_by_code(), i18n_list_languages(), player::language, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_laugh()

void command_laugh ( object op,
const char *  params 
)

'laugh' command.

Parameters
opplayer.
paramsmessage.

Definition at line 788 of file c_chat.cpp.

References basic_emote(), and EMOTE_LAUGH.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_learn_special_prayer()

void command_learn_special_prayer ( object op,
const char *  params 
)

Wizard wants to learn a god-given spell.

Parameters
opwizard.
paramsspell name.

Definition at line 2402 of file c_wiz.cpp.

References command_learn_spell_or_prayer().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_learn_spell()

void command_learn_spell ( object op,
const char *  params 
)

Wizard wants to learn a regular spell.

Parameters
opwizard.
paramsspell name.

Definition at line 2390 of file c_wiz.cpp.

References command_learn_spell_or_prayer().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_lick()

void command_lick ( object op,
const char *  params 
)

'lick' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1063 of file c_chat.cpp.

References basic_emote(), and EMOTE_LICK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_list()

void command_list ( object pl,
bool  is_dm 
)

Display the list of commands to a player.

Parameters
plplayer asking for commands.
is_dmtrue if the player is a DM, false else.

Definition at line 390 of file commands.cpp.

References COMMAND_TYPE_COMMUNICATION, COMMAND_TYPE_NORMAL, COMMAND_TYPE_WIZARD, draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, and show_commands().

Referenced by command_help().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_listen()

void command_listen ( object op,
const char *  params 
)

Change the player's listen level.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1090 of file c_misc.cpp.

References object::contr, draw_ext_info_format(), player::listening, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_listplugins()

void command_listplugins ( object op,
const char *  params 
)

Lists all plugins currently loaded with their IDs and full names.

Parameters
opwizard.
paramsignored.

Definition at line 2443 of file c_wiz.cpp.

References plugins_display_list().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_loadplugin()

void command_loadplugin ( object op,
const 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.

Parameters
opDM loading a plugin.
paramsshould be the plugin's name, eg cfpython.so

Definition at line 2458 of file c_wiz.cpp.

References buf, draw_ext_info, draw_ext_info_format(), llevDebug, llevInfo, LOG(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, and plugins_init_plugin().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_loadtest()

void command_loadtest ( object op,
const char *  params 
)

This command will stress server.

It will basically load all world maps (so 900 maps).

Parameters
opDM wanting to test the server.
paramsoption, must be "TRUE" for the test to happen.

Definition at line 306 of file c_wiz.cpp.

References buf, command_goto(), draw_ext_info, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, settings, Settings::worldmapstartx, Settings::worldmapstarty, Settings::worldmaptilesx, and Settings::worldmaptilesy.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_lock_item()

void command_lock_item ( object op,
const char *  params 
)

Alternate way to lock/unlock items (command line).

Parameters
opplayer
paramssent command line.

Definition at line 2710 of file c_object.cpp.

References CLEAR_FLAG, draw_ext_info, draw_ext_info_format(), esrv_update_item(), find_best_object_match(), FLAG_INV_LOCKED, HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, name, NDI_UNIQUE, object_merge(), QUERY_FLAG, query_short_name(), SET_FLAG, and UPD_FLAGS.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_malloc()

void command_malloc ( object op,
const char *  params 
)

Display memory information.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 796 of file c_misc.cpp.

References malloc_info().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_mapinfo()

void command_mapinfo ( object op,
const char *  params 
)

'mapinfo' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 809 of file c_misc.cpp.

References current_map_info().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_maps()

void command_maps ( object op,
const char *  params 
)

'maps' command.

Parameters
opplayer requesting the information.
paramsregion to restrict to.

Definition at line 835 of file c_misc.cpp.

References map_info().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_mark()

void command_mark ( object op,
const char *  params 
)

'mark' command, to mark an item for some effects (enchant armor, ...).

Parameters
opplayer.
paramsIf empty, we print out the currently marked object. Otherwise, try to find a matching object - try best match first.

Definition at line 1567 of file c_object.cpp.

References object::contr, object::count, draw_ext_info, draw_ext_info_format(), find_best_object_match(), find_marked_object(), player::mark, player::mark_count, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, name, NDI_UNIQUE, and query_name().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_me()

void command_me ( object op,
const char *  params 
)

'me' command.

Parameters
opplayer.
paramsmessage.

Definition at line 47 of file c_chat.cpp.

References buf, ext_info_map(), object::map, MAX_BUF, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_ME, object::name, NDI_BLUE, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_mon_aggr()

void command_mon_aggr ( object op,
const char *  params 
)

When DM is possessing a monster, flip aggression on and off, to allow better motion.

Parameters
opwiard.
paramsignored.

Definition at line 1405 of file c_wiz.cpp.

References CLEAR_FLAG, draw_ext_info, object::enemy, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, object_set_enemy(), QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_motd()

void command_motd ( object op,
const char *  params 
)

Display the message of the day.

Parameters
opplayer requesting the motd.
paramsunused.

Definition at line 217 of file c_misc.cpp.

References display_motd().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_news()

void command_news ( object op,
const char *  params 
)

Display the server news.

Parameters
opplayer requesting the news.
paramsunused.

Definition at line 243 of file c_misc.cpp.

References send_news().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_nod()

void command_nod ( object op,
const char *  params 
)

'nod' command.

Parameters
opplayer.
paramsmessage.

Definition at line 722 of file c_chat.cpp.

References basic_emote(), and EMOTE_NOD.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_north()

void command_north ( object op,
const char *  params 
)

'north' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 68 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_northeast()

void command_northeast ( object op,
const char *  params 
)

'northeast' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 79 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_northwest()

void command_northwest ( object op,
const char *  params 
)

'northwest' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 90 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_nowiz()

void command_nowiz ( object op,
const char *  params 
)

Steps down from wizard mode.

Parameters
opwizard.
paramsignored.

Definition at line 2080 of file c_wiz.cpp.

References CLEAR_FLAG, object::contr, draw_ext_info, FLAG_WAS_WIZ, FLAG_WIZ, FLAG_WIZCAST, FLAG_WIZPASS, player::hidden, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_ALL, NDI_LT_GREEN, NDI_UNIQUE, Settings::real_wiz, settings, TRUE, unhide(), and update_los().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_orcknuckle()

void command_orcknuckle ( object op,
const char *  params 
)

Plays the "orcknucke" game.

If there is an "dice" archetype in server arches, this command will require the player to have at least 4 dice to play. There is a 5% chance to lose one dice at each play. Dice can be made through alchemy (finding the recipe is left as an exercice to the player). Note that the check is on the name 'dice', so you can have multiple archetypes for that name, they'll be all taken into account.

Parameters
opplayer who plays.
paramsstring sent by the player. Ignored.

Definition at line 108 of file c_chat.cpp.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_overlay_reset()

void command_overlay_reset ( object op,
const char *  params 
)

Removes the overlay for op's current map.

Parameters
opDM acting.
paramsignored.

Definition at line 589 of file c_wiz.cpp.

References create_overlay_pathname(), draw_ext_info, object::map, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, mapstruct::path, and stats.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_overlay_save()

void command_overlay_save ( object op,
const char *  params 
)

Saves the op's map as an overlay - objects are persisted.

Parameters
opDM wanting to save.
paramsignored.

Definition at line 568 of file c_wiz.cpp.

References draw_ext_info, object::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, save_map(), and SAVE_MODE_OVERLAY.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_party()

void command_party ( object op,
const char *  params 
)

'party' command, subdivided in different sub commands.

Parameters
opplayer.
paramsadditional parameters. 1.
Todo:
split in different functions. clean the 'form' mess.

Definition at line 97 of file c_party.cpp.

References buf, command_help(), object::contr, draw_ext_info, draw_ext_info_format(), get_party_password(), list_players(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, object::name, NDI_UNIQUE, NDI_WHITE, player::party, party_find(), party_form(), party_get_first(), party_get_leader(), party_get_next(), party_get_password(), party_join(), party_leave(), party_send_message(), party_set_password(), and partylist::partyname.

Referenced by command_gsay(), and commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_party_rejoin()

void command_party_rejoin ( object op,
const char *  params 
)

Handles the 'party_rejoin' command.

Parameters
opplayer.
paramsoptional parameters.

Definition at line 307 of file c_party.cpp.

References object::contr, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, rejoin_modes, and player::rejoin_party.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_passwd()

void command_passwd ( object pl,
const char *  params 
)

Player is asking to change password.

Parameters
plplayer.
paramsunused.

Definition at line 2239 of file c_misc.cpp.

References object::contr, CS_QUERY_HIDEINPUT, draw_ext_info, i18n(), socket_struct::login_method, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, player_set_state(), send_query(), player::socket, and ST_CHANGE_PASSWORD_OLD.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_patch()

void command_patch ( object op,
const char *  params 
)

Wizard wants to altar an object.

Parameters
opwizard.
paramsobject and what to patch.

Definition at line 1493 of file c_wiz.cpp.

References object::contr, object::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, object::name, NDI_UNIQUE, Settings::real_wiz, SET_FLAG, set_variable(), and settings.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_peaceful()

void command_peaceful ( object op,
const char *  params 
)

Player toggles her peaceful status.

Parameters
opplayer.
paramsunused.

Definition at line 2124 of file c_misc.cpp.

References object::contr, draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and player::peaceful.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_petmode()

void command_petmode ( object op,
const char *  params 
)

Player wants to change how her pets behave.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1437 of file c_misc.cpp.

References object::contr, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, pet_arena, pet_defend, pet_normal, pet_sad, player::petmode, and types.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_pickup()

void command_pickup ( object op,
const char *  params 
)

'pickup' command.

Parameters
opplayer.
paramspickup mode. Can be empty to display the current mode.
Todo:
trash old pickup mode, merge with new pickup.

Definition at line 2361 of file c_object.cpp.

References object::contr, display_new_pickup(), draw_ext_info, draw_ext_info_format(), get_pickup_mode_index(), llevDebug, LOG(), player::mode, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pickup_modes, PU_NEWMODE, and set_pickup_mode().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_players()

void command_players ( object op,
const char *  params 
)

Display all known players.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1227 of file c_misc.cpp.

References buf, closedir(), draw_ext_info_format(), Settings::localdir, MAX_BUF, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, opendir(), Settings::playerdir, readdir(), settings, st, and t.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_poke()

void command_poke ( object op,
const char *  params 
)

'poke' command.

Parameters
opplayer.
paramsmessage.

Definition at line 898 of file c_chat.cpp.

References basic_emote(), and EMOTE_POKE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_possess()

void command_possess ( object op,
const 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,

Parameters
opwizard wanting to possess something.
paramsmonster to possess.
Todo:
fix and reactivate the function, or totally trash.

Definition at line 1432 of file c_wiz.cpp.

References object::body_info, buf, object::contr, do_some_living(), draw_ext_info, esrv_new_player(), esrv_send_inventory(), fix_object(), FLAG_WIZ, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, NUM_BODY_LOCATIONS, player::ob, object_find_by_name_global(), object_find_by_tag_global(), PLAYER, SET_FLAG, and object::type.

+ Here is the call graph for this function:

◆ command_pout()

void command_pout ( object op,
const char *  params 
)

'pout' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1074 of file c_chat.cpp.

References basic_emote(), and EMOTE_POUT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_printlos()

void command_printlos ( object op,
const char *  params 
)

Various LOS-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1061 of file c_misc.cpp.

References print_los().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_puke()

void command_puke ( object op,
const char *  params 
)

'puke' command.

Parameters
opplayer.
paramsmessage.

Definition at line 821 of file c_chat.cpp.

References basic_emote(), and EMOTE_PUKE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_purge_quest()

void command_purge_quest ( object op,
const char *  param 
)

Definition at line 2853 of file c_wiz.cpp.

References draw_ext_info, free_quest(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_purge_quest_definitions()

void command_purge_quest_definitions ( object op,
const char *  param 
)

Definition at line 2859 of file c_wiz.cpp.

References assets_collect(), ASSETS_QUESTS, Settings::datadir, draw_ext_info, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, NDI_UNIQUE, and settings.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_quest()

void command_quest ( object op,
const char *  params 
)

Command handler for 'quest'.

Parameters
opplayer asking for information, warning emitted if not a player.
paramsextra parameters for command.

Definition at line 738 of file quest.cpp.

References quest_definition::client_code, quest_state::code, command_help(), object::contr, draw_ext_info, draw_ext_info_format(), find_player_partial_name(), FLAG_WIZ, get_quest(), get_quest_by_number(), i18n(), llevError, LOG(), MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_QUESTS, MSG_TYPE_COMMAND_SUCCESS, name, object::name, NDI_UNIQUE, quest_state::next, player::ob, QUERY_FLAG, quest_get_by_code(), quest_info(), quest_list(), quest_set_state(), and quest_player::quests.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_quit()

void command_quit ( object op,
const char *  params 
)

Tell players to use the 'delete' command.

Too many new players have accidentally deleted their characters because they didn't carefully read the warning that the original 'quit' command gave.

Definition at line 1873 of file c_misc.cpp.

References draw_ext_info, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_recollect()

void command_recollect ( object op,
const char *  params 
)

Definition at line 1531 of file c_wiz.cpp.

References Socket_Info::allocated_sockets, assets_finish_archetypes_for_play(), first_player, load_assets(), player::next, reset_faces_sent(), and socket_info.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_register()

command_registration command_register ( const char *  name,
uint8_t  type,
command_function  func,
float  time 
)

Register a player-issued command.

The only cause of failure is trying to override an existing command with one having a different type.

Parameters
namecommand name.
typetype of the command, one of COMMAND_TYPE_xxx.
funcfunction to call for the command.
timehow long the command takes.
Returns
identifier to unregister the command, 0 if adding failed.

Definition at line 101 of file commands.cpp.

References do_register(), name, time, and is_valid_types_gen::type.

Referenced by cfapi_register_command().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_register_extra()

command_registration command_register_extra ( const char *  name,
const char *  extra,
uint8_t  type,
command_function_extra  func,
float  time 
)

Register a player-issued command with an extra parameter.

This allow commands that need a supplemental fixed argument. The only cause of failure is trying to override an existing command with one having a different type.

Parameters
namecommand name.
extraextra data to give the command, must not be null.
typetype of the command, one of COMMAND_TYPE_xxx.
funcfunction to call for the command.
timehow long the command takes.
Returns
identifier to unregister the command, 0 if adding failed.

Definition at line 526 of file commands.cpp.

References do_register(), name, time, and is_valid_types_gen::type.

Referenced by cfapi_register_command().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_remove()

void command_remove ( object op,
const char *  params 
)

Remove an object from its position.

Parameters
opwizard.
paramsobject to remove.

Definition at line 1565 of file c_wiz.cpp.

References object::contr, dm_stack_pop(), draw_ext_info, draw_ext_info_format(), FLAG_REMOVED, get_dm_object(), HEAD, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, name, NDI_UNIQUE, object_remove(), object_update_speed(), PLAYER, QUERY_FLAG, query_name(), object::speed, STACK_FROM_STACK, and object::type.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_rename_item()

void command_rename_item ( object op,
const char *  params 
)

Changing the custom name of an item.

Syntax is: rename <what object> to <new name>

  • if 'what object' is omitted, marked object is used
  • if 'to new name' is omitted, custom name is cleared

Names are considered for all purpose having a length <=127 (max length sent to client by server).

Parameters
opplayer.
paramshow to rename.

Definition at line 2524 of file c_object.cpp.

References buf, CUSTOM_NAME_FIELD, draw_ext_info, draw_ext_info_format(), esrv_update_item(), find_best_object_match(), find_marked_object(), FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, name, NDI_UNIQUE, object::nrof, object_get_value(), object_merge(), object_set_value(), query_base_name(), sstring, UPD_NAME, and VERY_BIG_BUF.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_reply()

void command_reply ( object op,
const char *  params 
)

Reply to last person who told you something [mids 01/14/2002].

Must have been told something by someone first.

Parameters
opwho is telling.
paramsmessage to say.
Returns
1.

Definition at line 336 of file c_chat.cpp.

References object::contr, draw_ext_info, draw_ext_info_format(), find_player(), FLAG_WIZ, player::hidden, player::last_tell, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_TELL, object::name, NDI_ORANGE, NDI_UNIQUE, player::ob, QUERY_FLAG, and safe_strncpy.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_reset()

◆ command_resistances()

void command_resistances ( object op,
const char *  params 
)

Players wants to know her resistances.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1597 of file c_misc.cpp.

References ATNR_INTERNAL, atnr_is_dragon_enabled(), attacktype_desc, change_resist_msg, draw_ext_info, draw_ext_info_format(), FORCE, is_dragon_pl(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_INFO, NDI_UNIQUE, NROFATTACKS, object_find_by_type_and_arch_name(), and object::resist.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_rotateshoottype()

void command_rotateshoottype ( object op,
const char *  params 
)

'rotateshoottype' command, switch range attack.

Parameters
opplayer.
paramsarguments to the command. '+' selects next range, other values previous range.

Definition at line 343 of file c_range.cpp.

References object::contr, legal_range(), MAX_BUF, name, range_bottom, range_none, range_size, send_updated_shoottype(), and player::shoottype.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_rskill()

void command_rskill ( object pl,
const char *  params 
)

'ready_skill' command.

Parameters
plplayer.
paramsskill name.

Definition at line 161 of file c_object.cpp.

References change_skill(), draw_ext_info, draw_ext_info_format(), find_skill_by_name(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, and skill.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_rules()

void command_rules ( object op,
const char *  params 
)

Display the server rules.

Parameters
opplayer requesting the rules.
paramsunused.

Definition at line 230 of file c_misc.cpp.

References send_rules().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_run()

void command_run ( object op,
const char *  params 
)

Player wants to start running.

Parameters
opplayer.
paramsadditional parameters.

Definition at line 41 of file c_new.cpp.

References object::contr, draw_ext_info, move_player(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and player::run_on.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_run_stop()

void command_run_stop ( object op,
const char *  params 
)

Player wants to stop running.

Parameters
opplayer.
paramsignored.
Returns
1.

Definition at line 64 of file c_new.cpp.

References object::contr, and player::run_on.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_save()

void command_save ( object op,
const char *  params 
)

Player wants to get saved.

Parameters
opplayer.
paramsunused.

Definition at line 2098 of file c_misc.cpp.

References draw_ext_info, living::exp, get_map_flags(), object::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, P_NO_CLERIC, save_player(), object::stats, object::x, and object::y.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_say()

void command_say ( object op,
const char *  params 
)

'say' command.

Parameters
opplayer.
paramsmessage.

Definition at line 34 of file c_chat.cpp.

References monster_communicate().

Referenced by cfapi_object_say(), and commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_scream()

void command_scream ( object op,
const char *  params 
)

'scream' command.

Parameters
opplayer.
paramsmessage.

Definition at line 843 of file c_chat.cpp.

References basic_emote(), and EMOTE_SCREAM.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_search()

void command_search ( object op,
const char *  params 
)

'search' command.

Parameters
opplayer.
paramsunused.

Definition at line 212 of file c_object.cpp.

References do_skill_by_number(), and SK_FIND_TRAPS.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_search_items()

void command_search_items ( object op,
const char *  params 
)

'search-items' command.

Parameters
opplayer.
paramsoptions.

Definition at line 2479 of file c_object.cpp.

References object::contr, draw_ext_info, draw_ext_info_format(), FALSE, fix_object(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, Settings::search_items, player::search_str, and settings.

Referenced by commands_init(), and kill_player_not_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_setgod()

void command_setgod ( object op,
const char *  params 
)

Sets the god for some objects.

Parameters
opDM wanting to change an object.
paramscommand options. Should contain two values, first the object to change, followed by the god to change it to.

Definition at line 418 of file c_wiz.cpp.

References become_follower(), draw_ext_info, draw_ext_info_format(), find_god(), find_object_both(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, PLAYER, and object::type.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_settings()

void command_settings ( object op,
const char *  ignored 
)

◆ command_shake()

void command_shake ( object op,
const char *  params 
)

'shake' command.

Parameters
opplayer.
paramsmessage.

Definition at line 810 of file c_chat.cpp.

References basic_emote(), and EMOTE_SHAKE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_shiver()

void command_shiver ( object op,
const char *  params 
)

'shiver' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1085 of file c_chat.cpp.

References basic_emote(), and EMOTE_SHIVER.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_shoottype()

void command_shoottype ( object op,
const char *  params 
)

'shoottype' command, set range attack.

Parameters
opplayer.
paramsarguments to the command.

Definition at line 370 of file c_range.cpp.

References object::contr, draw_ext_info_format(), legal_range(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_size, range_skill, send_updated_shoottype(), and player::shoottype.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_shout()

void command_shout ( object op,
const char *  params 
)

'shout' command.

Parameters
opplayer.
paramsmessage.

Definition at line 210 of file c_chat.cpp.

References command_tell_all(), MSG_TYPE_COMMUNICATION_SHOUT, and NDI_RED.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_showpets()

void command_showpets ( object op,
const char *  params 
)

Players wants to know her pets.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1481 of file c_misc.cpp.

References living::ac, living::Cha, living::Con, living::dam, living::Dex, draw_ext_info, draw_ext_info_format(), free_objectlink(), get_friends_of(), living::hp, living::Int, object::level, list, living::maxhp, living::maxsp, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, object::name, NDI_UNIQUE, objectlink::next, objectlink::ob, living::Pow, living::sp, object::stats, living::Str, living::wc, and living::Wis.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_shrug()

void command_shrug ( object op,
const char *  params 
)

'shrug' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1096 of file c_chat.cpp.

References basic_emote(), and EMOTE_SHRUG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_shutdown()

void command_shutdown ( object op,
const char *  params 
)

Totally shutdowns the server.

Parameters
opwizard shutting down the server.
paramsWhen to shut down the server.

Definition at line 658 of file c_wiz.cpp.

References command_help(), draw_ext_info, draw_ext_info_format(), llevInfo, LOG(), MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_ALL, NDI_UNIQUE, shutdown_s::next_warn, SHUTDOWN_IDLE, SHUTDOWN_NONE, shutdown_state, SHUTDOWN_TIME, shutdown_s::time, time, and shutdown_s::type.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_sigh()

void command_sigh ( object op,
const char *  params 
)

'sigh' command.

Parameters
opplayer.
paramsmessage.

Definition at line 854 of file c_chat.cpp.

References basic_emote(), and EMOTE_SIGH.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_skills()

void command_skills ( object op,
const 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.

Parameters
opplayer.
paramsoptional skill restriction.
Todo:
move out of this file as it is used by all players.

Definition at line 1365 of file c_wiz.cpp.

References show_skills().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_slap()

void command_slap ( object op,
const char *  params 
)

'slap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1107 of file c_chat.cpp.

References basic_emote(), and EMOTE_SLAP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_smile()

void command_smile ( object op,
const char *  params 
)

'smile' command.

Parameters
opplayer.
paramsmessage.

Definition at line 766 of file c_chat.cpp.

References basic_emote(), and EMOTE_SMILE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_smirk()

void command_smirk ( object op,
const char *  params 
)

'smirk' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1118 of file c_chat.cpp.

References basic_emote(), and EMOTE_SMIRK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_snap()

void command_snap ( object op,
const char *  params 
)

'snap' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1129 of file c_chat.cpp.

References basic_emote(), and EMOTE_SNAP.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_sneeze()

void command_sneeze ( object op,
const char *  params 
)

'sneeze' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1140 of file c_chat.cpp.

References basic_emote(), and EMOTE_SNEEZE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_snicker()

void command_snicker ( object op,
const char *  params 
)

'snicker' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1151 of file c_chat.cpp.

References basic_emote(), and EMOTE_SNICKER.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_sniff()

void command_sniff ( object op,
const char *  params 
)

'sniff' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1162 of file c_chat.cpp.

References basic_emote(), and EMOTE_SNIFF.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_snore()

void command_snore ( object op,
const char *  params 
)

'snore' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1173 of file c_chat.cpp.

References basic_emote(), and EMOTE_SNORE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_sound()

void command_sound ( object op,
const char *  params 
)

Player wants to change sound status.

Parameters
opplayer asking for change.
paramsunused.

Definition at line 1910 of file c_misc.cpp.

References object::contr, draw_ext_info, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, SND_MUTE, player::socket, and socket_struct::sound.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_south()

void command_south ( object op,
const char *  params 
)

'south' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 101 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_southeast()

void command_southeast ( object op,
const char *  params 
)

'southeast' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 112 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_southwest()

void command_southwest ( object op,
const char *  params 
)

'southwest' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 123 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_speed()

void command_speed ( object op,
const char *  params 
)

Changes the server speed.

Parameters
opwizard.
paramsnew speed, or NULL to see the speed.

Definition at line 1732 of file c_wiz.cpp.

References draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, reset_sleep(), set_tick_duration(), and tick_duration.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_spit()

void command_spit ( object op,
const char *  params 
)

'spit' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1184 of file c_chat.cpp.

References basic_emote(), and EMOTE_SPIT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_ssdumptable()

void command_ssdumptable ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1019 of file c_misc.cpp.

References SS_DUMP_TABLE, and ss_dump_table().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_stack_clear()

void command_stack_clear ( object op,
const char *  params 
)

Empty DM item stack.

Parameters
opwizard.
paramsignored.

Definition at line 2596 of file c_wiz.cpp.

References object::contr, draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, NDI_UNIQUE, and player::stack_position.

Referenced by commands_init().

+ Here is the caller graph for this function:

◆ command_stack_list()

void command_stack_list ( object op,
const char *  params 
)

Displays stack contents.

Parameters
opwizard.
paramsignored.

Definition at line 2565 of file c_wiz.cpp.

References object::contr, object::count, draw_ext_info, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, object::name, NDI_UNIQUE, object_find_by_tag_global(), player::stack_items, and player::stack_position.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_stack_pop()

void command_stack_pop ( object op,
const char *  params 
)

Pop the stack top.

Parameters
opwizard.
paramsignored.

Definition at line 2534 of file c_wiz.cpp.

References object::contr, and dm_stack_pop().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_stack_push()

void command_stack_push ( object op,
const char *  params 
)

Push specified item on stack.

Parameters
opwizard.
paramsobject specifier.

Definition at line 2547 of file c_wiz.cpp.

References object::contr, object::count, dm_stack_push(), get_dm_object(), and STACK_FROM_NUMBER.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_statistics()

void command_statistics ( object pl,
const char *  params 
)

Prints out some useful information for the character.

Everything we print out can be determined by the docs, so we aren't revealing anything extra - rather, we are making it convenient to find the values. params have no meaning here.

Parameters
plplayer asking for information.
paramsunused.

Add preliminary damage per second calculations here

Definition at line 1121 of file c_misc.cpp.

References object::arch, buf, living::Cha, archetype::clone, living::Con, object::contr, living::dam, living::Dex, draw_ext_info, draw_ext_info_format(), living::exp, object::expmul, FMT64, i18n(), living::Int, object::level, level_exp(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_STATISTICS, NDI_UNIQUE, player::orig_stats, player::peaceful, living::Pow, safe_strncpy, seconds(), object::stats, living::Str, tick_duration, player::ticks_played, object::weapon_speed, and living::Wis.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_stats()

void command_stats ( object op,
const char *  params 
)

Displays the statistics of a player.

Parameters
opwizard.
paramsplayer's name.

Definition at line 1762 of file c_wiz.cpp.

References living::ac, living::Cha, living::Con, living::dam, living::Dex, draw_ext_info, draw_ext_info_format(), living::exp, find_player_partial_name(), FMT64, living::food, living::grace, living::hp, living::Int, living::maxhp, living::maxsp, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, player::ob, living::Pow, living::sp, object::stats, living::Str, living::wc, and living::Wis.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_stay()

void command_stay ( object op,
const char *  params 
)

'stay' command.

Used to specify to fire under oneself.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 145 of file c_move.cpp.

References object::contr, fire(), and player::fire_on.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_strings()

void command_strings ( object op,
const char *  params 
)

Various string-related statistics.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 847 of file c_misc.cpp.

References draw_ext_info, draw_ext_info_format(), HUGE_BUF, MSG_TYPE_COMMAND, MSG_TYPE_LAST, NDI_UNIQUE, ss_dump_statistics(), ss_dump_table(), SS_DUMP_TOTALS, and stats.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_strut()

void command_strut ( object op,
const char *  params 
)

'strut' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1195 of file c_chat.cpp.

References basic_emote(), and EMOTE_STRUT.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_style_map_info()

void command_style_map_info ( object op,
const char *  params 
)

Displays information about styles loaded for random maps.

Parameters
opwizard.
paramsignored.

Definition at line 2763 of file c_wiz.cpp.

References draw_ext_info, draw_ext_info_format(), FOR_MAP_FINISH, FOR_MAP_PREPARE, MAP_HEIGHT, map_size(), MAP_WIDTH, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_MAPS, NDI_UNIQUE, mapstruct::next, and styles.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_sulk()

void command_sulk ( object op,
const char *  params 
)

'sulk' command.

Parameters
opplayer.
paramsmessage.

Definition at line 865 of file c_chat.cpp.

References basic_emote(), and EMOTE_SULK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_summon()

void command_summon ( object op,
const char *  params 
)

Summons player near DM.

Parameters
opDM.
paramsplayer to summon.

Definition at line 866 of file c_wiz.cpp.

References add_string(), draw_ext_info, draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, get_other_player_from_name(), object::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, player::ob, object_find_free_spot(), object_free(), object_new(), mapstruct::path, object::x, and object::y.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_swap()

void command_swap ( object op,
const char *  params 
)

Mark a map as ready for swapping.

Definition at line 907 of file c_wiz.cpp.

References draw_ext_info, has_been_loaded(), HUGE_BUF, m, object::map, MAP_IN_MEMORY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, path(), mapstruct::path, and path_combine_and_normalize().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_take()

void command_take ( object op,
const char *  params 
)

◆ command_teleport()

void command_teleport ( object op,
const char *  params 
)

Teleport next to target player.

Parameters
opDM teleporting.
paramsoptions sent by player.

Definition at line 933 of file c_wiz.cpp.

References add_string(), object::contr, draw_ext_info, draw_ext_info_format(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, find_player_partial_name(), FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, player::hidden, object::map, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_DM, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, player::ob, object_find_free_spot(), object_free(), object_new(), mapstruct::path, object::x, and object::y.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_tell()

void command_tell ( object op,
const char *  params 
)

Private communication.

Parameters
opplayer trying to tell something to someone.
paramswho to tell, and message.

Definition at line 308 of file c_chat.cpp.

References do_tell().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_thank()

void command_thank ( object op,
const char *  params 
)

'thank' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1206 of file c_chat.cpp.

References basic_emote(), and EMOTE_THANK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_think()

void command_think ( object op,
const char *  params 
)

'think' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1305 of file c_chat.cpp.

References basic_emote(), and EMOTE_THINK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_throw()

void command_throw ( object op,
const char *  params 
)

'throw' command.

A little special because we do want to pass the full params along as it includes the object to throw.

Parameters
opplayer.
paramswhat to throw.

Definition at line 239 of file c_object.cpp.

References do_skill_by_number(), and SK_THROWING.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_time()

void command_time ( object op,
const char *  params 
)

Players asks for the time.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 868 of file c_misc.cpp.

References time_info().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_title()

void command_title ( object op,
const char *  params 
)

Player wishes to change her title.

Parameters
opplayer asking for change.
paramsnew title.
Returns
1.

Definition at line 2047 of file c_misc.cpp.

References buf, object::contr, draw_ext_info, FALSE, HUGE_BUF, is_dragon_pl(), MAX_BUF, MAX_NAME, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, player_get_title(), player_has_own_title(), player_set_own_title(), Settings::set_title, and settings.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_toggle_shout()

void command_toggle_shout ( object op,
const char *  params 
)

A simple toggle for the no_shout field.

AKA the MUZZLE command.

Parameters
opwizard toggling.
paramsplayer to mute/unmute.

Definition at line 615 of file c_wiz.cpp.

References object::contr, draw_ext_info, draw_ext_info_format(), EVENT_MUZZLE, events_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, object::name, NDI_ORANGE, NDI_RED, NDI_UNIQUE, player::no_shout, and player::ob.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_twiddle()

void command_twiddle ( object op,
const char *  params 
)

'twiddle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1217 of file c_chat.cpp.

References basic_emote(), and EMOTE_TWIDDLE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_unarmed_skill()

void command_unarmed_skill ( object op,
const char *  params 
)

Player wants to change prefered unarmed skill.

Parameters
opplayer asking for change.
paramsnew mode.

Definition at line 1381 of file c_misc.cpp.

References add_string(), object::contr, draw_ext_info_format(), find_skill_by_name(), free_string(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, skill, and player::unarmed_skill.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_unloadplugin()

void command_unloadplugin ( object op,
const 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.

Parameters
opDM unloading a plugin.
paramsshould be the plugin's internal name, eg Python

Definition at line 2490 of file c_wiz.cpp.

References draw_ext_info, draw_ext_info_format(), init_signals(), llevInfo, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, and plugins_remove_plugin().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_unregister()

void command_unregister ( command_registration  command)

Unregister a previously registered command.

Parameters
commandidentifier returned by command_register() or command_register_extra().

Definition at line 535 of file commands.cpp.

References command, and registered_commands.

Referenced by cfapi_unregister_command().

+ Here is the caller graph for this function:

◆ command_use()

void command_use ( object op,
const char *  params 
)

Try to use an item on another.

Items are checked for key/values matching.

Parameters
opplayer.
paramssent string, with all parameters.
Todo:
handle multiple ingredients
Todo:
handle ingredient count, handle batches, and such

Definition at line 2753 of file c_object.cpp.

References object::arch, recipe::arch_name, create_archetype(), draw_ext_info, draw_ext_info_format(), find_best_object_match(), find_recipe_for_tool(), recipe::ingred, recipe::ingred_count, IS_PLAYER(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, linked_char::name, object::name, archetype::name, NDI_UNIQUE, object::nrof, object_decrease_nrof_by_one, object_insert_in_ob(), strlcpy(), and recipe::yield.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_usekeys()

void command_usekeys ( object op,
const char *  params 
)

Player wants to change how keys are used.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1556 of file c_misc.cpp.

References containers, object::contr, draw_ext_info_format(), key_inventory, keyrings, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, types, and player::usekeys.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_uskill()

void command_uskill ( object pl,
const char *  params 
)

'use_skill' command.

Parameters
plplayer.
paramsskill to use, and optional parameters.

Definition at line 144 of file c_object.cpp.

References draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, and use_skill().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_version()

void command_version ( object op,
const char *  params 
)

Server version.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 1076 of file c_misc.cpp.

References draw_ext_info_format(), FULL_VERSION, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_VERSION, and NDI_UNIQUE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_wave()

void command_wave ( object op,
const char *  params 
)

'wave' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1228 of file c_chat.cpp.

References basic_emote(), and EMOTE_WAVE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_west()

void command_west ( object op,
const char *  params 
)

'west' command.

Parameters
opplayer.
paramsoptional parameters for moving (fire, run).

Definition at line 134 of file c_move.cpp.

References move_internal().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_whereabouts()

void command_whereabouts ( object op,
const char *  params 
)

'whereabouts' command.

Displays how many players are in which regions.

Parameters
opplayer requesting information.
paramsunused.

Definition at line 484 of file c_misc.cpp.

References all_regions, region::counter, draw_ext_info, draw_ext_info_format(), first_player, get_region_by_map(), get_region_longname(), llevError, LOG(), object::map, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, player::next, and player::ob.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_whereami()

void command_whereami ( object op,
const char *  params 
)

'whereami' command.

Parameters
opplayer requesting the information.
paramsunused.

Definition at line 822 of file c_misc.cpp.

References current_region_info().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_whistle()

void command_whistle ( object op,
const char *  params 
)

'whistle' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1239 of file c_chat.cpp.

References basic_emote(), and EMOTE_WHISTLE.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_who()

void command_who ( object op,
const char *  params 
)

'who' command.

Parameters
opplayer requesting the information.
paramsoptional region to limit the information to.

Definition at line 623 of file c_misc.cpp.

References get_region_from_string(), and list_players().

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_wimpy()

void command_wimpy ( object op,
const char *  params 
)

Player wants to change how soon she'll flee.

Parameters
opplayer.
paramsnew value.

Definition at line 2142 of file c_misc.cpp.

References draw_ext_info, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, and object::run_away.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_wink()

void command_wink ( object op,
const char *  params 
)

'wink' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1250 of file c_chat.cpp.

References basic_emote(), and EMOTE_WINK.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_wizcast()

void command_wizcast ( object op,
const char *  params 
)

Wizard toggling "cast everywhere" ability.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 947 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info, FLAG_WIZCAST, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_wizpass()

void command_wizpass ( object op,
const char *  params 
)

Wizard toggling wall-crossing.

Parameters
opplayer asking for information.
paramsunused.

Definition at line 917 of file c_misc.cpp.

References CLEAR_FLAG, draw_ext_info, FLAG_WIZPASS, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, onoff_value(), QUERY_FLAG, and SET_FLAG.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ command_yawn()

void command_yawn ( object op,
const char *  params 
)

'yawn' command.

Parameters
opplayer.
paramsmessage.

Definition at line 1261 of file c_chat.cpp.

References basic_emote(), and EMOTE_YAWN.

Referenced by commands_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ commands_clear()

void commands_clear ( )

Clear all registered commands.

Definition at line 346 of file commands.cpp.

References next_registration, and registered_commands.

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ commands_init()

void commands_init ( void  )

Init standard commands.

Wizard commands.

Definition at line 108 of file commands.cpp.

References command_abil(), command_accountpasswd(), command_accuse(), command_addexp(), command_afk(), command_apply(), command_applymode(), command_arrest(), command_banish(), command_beg(), command_bleed(), command_blush(), command_body(), command_bounce(), command_bow(), command_bowmode(), command_brace(), command_burp(), command_cackle(), command_cast(), command_chat(), command_chuckle(), command_clap(), command_cointoss(), command_cough(), command_create(), command_cringe(), command_cry(), command_dance(), command_debug(), command_delete(), command_diff(), command_disarm(), command_dm(), command_dmhide(), command_dmtell(), command_drop(), command_dropall(), command_dump(), command_dumpabove(), command_dumpallarchetypes(), command_dumpallmaps(), command_dumpallobjects(), command_dumpbelow(), command_dumpfriendlyobjects(), command_dumpmap(), command_east(), command_empty(), command_examine(), command_face(), command_fire(), command_fire_stop(), command_fix_me(), command_flip(), command_follow(), command_forget_spell(), command_free(), command_freeze(), command_frown(), command_gasp(), command_giggle(), command_glare(), command_goto(), command_grin(), command_groan(), command_growl(), command_gsay(), command_help(), command_hiccup(), command_hide(), command_hiscore(), command_hug(), command_insert_into(), command_inventory(), command_invisible(), command_invoke(), command_kick(), command_kill_pets(), command_kiss(), command_knowledge(), command_language(), command_laugh(), command_learn_special_prayer(), command_learn_spell(), command_lick(), command_listen(), command_listplugins(), command_loadplugin(), command_loadtest(), command_lock_item(), command_malloc(), command_mapinfo(), command_maps(), command_mark(), command_me(), command_mon_aggr(), command_motd(), command_news(), command_nod(), command_north(), command_northeast(), command_northwest(), command_nowiz(), command_orcknuckle(), command_overlay_reset(), command_overlay_save(), command_partial_commands(), command_party(), command_party_rejoin(), command_passwd(), command_patch(), command_peaceful(), command_petmode(), command_pickup(), command_players(), command_poke(), command_pout(), command_printlos(), command_puke(), command_purge_quest(), command_purge_quest_definitions(), command_quest(), command_quit(), command_recollect(), command_remove(), command_rename_item(), command_reply(), command_reset(), command_resistances(), command_rotateshoottype(), command_rskill(), command_rules(), command_run(), command_run_stop(), command_save(), command_say(), command_scream(), command_search(), command_search_items(), command_setgod(), command_settings(), command_shake(), command_shiver(), command_shoottype(), command_shout(), command_showpets(), command_shrug(), command_shutdown(), command_sigh(), command_skills(), command_slap(), command_smile(), command_smirk(), command_snap(), command_sneeze(), command_snicker(), command_sniff(), command_snore(), command_sound(), command_south(), command_southeast(), command_southwest(), command_speed(), command_spit(), command_ssdumptable(), command_stack_clear(), command_stack_list(), command_stack_pop(), command_stack_push(), command_statistics(), command_stats(), command_stay(), command_strings(), command_strut(), command_style_map_info(), command_sulk(), command_summon(), command_swap(), command_take(), command_teleport(), command_tell(), command_thank(), command_think(), command_throw(), command_time(), command_title(), command_toggle_shout(), command_twiddle(), command_unarmed_skill(), command_unloadplugin(), command_use(), command_usekeys(), command_uskill(), command_version(), command_wave(), command_west(), command_whereabouts(), command_whereami(), command_whistle(), command_who(), command_wimpy(), command_wink(), command_wizcast(), command_wizpass(), command_yawn(), RC, RN, and RW.

Referenced by init().

+ Here is the caller graph for this function:

◆ cone_drop()

void cone_drop ( object op)

Drops an object based on what is in the cone's "other_arch".

Parameters
opwhat object should drop.

Definition at line 265 of file spell_attack.cpp.

References add_refcount(), arch_to_object(), free_string(), object::level, object::map, object_get_owner(), object_insert_in_map_at(), object_set_owner(), object::other_arch, object::skill, object::x, and object::y.

Referenced by cast_cone(), and move_cone().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirm_password()

void confirm_password ( object op)

Ask the player to confirm her password during creation.

Parameters
opplayer.

Definition at line 1014 of file player.cpp.

References object::contr, CS_QUERY_HIDEINPUT, i18n(), player_set_state(), send_query(), player::socket, and ST_CONFIRM_PASSWORD.

Referenced by check_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confuse_living()

void confuse_living ( object op,
object hitter,
int  dam 
)

Confuse a living thing.

Parameters
opvictim.
hitterwho is attacking, unused.
damdamage to deal, unused.
Todo:
vary duration with dam/hitter?

Definition at line 2315 of file attack.cpp.

References add_string(), ATNR_CONFUSION, create_archetype(), draw_ext_info, object::duration, FLAG_APPLIED, FLAG_CONFUSED, FORCE, FORCE_CONFUSION, FORCE_NAME, free_string(), MAX, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, object::name, NDI_UNIQUE, object_insert_in_ob(), object_present_in_ob_by_name(), PLAYER, QUERY_FLAG, object::resist, SET_FLAG, object::speed, object::subtype, and object::type.

Referenced by charge_mana_effect(), hit_with_one_attacktype(), prayer_failure(), scroll_failure(), spell_failure(), and write_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ counterspell()

void counterspell ( object op,
int  dir 
)

Nullifies spell effects.

Basically, if the object has a magic attacktype, this may nullify it.

Parameters
opcounterspell object.
dirdirection it was cast in.

Definition at line 2911 of file spell_effect.cpp.

References AT_COUNTERSPELL, AT_MAGIC, object::attacktype, FLAG_MONSTER, living::food, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, living::hp, object::level, m, object::map, object_free(), object_get_owner(), object_remove(), P_OUT_OF_MAP, QUERY_FLAG, rndm(), RUNE, object::speed_left, SPELL_EFFECT, object::stats, object::type, object::x, and object::y.

Referenced by hit_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_aura()

int create_aura ( object op,
object caster,
object spell 
)

Create an aura spell object and put it in the player's inventory.

This is also used for elemental shields - the creation is the same just the 'move' code is different.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Returns
1.

Definition at line 3327 of file spell_effect.cpp.

References add_refcount(), arch_present_in_ob(), arch_to_object(), object::attacktype, caster_level(), change_abil(), create_archetype(), living::dam, draw_ext_info, object::duration, fix_object(), FLAG_APPLIED, FORCE, FORCE_CHANGE_ABILITY, FORCE_NAME, free_string(), object::level, MAX, MSG_TYPE_SPELL, MSG_TYPE_SPELL_SUCCESS, object::name, object::name_pl, NDI_UNIQUE, NROFATTACKS, object_insert_in_ob(), object_present_in_ob_by_name(), object_set_owner(), PLAYER, object::range, object::resist, SET_FLAG, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::speed, spell, object::stats, store_spell_expiry(), object::subtype, and object::type.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_bomb()

int create_bomb ( object op,
object caster,
int  dir,
object spell 
)

Create a bomb.

Parameters
opwho is casting.
casterwhat object is casting.
dircast direction.
spellspell object to cast.
Return values
0no bomb was placed.
1bomb was placed on map.

Definition at line 447 of file spell_attack.cpp.

References arch_to_object(), object::attacktype, living::dam, draw_ext_info, object::duration, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, object::map, MOVE_WALK, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, object_insert_in_map_at(), object_set_owner(), P_OUT_OF_MAP, object::range, set_spell_skill(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), spell, object::stats, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cure_disease()

int cure_disease ( object sufferer,
object caster,
sstring  skill 
)

Do the cure disease stuff, from the spell "cure disease".

Parameters
suffererwho is getting cured.
casterspell object used for curing. If NULL all diseases are removed, else only those of lower level than caster or randomly chosen.
skillskill to give experience to, can be NULL.
Return values
0no disease was cured.
1at least one disease was cured.

Definition at line 685 of file disease.cpp.

References change_exp(), DISEASE, draw_ext_info, draw_ext_info_format(), living::exp, FLAG_STARTEQUIP, FOR_INV_FINISH, FOR_INV_PREPARE, object::level, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_HEAL, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), PREFER_LOW, QUERY_FLAG, random_roll(), remove_symptoms(), skill, and object::stats.

Referenced by cast_heal(), and restore_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dead_player()

void dead_player ( object op)

Kill a player on a permanent death server with resurrection.

Parameters
opplayer to kill.

Definition at line 297 of file resurrection.cpp.

References llevError, Settings::localdir, LOG(), make_perma_dead(), MAX_BUF, object::name, path(), Settings::playerdir, and settings.

Referenced by kill_player_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_character()

void delete_character ( const char *  name)

Totally deletes a character.

The contents of its directory are effectively totally removed. Used when a player 'quits' the game, or dies on a server with permadeath and no resurrect.

Parameters
nameplayer to delete.

Definition at line 88 of file login.cpp.

References buf, Settings::localdir, MAX_BUF, name, Settings::playerdir, remove_directory(), and settings.

Referenced by key_confirm_quit(), and kill_player_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy_object()

void destroy_object ( object op)

Recursively object_free_drop_inventory() op and its inventory.

Parameters
opobject to totally object_free_drop_inventory().
Todo:
trash that function

Definition at line 209 of file login.cpp.

References FLAG_REMOVED, object::inv, object_free_drop_inventory(), object_remove(), and QUERY_FLAG.

Referenced by save_player(), and trap_disarm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detect_curse_on_item()

int detect_curse_on_item ( object pl,
object tmp,
object skill 
)

Runs a 'detect curse' check on a given item.

Parameters
plplayer detecting a curse.
tmpobject to check for curse
skilldetect skill object.
Returns
amount of experience gained (on successful detecting).

Definition at line 703 of file skills.cpp.

References calc_skill_exp(), esrv_update_item(), FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_KNOWN_CURSED, object::item_power, NROF(), unpaid_count::pl, QUERY_FLAG, SET_FLAG, skill, and UPD_FLAGS.

Referenced by do_skill_detect_curse(), and examine_autoidentify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ detect_magic_on_item()

int detect_magic_on_item ( object pl,
object tmp,
object skill 
)

Runs a 'detect magic' check on a given item.

Parameters
plplayer detecting magic.
tmpobject to check for magic
skilldetect skill object.
Returns
amount of experience gained (on successful detecting).

Definition at line 752 of file skills.cpp.

References calc_skill_exp(), esrv_update_item(), FLAG_KNOWN_MAGICAL, is_magical(), object::item_power, NROF(), unpaid_count::pl, QUERY_FLAG, SET_FLAG, skill, and UPD_FLAGS.

Referenced by do_skill_detect_magic(), and examine_autoidentify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determine_god()

const char* determine_god ( object op)

Determines if op worships a god.

Returns the godname if they do or "none" if they have no god. In the case of an NPC, if they have no god, we try and guess who they should worship based on their race. If that fails we give them a random one.

Parameters
opobject to get name of.
Returns
god name, "none" if nothing suitable.

Definition at line 55 of file gods.cpp.

References add_string(), find_god(), FLAG_ALIVE, get_god_for_race(), get_rand_god(), object::name, object_find_by_type_subtype(), PLAYER, QUERY_FLAG, object::race, SK_PRAYING, SKILL, SPELL, SPELL_EFFECT, object::title, and object::type.

Referenced by become_follower(), cast_bless(), cast_consecrate(), cast_curse(), cast_detection(), cast_smite_spell(), cast_spell(), cfapi_object_get_property(), hit_player(), hit_with_one_attacktype(), kill_player_not_permadeath(), mood_change(), perceive_self(), pets_summon_golem(), pets_summon_object(), pray_at_altar(), prayer_failure(), ring_bell(), show_skills(), and tailor_god_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determine_holy_arch()

archetype* determine_holy_arch ( const object god,
const char *  type 
)

Determines the archetype for holy servant and god avatar.

Possible monsters are stored as invisible books in god's inventory, one having the right name is selected randomly.

Parameters
godgod for which we want something.
typewhat the summon type is. Must be a shared string.
Returns
random archetype matching the type, NULL if none found.

Definition at line 676 of file gods.cpp.

References BOOK, archetype::clone, object::invisible, treasure::item, treasurelist::items, llevError, LOG(), object::name, treasure::next, object::other_arch, object::randomitems, rndm(), is_valid_types_gen::type, and object::type.

Referenced by pets_summon_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dimension_door()

int dimension_door ( object op,
object caster,
object spob,
int  dir 
)

Teleport through some doors and space.

Parameters
opwho is casting.
casterwhat is casting.
spobactual spell object.
dircasting direction.
Return values
0spell failure.
1spell was successful.

Definition at line 1609 of file spell_effect.cpp.

References object::contr, player::count, draw_ext_info, esrv_map_scroll(), FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, m, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, ob_apply(), OB_TYPE_MOVE_BLOCK, object_insert_in_map_at(), object_remove(), P_BLOCKSVIEW, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, PLAYER, player_update_bg_music(), object::range, player::socket, SP_level_range_adjust(), object::speed, object::speed_left, TRANSPORT, player::transport, object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dispel_rune()

int dispel_rune ( object op,
object skill,
int  dir 
)

Someone is trying to disarm a rune.

The actual attempt is done in trap_disarm().

Parameters
opobject trying to disarm.
skillskill to disarm runes.
dirdirection to disarm.
Return values
0rune wasn't disarmed.
1a rune was disarmed.

Definition at line 304 of file rune.cpp.

References draw_ext_info, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, object_find_by_type2(), object_free_drop_inventory(), object_remove(), P_OUT_OF_MAP, RUNE, SIGN, skill, TRAP, trap_disarm(), object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ display_motd()

void display_motd ( const object op)

Sends the message of the day to the player.

Parameters
opplayer to send to.

Definition at line 139 of file player.cpp.

References buf, Settings::confdir, draw_ext_info, HUGE_BUF, MAX_BUF, motd, Settings::motd, MSG_SUBTYPE_NONE, MSG_TYPE_MOTD, NDI_GREEN, NDI_UNIQUE, safe_strcat(), and settings.

Referenced by add_player(), command_motd(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_dump()

void do_dump ( object who,
object what 
)

Definition at line 2865 of file c_wiz.cpp.

References object::contr, object::count, dm_stack_push(), draw_ext_info, MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, NDI_UNIQUE, object_dump(), stringbuffer_finish(), and stringbuffer_new().

Referenced by command_dumpabove(), command_dumpbelow(), and examine_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_forget_spell()

void do_forget_spell ( object op,
const char *  spell 
)

Erases spell from player's inventory.

Will inform player of loss.

Parameters
opplayer.
spellspell name to forget.

Definition at line 525 of file apply.cpp.

References check_spell_known(), object::contr, draw_ext_info_format(), esrv_remove_spell(), llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_CURSED, NDI_NAVY, NDI_UNIQUE, object_free(), object_remove(), PLAYER, player_unready_range_ob(), spell, and object::type.

Referenced by cfapi_object_forget_spell(), command_forget_spell(), and spellbook_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_goto()

void do_goto ( object op,
const char *  name,
int  x,
int  y 
)

Definition at line 151 of file c_move.cpp.

References add_string(), enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, object::map, name, object::name, object_free(), and object_new().

Referenced by command_goto().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_harvest()

void do_harvest ( object pl,
int  dir,
object skill 
)

Player is trying to harvest something.

Parameters
plplayer trying to harvest.
dirdirection.
skillskill being used.

In the past, things were made harvestable by adding randomitems. This is not ideal, because randomitems are treasurelist-generated on map load, which means that if common items (e.g. mountains) are harvestable, then we have to do a lot of extra work generating junk that probably nobody will use.

Instead of doing that, check for a harvestitems field. The value will be used as the name of a treasurelist and we only generate it when it is being harvested.

We still have to keep the old way of treasurelist harvestables working, even though this can be much slower.

Definition at line 2263 of file c_misc.cpp.

References object::above, object::carrying, change_exp(), object::chosen_skill, create_treasure(), mapstruct::difficulty, draw_ext_info_format(), object::env, find_treasurelist(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, is_valid_types_gen::found, FREE_OBJ_FREE_INVENTORY, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, get_weight_limit(), i18n(), INS_BELOW_ORIGINATOR, IS_PLAYER(), level, llevError, LOG(), object::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, object::name, NDI_WHITE, object::nrof, object_create_arch(), object_find_free_spot(), object_free(), object_get_value(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_set_value(), object_split(), object_value_set(), P_OUT_OF_MAP, QUERY_FLAG, random_roll(), rndm(), SIZEOFFREE, SK_EXP_ADD_SKILL, object::skill, skill, speed, object::speed, object::speed_left, sstring, object::stats, living::Str, t, try_find_archetype(), object::weight, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_hidden_move()

void do_hidden_move ( object op)

For hidden creatures - a chance of becoming 'unhidden' every time they move - as we subtract off 'invisibility' AND, for players, if they move into a ridiculously unhideable spot (surrounded by clear terrain in broad daylight).

-b.t.

Parameters
opobject moving.

Definition at line 4054 of file player.cpp.

References calc_skill_exp(), change_exp(), object::contr, mapstruct::difficulty, draw_ext_info, hide, hideability(), object::invisible, object::level, make_visible(), object::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, object_find_by_type_subtype(), PLAYER, PREFER_LOW, random_roll(), player::run_on, SK_HIDING, SKILL, object::skill, and object::type.

Referenced by face_player(), monster_move(), and move_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_learn_spell()

void do_learn_spell ( object op,
object spell,
int  special_prayer 
)

Actually makes op learn spell.

Informs player of new spell and binding.

Parameters
opplayer who'll learn the spell.
spellspell to learn.
special_prayer1 for god-given prayer, 0 else.

Definition at line 484 of file apply.cpp.

References check_spell_known(), object::contr, draw_ext_info_format(), esrv_add_spells(), FLAG_STARTEQUIP, llevError, LOG(), MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, NDI_UNIQUE, object_copy(), object_insert_in_ob(), object_new(), play_sound_player_only(), PLAYER, QUERY_FLAG, SET_FLAG, SOUND_TYPE_SPELL, spell, and object::type.

Referenced by cfapi_object_learn_spell(), command_learn_spell_or_prayer(), dragon_ability_gain(), god_intervention(), and spellbook_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_skill()

int do_skill ( object op,
object part,
object skill,
int  dir,
const char *  string 
)

Main skills use function-similar in scope to cast_spell().

We handle all requests for skill use outside of some combat here. We require a separate routine outside of fire() so as to allow monsters to utilize skills.

This is changed (2002-11-30) from the old method that returned exp - no caller needed that info, but it also prevented the callers from know if a skill was actually used, as many skills don't give any exp for their direct use (eg, throwing).

Gives experience if appropriate.

Parameters
opThe object actually using the skill
partactual part using the skill, used by throwing for monsters
skillThe skill used by op
dirThe direction in which the skill is used
stringA parameter string, necessary to use some skills
Return values
0skill failure.
1use of the skill was successful.

Definition at line 431 of file skill_util.cpp.

References apply_anim_suffix(), attack_hth(), attack_melee_weapon(), change_exp(), object::chosen_skill, CLEAR_FLAG, do_harvest(), draw_ext_info, find_traps(), fix_object(), FLAG_APPLIED, give_skill_by_name(), hide, jump(), llevDebug, llevError, LOG(), MAX_BUF, meditate(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, name, NDI_UNIQUE, object_find_by_type_and_skill(), pick_lock(), PLAYER, pray(), QUERY_FLAG, query_name(), remove_trap(), SET_FLAG, shop_describe(), singing(), SK_AIR_MAGIC, SK_ALCHEMY, SK_BARGAINING, SK_BOWYER, SK_CLAWING, SK_CLIMBING, SK_DET_CURSE, SK_DET_MAGIC, SK_DISARM_TRAPS, SK_EARTH_MAGIC, SK_EVOCATION, SK_FIND_TRAPS, SK_FIRE_MAGIC, SK_FLAME_TOUCH, SK_HARVESTING, SK_HIDING, SK_INSCRIPTION, SK_JEWELER, SK_JUMPING, SK_KARATE, SK_LEVITATION, SK_LITERACY, SK_LOCKPICKING, SK_MEDITATION, SK_MISSILE_WEAPON, SK_ONE_HANDED_WEAPON, SK_ORATORY, SK_PRAYING, SK_PUNCHING, SK_PYROMANCY, SK_SET_TRAP, SK_SINGING, SK_SMITHERY, SK_SORCERY, SK_STEALING, SK_SUBTRACT_SKILL_EXP, SK_SUMMONING, SK_THAUMATURGY, SK_THROWING, SK_TWO_HANDED_WEAPON, SK_USE_MAGIC_ITEM, SK_WATER_MAGIC, SK_WOODSMAN, SK_WRAITH_FEED, SKILL, skill, skill_ident(), skill_throw(), living::sp, object::speed_left, object::stats, steal(), object::type, use_alchemy(), use_oratory(), and write_on_item().

Referenced by do_skill_by_number(), fire(), monster_use_skill(), player_attack_door(), and use_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_some_living()

void do_some_living ( object op)

Regenerate hp/sp/gr, decreases food.

This only works for players. Will grab food if needed, or kill player.

Parameters
opplayer to regenerate for.

Definition at line 3293 of file player.cpp.

References object::contr, living::food, player::gen_hp, player::gen_sp, living::maxhp, living::maxsp, ST_PLAYING, player::state, and object::stats.

Referenced by command_possess(), and process_players1().

+ Here is the caller graph for this function:

◆ dragon_ability_gain()

◆ drain_rod_charge()

void drain_rod_charge ( object rod)

Drain charges from a rod.

Parameters
rodrod to drain.

Definition at line 776 of file spell_util.cpp.

References living::hp, object::inv, SP_level_spellpoint_cost(), SPELL_HIGHEST, and object::stats.

Referenced by fire_misc_object(), and monster_use_range().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drain_wand_charge()

void drain_wand_charge ( object wand)

Drains a charge from a wand.

Handles animation fix, and player update if required.

Parameters
wandwand to drain. Must be of type WAND.

Definition at line 786 of file spell_util.cpp.

References object::arch, CLEAR_FLAG, archetype::clone, esrv_update_item(), object::face, FLAG_ANIMATE, living::food, object_get_player_container(), object_update_speed(), object::speed, object::stats, object::type, UPD_ANIM, and WAND.

Referenced by fire_misc_object(), and monster_use_range().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drop()

void drop ( object op,
object tmp 
)

Drop an item, either on the floor or in a container.

Parameters
opwho is dropping an item.
tmpwhat object to drop.

Definition at line 1168 of file c_object.cpp.

References object::container, object::contr, player::count, draw_ext_info, drop_object(), object::env, FLAG_INV_LOCKED, FLAG_NO_DROP, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, object::invisible, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, object_free_drop_inventory(), object_remove(), PLAYER, put_object_in_sack(), QUERY_FLAG, and object::type.

Referenced by apply_handle_yield(), cfapi_object_drop(), command_drop(), command_dropall(), and empty_container().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drop_object()

object* drop_object ( object op,
object tmp,
uint32_t  nrof 
)

Try to drop an object on the floor.

This function was part of drop, now is own function.

Parameters
opwho is dropping the item.
tmpitem to drop.
nrofif is non zero, then nrof objects is tried to be dropped.
Returns
object dropped, NULL if it was destroyed.
Todo:
shouldn't tmp be NULL if object_was_destroyed returns true?

Definition at line 1073 of file c_object.cpp.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), object::contr, object::count, draw_ext_info, draw_ext_info_format(), esrv_update_item(), EVENT_DROP, events_execute_object_event(), fix_object(), FLAG_APPLIED, FLAG_NO_DROP, FLAG_NO_FIX_PLAYER, FLAG_REMOVED, FLAG_STARTEQUIP, FLAG_UNPAID, INS_BELOW_ORIGINATOR, object::map, MAX_BUF, MONEY, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, name, NDI_UNIQUE, object::nrof, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_split(), object_was_destroyed, PLAYER, QUERY_FLAG, query_name(), save_player(), SCRIPT_FIX_ALL, sell_item(), shop_contains(), time, object::type, UPD_WEIGHT, object::value, object::x, and object::y.

Referenced by drop(), esrv_move_object(), and transport_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dump_quests()

void dump_quests ( void  )

Dump all of the quests, then calls exit() - useful in terms of debugging to make sure that quests are set up and recognised correctly.

Definition at line 880 of file quest.cpp.

References d, output_quests(), and quest_for_each().

+ Here is the call graph for this function:

◆ dump_races()

void dump_races ( void  )

Dumps all race information to stderr.

Definition at line 81 of file races.cpp.

References races.

Referenced by init_beforeplay().

+ Here is the caller graph for this function:

◆ dump_spells()

void dump_spells ( void  )

Dumps all the spells - now also dumps skill associated with the spell.

not sure what this would be used for, as the data seems pretty minimal, but easy enough to keep around.

Definition at line 108 of file spell_util.cpp.

References AssetsManager::archetypes(), AssetsCollection< T, Key >::each(), getManager(), and SPELL.

Referenced by init_beforeplay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emergency_save()

void emergency_save ( int  flag)

Save all players.

Parameters
flagif non zero, it means that we want to try and save everyone, but keep the game running. Thus, we don't want to free any information.

Definition at line 347 of file main.cpp.

References draw_ext_info, first_map_path, first_player, hiscore_check(), llevError, llevInfo, LOG(), object::map, player::maplevel, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, object::name, NDI_UNIQUE, player::next, player::ob, save_player(), trying_emergency_save, object::x, and object::y.

Referenced by fatal(), and LOG().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enter_exit()

void enter_exit ( object op,
object exit_ob 
)

Tries to move 'op' to exit_ob.

Largely redone by MSW 2001-01-21 - this function was overly complex and had some obscure bugs.

May call abort() in some situations.

Parameters
opcharacter or monster that is using the exit.
exit_obexit object (boat, door, teleporter, etc.)

Definition at line 727 of file server.cpp.

References AP_UNAPPLY, object::attacktype, player::bed_x, player::bed_y, buf, object::contr, living::dam, draw_ext_info_format(), enter_fixed_template_map(), enter_map(), enter_random_map(), enter_random_template_map(), enter_unique_map(), EXIT_PATH, EXIT_X, EXIT_Y, FLAG_DAMNED, FLAG_UNIQUE, FLAG_UNPAID, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, FORCE, FREE_OBJ_NO_DESTROY_CALLBACK, hit_player(), HUGE_BUF, object::inv, player::last_exit, llevDebug, LOG(), object::map, MAP_ENTER_X, MAP_ENTER_Y, map_path_unique(), MAP_PLAYER_UNIQUE, MAX_BUF, object::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, NDI_UNIQUE, ob_apply(), ob_describe(), object_copy(), object_find_by_type_and_slaying(), object_free(), object_new(), object_remove(), object_update_speed(), mapstruct::path, path_combine_and_normalize(), PLAYER, PORTAL_DESTINATION_NAME, QUERY_FLAG, ready_map_name(), save_player(), player::savebed_map, SP_WORD_OF_RECALL, object::speed, object::stats, object::subtype, player::transport, and object::type.

Referenced by command_reset(), command_summon(), command_teleport(), create_player_cmd(), do_follow(), do_goto(), enter_player_savebed(), execute_word_of_recall(), exit_type_apply(), exit_type_move_on(), key_change_class(), move_teleporter(), player_arrest(), and player_changer_type_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enter_player_maplevel()

void enter_player_maplevel ( object op)

Move a player to its stored map level.

This function is used to place the player just after logging in. Since the map may no longer exist, dump the player to an alternative 'emergency' location if that's the case.

Definition at line 682 of file server.cpp.

References object::contr, draw_ext_info_format(), Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_map(), flags, llevError, LOG(), MAP_ENTER_X, MAP_ENTER_Y, player::maplevel, MSG_TYPE_MISC, NDI_UNIQUE, PLAYER, ready_map_name(), settings, object::type, object::x, and object::y.

Referenced by check_login(), and set_first_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enter_player_savebed()

void enter_player_savebed ( object op)

This is a basic little function to put the player back to his savebed.

We do some error checking - its possible that the savebed map may no longer exist, so we make sure the player goes someplace.

Parameters
opplayer.

Definition at line 142 of file server.cpp.

References add_string(), player::bed_x, player::bed_y, object::contr, Settings::emergency_mapname, Settings::emergency_x, Settings::emergency_y, enter_exit(), EXIT_PATH, EXIT_X, EXIT_Y, FREE_OBJ_NO_DESTROY_CALLBACK, free_string(), llevDebug, LOG(), object::map, MAX_BUF, object::name, object_free(), object_new(), mapstruct::path, safe_strncpy, player::savebed_map, and settings.

Referenced by kill_player_not_permadeath(), and save_life().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ examine()

void examine ( object op,
object tmp 
)

◆ examine_monster()

void examine_monster ( object op,
object tmp,
int  level 
)

Player examine a monster.

Parameters
opplayer.
tmpmonster being examined.
levellevel of the probe, to have a persistant marker for some duration.

Definition at line 1614 of file c_object.cpp.

References add_string(), AT_ACID, object::attacktype, create_archetype(), draw_ext_info, fix_object(), FLAG_APPLIED, FLAG_PROBE, FLAG_UNDEAD, FORCE, FORCE_NAME, free_string(), HEAD, living::hp, knowledge_add_probe_monster(), object::level, level, living::maxhp, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, NDI_UNIQUE, object_find_by_type_and_name(), object_insert_in_ob(), object_present_in_ob(), POISONING, probe(), QUERY_FLAG, SET_FLAG, and object::stats.

Referenced by examine(), and probe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ explode_bullet()

◆ face_player()

int face_player ( object op,
int  dir 
)

Face player in the given direction.

Parameters
opplayer.
dirdirection to face
Returns
0.

Definition at line 3044 of file player.cpp.

References animate_object(), object::contr, object::direction, do_hidden_move(), object::facing, player::fire_on, FLAG_CONFUSED, get_randomized_dir(), object::hide, mapstruct::in_memory, llevError, LOG(), object::map, MAP_IN_MEMORY, QUERY_FLAG, player::run_on, object::state, player::transport, and turn_transport().

Referenced by command_face().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_applied_skill_by_name()

object* find_applied_skill_by_name ( const object op,
const char *  name 
)

Find a skill by name using the last_skill_ob list.

Assume last_skill_ob was correctly updated before.

This is defined here rather than server/skill_util.c because things defined in libserver.a are not available when libcommon.a is linked.

Definition at line 1932 of file living.cpp.

References object::contr, FLAG_REMOVED, player::last_skill_ob, llevDebug, llevError, LOG(), MAX_SKILLS, name, object::name, QUERY_FLAG, and object::skill.

Referenced by add_player_exp(), caster_level(), and kill_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_key()

object* find_key ( object pl,
object container,
object door 
)

We try to find a key for the door as passed.

If we find a key and player can use it (based on the usekeys settings), we return the key, otherwise NULL.

This function merges both normal and locked door, since the logic for both is the same - just the specific key is different.

This function can be called recursively to search containers.

Parameters
plplayer.
containerinventory to searched for keys.
doordoor we are trying to match against.
Returns
key to use, NULL if none found or usekeys mode doesn't let reach the key.
Todo:
document use key modes.

Definition at line 2485 of file player.cpp.

References CONTAINER, object::contr, DOOR, draw_ext_info_format(), FLAG_APPLIED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, object::inv, KEY, key_inventory, keyrings, MAX_BUF, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, NDI_BROWN, NDI_UNIQUE, object_find_by_type_and_slaying(), object_find_by_type_without_flags(), QUERY_FLAG, query_name(), object::race, object::slaying, SPECIAL_KEY, object::type, and player::usekeys.

Referenced by apply_container(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_marked_object()

object* find_marked_object ( object op)

Return the object the player has marked with the 'mark' command below.

If no match is found (or object has changed), we return NULL. We leave it up to the calling function to print messages if nothing is found.

Parameters
opobject. Should be a player.
Returns
marked object if still valid, NULL else.

Definition at line 1520 of file c_object.cpp.

References object::contr, object::count, object::env, player::mark, and player::mark_count.

Referenced by animate_weapon(), apply_map_builder(), armour_improver_type_apply(), cast_item_curse_or_bless(), cfapi_object_get_property(), command_mark(), command_rename_item(), find_throw_ob(), identify_altar_type_move_on(), lightable_type_apply(), lighter_type_apply(), recharge(), weapon_improver_type_apply(), and write_on_item().

+ Here is the caller graph for this function:

◆ find_player()

player* find_player ( const char *  plname)

Find a player by her full name.

Parameters
plnamename to find.
Returns
matching player, or NULL if no match.

Definition at line 59 of file player.cpp.

References find_player_options().

Referenced by command_reply(), and list_players().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_player_options()

player* find_player_options ( const char *  plname,
int  options,
const mapstruct map 
)

Find a player.

Parameters
plnamename of the player to search for. Can be partial.
optionscombination of FIND_PLAYER_xxx flags.
mapoptional map the player must be on (adjacent maps are ok too).
Returns
matching player, NULL if none or more than one.

Definition at line 70 of file player.cpp.

References object::contr, FIND_PLAYER_NO_HIDDEN_DM, FIND_PLAYER_PARTIAL_NAME, first_player, FLAG_WIZ, is_valid_types_gen::found, player::hidden, object::map, MAX_BUF, name, object::name, player::next, player::ob, options, QUERY_FLAG, and query_name().

Referenced by basic_emote(), find_player(), and find_player_partial_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_player_partial_name()

player* find_player_partial_name ( const char *  plname)

Find a player by a partial name.

Parameters
plnamename to match.
Returns
matching player if only one matching, or one perfectly matching, NULL if no match or more than one.

Definition at line 114 of file player.cpp.

References find_player_options(), and FIND_PLAYER_PARTIAL_NAME.

Referenced by cfapi_player_find(), command_follow(), command_quest(), command_stats(), command_teleport(), do_follow(), and do_tell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_player_socket()

player* find_player_socket ( const socket_struct ns)

Return a player for a socket structure.

Parameters
nssocket to search for.
Returns
NULL if no player, player else.

Definition at line 123 of file player.cpp.

References first_player, player::next, and player::socket.

Referenced by add_me_cmd(), and set_up_cmd().

+ Here is the caller graph for this function:

◆ find_random_spell_in_ob()

object* find_random_spell_in_ob ( object ob,
const char *  skill 
)

This returns a random spell from 'ob'.

If skill is set, then the spell must be of this skill, it can be NULL in which case all matching spells are used.

Parameters
obobject to find spells in.
skillskill the spell should match, NULL if can match any spell.
Returns
random spell, or NULL if none found.
Todo:
change skill to sstring.

Definition at line 48 of file spell_util.cpp.

References FOR_INV_FINISH, FOR_INV_PREPARE, RANDOM, skill, and SPELL.

Referenced by cast_spell(), and write_scroll().

+ Here is the caller graph for this function:

◆ find_skill_by_name()

object* find_skill_by_name ( object who,
const char *  name 
)

This returns the skill pointer of the given name (the one that accumulates exp, has the level, etc).

It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.

This code is basically the same as find_skill_by_number() below, but instead of a skill number, we search by the name.

Because a multiple skill names are allowed, we have to use arrays to store the intermediate results - we can't have skill_tool point to praying with skill pointing to fire magic.

Parameters
whoPlayer to get skill.
nameskill to find. Needs not to be a shared string. name can be a comma separated list of skill names - in that case, we will find the skill of the highest level.
Returns
pointer to skill object, or NULL if player doesn't have it.
Todo:
Maybe better selection of skill when choice of multiple skills is in use (highest level may not be the best answer?)

Definition at line 211 of file skill_util.cpp.

References adjust_skill_tool(), FLAG_APPLIED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), MAX_SKILLS, name, QUERY_FLAG, SKILL, skill, skill_names, SKILL_TOOL, and skills.

Referenced by apply_special(), attempt_do_alchemy(), attempt_recipe(), book_type_apply(), calc_alch_danger(), cast_destruction(), cast_dust(), cast_spell(), command_addexp(), command_cast_spell(), command_rskill(), command_unarmed_skill(), do_skill_attack(), dragon_ability_gain(), find_best_player_hth_skill(), fire_bow(), inscribe_scroll_cmd(), player_attack_door(), spellbook_type_apply(), and write_on_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_skill_by_number()

object* find_skill_by_number ( object who,
int  skillno 
)

This returns the first skill pointer of the given subtype (the one that accumulates exp, has the level, etc).

It is presumed that the player will be needing to actually use the skill, so a skill tool will be equipped if one if found to benefit from its bonuses.

This code is basically the same as find_skill_by_name() above, but instead of a skill name, we search by matching subtype.

Warning: skill subtypes are not unique to skills, various skills (eg harvesting-like) will share the same subtype, so this function should only be used if the skill's subtype is known to be used only by one skill.

Parameters
whoplayer applying a skill.
skillnoskill subtype.
Returns
skill object if player can use it, NULL else.

Definition at line 375 of file main.cpp.

References adjust_skill_tool(), FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, MAX_SKILLS, QUERY_FLAG, SKILL, skill, and SKILL_TOOL.

Referenced by compute_price_variation_with_bargaining(), cost_approx_str(), do_skill_by_number(), examine_autoidentify(), find_best_player_hth_skill(), god_enchants_weapon(), monster_can_detect_enemy(), object_check_move_on(), price_approx(), and scroll_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_target_for_friendly_spell()

object* find_target_for_friendly_spell ( object op,
int  dir 
)

This function is commonly used to find a friendly target for spells such as heal or protection or armour.

Parameters
opwhat is looking for the target (which can be a player).
dirdirection we are looking in.
Returns
object found, or NULL if no good object.

Definition at line 813 of file spell_util.cpp.

References object::above, object::below, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_OB, object::inv, m, object::map, object_get_owner(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, TRANSPORT, object::type, object::x, and object::y.

Referenced by cast_bless(), cast_change_ability(), and cast_heal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_traps()

int find_traps ( object pl,
object skill 
)

Checks for traps on the spaces around the player or in certain objects.

Parameters
plplayer searching.
skillfind trap skill object.
Returns
experience gained for finding traps.

Definition at line 1240 of file skills.cpp.

References calc_skill_exp(), draw_ext_info, FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, object_get_owner(), P_OUT_OF_MAP, unpaid_count::pl, PLAYER, QUERY_FLAG, RUNE, skill, TRAP, trap_see(), trap_show(), object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finish_races()

void finish_races ( )

Definition at line 98 of file races.cpp.

References addToRace, AssetsManager::archetypes(), AssetsCollection< T, Key >::find(), FLAG_MONSTER, getManager(), llevError, LOG(), name, QUERY_FLAG, and races.

Referenced by init_beforeplay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fire()

void fire ( object op,
int  dir 
)

Received a fire command for the player - go and do it.

Parameters
opplayer.
dirdirection to fire into.

Definition at line 2413 of file player.cpp.

References action_makes_visible(), apply_map_builder(), cast_spell(), object::chosen_skill, object::contr, object::count, do_skill(), draw_ext_info, fire_misc_object(), player::golem_count, make_visible(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, pets_control_golem(), PLAYER, player_fire_bow(), range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, player::ranges, player::shoottype, player::spellparam, and object::type.

Referenced by command_stay(), and move_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fire_arch_from_position()

int fire_arch_from_position ( object op,
object caster,
int16_t  x,
int16_t  y,
int  dir,
object spell 
)

Fires an archetype.

Note
it uses op->map for the map for these coordinates, which is probably a really bad idea.
Parameters
opperson firing the object.
casterobject casting the spell.
x
ywhere to fire the spell.
dirdirection to fire in.
spellspell that is being fired. It uses other_arch for the archetype to fire.
Returns
0 on failure, 1 on success.
Todo:
check the note?

Definition at line 629 of file spell_util.cpp.

References absdir(), add_refcount(), arch_to_object(), AT_GODPOWER, AT_HOLYWORD, object::attacktype, caster_level(), check_bullet(), living::dam, object::dam_modifier, object::direction, DIRX, DIRY, draw_ext_info, object::duration, FLAG_REFLECTING, living::food, get_map_flags(), GET_MAP_MOVE_BLOCK, living::hp, object::level, llevError, LOG(), m, object::map, living::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, NDI_UNIQUE, ob_process(), OB_TYPE_MOVE_BLOCK, object_copy_owner(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map_at(), object_set_owner(), object_update_turn_face(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RANDOM, object::range, set_spell_skill(), object::slaying, SP_BULLET, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_MAGIC_MISSILE, SP_MOVING_BALL, spell, SPELL, object::stats, tailor_god_spell(), object::type, object::x, and object::y.

Referenced by alchemy_failure_effect(), cast_spell(), and move_swarm_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fire_bolt()

int fire_bolt ( object op,
object caster,
int  dir,
object spob 
)

Cast a bolt-like spell.

We remove the magic flag - that can be derived from spob->attacktype. This function sets up the appropriate owner and skill pointers.

Parameters
opwho is casting the spell.
casterwhat object is casting the spell (rod, ...).
dirfiring direction.
spobspell object for the bolt.
Return values
0no bolt could be fired.
1bolt was fired (but may have been destroyed already).

Definition at line 61 of file spell_attack.cpp.

References absdir(), add_refcount(), arch_to_object(), object::attacktype, living::Con, living::dam, living::Dex, object::direction, DIRX, DIRY, object::duration, FLAG_REFLECTING, get_map_flags(), GET_MAP_MOVE_BLOCK, object::map, ob_process(), OB_TYPE_MOVE_BLOCK, object_free_drop_inventory(), object_insert_in_map_at(), object_set_owner(), object_update_turn_face(), object::other_arch, P_OUT_OF_MAP, QUERY_FLAG, object::range, set_spell_skill(), object::slaying, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), object::stats, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fire_bow()

int fire_bow ( object op,
object arrow,
int  dir,
int  wc_mod,
int16_t  sx,
int16_t  sy 
)

Creature (monster or player) fires a bow.

Parameters
opobject firing the bow.
arrowobject to fire.
dirdirection of fire.
wc_modany special modifier to give (used in special player fire modes)
sx
sycoordinates to fire arrow from - also used in some of the special player fire modes.
Returns
1 if bow was actually fired, 0 otherwise.
Todo:
describe player firing modes.

Definition at line 2110 of file player.cpp.

References add_refcount(), add_string(), object::anim_suffix, apply_anim_suffix(), AT_PHYSICAL, object::attacktype, BOW, bow_bestarrow, player::bowtype, change_skill(), object::chosen_skill, CLEAR_FLAG, object::contr, object::count, living::dam, living::Dex, object::direction, draw_ext_info, draw_ext_info_format(), FABS, find_arrow(), find_skill_by_name(), fix_object(), FLAG_NO_STRENGTH, FLAG_READY_BOW, free_string(), get_dam_bonus(), get_dex_bonus(), get_map_flags(), GET_MAP_MOVE_BLOCK, get_thaco_bonus(), living::grace, living::hp, if(), object::level, llevError, LOG(), m, object::magic, object::map, MOVE_FLY_LOW, object::move_on, object::move_type, MOVE_WALK, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, object::nrof, ob_process(), object_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_set_owner(), object_split(), object_update_speed(), object_update_turn_face(), object_was_destroyed, P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, object::race, range_bow, player::ranges, object::skill, skill, object::slaying, SOUND_TYPE_ITEM, living::sp, object::speed, object::speed_left, object::spellarg, object::stats, living::Str, strdup_local, object::type, and living::wc.

Referenced by monster_use_bow(), and player_fire_bow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fire_swarm()

int fire_swarm ( object op,
object caster,
object spell,
int  dir 
)

The following routine creates a swarm of objects.

It actually sets up a specific swarm object, which then fires off all the parts of the swarm.

Parameters
opwho is casting.
casterwhat object is casting.
spellspell object to cast.
dircast direction.
Return values
0nothing happened.
1swarm was placed on map.

Definition at line 1088 of file spell_attack.cpp.

References arch_to_object(), AT_GODPOWER, AT_HOLYWORD, object::attacktype, caster_level(), create_archetype(), die_roll(), object::direction, object::duration, object::invisible, object::level, object::map, object_insert_in_map_at(), object_set_owner(), PREFER_HIGH, set_spell_skill(), SP_level_duration_adjust(), spell, object::spell, SWARM_SPELL, tailor_god_spell(), object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fix_luck()

void fix_luck ( void  )

Fixes luck of players, slowly move it towards 0.

Definition at line 3927 of file player.cpp.

References change_luck(), object::contr, first_player, player::next, player::ob, and player::state.

Referenced by do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fix_stopped_arrow()

object* fix_stopped_arrow ( object op)

◆ fix_stopped_item()

void fix_stopped_item ( object op,
mapstruct map,
object originator 
)

Put stopped item where stop_item() had found it.

Inserts item into the old map, or merges it if it already is on the map.

Parameters
opobject to stop.
mapmust be the value of op->map before stop_item() was called.
originatorwhat caused op to be stopped.

Definition at line 495 of file time.cpp.

References ARROW, FLAG_REMOVED, object_insert_in_map(), object_merge(), QUERY_FLAG, and object::type.

Referenced by save_throw_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fix_weight()

void fix_weight ( void  )

Check recursively the weight of all players, and fix what needs to be fixed.

Refresh windows and fix speed if anything was changed.

Todo:
is this still useful?

Definition at line 3911 of file player.cpp.

References object::carrying, first_player, fix_object(), llevDebug, LOG(), object::name, player::next, player::ob, and object_sum_weight().

Referenced by do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flush_old_maps()

void flush_old_maps ( void  )

Reset maps that need to, remove their swap file.

This is very useful if the tmp-disk is very full.

Definition at line 291 of file swap.cpp.

References clean_tmp_map(), delete_map(), EVENT_MAPRESET, events_execute_global_event(), first_map, llevDebug, LOG(), m, map_can_reset(), MAP_IN_MEMORY, MAP_SWAPPED, players_on_map(), seconds(), set_map_timeout(), and TRUE.

Referenced by command_reset(), and do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forbid_play()

int forbid_play ( void  )

Checks if server should be started.

Returns
1 if play is forbidden, 0 if ok.
Todo:
document forbidden stuff.

Definition at line 1364 of file server.cpp.

References buf, Settings::confdir, days, llevDebug, LOG(), logfile, MAX_BUF, PERM_FILE, settings, and time.

Referenced by init_startup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_knowledge()

void free_knowledge ( void  )

Free all knowledge data.

Definition at line 1280 of file knowledge.cpp.

References free_knowledge_player(), knowledge_global, and knowledge_player::next.

Referenced by cleanup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_no_drop()

int free_no_drop ( object op)

Check whether the given object is FLAG_NO_DROP.

If so, (optionally) remove and free it.

Parameters
opthe object to check
Returns
whether the object was freed

Definition at line 565 of file time.cpp.

References FLAG_NO_DROP, FLAG_REMOVED, FREE_OBJ_FREE_INVENTORY, object_free(), object_remove(), and QUERY_FLAG.

Referenced by fix_stopped_arrow(), hit_with_arrow(), and stop_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_quest()

void free_quest ( void  )

Free all quest status structures.

It is all right to call quest functions again after that.

Definition at line 891 of file quest.cpp.

References free_state(), free_string(), quest_player::next, quest_player::player_name, and player_states.

Referenced by cleanup(), command_purge_quest(), and free_server().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_quest_definitions()

void free_quest_definitions ( void  )

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ free_races()

void free_races ( void  )

Frees all race-related information.

Definition at line 93 of file races.cpp.

References llevDebug, LOG(), and races.

Referenced by free_server().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free_server()

void free_server ( void  )

Frees all memory allocated around here:

  • materials
  • races

Definition at line 1136 of file init.cpp.

References Settings::disabled_plugins, free_materials(), free_quest(), free_races(), and settings.

Referenced by cleanup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ friendly_fire()

int friendly_fire ( object op,
object hitter 
)

Find out if this is friendly fire (PVP and attacker is peaceful) or not.

Parameters
opvictim.
hitterattacker.
Returns
0 this is not friendly fire, 1 if hitter is a peaceful player, 2 if hitter is a pet of a peaceful player.

Definition at line 1858 of file attack.cpp.

References object::contr, DISEASE, HEAD, object_get_owner(), player::peaceful, PLAYER, POISONING, RUNE, SPELL, and object::type.

Referenced by hit_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_attack_message_for_attack_type()

void get_attack_message_for_attack_type ( int  dam,
uint8_t  atm_type,
const char *  victim_name,
char *  buf1,
char *  buf2 
)

Get the attack message for a damage and a type.

Parameters
damdamage done.
atm_typeone Attack types of type ATM_xxx.
victim_namename of the victim of the attack.
[out]buf1where to write the message for the one doing the attack, must be at least MAX_BUF long.
[out]buf2where to write the message for the victim of the attack, must be at least MAX_BUF long.

Definition at line 538 of file attack.cpp.

References attack_mess, attackmess_t::level, level, MAX_BUF, and MAXATTACKMESS.

Referenced by get_attack_message().

+ Here is the caller graph for this function:

◆ get_name()

void get_name ( object op)

Waiting for the player's name.

Parameters
opplayer.

Definition at line 889 of file player.cpp.

References object::contr, i18n(), player_set_state(), send_query(), player::socket, and ST_GET_NAME.

Referenced by add_player(), receive_play_again(), receive_player_name(), receive_player_password(), and wrong_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_nearest_criminal()

object* get_nearest_criminal ( object mon)

Definition at line 591 of file player.cpp.

References first_player, is_criminal(), monster_can_detect_enemy(), and player::next.

Referenced by monster_find_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_nearest_player()

object* get_nearest_player ( object mon)

Finds the nearest visible player or player-friendly for some object.

Parameters
monwhat object is searching a player.
Returns
player, or NULL if nothing suitable.

Definition at line 548 of file player.cpp.

References rv_vector::distance, first_player, FLAG_FREED, FLAG_FRIENDLY, free_objectlink(), get_friends_of(), list, monster_can_detect_enemy(), player::next, objectlink::next, player::ob, objectlink::ob, and QUERY_FLAG.

Referenced by monster_find_enemy(), and monster_move().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_party_password()

int get_party_password ( object op,
partylist party 
)

Ask the player for the password of the party she wants to join.

Parameters
opplayer.
partyparty op wishes to join.
Returns
whether a party password has been requested from the client

Definition at line 1029 of file player.cpp.

References object::contr, CS_QUERY_HIDEINPUT, i18n(), party_get_password(), player::party_to_join, player_set_state(), send_query(), player::socket, and ST_GET_PARTY_PASSWORD.

Referenced by command_party().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_password()

void get_password ( object op)

Waiting for the player's password.

Parameters
opplayer.

Definition at line 900 of file player.cpp.

References object::contr, CS_QUERY_HIDEINPUT, i18n(), player_set_state(), send_query(), player::socket, and ST_GET_PASSWORD.

Referenced by receive_player_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_player()

player* get_player ( player p)

Create a player's object, initialize a player's structure.

This no longer sets the player map. Also, it now updates all the pointers so the caller doesn't need to do that. Caller is responsible for setting the correct map.

Redo this to do both get_player_ob and get_player. Hopefully this will be bugfree and simpler.

Parameters
pif NULL, a new player structure is created, else p is recycled.
Returns
initialized player structure.

Definition at line 285 of file player.cpp.

References add_string(), object::arch, arch_to_object(), bow_normal, player::bowtype, living::Cha, CLEAR_FLAG, clear_los(), clear_player(), archetype::clone, living::Con, object::contr, living::Dex, object::direction, player::do_los, living::exp, fatal(), first_map_path, first_player, FLAG_READY_SKILL, player::gen_sp_armour, get_player_archetype(), i18n_get_language_by_code(), living::Int, player::language, player::last_applied_stats, player::last_character_flags, player::last_character_load, player::last_item_power, player::last_path_attuned, player::last_path_denied, player::last_path_repelled, player::last_resist, player::last_skill_exp, player::last_skill_ob, player::last_speed, player::last_stats, player::last_weapon_sp, player::last_weight, player::last_weight_limit, player::listening, MAX_SKILLS, object::name, player::next, player::no_shout, NROFATTACKS, player::ob, offsetof, OUT_OF_MEMORY, player::party, party_rejoin_if_exists, player::peaceful, pet_normal, player::petmode, player_set_state(), living::Pow, object::race, range_none, player::rejoin_party, roll_stats(), object::run_away, player::savebed_map, player::shoottype, object::speed, object::speed_left, ST_ROLL_STAT, object::stats, living::Str, player::swap_first, player::ticks_played, player::title, player::unapply, unapply_nochoice, player::unarmed_skill, living::wc, and living::Wis.

Referenced by account_play_cmd(), add_player(), make_perma_dead(), and receive_play_again().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_reply_text_own()

const char* get_reply_text_own ( reply_type  rt)

Return the verb for the player's dialog type.

Parameters
rtdialog type.
Returns
verb.

Definition at line 2318 of file monster.cpp.

References rt_question, rt_reply, and rt_say.

Referenced by monster_communicate().

+ Here is the caller graph for this function:

◆ give_initial_items()

void give_initial_items ( object pl,
treasurelist items 
)

Gives a new player her initial items.

They will be god-given, and suitable for the player's race/restrictions.

Parameters
plplayer.
itemstreasure list containing the items.

Now we do a second loop, to apply weapons/armors/... This is because weapons require the skill, which can be given after the first loop.

Definition at line 792 of file player.cpp.

References AP_NOPRINT, apply_manual(), CLEAR_FLAG, create_treasure(), FLAG_APPLIED, FLAG_CAN_USE_SKILL, FLAG_CURSED, FLAG_DAMNED, FLAG_IDENTIFIED, FLAG_INV_LOCKED, FLAG_NEUTRAL, FLAG_STARTEQUIP, FLAG_USE_ARMOUR, FLAG_USE_SHIELD, FLAG_USE_WEAPON, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FOR_INV_FINISH, FOR_INV_PREPARE, FORCE, is_valid_types_gen::found, GT_ONLY_GOOD, GT_STARTEQUIP, IS_ARMOR, is_identifiable_type(), IS_SHIELD, IS_WEAPON, link_player_skills(), llevError, LOG(), object_can_merge(), object_free_drop_inventory(), object_remove(), PLAYER, QUERY_FLAG, object::randomitems, SET_FLAG, SKILL, SPELLBOOK, and object::type.

Referenced by apply_changes_to_player(), apply_race_and_class(), and key_change_class().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_newcs_player()

int handle_newcs_player ( object op)

Handles commands the player can send us, and various checks on invisibility, golem and such.

This is sort of special, in that the new client/server actually uses the new speed values for commands.

Parameters
opplayer to handle.
Returns
true if there are more actions we can do.

Definition at line 3103 of file player.cpp.

References CLEAR_FLAG, object::contr, object::count, object::direction, draw_ext_info, player::fire_on, FLAG_MAKE_INVIS, FLAG_PARALYZED, FLAG_REMOVED, FLAG_SCARED, flee_player(), player::golem_count, player::hidden, object::invisible, make_visible(), move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END, MSG_TYPE_SPELL, MSG_TYPE_SPELL_END, NDI_UNIQUE, PLAYER, pticks, QUERY_FLAG, range_golem, player::ranges, player::run_on, object::speed_left, and object::type.

Referenced by process_players1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hide()

int hide ( object op,
object skill 
)

Main hide handling.

Parameters
opliving trying to hide.
skillhiding skill.
Returns
experience gained for the skill use (can be 0).

Definition at line 496 of file skills.cpp.

References attempt_hide(), calc_skill_exp(), draw_ext_info, FLAG_MAKE_INVIS, object::hide, object::invisible, make_visible(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, object_update(), PLAYER, QUERY_FLAG, skill, object::type, and UP_OBJ_FACE.

+ Here is the call graph for this function:

◆ hideability()

int hideability ( object ob)

Look at the surrounding terrain to determine the hideability of this object.

Positive levels indicate greater hideability.

Parameters
obobject that may want to hide.
Returns
the higher the value, the easier to hide here.

Definition at line 4013 of file player.cpp.

References mapstruct::darkness, freearr_x, freearr_y, get_map_flags(), has_carried_lights(), level, object::map, P_BLOCKSVIEW, P_OUT_OF_MAP, object::x, and object::y.

Referenced by attempt_hide(), and do_hidden_move().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hiscore_check()

void hiscore_check ( object op,
int  quiet 
)

Checks if player should enter the hiscore, and if so writes her into the list.

Parameters
opplayer to check.
quietIf set, don't print anything out - used for periodic updates during game play or when player unexpected quits - don't need to print anything in those cases

Definition at line 348 of file hiscore.cpp.

References add_score(), BIG_NAME, object::contr, draw_ext_info, draw_ext_info_format(), draw_one_high_score(), score::exp, living::exp, FLAG_WAS_WIZ, FMT64, FOR_INV_FINISH, FOR_INV_PREPARE, get_skill_client_code(), HIGHSCORE_LENGTH, hiscore_tables, score::killer, player::killer, llevDebug, LOG(), object::map, score::maplevel, MAX_BUF, score::maxgrace, living::maxgrace, score::maxhp, living::maxhp, score::maxsp, living::maxsp, message, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, score::name, mapstruct::name, object::name, player::name_changed, NDI_UNIQUE, mapstruct::path, player_get_title(), score::position, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, SKILL, object::stats, and score::title.

Referenced by apply_savebed(), emergency_save(), key_confirm_quit(), kill_player_permadeath(), leave(), and process_players1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hiscore_display()

void hiscore_display ( object op,
int  max,
const char *  match 
)

Displays the high score file.

Parameters
opplayer asking for the score file.
maxmaximum number of scores to display.
matchif non-empty, will only print players with name or title containing the string (non case-sensitive). Other options: -s:[name] – show the table for the skill 'name' instead of overall -s – show a short list for each skill

Definition at line 451 of file hiscore.cpp.

References draw_ext_info, draw_ext_info_format(), draw_one_high_score(), score_table::entry, HIGHSCORE_LENGTH, hiscore_tables, llevDebug, LOG(), MAX_BUF, MAX_SKILLS, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_HISCORE, name, score::name, NDI_UNIQUE, skill, and strcasestr_local.

Referenced by command_hiscore().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hiscore_init()

void hiscore_init ( void  )

Initializes the module.

Note
There is one table per skill, as well as the "Overall" table, each saved in a file in .../var/crossfire/hiscores/[skill_name] or as configured in config.h.

Definition at line 296 of file hiscore.cpp.

References c, get_skill_client_code(), HIGHSCORE_DIR, hiscore_load(), hiscore_tables, Settings::localdir, MAX_BUF, MAX_SKILLS, name, OLD_HIGHSCORE, settings, and skill_names.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hit_map()

int hit_map ( object op,
int  dir,
uint32_t  type,
int  full_hit 
)

Attack a spot on the map.

Parameters
opobject hitting the map.
dirdirection op is hitting/going.
typeattacktype.
full_hitif set then monster area does not matter, it gets all damage. Else damage is proportional to affected area vs full monster area.
Returns
1 if it hits something, 0 otherwise.

Definition at line 355 of file attack.cpp.

References object::arch, AT_CHAOS, AT_COUNTERSPELL, AT_MAGIC, object::count, counterspell(), living::dam, object::env, FLAG_ALIVE, FLAG_FREED, FLAG_REMOVED, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, hit_player(), llevError, LOG(), object::map, object::name, archetype::name, object_update(), object_was_destroyed, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, save_throw_object(), shuffle_attack(), object::stats, TRANSPORT, is_valid_types_gen::type, UP_OBJ_FACE, object::x, and object::y.

Referenced by explode_bullet(), explosion(), move_aura(), move_ball_spell(), move_bolt(), move_cone(), and rune_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hit_player()

int hit_player ( object op,
int  dam,
object hitter,
uint32_t  type,
int  full_hit 
)

Object is attacked by something.

This isn't used just for players, but in fact most objects.

Oct 95 - altered the following slightly for MULTIPLE_GODS hack which needs new attacktype AT_HOLYWORD to work . b.t.

Parameters
opobject to be hit
dambase damage - protections/vulnerabilities/slaying matches can modify it.
hitterwhat is hitting the object
typeattacktype
full_hitset if monster area does not matter.
Returns
dealt damage.
Todo:
rename to something more meaningful.

Definition at line 1907 of file attack.cpp.

References abort_attack(), object::arch, AT_CHAOS, AT_DEATH, AT_HOLYWORD, AT_MAGIC, AT_PARALYZE, AT_PHYSICAL, AT_SLOW, ATNR_MAGIC, attack_message(), ATTACKS, change_object(), CLEAR_FLAG, object::count, object::current_weapon, determine_god(), did_make_save(), DOOR, object::enemy, EVENT_ATTACKED, events_execute_object_event(), find_god(), FLAG_ALIVE, FLAG_FREED, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_NO_DAMAGE, FLAG_ONE_HIT, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SPLITTING, FLAG_TEAR_DOWN, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, friendly_fire(), get_attack_mode(), object::head, hit_with_one_attacktype(), living::hp, kill_object(), object::level, llevDebug, LOG(), living::maxhp, monster_npc_call_help(), archetype::more, object::name, archetype::name, NROFATTACKS, object_find_by_type2(), object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), object_was_destroyed, op_on_battleground(), PLAYER, QUERY_FLAG, object::race, RANDOM, remove_friendly_object(), object::resist, rndm(), object::run_away, RUNE, scare_creature(), SCRIPT_FIX_ALL, SET_FLAG, Settings::set_friendly_fire, settings, object::slaying, spring_trap(), object::stats, tear_down_wall(), object::title, TRAP, is_valid_types_gen::type, object::type, and undead_name.

Referenced by attack_ob_simple(), cast_destruction(), cast_earth_to_dust(), cast_light(), check_bullet(), check_heal_and_mana(), enter_exit(), gate_type_process(), hit_map(), legacy_ob_process(), monster_check_doors(), monster_check_earthwalls(), move_symptom(), poison_type_apply(), poisoning_type_process(), rune_attack(), spell_effect_type_move_on(), and spell_failure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hit_with_arrow()

object* hit_with_arrow ( object op,
object victim 
)

hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.

Parameters
opmissile hitting.
victimwho is hit by op.
Returns
pointer to the reassembled missile, or NULL if the missile isn't available anymore.

Definition at line 979 of file attack.cpp.

References add_refcount(), attack_ob_simple(), object::count, living::dam, object::env, EVENT_ATTACKS, EVENT_CONNECTOR, events_execute_object_event(), fix_stopped_arrow(), FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, free_no_drop(), free_string(), INS_NO_MERGE, INS_NO_WALK_ON, object::inv, object::map, object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_remove(), object_set_owner(), object_was_destroyed, SCRIPT_FIX_ALL, object::skill, object::speed, object::stats, stick_arrow(), object::type, living::wc, object::x, and object::y.

Referenced by common_process_projectile(), and common_projectile_move_on().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ identify_object_with_skill()

int identify_object_with_skill ( object tmp,
object pl,
object skill,
int  print_on_success 
)

Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conveniently.

Identification will be attempted as many times as NROF(tmp), and tmp will be split if needed. This is to allow players to maximise experience for identification without having to resort to picking one item, moving, attempting identification of the item, and such.

See https://sourceforge.net/p/crossfire/feature-requests/244/

Parameters
tmpobject to try to identify.
plobject identifying.
skillidentification skill.
print_on_success1 to print a description if the object is identified, 0 to leave it to the calling function
Returns
experience for successful identification.

Definition at line 810 of file skills.cpp.

References calc_skill_exp(), chance(), die_roll(), draw_ext_info_format(), object::env, FLAG_NO_SKILL_IDENT, identify(), if(), INS_BELOW_ORIGINATOR, living::Int, object::invisible, is_identified(), object::magic, object::map, MAX_BUF, object::msg, MSG_TYPE_ITEM, MSG_TYPE_ITEM_INFO, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, NROF(), ob_describe(), object_insert_in_map_at(), object_insert_in_ob(), object_merge(), object_split(), unpaid_count::pl, PLAYER, PREFER_LOW, QUERY_FLAG, rndm(), SET_FLAG, skill, object::stats, object::type, object::x, and object::y.

Referenced by do_skill_ident(), and examine_autoidentify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infect_object()

int infect_object ( object victim,
object disease,
int  force 
)

Try to infect something with a disease.

Rules:

  • objects with immunity aren't infectable.
  • objects already infected aren't infectable.
  • dead objects aren't infectable.
  • undead objects are infectible only if specifically named.
Parameters
victimpotential victim to infect.
diseasewhat could infect.
forcedon't do a random check for infection. Other checks (susceptible to disease, not immune, and so on) are still done.
Return values
0victim wasn't infected.
1victim was infected.

Definition at line 317 of file disease.cpp.

References add_refcount(), buf, DISEASE, draw_ext_info, object::env, FLAG_MONSTER, living::food, free_string(), HEAD, is_susceptible_to_disease(), object::last_grace, object::level, object::map, living::maxgrace, living::maxhp, object::move_block, MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_DID_HIT, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, object::name, NDI_RED, NDI_UNIQUE, object_copy(), object_find_by_type_and_name(), object_get_owner(), object_insert_in_ob(), object_new(), object_set_owner(), op_on_battleground(), PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), SIGN, object::skill, object::stats, object::title, object::type, object::value, and living::wc.

Referenced by cast_cause_disease(), check_infection(), check_physically_infect(), and rune_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

void init ( int  argc,
char **  argv 
)

This is the main server initialization function.

Called only once, when starting the program.

Parameters
argcargument count.
argvarguments on the command line.

Definition at line 1096 of file init.cpp.

References accounts_load(), add_server_collect_hooks(), cftimer_init(), commands_init(), FULL_VERSION, hiscore_init(), init_beforeplay(), init_library(), init_modules(), init_ob_methods(), init_server(), init_signals(), init_skills(), init_startup(), llevInfo, load_settings(), LOG(), logfile, metaserver2_init(), parse_args(), read_map_log(), reset_sleep(), SRANDOM, and time.

+ Here is the call graph for this function:

◆ init_ob_methods()

void init_ob_methods ( void  )

Initializes the ob_method system.

This means initializing legacy_type, base_type, and also calling init_ob_types() from ob_types.c

Definition at line 35 of file ob_methods.cpp.

References ob_methods::apply, base_type, ob_methods::describe, init_ob_method_struct(), init_ob_types(), legacy_ob_apply(), legacy_ob_describe(), legacy_ob_process(), legacy_type, ob_methods::move_on, ob_methods::process, and register_all_ob_types().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_signals()

void init_signals ( )

Setup our signal handlers.

Definition at line 1323 of file init.cpp.

References rec_sighup(), and signal_shutdown().

Referenced by command_unloadplugin(), and init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_skills()

void init_skills ( void  )

This just sets up the skill_names table above.

The index into the array is simply the order the skill is found.

Definition at line 99 of file skill_util.cpp.

References archetypes_for_each(), do_each_skill(), MAX_SKILLS, skill_faces, skill_messages, and skill_names.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPlugins()

void initPlugins ( void  )

Plugins initialization.

Browses the plugins directory and call plugins_init_plugin() for each file found.

Definition at line 4570 of file plugins.cpp.

References buf, closedir(), Settings::disabled_plugins, llevDebug, llevInfo, LOG(), opendir(), plugins_init_plugin(), readdir(), and settings.

Referenced by server_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inventory()

void inventory ( object op,
object inv 
)

Prints object's inventory.

Parameters
opwho to print for.
invif NULL then print op's inventory, else print the inventory of inv.

Definition at line 2167 of file c_object.cpp.

References CONTAINER, draw_ext_info, draw_ext_info_format(), FLAG_APPLIED, FLAG_WIZ, FOR_INV_FINISH, FOR_INV_PREPARE, in, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_INVENTORY, name, NDI_UNIQUE, QUERY_FLAG, query_name(), query_weight(), object::type, and weight.

Referenced by command_inventory(), and look_at().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_true_undead()

int is_true_undead ( object op)

Is the object a true undead?

Parameters
opobject to test.
Returns
1 if undead, 0 else.

Definition at line 3996 of file player.cpp.

References object::arch, archetype::clone, FLAG_UNDEAD, and QUERY_FLAG.

Referenced by makes_invisible_to(), monster_can_detect_enemy(), and monster_can_see_enemy().

+ Here is the caller graph for this function:

◆ jump()

int jump ( object pl,
int  dir,
object skill 
)

Jump skill handling.

This is both a new type of movement for player/monsters and an attack as well. Perhaps we should allow more spaces based on level, eg, level 50 jumper can jump several spaces?

Parameters
plobject jumping.
dirdirection to jump to.
skilljumping skill.
Returns
1 if jump was successful, 0 else

Definition at line 666 of file skills.cpp.

References attempt_jump(), object::carrying, living::Dex, draw_ext_info, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, unpaid_count::pl, skill, stats, object::stats, and living::Str.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key_change_class()

void key_change_class ( object op,
char  key 
)

This function takes the key that is passed, and does the appropriate action with it (change race, or other things).

The function name is for historical reasons - now we have separate race and class; this actually changes the RACE, not the class.

Parameters
opplayer.
keykey to handle.

Definition at line 1297 of file player.cpp.

References add_statbonus(), add_string(), allowed_class(), object::arch, player::bed_x, player::bed_y, buf, object::carrying, CLEAR_FLAG, archetype::clone, object::contr, create_treasure(), CS_QUERY_SINGLECHAR, draw_ext_info, draw_ext_info_format(), enter_exit(), esrv_new_player(), esrv_send_inventory(), esrv_update_item(), EVENT_BORN, EVENT_LOGIN, events_execute_global_event(), EXIT_PATH, EXIT_X, EXIT_Y, find_treasurelist(), first_map_ext_path, fix_object(), FLAG_WIZ, free_string(), get_player_archetype(), give_initial_items(), living::grace, socket_struct::host, living::hp, i18n(), player::is_wraith, link_player_skills(), llevDebug, Settings::localdir, LOG(), make_path_to_file(), object::map, MAX_BUF, living::maxhp, living::maxsp, object::msg, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOGIN, MSG_TYPE_ADMIN_PLAYER, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, name, object::name, archetype::name, object::name_pl, NDI_ALL, NDI_BLUE, NDI_DK_ORANGE, NDI_UNIQUE, object_copy(), object_find_by_name(), object_free_drop_inventory(), object_insert_in_map_at(), object_new(), object_remove(), object_set_msg(), object_update(), player::orig_stats, play_again(), player_set_state(), Settings::playerdir, pticks, object::randomitems, remove_statbonus(), player::savebed_map, send_query(), SET_ANIMATION, settings, player::socket, living::sp, ST_PLAYING, object::stats, strlcpy(), player::title, UP_OBJ_FACE, UPD_FACE, object::weight, object::x, and object::y.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key_confirm_quit()

◆ key_roll_stat()

void key_roll_stat ( object op,
char  key 
)

Player is currently swapping stats.

This code has been greatly reduced, because with set_attr_value and get_attr_value, the stats can be accessed just numeric ids. stat_trans is a table that translate the number entered into the actual stat. It is needed because the order the stats are displayed in the stat window is not the same as how the number's access that stat. The table does that translation.

Parameters
opplayer.
keyreceived key.

Definition at line 1221 of file player.cpp.

References add_statbonus(), CHARISMA, CONSTITUTION, object::contr, CS_QUERY_SINGLECHAR, DEXTERITY, draw_ext_info, draw_ext_info_format(), FLAG_WIZ, i18n(), INTELLIGENCE, llevError, LOG(), object::map, object::msg, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_NEWPLAYER, NDI_BLUE, NDI_UNIQUE, play_again(), player_set_state(), POWER, roll_stats(), send_query(), SET_ANIMATION, SET_FLAG, short_stat_name, player::socket, ST_CHANGE_CLASS, STRENGTH, player::swap_first, swap_stat(), and WISDOM.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ kill_player()

void kill_player ( object op,
const object killer 
)

Handle a player's death.

Also deals with lifesaving objects, arena deaths, cleaning disease/poison, death penalties, and removing the player file in case of permadeath.

Parameters
opPlayer to be killed.
killerThe object that's trying to kill op, which can be NULL.

Definition at line 3509 of file player.cpp.

References add_string(), arch_to_object(), player::braced, buf, object::contr, draw_ext_info, EVENT_DEATH, EVENT_PLAYER_DEATH, events_execute_global_event(), events_execute_object_event(), FLESH, living::food, living::hp, kill_player_not_permadeath(), kill_player_permadeath(), player::killer, object::level, object::map, object::material, object::materialname, MAX_BUF, MAX_FOOD, living::maxhp, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_DIED, object::name, NDI_NAVY, NDI_UNIQUE, Settings::not_permadeth, object_insert_in_map_at(), object_set_msg(), op_on_battleground(), play_sound_player_only(), restore_player(), save_life(), SCRIPT_FIX_ALL, settings, SOUND_TYPE_LIVING, starving(), object::stats, player::title, transfer_ob(), TRUE, object::type, object::value, object::x, and object::y.

Referenced by check_login(), deep_swamp_type_process(), kill_object(), and save_throw_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_add_probe_monster()

void knowledge_add_probe_monster ( object op,
object mon 
)

Display monster details, then add to a player's knowledge if not already.

Parameters
opplayer asking for details.
monmonster

Definition at line 1528 of file knowledge.cpp.

References buf, object::contr, describe_item(), draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, object::name, NDI_UNIQUE, stringbuffer_append_printf(), stringbuffer_finish(), and stringbuffer_new().

Referenced by examine_monster().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_first_player_save()

void knowledge_first_player_save ( player pl)

Ensure the knowledge state is correctly saved for the player.

This function should only be called once, when the player's save directory is created. All other knowledge functions save the state automatically, but save can only happen when the player directory exists.

Parameters
plwho to save the state for.

Definition at line 1423 of file knowledge.cpp.

References knowledge_global, knowledge_write_player_data(), object::name, knowledge_player::next, player::ob, and knowledge_player::player_name.

Referenced by save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_give()

void knowledge_give ( player pl,
const char *  marker,
const object book 
)

Give a knowledge item from its code.

Parameters
plwho to give the knowldge to.
markerknowledge's code.
bookoptional item containing the knowledge code.

Definition at line 996 of file knowledge.cpp.

References code, draw_ext_info_format(), fatal(), player::has_directory, knowledge_player::items, knowledge_find(), knowledge_get_or_create(), knowledge_write_player_data(), llevError, LOG(), MSG_TYPE_CLIENT_NOTICE, MSG_TYPE_MISC, object::name, NDI_UNIQUE, player::ob, OUT_OF_MEMORY, TAG_END, TAG_START, and is_valid_types_gen::type.

Referenced by cfapi_player_knowledge(), and knowledge_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_item_can_be_used_alchemy()

void knowledge_item_can_be_used_alchemy ( object op,
const object item 
)

Displays known alchemy recipes an item can be used in.

Parameters
opwho to display recipes for.
itemwhat to check formulae for.

Definition at line 1334 of file knowledge.cpp.

References buf, object::contr, draw_ext_info, knowledge_item::handler, knowledge_item::item, knowledge_player::item_count, knowledge_player::items, knowledge_get_or_create(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_EXAMINE, name, object::name, NDI_UNIQUE, PLAYER, stringbuffer_append_string(), stringbuffer_finish(), object::title, object::type, and knowledge_type::use_alchemy.

Referenced by examine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_player_knows()

int knowledge_player_knows ( const player pl,
const char *  knowledge 
)

Determines whether a player knows a specific knowledge or not.

Parameters
plwho to check knowledge for.
knowledgewhat to check for, in format "type:(type specific value)".
Returns
0 if item is known, 1 else.

Definition at line 1298 of file knowledge.cpp.

References knowledge_find(), knowledge_get_or_create(), knowledge_known(), llevError, LOG(), MAX_BUF, strlcpy(), and is_valid_types_gen::type.

Referenced by cfapi_player_knowledge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_process_incremental()

◆ knowledge_read()

void knowledge_read ( player pl,
object book 
)

Player is reading a book, give knowledge if needed, warn player, and such.

Parameters
plwho is reading.
bookwhat is read.

Definition at line 1056 of file knowledge.cpp.

References knowledge_give(), object_get_value(), and sstring.

Referenced by apply_sign(), and book_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_send_info()

void knowledge_send_info ( socket_struct ns)

Send the reply_info for 'knowledge_info'.

Parameters
nssocket to send information to.

Definition at line 1374 of file knowledge.cpp.

References knowledge_type::attempt_alchemy, esrv_send_face(), face(), socket_struct::faces_sent, knowledges, name, NS_FACESENT_FACE, Send_With_Handling(), SockList_AddPrintf(), SockList_AddString(), SockList_Init(), SockList_Term(), try_find_face(), is_valid_types_gen::type, and knowledge_type::type.

Referenced by request_info_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ knowledge_send_known()

void knowledge_send_known ( player pl)

Send initial known knowledge to player, if requested.

Parameters
plwho to send knowledge for.

Definition at line 1403 of file knowledge.cpp.

References knowledge_get_or_create(), socket_struct::notifications, knowledge_player::sent_up_to, and player::socket.

Referenced by check_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ learn_skill()

int learn_skill ( object pl,
object scroll 
)

Player is trying to learn a skill.

Success is based on Int.

This inserts the requested skill in the player's inventory. The skill field of the scroll should have the exact name of the requested skill.

This one actually teaches the player the skill as something they can equip.

Return values
0player already knows the skill.
1the player learns the skill.
2some failure.

Definition at line 759 of file skill_util.cpp.

References FLAG_CAN_USE_SKILL, FOR_INV_FINISH, FOR_INV_PREPARE, get_learn_spell(), give_skill_by_name(), living::Int, object::level, link_player_skills(), llevError, LOG(), object::name, unpaid_count::pl, PREFER_LOW, QUERY_FLAG, random_roll(), SET_FLAG, SKILL, object::skill, and object::stats.

Referenced by skillscroll_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leave()

◆ legacy_animate_trigger()

void legacy_animate_trigger ( object op)

Definition at line 871 of file time.cpp.

References animate_trigger().

Referenced by legacy_ob_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ legacy_move_hole()

void legacy_move_hole ( object op)

Definition at line 875 of file time.cpp.

References move_hole().

Referenced by legacy_ob_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ legacy_remove_force()

void legacy_remove_force ( object op)

Definition at line 867 of file time.cpp.

References remove_force().

Referenced by legacy_ob_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ legal_range()

int legal_range ( object op,
int  r 
)

Check for the validity of a player range.

This function could probably be simplified, eg, everything should index into the ranges[] array.

Parameters
opplayer to check.
rrange to check.
Return values
1range specified is legal - that is, the character has an item that is equipped for that range type.
0no item of that range type that is usable.

Definition at line 247 of file c_range.cpp.

References object::chosen_skill, object::contr, object::count, player::golem_count, range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, and player::ranges.

Referenced by check_login(), command_rotateshoottype(), and command_shoottype().

+ Here is the caller graph for this function:

◆ list_players()

void list_players ( object op,
region reg,
partylist party 
)

Displays the players in a region or party.

If both are NULL, all players are listed.

Parameters
opwho is asking for player list.
regregion to display players of.
partyparty to list.

Definition at line 550 of file c_misc.cpp.

References display_who_entry(), draw_ext_info, draw_ext_info_format(), find_player(), first_player, FLAG_AFK, FLAG_WIZ, get_region_by_map(), player::hidden, socket_struct::is_bot, chars_names::login_order, region::longname, object::map, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_WHO, region::name, object::name, name_cmp(), NDI_UNIQUE, player::next, num_players, player::ob, player::party, partylist::partyname, QUERY_FLAG, region_is_child_of_region(), settings, player::socket, ST_GET_PARTY_PASSWORD, ST_PLAYING, player::state, Settings::who_format, and Settings::who_wiz_format.

Referenced by command_party(), and command_who().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_races()

void load_races ( BufferReader reader,
const char *   
)

Reads the races file in the lib/ directory, then overwrites old 'race' entries.

This routine allow us to quickly re-configure the 'alignment' of monsters, objects. Useful for putting together lists of creatures, etc that belong to gods.

Definition at line 47 of file races.cpp.

References addToRace, buf, bufferreader_next_line(), llevDebug, LOG(), MAX_BUF, and variable.

Referenced by add_server_collect_hooks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookup_spell_by_name()

object* lookup_spell_by_name ( object op,
const char *  spname 
)

Look at object 'op' and see if they know the spell spname.

This is pretty close to check_spell_known above, but it uses a looser matching mechanism.

Parameters
opobject we're searching the inventory.
spnamepartial spell name.
Returns
matching spell object, or NULL. If we match multiple spells but don't get an exact match, we also return NULL.

Definition at line 410 of file spell_util.cpp.

References FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), and SPELL.

Referenced by command_cast_spell(), and command_forget_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ magic_wall()

int magic_wall ( object op,
object caster,
int  dir,
object spell_ob 
)

◆ make_visible()

void make_visible ( object op)

Makes an object visible again.

Parameters
opwhat to make visible.

Definition at line 3977 of file player.cpp.

References object::contr, FREE_AND_CLEAR_STR, object::hide, player::invis_race, object::invisible, object_update(), PLAYER, player::tmp_invis, object::type, and UP_OBJ_FACE.

Referenced by attack_ob_simple(), attempt_steal(), do_hidden_move(), fire(), handle_newcs_player(), hide(), monster_can_detect_enemy(), monster_can_see_enemy(), move_player_attack(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makes_invisible_to()

int makes_invisible_to ( object pl,
object mon 
)

This checks to see if 'pl' is invisible to 'mon'.

Does race check, undead check, etc Returns TRUE if mon can't see pl, false otherwise. This doesn't check range, walls, etc. It only checks the racial adjustments, and in fact that pl is invisible.

Parameters
plpotentially invisible object.
monwho may see pl.
Return values
0mon can see pl.
1mon can't see pl.

Definition at line 756 of file spell_effect.cpp.

References object::contr, FLAG_UNDEAD, player::invis_race, object::invisible, is_true_undead(), unpaid_count::pl, PLAYER, QUERY_FLAG, object::race, and object::type.

Referenced by cast_invisible(), and monster_can_see_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ map_can_reset()

bool map_can_reset ( const mapstruct map,
long  current_time 
)

Returns whether a map can be reset, including all other maps in the same reset group.

Parameters
mapmap to consider.
current_timecurrent time.
Returns
false if the map can't be reset, true if the map can be reset.

Definition at line 266 of file swap.cpp.

References first_map, map_can_reset_no_group(), mapstruct::next, and mapstruct::reset_group.

Referenced by flush_old_maps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ meditate()

void meditate ( object pl,
object skill 
)

Meditation skill handling.

This skill allows the player to regain a few sp or hp for a brief period of concentration. The amount of time needed to concentrate and the # of points regained is dependant on the level of the user.

Depending on the level, the player can wear armour or not.

Author
b.t. thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du
Parameters
pllivng meditating, should be a player.
skillmeditation skill.

Definition at line 1432 of file skills.cpp.

References ARMOUR, BOOTS, draw_ext_info, FLAG_APPLIED, FLAG_READY_WEAPON, FOR_INV_FINISH, FOR_INV_PREPARE, GLOVES, HELMET, living::hp, object::last_heal, object::last_sp, living::maxhp, living::maxsp, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, NDI_UNIQUE, unpaid_count::pl, PLAYER, QUERY_FLAG, SHIELD, skill, living::sp, object::stats, and object::type.

Referenced by do_skill().

+ Here is the caller graph for this function:

◆ min_casting_level()

int min_casting_level ( const object caster,
const object spell 
)

This function takes a caster and spell and presents the effective level the caster needs to be to cast the spell.

Basically, it just adjusts the spell->level with attuned/repelled spellpaths.

Parameters
casterperson casting the spell.
spellspell object.
Returns
adjusted level.

Definition at line 164 of file spell_util.cpp.

References MAX, object::path_attuned, object::path_denied, object::path_repelled, and spell.

Referenced by cast_spell(), SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), and SP_level_wc_adjust().

+ Here is the caller graph for this function:

◆ monster_can_detect_enemy()

int monster_can_detect_enemy ( object op,
object enemy,
rv_vector rv 
)

Determine if we can 'detect' the enemy.

Check for walls blocking the los. Also, just because its hidden/invisible, we may be sensitive/smart enough (based on Wis & Int) to figure out where the enemy is. -b.t.

Modified by MSW to use the get_rangevector so that map tiling works properly. I also so odd code in place that checked for x distance OR y distance being within some range - that seemed wrong - both should be within the valid range. MSW 2001-08-05

Parameters
opwho should detect.
enemywhat to detect.
rvif the function returns 1, contains the range vector towards enemy.
Returns
0 if enemy can not be detected, 1 if it is detected

Definition at line 2581 of file monster.cpp.

References bonus, object::contr, mapstruct::darkness, rv_vector::distance, draw_ext_info_format(), find_skill_by_number(), FLAG_SEE_IN_DARK, FLAG_STEALTH, FLAG_WIZ, get_rangevector(), player::hidden, object::hide, living::Int, object::invisible, is_true_undead(), object::level, llevError, LOG(), make_visible(), object::map, MAX, MAX_BUF, MIN_MON_RADIUS, monster_can_see_enemy(), monster_stand_in_light(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, name, object::name, NDI_UNIQUE, PLAYER, player_can_view(), QUERY_FLAG, query_name(), RANDOM, SK_HIDING, object::stats, player::tmp_invis, object::type, and living::Wis.

Referenced by attempt_steal(), get_nearest_criminal(), get_nearest_player(), monster_check_enemy(), and pets_get_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_can_see_enemy()

int monster_can_see_enemy ( object op,
object enemy 
)

Assuming no walls/barriers, lets check to see if its possible to see an enemy.

Note, "detection" is different from "seeing". See monster_can_detect_enemy() for more details. -b.t.

Parameters
opwho is trying to see enemy.
enemyvictim op is trying to see.
Returns
0 if can't be seen, 1 if can be

Definition at line 2758 of file monster.cpp.

References mapstruct::darkness, draw_ext_info, FLAG_ALIVE, FLAG_BLIND, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_XRAYS, has_carried_lights(), HEAD, object::hide, object::invisible, is_true_undead(), make_visible(), makes_invisible_to(), object::map, monster_stand_in_light(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, PLAYER, player_can_view(), QUERY_FLAG, and object::type.

Referenced by adj_attackroll(), attack_ob_simple(), monster_can_detect_enemy(), and pets_get_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_check_apply_all()

void monster_check_apply_all ( object monster)

Calls monster_check_apply() for all inventory objects.

Parameters
monsterthe monster to operate on

Definition at line 1999 of file monster.cpp.

References fix_object(), FOR_INV_FINISH, FOR_INV_PREPARE, monster, and monster_check_apply().

Referenced by apply_auto_fix(), command_create(), fix_summon_pet(), generate_monster_arch(), generate_monster_inv(), pets_summon_object(), and polymorph_living().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_check_doors()

void monster_check_doors ( object op,
mapstruct m,
int  x,
int  y 
)

Living creature attempts to open a door.

Parameters
opcreature to consider.
mmap to consider.
xcoordinate.
ycoordinate.

Definition at line 2278 of file monster.cpp.

References AT_PHYSICAL, living::dam, DOOR, FOR_MAP_FINISH, FOR_MAP_PREPARE, hit_player(), m, and object::stats.

Referenced by move_ob().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_check_earthwalls()

void monster_check_earthwalls ( object op,
mapstruct m,
int  x,
int  y 
)

Living creature attempts to hit an earthwall.

Parameters
opcreature to consider.
mmap to consider.
xcoordinate.
ycoordinate.

Definition at line 2262 of file monster.cpp.

References AT_PHYSICAL, living::dam, EARTHWALL, FOR_MAP_FINISH, FOR_MAP_PREPARE, hit_player(), m, and object::stats.

Referenced by move_ob().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_check_enemy()

object* monster_check_enemy ( object npc,
rv_vector rv 
)

Checks npc->enemy and returns that enemy if still valid, NULL otherwise.

This is map tile aware. If this returns an enemy, the range vector rv should also be set to sane values.

Parameters
npcmonster we're considering
[out]rvwill contain vector to go to enemy if function returns not NULL.
Returns
valid enemy for npc.

Definition at line 72 of file monster.cpp.

References object::attack_movement, object::enemy, FLAG_FREED, FLAG_FRIENDLY, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NEUTRAL, FLAG_REMOVED, GOLEM, HI4, monster_can_detect_enemy(), object_get_owner(), object_set_enemy(), object_value_set(), on_same_map(), PETMOVE, pets_should_arena_attack(), PLAYER, QUERY_FLAG, and object::type.

Referenced by monster_find_enemy(), and pets_get_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_communicate()

void monster_communicate ( object op,
const char *  txt 
)

This function looks for an object or creature that is listening to said text.

The process is such:

  • first, build up information on NPCs reacting to what is said, replies
  • second, figure what the player will be displayed as said
  • third, have the player actually talk
  • fourth, the NPCs talk too
  • fifth: show the player available replies

There is a rare event that the orig_map is used for - basically, if a player says the magic word that gets him teleported off the map, it can result in the new map putting the object count too high, which forces the swap out of some other map. In some cases, the map the player was just on now gets swapped out - thus, the object on that map are no longer in memory. So check to see if the players map changes, and if so, don't process any further. If it does change, most likely we don't care about the results of further conversation. Also, depending on the value of i, the conversation would continue on the new map, which probably isn't what is really wanted either.

Parameters
opwho is saying something.
txtwhat is said.

Definition at line 2374 of file monster.cpp.

References draw_ext_info, draw_ext_info_format(), ext_info_map_except(), FOR_MAP_FINISH, FOR_MAP_PREPARE, free_string(), freearr_x, freearr_y, get_map_flags(), get_reply_text_other(), get_reply_text_own(), llevDebug, LOG(), object::map, MAX_BUF, talk_info::message, talk_info::message_type, monster_do_say(), monster_talk_to_npc(), MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_SAY, object::name, NDI_WHITE, talk_info::npc_msg_count, talk_info::npc_msgs, P_OUT_OF_MAP, talk_info::replies, talk_info::replies_count, talk_info::replies_words, SIZEOFFREE2, talk_info::text, talk_info::who, object::x, and object::y.

Referenced by command_say().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_compute_path()

int monster_compute_path ( object source,
object target,
int  default_dir 
)

Computes a path from source to target.

Takes into account walls, other living things, and such. Only works if both items are on same map.

Computes the path from target to source, so that the last direction is the one we need.

Parameters
sourcewhat wants to move.
targettarget to go to.
default_dirgeneral direction from source to target.
Returns
direction to go into. Will be default_dir if no path found.
Todo:
cache path, smart adjustment and such things to not compute all the time ; try directions randomly.

Also, do a quick check to make sure our source monster is not completely sandwiched Do this before we malloc our distance array since we can check this without needing that array.

Does not do multitile right: I keep seeing two-tile monsters that can only go south not do so because of this code. So skip multitile monsters. – 2018-05-28

It is worth noting that the variables used here are also used later – their info here is irrelevant there, and vice versa. Neila Hawkins 2018-02-12

Definition at line 463 of file monster.cpp.

References absdir(), object::attack_movement, path_data::distance, estimate_distance(), fatal(), FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, freearr_x, freearr_y, GET_MAP_OB, mapstruct::height, path_data::heuristic_dist, living::Int, object::map, MAX_EXPLORE, minheap_init_static(), minheap_insert(), minheap_remove(), object::more, object::move_block, object::move_slow, object::move_slow_penalty, object::move_type, MOVE_WALK, path_data::movement_penalty, ob_blocked(), OUT_OF_MEMORY, OUT_OF_REAL_MAP, path_measure_func(), RANDOM, RUSH, object::stats, mapstruct::width, living::Wis, object::x, path_data::x, object::y, and path_data::y.

Referenced by monster_move(), and move_to().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_do_living()

void monster_do_living ( object op)

For a monster, regenerate hp and sp, potentially clear scared status.

Parameters
opmonster. Must have FLAG_MONSTER set.

Definition at line 719 of file monster.cpp.

References CLEAR_FLAG, living::Con, FABS, FLAG_MONSTER, FLAG_RUN_AWAY, FLAG_SCARED, living::hp, object::last_heal, object::last_sp, living::maxhp, living::maxsp, MIN, living::Pow, QUERY_FLAG, RANDOM, object::run_away, living::sp, object::speed, and object::stats.

Referenced by monster_move().

+ Here is the caller graph for this function:

◆ monster_do_say()

void monster_do_say ( const mapstruct map,
const char *  message 
)

Output a NPC message on a map.

Parameters
mapwhere to talk to.
messagewhat to say.

Definition at line 2292 of file monster.cpp.

References ext_info_map(), message, MSG_TYPE_DIALOG, MSG_TYPE_DIALOG_NPC, NDI_NAVY, and NDI_UNIQUE.

Referenced by monster_communicate(), and monster_npc_say().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_find_nearest_enemy()

object* monster_find_nearest_enemy ( object npc,
object owner 
)

Returns the nearest enemy (monster or generator) which is visible to npc.

Directions are randomized so if multiple monsters are at the same distance, the same won't always be selected. This function is map tile aware.

Parameters
npcmonster to consider
ownerif not NULL, then search will:
  • ignore peaceful players if owner is peaceful
  • ignore other monsters with the same owner
Returns
enemy, or NULL if none found.

Definition at line 175 of file monster.cpp.

References can_see_monsterP(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_search_arr(), is_enemy(), m, object::map, P_IS_ALIVE, P_OUT_OF_MAP, SIZEOFFREE, object::x, and object::y.

Referenced by monster_find_enemy(), and pets_get_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_find_throw_ob()

object* monster_find_throw_ob ( object op)

Find an item for the monster to throw.

Modeled on find_throw_ob(). This is probably overly simplistic as it is now - We want monsters to throw things like chairs and other pieces of furniture, even if they are not good throwable objects. Probably better to have the monster throw a throwable object first, then throw any non equipped weapon.

Parameters
opmonster to find an item to throw for.
Returns
item, NULL if none suitable.

Definition at line 2542 of file monster.cpp.

References FLAG_APPLIED, FLAG_IS_THROWN, FOR_INV_FINISH, FOR_INV_PREPARE, llevDebug, LOG(), MAX_BUF, object::name, QUERY_FLAG, and query_name().

Referenced by skill_throw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_move()

int monster_move ( object op)

Main monster processing routine.

Will regenerate spell points, hit points. Moves the monster, handle attack, item applying, pickup, ...

Parameters
opmonster to process.
Returns
1 if the object has been freed, otherwise 0.

Definition at line 854 of file monster.cpp.

References absdir(), add_refcount(), ALLRUN, animate_object(), object::animation, object::attack_movement, object::attacked_by, object::attacked_by_count, CLEAR_FLAG, object::count, mapstruct::darkness, object::direction, rv_vector::direction, DISTATT, DISTHIT, do_hidden_move(), object::enemy, FABS, object::face, object::facing, FLAG_BLIND, FLAG_CAST_SPELL, FLAG_CONFUSED, FLAG_FREED, FLAG_FRIENDLY, FLAG_NO_ATTACK, FLAG_ONLY_ATTACK, FLAG_PARALYZED, FLAG_READY_BOW, FLAG_READY_RANGE, FLAG_READY_SCROLL, FLAG_READY_SKILL, FLAG_REMOVED, FLAG_RUN_AWAY, FLAG_SCARED, FLAG_SEE_IN_DARK, FLAG_SEE_INVISIBLE, FLAG_SLEEP, FLAG_STAND_STILL, free_string(), get_nearest_player(), get_randomized_dir(), get_rangevector(), HI4, object::hide, HITRUN, llevDebug, llevMonster, LO4, LOG(), m, object::map, MIN_ACTIVE_SPEED, monster_apply_below(), monster_can_hit(), monster_cast_spell(), monster_check_pickup(), monster_check_wakeup(), monster_compute_path(), monster_dist_att(), monster_disthit_att(), monster_do_living(), monster_find_enemy(), monster_hitrun_att(), monster_move_no_enemy(), monster_move_randomly(), monster_run_att(), monster_use_bow(), monster_use_range(), monster_use_scroll(), monster_use_skill(), monster_wait_att(), monster_wait_att2(), move_object(), mapstruct::name, object::name, object_free_drop_inventory(), object_get_owner(), object_remove(), object_set_enemy(), on_same_map(), rv_vector::part, mapstruct::path, PETMOVE, pets_follow_owner(), object::pick_up, QUERY_FLAG, object::race, RANDOM, remove_friendly_object(), RUNATT, RUSH, skill_attack(), object::speed, object::stats, WAIT2, WAITATT, living::wc, object::will_apply, object::x, and object::y.

Referenced by process_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_npc_call_help()

void monster_npc_call_help ( object op)

A monster calls for help against its enemy.

Parameters
opmonster calling for help.

Definition at line 2012 of file monster.cpp.

References CLEAR_FLAG, object::enemy, FLAG_ALIVE, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), llevDebug, LOG(), m, object::map, object_get_value(), object_set_enemy(), P_IS_ALIVE, P_OUT_OF_MAP, QUERY_FLAG, object::x, and object::y.

Referenced by alchemy_failure_effect(), attack_ob_simple(), attempt_steal(), hit_player(), and push_ob().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_npc_say()

void monster_npc_say ( object npc,
const char *  cp 
)

Simple function to have some NPC say something.

Parameters
npcwho should say something.
cpwhat is being said.

Definition at line 2497 of file monster.cpp.

References buf, object::map, message, monster_do_say(), monster_format_say(), and stringbuffer_finish().

Referenced by cfapi_object_say(), and monster_find_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_stand_in_light()

int monster_stand_in_light ( object op)

Cache monster_stand_in_light_internal().

Definition at line 2736 of file monster.cpp.

References object::light_cached, object::light_cached_time, monster_stand_in_light_internal(), and pticks.

Referenced by adj_attackroll(), monster_can_detect_enemy(), monster_can_see_enemy(), and monster_check_wakeup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mood_change()

int mood_change ( object op,
object caster,
object spell 
)

◆ move_disease()

int move_disease ( object disease)

Ticks the clock for disease: infect, aggravate symptoms, ...

Parameters
diseasedisease to move. Can be removed during processing.
Return values
1if disease was removed.
0disease just moved.

Definition at line 180 of file disease.cpp.

References check_infection(), do_symptoms(), object::env, FLAG_WIZ, living::food, grant_immunity(), is_susceptible_to_disease(), living::maxhp, object_free_drop_inventory(), object_remove(), QUERY_FLAG, remove_symptoms(), object::stats, and object::value.

Referenced by legacy_ob_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_firewall()

void move_firewall ( object op)

Move for FIREWALL.

firewalls fire other spells. The direction of the wall is stored in op->direction. walls can have hp, so they can be torn down.

Parameters
opfirewall.

Definition at line 343 of file main.cpp.

References cast_spell(), object::direction, get_random_dir(), object::inv, llevError, LOG(), object::map, object::name, mapstruct::path, spell, object::x, and object::y.

Referenced by legacy_ob_process(), and trigger_connected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_ob()

int move_ob ( object op,
int  dir,
object originator 
)

Op is trying to move in direction dir.

Parameters
opwhat is moving.
dirwhat direction op wants to move.
originatortypically the same as op, but can be different if originator is causing op to move (originator is pushing op).
Return values
0op is not able to move to the desired space.
1op was moved.

Definition at line 58 of file move.cpp.

References blocked_link(), object::contr, object::count, object::direction, esrv_map_scroll(), FLAG_ALIVE, FLAG_WIZPASS, FOR_INV_FINISH, FOR_INV_PREPARE, freearr_x, freearr_y, get_map_flags(), object::hide, socket_struct::look_position, m, object::map, monster_check_doors(), monster_check_earthwalls(), object::more, object::move_type, MOVE_WALK, object_insert_in_map_at(), object_remove(), object_was_destroyed, P_OUT_OF_MAP, play_sound_map(), PLAYER, QUERY_FLAG, player::socket, SOUND_TYPE_GROUND, TRANSPORT, object::type, socket_struct::update_look, object::weight, object::will_apply, WILL_APPLY_DOOR, WILL_APPLY_EARTHWALL, object::x, and object::y.

Referenced by cfapi_object_move(), eventListener(), flee_player(), move_object(), move_player_attack(), move_to(), pets_move(), pets_move_golem(), and recursive_roll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_object()

int move_object ( object op,
int  dir 
)

Try to move op in the direction "dir".

Parameters
opwhat to move.
dirmoving direction.
Return values
0something blocks the passage.
1op was moved..

Definition at line 39 of file move.cpp.

References move_ob().

Referenced by check_spell_knockback(), monster_circ1_move(), monster_circ2_move(), monster_move(), monster_move_randomly(), monster_pace2_moveh(), monster_pace2_movev(), monster_pace_moveh(), monster_pace_movev(), monster_rand_move(), move_player_mover(), and push_ob().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_player()

int move_player ( object op,
int  dir 
)

Move player in the given direction.

Can be called by a client through a movement command, or by the server for some other reasons.

Parameters
opplayer.
dirdirection to move/fire.
Returns
0.

Definition at line 2965 of file player.cpp.

References animate_object(), check_pick(), object::contr, object::direction, do_hidden_move(), object::facing, fire(), player::fire_on, FLAG_CONFUSED, get_randomized_dir(), object::hide, mapstruct::in_memory, llevError, LOG(), object::map, MAP_IN_MEMORY, move_player_attack(), QUERY_FLAG, player::run_on, object::speed_left, object::state, player::transport, and turn_transport().

Referenced by cfapi_object_move(), command_fire(), command_run(), handle_newcs_player(), move_internal(), move_player_mover(), move_towards(), and pray_at_altar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_player_attack()

void move_player_attack ( object op,
int  dir 
)

The player is also actually going to try and move (not fire weapons).

This function is just part of a breakup from move_player(). It should keep the code cleaner. When this is called, the players direction has been updated (taking into account confusion).

Parameters
opplayer moving.
dirmoving direction.

Definition at line 2640 of file player.cpp.

References action_makes_visible(), player::braced, object::contr, DOOR, draw_ext_info, object::enemy, FLAG_ALIVE, FLAG_CAN_ROLL, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_from_coord(), GET_MAP_OB, player::has_hit, HEAD, object::hide, living::hp, LOCKED_DOOR, living::luck, m, make_visible(), object::map, move_ob(), MSG_TYPE_ATTACK, MSG_TYPE_ATTACK_NOATTACK, object_get_owner(), op_on_battleground(), out_of_map(), OUT_OF_REAL_MAP, player::party, player::peaceful, play_sound_map(), PLAYER, player_attack_door(), player_map_change_common(), push_ob(), QUERY_FLAG, recursive_roll(), skill_attack(), SOUND_TYPE_LIVING, object::speed_left, object::stats, player::tmp_invis, player::transport, object::type, object::weapon_speed_left, object::x, and object::y.

Referenced by move_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_player_mover()

void move_player_mover ( object op)

This function takes a PLAYERMOVER as an argument, and performs the function of a player mover, which is:

a player mover finds any players that are sitting on it. It moves them in the op->stats.sp direction. speed is how often it'll move.

  • If attacktype is nonzero it will paralyze the player. If lifesave is set,
  • it'll dissapear after hp+1 moves. If hp is set and attacktype is set,
  • it'll paralyze the victim for hp*his speed/op->speed
Parameters
opmover.

Definition at line 707 of file time.cpp.

References object::attacktype, object::env, FABS, FLAG_ALIVE, FLAG_LIFESAVE, FLAG_WIZPASS, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_random_dir(), HEAD, living::hp, object::level, llevError, LOG(), m, object::map, living::maxsp, move_object(), move_player(), object::move_type, object_free_drop_inventory(), object_remove(), object_update_speed(), P_OUT_OF_MAP, mapstruct::path, PLAYER, PLAYERMOVER, QUERY_FLAG, should_director_abort(), living::sp, object::speed, object::speed_left, object::stats, object::x, and object::y.

Referenced by legacy_ob_process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_symptom()

void move_symptom ( object symptom)

◆ move_to()

int move_to ( object op,
int  x,
int  y 
)

Move an object one square toward a specified destination on the same map.

The move takes into account blocked squares for op, and things like that. No check is done to know if the object has enough speed to move.

Parameters
opobject to move
x
ydestination coordinates
Returns
0 if op is on the specified spot, 1 if it moved towards the goal, 2 if it didn't find any path to the goal.

Definition at line 563 of file move.cpp.

References animate_object(), object::animation, object::direction, object::facing, get_map_flags(), GET_MAP_OB, object::map, monster_compute_path(), move_ob(), P_OUT_OF_MAP, object::x, and object::y.

Referenced by cfapi_object_transfer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newhash()

char const* newhash ( char const *  password)

Definition at line 101 of file server.cpp.

References crypt_string().

Referenced by account_change_password(), account_new(), create_player_cmd(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ object_teleport()

int object_teleport ( object op,
mapstruct map,
int  x,
int  y 
)

Move the specified object in a free spot around the map's x & y.

Parameters
opobject to move, may be REMOVED or not.
mapmap to move op to.
xcoordinate to move op to.
ycoordinate to move op to.
Returns
1 if op was moved, 0 else.

Definition at line 597 of file move.cpp.

References object::contr, FLAG_REMOVED, map_newmap_cmd(), object_find_first_free_spot(), object_insert_in_map_at(), object_remove(), out_of_map(), PLAYER, player_update_bg_music(), QUERY_FLAG, player::socket, and object::type.

Referenced by add_npc_to_point(), add_npc_to_zone(), and cfapi_object_teleport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ok_to_put_more()

int ok_to_put_more ( mapstruct m,
int16_t  x,
int16_t  y,
object op,
uint32_t  immune_stop 
)

Returns true if it is ok to put spell op on the space/may provided.

Parameters
m
x
ycoordinates to test.
opspell to test for.
immune_stopbasically the attacktype of the spell (why passed as a different value, not sure of). If immune_stop has the AT_MAGIC bit set, and there is a counterwall on the space, the object doesn't get placed. if immune_stop does not have AT_MAGIC, then counterwalls do not effect the spell.
Returns
1 if we can add op, 0 else.

Definition at line 530 of file spell_util.cpp.

References ARROW, AT_COUNTERSPELL, AT_MAGIC, BOW, FLAG_MONSTER, FOR_MAP_FINISH, FOR_MAP_PREPARE, get_map_flags(), GET_MAP_MOVE_BLOCK, GOLEM, m, living::maxhp, OB_SPELL_TAG_MATCH, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, Statistics::spell_suppressions, SPELL_TAG_SIZE, object::spell_tags, statistics, object::stats, object::subtype, object::type, and WEAPON.

Referenced by explosion(), and move_cone().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ op_on_battleground()

int op_on_battleground ( object op,
int *  x,
int *  y,
archetype **  trophy 
)

Check if the given object (usually a player) is standing on a battleground tile.

This is used to handle deaths and special attacks in arenas.

A battleground tile must have the following attributes set:

  • name "battleground"
  • type 58 (BATTLEGROUND)
  • is_floor 1 (must be the first tile beneath the player's feet)
  • no_pick 1
  • sp / hp > 0 (non-zero exit coordinates)

If the tile has 'slaying', 'maxhp', and 'maxsp' set, and the player has a matching marker, send the player to those coordinates instead.

If the tile has 'other_arch' set, then create that archetype as the trophy instead of the default ("finger").

Parameters
opObject to check (usually a player).
[out]x
[out]yIf not NULL and standing on a battleground tile, store exit coordinates.
[out]trophyIf not NULL and standing on a battleground tile, store a pointer to the archetype that can be collected by the winner.
Returns
TRUE if op is on a battleground, FALSE if not.

Definition at line 4262 of file player.cpp.

References BATTLEGROUND, EXIT_ALT_X, EXIT_ALT_Y, EXIT_PATH, EXIT_X, EXIT_Y, find_archetype(), FLAG_IS_FLOOR, FLAG_NO_PICK, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FORCE, object_find_by_type_and_slaying(), and QUERY_FLAG.

Referenced by hit_player(), hit_with_drain(), hit_with_one_attacktype(), infect_object(), kill_object(), kill_player(), move_player_attack(), pets_should_arena_attack(), and spell_find_dir().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ paralyze_living()

void paralyze_living ( object op,
int  dam 
)

Paralyze a living thing.

Parameters
opvictim.
damdamage to deal.

Definition at line 2402 of file attack.cpp.

References ATNR_PARALYZE, draw_ext_info, FABS, FLAG_PARALYZED, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START, NDI_UNIQUE, PLAYER, QUERY_FLAG, object::resist, SET_FLAG, object::speed, object::speed_left, and object::type.

Referenced by hit_with_one_attacktype(), prayer_failure(), scroll_failure(), and spell_failure().

+ Here is the caller graph for this function:

◆ party_confirm_password()

int party_confirm_password ( const partylist party,
const char *  password 
)

Checks whether a given password matches the party's password.

Parameters
partythe party to check
passwordthe password to check for
Returns
whether the password matches

Definition at line 259 of file party.cpp.

References partylist::passwd.

Referenced by check_login(), and confirm_party_password().

+ Here is the caller graph for this function:

◆ party_find()

partylist* party_find ( const char *  partyname)

Find a party by name.

Parameters
partynamethe party's name to find
Returns
the party or NULL if no such party exists

Definition at line 148 of file party.cpp.

References firstparty, partylist::next, and partylist::partyname.

Referenced by check_login(), command_party(), confirm_party_password(), and party_form().

+ Here is the caller graph for this function:

◆ party_form()

partylist* party_form ( object op,
const char *  partyname 
)

Forms the party struct for a party called 'partyname'.

it is the responsibility of the caller to ensure that the name is unique. New item is placed on the party list.

Parameters
opparty creator.
partynamethe party name.
Returns
new party or NULL if the name is not unique.

Definition at line 40 of file party.cpp.

References buf, object::contr, draw_ext_info_format(), firstparty, lastparty, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, partylist::next, player::party, party_find(), party_leave(), partylist::partyleader, partylist::partyname, partylist::passwd, replace_unprintable_chars(), strdup_local, and strlcpy().

Referenced by check_login(), and command_party().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ party_get_first()

partylist* party_get_first ( void  )

Returns the first party from the list of all parties.

Returns
the first party or NULL if no party exists

Definition at line 196 of file party.cpp.

References firstparty.

Referenced by cfapi_party_get_property(), cfapi_system_get_party_vector(), and command_party().

+ Here is the caller graph for this function:

◆ party_get_leader()

const char* party_get_leader ( const partylist party)

Returns the name of the party's leader.

Parameters
partythe party to query
Returns
the leader's name

Definition at line 292 of file party.cpp.

References partylist::partyleader.

Referenced by command_party().

+ Here is the caller graph for this function:

◆ party_get_next()

partylist* party_get_next ( const partylist party)

Returns the next party from the list of all parties.

Parameters
partythe party to use
Returns
the next party or NULL if party is the last one in list

Definition at line 208 of file party.cpp.

References partylist::next.

Referenced by cfapi_party_get_property(), cfapi_system_get_party_vector(), and command_party().

+ Here is the caller graph for this function:

◆ party_get_password()

const char* party_get_password ( const partylist party)

Returns the party's password.

Parameters
partythe party to query
Returns
the password or an empty string if the party has no password

Definition at line 232 of file party.cpp.

References partylist::passwd.

Referenced by cfapi_party_get_property(), command_party(), get_party_password(), and save_player().

+ Here is the caller graph for this function:

◆ party_join()

void party_join ( object op,
partylist party 
)

Makes a player join a party.

Leaves the former party if necessary. Does nothing if the player already is a member of the party.

Parameters
opthe player
partythe party to join

Definition at line 85 of file party.cpp.

References buf, object::contr, draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, player::party, party_leave(), party_send_message(), and partylist::partyname.

Referenced by cfapi_object_set_property(), check_login(), command_party(), and receive_party_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ party_leave()

void party_leave ( object op)

Makes a player leave his party.

Does nothing if the player is not member of a party.

Parameters
opthe player

Definition at line 123 of file party.cpp.

References buf, object::contr, draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, player::party, party_send_message(), partylist::partyname, and remove_if_unused().

Referenced by apply_savebed(), command_party(), key_confirm_quit(), kill_player_permadeath(), leave(), party_form(), and party_join().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ party_obsolete_parties()

void party_obsolete_parties ( void  )

Remove unused parties (no players).

Definition at line 215 of file party.cpp.

References firstparty, partylist::next, and remove_if_unused().

Referenced by do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ party_remove()

void party_remove ( partylist party)

Removes and frees a party.

Removes all members from the party.

Parameters
partythe party to remove

Definition at line 164 of file party.cpp.

References first_player, firstparty, lastparty, llevError, LOG(), partylist::next, player::next, player::party, partylist::partyleader, and partylist::partyname.

Referenced by remove_if_unused().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ party_send_message()

void party_send_message ( object op,
const char *  message 
)

Send a message to all party members except the speaker.

Parameters
opplayer talking.
messagemessage to send.
Todo:
should be moved to player.c?

Definition at line 274 of file party.cpp.

References object::contr, draw_ext_info, first_player, message, MSG_TYPE_COMMUNICATION, MSG_TYPE_COMMUNICATION_PARTY, NDI_WHITE, and player::next.

Referenced by command_party(), party_join(), and party_leave().

+ Here is the caller graph for this function:

◆ party_set_password()

void party_set_password ( partylist party,
const char *  password 
)

Sets a party's password.

Parameters
partythe party to change
passwordthe new password to set

Definition at line 244 of file party.cpp.

References partylist::passwd, replace_unprintable_chars(), and strlcpy().

Referenced by check_login(), and command_party().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ path_to_player()

int path_to_player ( object mon,
object pl,
unsigned  mindiff 
)

Returns the direction to the player, if valid.

Returns 0 otherwise.

Modified to verify there is a path to the player. Does this by stepping towards player and if path is blocked then see if blockage is close enough to player that direction to player is changed (ie zig or zag). Continue zig zag until either reach player or path is blocked. Thus, will only return true if there is a free path to player. Though path may not be a straight line. Note that it will find player hiding along a corridor at right angles to the corridor with the monster.

Modified by MSW 2001-08-06 to handle tiled maps. Various notes:

  • With DETOUR_AMOUNT being 2, it should still go and find players hiding down corridors.
  • I think the old code was broken if the first direction the monster should move was blocked - the code would store the first direction without verifying that the player can actually move in that direction. The new code does not store anything in firstdir until we have verified that the monster can in fact move one space in that direction.
  • I'm not sure how good this code will be for moving multipart monsters, since only simple checks to blocked are being called, which could mean the monster is blocking itself.
Parameters
monsource object.
pltarget.
mindiffminimal distance mon and pl should have.
Returns
direction from mon to pl, 0 if can't get there.

Definition at line 659 of file player.cpp.

References absdir(), blocked_link(), DETOUR_AMOUNT, rv_vector::direction, rv_vector::distance, rv_vector::distance_x, rv_vector::distance_y, FABS, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, get_rangevector(), get_rangevector_from_mapcoord(), m, object::map, MAX, MAX_SPACES, MOVE_ALL, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, object::x, and object::y.

Referenced by monster_cast_spell(), monster_use_range(), monster_use_scroll(), and monster_use_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ perceive_self()

◆ pets_attempt_follow()

void pets_attempt_follow ( object for_owner,
int  force 
)

Check pets so they try to follow their master around the world.

Parameters
for_ownerif NULL, check all pets, else only pets for this owner.
forceif non zero, then forcibly move the pet close to its owner. If zero then only check pets if they are not on the same map, as computed by on_same_map(), as their owner.

Definition at line 249 of file pets.cpp.

References FABS, FLAG_FRIENDLY, FLAG_REMOVED, free_objectlink(), get_friends_of(), list, llevMonster, LOG(), MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_get_owner(), on_same_map(), pets_follow_owner(), PLAYER, QUERY_FLAG, and remove_friendly_object().

Referenced by enter_map(), swap_map(), teleport(), and transfer_ob().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_control_golem()

void pets_control_golem ( object op,
int  dir 
)

Makes the golem go in specified direction.

This is a really stupid function when you get down and look at it. Keep it here for the time being - makes life easier if we ever decide to do more interesting thing with controlled golems.

Parameters
opgolem.
dirdesired direction.
Todo:
trash.

Definition at line 630 of file pets.cpp.

References object::direction.

Referenced by animate_weapon(), and fire().

+ Here is the caller graph for this function:

◆ pets_follow_owner()

void pets_follow_owner ( object ob,
object owner 
)

A pet is trying to follow its owner.

Parameters
obpet trying to follow. Will be object_remove()'d if can't follow.
ownerowner of ob.

Definition at line 284 of file pets.cpp.

References draw_ext_info, FLAG_REMOVED, freearr_x, freearr_y, mapstruct::in_memory, llevError, llevMonster, LOG(), object::map, MAP_IN_MEMORY, MSG_TYPE_SPELL, MSG_TYPE_SPELL_PET, object::name, NDI_UNIQUE, object_find_free_spot(), object_insert_in_map_at(), object_remove(), PLAYER, QUERY_FLAG, SIZEOFFREE, object::type, object::x, and object::y.

Referenced by monster_move(), pets_attempt_follow(), and pets_move().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_get_enemy()

object* pets_get_enemy ( object pet,
rv_vector rv 
)

Given that 'pet' is a friendly object, this function returns a monster the pet should attack, NULL if nothing appropriate is found.

it basically looks for nasty things around the owner of the pet to attack. This is now tilemap aware.

Parameters
petwho is seeking an enemy.
[out]rvwill contain the path to the enemy.
Returns
enemy, or NULL if nothing suitable.

Definition at line 54 of file pets.cpp.

References object::attack_movement, object::attacked_by, object::attacked_by_count, CLEAR_FLAG, object::contr, object::count, FLAG_ALIVE, FLAG_CONFUSED, FLAG_FRIENDLY, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), get_rangevector(), get_search_arr(), HEAD, object::map, monster_can_detect_enemy(), monster_can_see_enemy(), monster_check_enemy(), monster_find_nearest_enemy(), object_get_owner(), object_set_enemy(), on_same_map(), P_IS_ALIVE, P_OUT_OF_MAP, pet_defend, pet_sad, player::petmode, PETMOVE, pets_should_arena_attack(), PLAYER, QUERY_FLAG, remove_friendly_object(), SIZEOFFREE, object::type, object::x, and object::y.

Referenced by monster_find_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_move()

◆ pets_move_golem()

void pets_move_golem ( object op)

◆ pets_should_arena_attack()

int pets_should_arena_attack ( object pet,
object owner,
object target 
)

Determines if checks so pets don't attack players or other pets should be overruled by the arena petmode.

Parameters
petpet considered.
ownerpet's owner.
targetpotential pet target.
Return values
0pet shouldn't attack target.
1target is a suitable victim for the pet.

Definition at line 1086 of file pets.cpp.

References object::contr, get_real_owner(), llevError, LOG(), op_on_battleground(), player::party, pet_arena, player::petmode, PLAYER, and object::type.

Referenced by monster_check_enemy(), and pets_get_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_summon_golem()

int pets_summon_golem ( object op,
object caster,
int  dir,
object spob 
)

Summons a monster.

Parameters
opwho is summoning.
casterobject casting the spell.
dirdirection to place the monster.
spobspell object casting. At this stage, all spob is really used for is to adjust some values in the monster.
Return values
0failed to summon something.
1summoned correctly something.

Definition at line 651 of file pets.cpp.

References add_friendly_object(), add_string(), AT_PHYSICAL, object::attack_movement, object::attacktype, buf, caster_level(), archetype::clone, object::contr, object::count, living::dam, determine_god(), determine_holy_arch(), object::direction, draw_ext_info, draw_ext_info_format(), object::duration, living::exp, FABS, find_god(), fix_summon_pet(), FLAG_FRIENDLY, FLAG_MONSTER, FREE_AND_CLEAR_STR, free_string(), freearr_x, freearr_y, GOLEM, player::golem_count, living::hp, llevError, LOG(), object::map, MAX, MAX_BUF, living::maxgrace, living::maxhp, MIN, object::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_PET, object::name, NDI_UNIQUE, ob_blocked(), object_find_free_spot(), object_free_drop_inventory(), object_get_owner(), object_insert_in_map_at(), object_remove(), object_set_owner(), object::other_arch, PETMOVE, PLAYER, QUERY_FLAG, object::race, range_golem, player::ranges, object::resist, SET_FLAG, set_spell_skill(), player::shoottype, SIZEOFFREE1, object::slaying, living::sp, SP_level_dam_adjust(), SP_level_duration_adjust(), SP_level_range_adjust(), SP_level_wc_adjust(), object::speed, object::speed_left, object::stats, object::type, living::wc, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_summon_object()

int pets_summon_object ( object op,
object caster,
object spell_ob,
int  dir,
const char *  stringarg 
)

General purpose summoning function.

Parameters
opwho is summoning.
casterwhat object did cast the summoning spell.
spell_obactual spell object for summoning.
dirdirection to summon in.
stringargadditional parameters.
Return values
0nothing was summoned.
1something was summoned.

Definition at line 872 of file pets.cpp.

References absdir(), add_friendly_object(), object::arch, arch_to_object(), object::attack_movement, caster_level(), choose_cult_monster(), CLEAR_FLAG, archetype::clone, create_treasure(), living::dam, determine_god(), die_roll(), object::direction, draw_ext_info, draw_ext_info_format(), object::enemy, find_god(), FLAG_FRIENDLY, FLAG_MONSTER, FLAG_SLEEP, freearr_x, freearr_y, freedir, GT_STARTEQUIP, treasure::item, treasurelist::items, object::level, level, llevError, LOG(), object::map, mark_inventory_as_no_drop(), MIN_ACTIVE_SPEED, monster_check_apply_all(), object::more, archetype::more, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, treasurelist::name, object::name, archetype::name, NDI_UNIQUE, treasure::next, treasure::nrof, ob_blocked(), object_find_free_spot(), object_get_owner(), object_insert_in_map_at(), object_set_enemy(), object_set_owner(), object::other_arch, PLAYER, PREFER_HIGH, QUERY_FLAG, object::race, RANDOM, random_roll(), object::randomitems, SET_FLAG, set_spell_skill(), SIZEOFFREE, SP_level_dam_adjust(), object::stats, object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pets_terminate_all()

void pets_terminate_all ( object owner)

Removes all pets someone owns.

Parameters
ownerplayer we wish to remove all pets of.

Definition at line 225 of file pets.cpp.

References FLAG_REMOVED, free_objectlink(), get_friends_of(), objectlink::next, objectlink::ob, object_free_drop_inventory(), object_remove(), QUERY_FLAG, and remove_friendly_object().

Referenced by apply_savebed(), command_kill_pets(), key_confirm_quit(), leave(), and save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pick_lock()

int pick_lock ( object pl,
int  dir,
object skill 
)

Lock pick handling.

Implementation by bt. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du) monster implementation 7-7-95 by bt.

Parameters
plplayer picking the lock.
dirdirection to pick.
skilllock picking skill.
Returns
experience for picking a lock, 0 if nothing was picked.

Definition at line 391 of file skills.cpp.

References object::above, attempt_pick_lock(), calc_skill_exp(), DOOR, draw_ext_info, EVENT_TRIGGER, events_execute_object_event(), object::facing, freearr_x, freearr_y, GET_MAP_OB, isqrt(), LOCKED_DOOR, object::map, object::move_block, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OUT_OF_REAL_MAP, unpaid_count::pl, SCRIPT_FIX_ALL, skill, object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pick_up()

void pick_up ( object op,
object alt 
)

Try to pick up an item.

Parameters
opobject trying to pick up.
altoptional object op is trying to pick. If NULL, try to pick first item under op.

Definition at line 519 of file c_object.cpp.

References object::below, CONTAINER, object::container, object::contr, player::count, draw_ext_info, draw_ext_info_format(), object::env, FLAG_APPLIED, FLAG_STARTEQUIP, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, INS_NO_MERGE, object::inv, llevDebug, LOG(), object::map, MIMIC, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, object::name, NDI_UNIQUE, object::nrof, object_can_pick(), object_insert_in_map(), pick_up_object(), PLAYER, QUERY_FLAG, object::race, sack_can_hold(), stop_item(), and object::type.

Referenced by attempt_steal(), cast_create_missile(), cfapi_object_pickup(), check_pick(), command_take(), and esrv_move_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ play_again()

◆ player_arrest()

int player_arrest ( object who)

Put a player into jail, taking into account cursed exits and player's region.

Parameters
whoplayer to put in jail
Return values
0player was moved to jail.
-1no jail found.
-2couldn't move to jail (map loading error, or already at jail's position).
-3op isn't a player.

Definition at line 789 of file c_wiz.cpp.

References enter_exit(), FREE_OBJ_NO_DESTROY_CALLBACK, get_jail_exit(), object::map, object_free(), PLAYER, object::type, object::x, and object::y.

Referenced by attack_ob_simple(), cfapi_object_move(), and command_arrest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_can_find()

bool player_can_find ( object op,
object ob 
)

Return true if player 'op' can see object 'op' for purpose of locating items for partial item matching or searching by tag.

Definition at line 590 of file item.cpp.

References FLAG_WIZ, object::invisible, and QUERY_FLAG.

Referenced by find_best_apply_object_match(), and ob_if_can_find().

+ Here is the caller graph for this function:

◆ player_can_view()

int player_can_view ( object pl,
object op 
)

Check the player los field for viewability of the object op.

This function works fine for monsters, but we dont worry if the object isnt the top one in a pile (say a coin under a table would return "viewable" by this routine). Another question, should we be concerned with the direction the player is looking in? Realistically, most of use cant see stuff behind our backs...on the other hand, does the "facing" direction imply the way your head, or body is facing? Its possible for them to differ. Sigh, this fctn could get a bit more complex. -b.t.

This function is now map tiling safe.

Parameters
plplayer that may see op.
opwhat may be seen by pl.
Return values
-1pl isn't a player
0pl can't see op.
1pl can see op.

Definition at line 4163 of file player.cpp.

References object::arch, player::blocked_los, archetype::clone, object::contr, rv_vector::distance_x, rv_vector::distance_y, FABS, get_rangevector(), HEAD, llevError, LOG(), socket_struct::mapx, socket_struct::mapy, object::more, PLAYER, player::socket, object::type, object::x, and object::y.

Referenced by adj_attackroll(), monster_can_detect_enemy(), and monster_can_see_enemy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_get_delayed_buffer()

SockList* player_get_delayed_buffer ( player pl)

Get a delayed socket buffer, that will be sent after the player's tick is complete.

Will fatal() if memory error.

Parameters
plplayer to get a buffer for.
Returns
buffer, never NULL.

Definition at line 4501 of file player.cpp.

References player::delayed_buffers, player::delayed_buffers_allocated, player::delayed_buffers_used, fatal(), llevError, LOG(), object::name, player::ob, OUT_OF_MEMORY, SockList_Init(), and UINT8_MAX.

Referenced by draw_ext_info(), and quest_set_state().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ player_set_state()

void player_set_state ( player pl,
uint8_t  state 
)

Set the player's state to the specified one.

Parameters
plwho to set state for.
statenew state.

Definition at line 4488 of file player.cpp.

References ST_CHANGE_PASSWORD_CONFIRM, and player::state.

Referenced by add_player(), check_login(), command_delete(), command_passwd(), confirm_password(), create_player_cmd(), get_name(), get_party_password(), get_password(), get_player(), key_change_class(), key_confirm_quit(), key_roll_stat(), play_again(), receive_party_password(), receive_play_again(), and receive_player_password().

+ Here is the caller graph for this function:

◆ player_unready_range_ob()

void player_unready_range_ob ( player pl,
object ob 
)

Unready an object for a player.

This function does nothing if the object was not readied.

Parameters
plplayer.
obobject to unready.

Definition at line 4470 of file player.cpp.

References range_none, range_size, player::ranges, and player::shoottype.

Referenced by become_follower(), do_forget_spell(), and remove_special_prayers().

+ Here is the caller graph for this function:

◆ playername_ok()

int playername_ok ( const char *  cp)

Is the player name valid.

Parameters
cpname to test.
Returns
0 if invalid, 1 if valid.

Definition at line 257 of file player.cpp.

Referenced by check_name(), and create_player_cmd().

+ Here is the caller graph for this function:

◆ players_on_map()

int players_on_map ( mapstruct m,
int  show_all 
)

Returns the count of players on a map, calculated from player list.

Parameters
mmap we want the count of players on.
show_allif true, show everyone. If not, don't show hidden players (dms)
Returns
player count.
Todo:
this doesn't take into account transports. Should be removed when mapstruct::players is valid.

Definition at line 234 of file swap.cpp.

References first_player, FLAG_REMOVED, m, object::map, object::next, unpaid_count::pl, and QUERY_FLAG.

Referenced by flush_old_maps().

+ Here is the caller graph for this function:

◆ plugins_display_list()

void plugins_display_list ( object op)

Displays a list of loaded plugins (keystrings and description) in the game log window.

Parameters
opwho to display the list to.

Definition at line 479 of file plugins.cpp.

References draw_ext_info, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and plugins_list.

Referenced by command_listplugins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plugins_init_plugin()

int plugins_init_plugin ( const char *  libfile)

Try to load the specified plugin.

Update plugins_list if successful. Log errors at llevError.

Parameters
libfilefull path to the plugin.
Returns
-1 if an error occurred, 0 if the plugin was loaded.

Definition at line 373 of file plugins.cpp.

References cfapi_get_hooks(), crossfire_plugin::closefunc, events_register_object_handler(), crossfire_plugin::fullname, crossfire_plugin::global_registration, crossfire_plugin::id, Settings::ignore_plugin_compatibility, crossfire_plugin::libptr, LIBPTRTYPE, llevError, LOG(), NR_EVENTS, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, plugins_list, crossfire_plugin::propfunc, settings, and SVN_REV.

Referenced by command_loadplugin(), and initPlugins().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ plugins_remove_plugin()

int plugins_remove_plugin ( const char *  id)

Unload the specified plugin.

No logging is done in case of error. Updates plugins_list.

Parameters
idplugin internal identifier.
Returns
0 if the plugin was unloaded, -1 if no such plugin.

Definition at line 454 of file plugins.cpp.

References crossfire_plugin::closefunc, events_unregister_global_handler(), events_unregister_object_handler(), crossfire_plugin::global_registration, crossfire_plugin::id, crossfire_plugin::libptr, NR_EVENTS, plugin, plugins_dlclose, and plugins_list.

Referenced by command_unloadplugin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ polymorph()

void polymorph ( object op,
object who,
int  level 
)

Handles polymorphing an object, living or not.

Will avoid some specific items (flying arrows and such).

Parameters
opobject being polymorphed.
whospell caster.
levelspell level.

Definition at line 371 of file spell_effect.cpp.

References object::arch, FABS, FLAG_ALIVE, FLAG_ANIMATE, FLAG_GENERATOR, FLAG_MONSTER, FLAG_NO_PICK, level, object::move_block, PLAYER, polymorph_item(), polymorph_living(), polymorph_melt(), QUERY_FLAG, rndm(), object::speed, TREASURE, and object::type.

Referenced by cast_polymorph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pray()

int pray ( object pl,
object skill 
)

Praying skill handling.

When this skill is called from do_skill(), it allows the player to regain lost grace points at a faster rate. -b.t.

This always returns 0 - return value is used by calling function such that if it returns true, player gets exp in that skill. This the effect here can be done on demand, we probably don't want to give infinite exp by returning true in any cases.

Parameters
plobject praying, should be a player.
skillpraying skill.
Returns
0.

Definition at line 1384 of file skills.cpp.

References buf, draw_ext_info, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, living::grace, HOLY_ALTAR, object::last_grace, MAX_BUF, living::maxgrace, MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_BLACK, unpaid_count::pl, PLAYER, pray_at_altar(), skill, object::stats, and object::type.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pray_at_altar()

void pray_at_altar ( object pl,
object altar,
object skill 
)

Player prays at altar.

Checks for god changing, divine intervention, and so on.

Parameters
plplayer praying.
altaraltar player's praying on. Doesn't need to be consecrated.
skillpraying skill.

Definition at line 258 of file gods.cpp.

References absdir(), become_follower(), bonus, cast_magic_storm(), archetype::clone, create_archetype(), determine_god(), draw_ext_info, draw_ext_info_format(), EVENT_APPLY, events_execute_object_event(), object::facing, find_god(), god_intervention(), living::grace, object::level, LOOSE_MANA, living::luck, MAX, living::maxgrace, move_player(), MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, object::name, archetype::name, NDI_NAVY, NDI_UNIQUE, object::other_arch, PREFER_LOW, random_roll(), SCRIPT_FIX_ALL, skill, object::stats, try_leave_cult(), and living::Wis.

Referenced by pray().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ probe()

int probe ( object op,
object caster,
object spell_ob,
int  dir,
int  level 
)

Try to get information about a living thing.

Parameters
opwho is casting.
casterwhat is casting.
spell_obspell object being cast.
dircast direction.
levelprobe level.
Return values
0nothing probed.
1something was probed.

Definition at line 699 of file spell_effect.cpp.

References CAN_PROBE(), draw_ext_info, examine_monster(), FLAG_WIZCAST, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, level, m, object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, P_IS_ALIVE, P_NO_MAGIC, P_OUT_OF_MAP, QUERY_FLAG, object::range, SP_level_range_adjust(), object::x, and object::y.

Referenced by cast_spell(), check_probe(), and examine_monster().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_events()

◆ process_object()

◆ push_ob()

int push_ob ( object who,
int  dir,
object pusher 
)

Something is pushing some other object.

Parameters
whoobject being pushed.
dirpushing direction.
pusherwhat is pushing who.
Return values
1if pushing invokes a attack
0no attack during pushing.
Todo:
fix return value which is weird for last case.

Definition at line 434 of file move.cpp.

References CLEAR_FLAG, object::contr, draw_ext_info_format(), esrv_map_scroll(), FLAG_FRIENDLY, FLAG_NEUTRAL, FLAG_SLEEP, FLAG_STAND_STILL, FLAG_UNAGGRESSIVE, FLAG_WIZ, freearr_x, freearr_y, HEAD, object::level, socket_struct::look_position, m, object::map, monster_npc_call_help(), object::more, move_object(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_VICTIM, MSG_TYPE_VICTIM_WAS_PUSHED, object::name, NDI_UNIQUE, object_get_owner(), object_insert_in_map_at(), object_remove(), object_set_enemy(), player::party, PLAYER, PREFER_HIGH, QUERY_FLAG, random_roll(), player::run_on, player::socket, object::stats, living::Str, object::type, socket_struct::update_look, object::x, and object::y.

Referenced by move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ put_object_in_sack()

void put_object_in_sack ( object op,
object sack,
object tmp,
uint32_t  nrof 
)

Something tries to put an object into another.

This function was part of drop(), now is own function.

Note
the 'sack' in question can now be a transport, so this function isn't named very good anymore.
Parameters
opwho is moving the item.
sackwhere to put the object.
tmpwhat to put into sack.
nrofif non zero, then nrof objects is tried to put into sack, else everything is put.

Definition at line 937 of file c_object.cpp.

References AP_NO_MERGE, AP_UNAPPLY, apply_special(), CLEAR_FLAG, CONTAINER, object::container, object::contr, draw_ext_info, draw_ext_info_format(), object::env, esrv_update_item(), fix_object(), FLAG_APPLIED, FLAG_NO_FIX_PLAYER, FLAG_STARTEQUIP, FOR_INV_FINISH, FOR_INV_PREPARE, object::inv, object::map, MAX_BUF, object::move_off, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, object::nrof, object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_split(), PLAYER, QUERY_FLAG, query_name(), sack_can_hold(), set_object_face_main(), object::slaying, player::socket, TRANSPORT, transport_can_hold(), object::type, UPD_WEIGHT, socket_struct::update_look, object::x, and object::y.

Referenced by drop(), esrv_move_object(), and knowledge_alchemy_attempt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_first_player_save()

void quest_first_player_save ( player pl)

Ensure the quest state is correctly saved for a player.

This function should only be called once, when the player's save directory is created. All other quest functions save the state automatically, but save can only happen when the player directory exists.

Parameters
plwho to save quests for.

Definition at line 967 of file quest.cpp.

References get_quest(), quest_write_player_data(), and quest_player::quests.

Referenced by save_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_get_player_state()

int quest_get_player_state ( player pl,
sstring  quest_code 
)

Get the quest state for a player.

Parameters
plplayer.
quest_codeinternal quest code.
Returns
QC_COMPLETED if finished and quest can't be replayed, 0 if not started or finished and can be replayed, else quest-specific value.

Definition at line 660 of file quest.cpp.

References get_or_create_quest(), get_state(), QC_CAN_RESTART, quest_find_by_code(), quest_definition::quest_restart, and quest_state::state.

Referenced by cfapi_player_quest(), do_update(), and evaluate_quest_conditions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_load_definitions()

void quest_load_definitions ( void  )

◆ quest_send_initial_states()

◆ quest_set_player_state()

void quest_set_player_state ( player pl,
sstring  quest_code,
int  state 
)

Set the state of a quest for a player.

Parameters
plplayer to set the state for.
quest_codequest internal code.
statenew state for the quest, must be greater than 0 else forced to 100 and a warning is emitted.

Definition at line 716 of file quest.cpp.

References quest_set_state().

Referenced by cfapi_player_quest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_start()

void quest_start ( player pl,
sstring  quest_code,
int  state 
)

Start a quest for a player.

Will notify the player.

Parameters
plplayer.
quest_codeinternal quest code.
stateinitial quest state, must be greater than 0 else forced to 100 and warning emitted.

Definition at line 680 of file quest.cpp.

References draw_ext_info_format(), get_or_create_quest(), get_or_create_state(), llevDebug, llevError, LOG(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_QUESTS, object::name, NDI_DELAYED, NDI_UNIQUE, player::ob, quest_find_by_code(), quest_set_state(), quest_definition::quest_title, and quest_state::state.

Referenced by cfapi_player_quest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ quest_was_completed()

int quest_was_completed ( player pl,
sstring  quest_code 
)

Check if a quest was completed once for a player, without taking account the current state.

Parameters
plwho to check for.
quest_codequest internal code.
Returns
1 if the quest was already completed at least once, 0 else.

Definition at line 726 of file quest.cpp.

References get_or_create_quest(), get_state(), and quest_state::was_completed.

Referenced by cfapi_player_quest(), and evaluate_quest_conditions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ races_get_random_monster()

object* races_get_random_monster ( const char *  race,
int  level 
)

Get a random monster of specified race and level at most the specified one.

Parameters
racerace, must not be NULL. If invalid, then logs as an error.
levelmaximum number, included.
Returns
random monster, NULL if none available for the level.

Definition at line 22 of file races.cpp.

References it, level, llevError, LOG(), races, and rndm().

Referenced by choose_cult_monster().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_map_log()

void read_map_log ( void  )

Reads temporary maps information from disk.

Will LOG() in case of error.

Definition at line 71 of file swap.cpp.

References buf, mapstruct::darkness, mapstruct::difficulty, get_linked_map(), mapstruct::in_memory, llevDebug, Settings::localdir, LOG(), MAP_MAXRESET, MAP_SWAPPED, MAX_BUF, mapstruct::path, mapstruct::reset_time, safe_strncpy, seconds(), settings, split_string(), strdup_local, mapstruct::timeout, and mapstruct::tmpname.

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_party_password()

void receive_party_password ( object op,
const char *  password 
)

Player entered a party password.

Parameters
opplayer.
passwordparty password.

Definition at line 53 of file c_party.cpp.

References confirm_party_password(), object::contr, draw_ext_info, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, NDI_UNIQUE, party_join(), player::party_to_join, player_set_state(), and ST_PLAYING.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_play_again()

void receive_play_again ( object op,
char  key 
)

◆ receive_player_name()

void receive_player_name ( object op,
const char *  name 
)

A player just entered her name.

Perhaps these should be in player.c, but that file is already a bit big.

Parameters
opplayer we're getting the name of.
namename the player entered.

Definition at line 1935 of file c_misc.cpp.

References check_name(), object::contr, draw_ext_info, FREE_AND_COPY, get_name(), get_password(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, name, object::name, player::name_changed, object::name_pl, and NDI_UNIQUE.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ receive_player_password()

void receive_player_password ( object op,
const char *  password 
)

A player just entered her password, including for changing it.

Parameters
opplayer.
passwordpassword used.

Definition at line 1955 of file c_misc.cpp.

References check_login(), check_password(), checkbanned(), object::contr, CS_QUERY_HIDEINPUT, display_motd(), draw_ext_info, get_name(), socket_struct::host, i18n(), llevInfo, LOG(), MSG_SUBTYPE_NONE, MSG_TYPE_COMMAND, object::name, NDI_RED, NDI_UNIQUE, player::new_password, newhash(), player::password, player_set_state(), roll_again(), safe_strncpy, send_query(), player::socket, ST_CHANGE_PASSWORD_CONFIRM, ST_CHANGE_PASSWORD_NEW, ST_CHANGE_PASSWORD_OLD, ST_CONFIRM_PASSWORD, ST_PLAYING, ST_ROLL_STAT, and player::state.

Referenced by reply_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recharge()

int recharge ( object op,
object caster,
object spell_ob 
)

Recharge wands.

Parameters
opwho is casting.
casterwhat is casting.
spell_obspell object.
Return values
0nothing happened.
1wand was recharged, or destroyed.

Definition at line 84 of file spell_effect.cpp.

References object::arch, archetype::clone, create_archetype(), living::dam, draw_ext_info, draw_ext_info_format(), find_marked_object(), FLAG_ANIMATE, living::food, living::hp, object::inv, object::level, object::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, name, NDI_UNIQUE, object_free(), object_insert_in_map_at(), object_remove(), object_update_speed(), play_sound_map(), PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SOUND_TYPE_ITEM, SP_level_dam_adjust(), object::speed, object::stats, object::type, WAND, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ recursive_roll()

void recursive_roll ( object op,
int  dir,
object pusher 
)

An object is pushed by another which is trying to take its place.

Parameters
opwhat is being pushed.
dirpushing direction.
pusherwhat is pushing op.

Definition at line 293 of file move.cpp.

References draw_ext_info_format(), MAX_BUF, move_ob(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, name, NDI_BLACK, NDI_UNIQUE, query_name(), and roll_ob().

Referenced by move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reflwall()

int reflwall ( mapstruct m,
int  x,
int  y,
object sp_op 
)

Decides weither the (spell-)object sp_op will be reflected from the given mapsquare.

Returns 1 if true.

(Note that for living creatures there is a small chance that reflect_spell fails.)

Caller should be sure it passes us valid map coordinates eg, updated for tiled maps.

Parameters
m
x
yposition of the object to test.
sp_opspell object to test.
Returns
1 if reflected, 0 else.

Definition at line 470 of file spell_util.cpp.

References FLAG_ALIVE, FLAG_REFL_SPELL, FOR_MAP_FINISH, FOR_MAP_PREPARE, object::level, m, OUT_OF_REAL_MAP, QUERY_FLAG, and rndm().

Referenced by move_bolt(), and move_bullet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ regenerate_rod()

void regenerate_rod ( object rod)

Regenerates a rod's charges.

Parameters
rodrod to regenerate.

Definition at line 761 of file spell_util.cpp.

References living::hp, living::maxhp, and object::stats.

Referenced by legacy_ob_process().

+ Here is the caller graph for this function:

◆ register_all_ob_types()

void register_all_ob_types ( void  )

Calls the intialization functions for all individual types.

Todo:
this should probably be moved to a file in the types/ directory, to separate types and server.

Definition at line 31 of file ob_types.cpp.

References init_type_altar(), init_type_armour_improver(), init_type_arrow(), init_type_blindness(), init_type_book(), init_type_button(), init_type_cf_handle(), init_type_check_inv(), init_type_clock(), init_type_container(), init_type_converter(), init_type_creator(), init_type_deep_swamp(), init_type_detector(), init_type_director(), init_type_dragon_focus(), init_type_duplicator(), init_type_exit(), init_type_food(), init_type_gate(), init_type_hole(), init_type_identify_altar(), init_type_lamp(), init_type_lightable(), init_type_lighter(), init_type_marker(), init_type_mimic(), init_type_mood_floor(), init_type_peacemaker(), init_type_pedestal(), init_type_player_changer(), init_type_player_mover(), init_type_poison(), init_type_poisoning(), init_type_potion(), init_type_power_crystal(), init_type_rune(), init_type_savebed(), init_type_scroll(), init_type_shop_inventory(), init_type_shop_mat(), init_type_sign(), init_type_skillscroll(), init_type_spell_effect(), init_type_spellbook(), init_type_spinner(), init_type_teleporter(), init_type_thrown_object(), init_type_transport(), init_type_trap(), init_type_trapdoor(), init_type_treasure(), init_type_trigger(), init_type_trigger_altar(), init_type_trigger_button(), init_type_trigger_pedestal(), and init_type_weapon_improver().

Referenced by init_ob_methods().

+ Here is the caller graph for this function:

◆ remove_curse()

int remove_curse ( object op,
object caster,
object spell 
)

This function removes the cursed/damned status on equipped items.

Parameters
opwho is casting.
casterwhat is casting.
spellactual spell object.
Returns
how many items were affected.
Todo:
why is the value set to 0?

Definition at line 2406 of file spell_effect.cpp.

References caster_level(), CLEAR_FLAG, draw_ext_info, esrv_update_item(), FLAG_APPLIED, FLAG_CURSED, FLAG_DAMNED, FLAG_KNOWN_CURSED, FOR_INV_FINISH, FOR_INV_PREPARE, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, NDI_UNIQUE, PLAYER, QUERY_FLAG, spell, object::type, and UPD_FLAGS.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_door()

void remove_door ( object op)

Remove non locked doors.

The functions check to see if similar doors are next to the one that is being removed, and if so, set it so those will be removed shortly (in a cascade like fashion.)

See also
remove_locked_door().
Parameters
opdoor to remove.

Definition at line 38 of file time.cpp.

References arch_to_object(), DOOR, freearr_x, freearr_y, object::level, object::map, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), object::other_arch, object::speed, object::speed_left, object::x, and object::y.

Referenced by attempt_pick_lock(), legacy_ob_process(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_locked_door()

void remove_locked_door ( object op)

Same as remove_door() but for locked doors.

Parameters
opdoor to remove.

Definition at line 64 of file time.cpp.

References arch_to_object(), freearr_x, freearr_y, object::level, LOCKED_DOOR, object::map, map_find_by_type(), object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), object_update_speed(), object::other_arch, object::slaying, object::speed, object::speed_left, object::x, and object::y.

Referenced by legacy_ob_process(), and player_attack_door().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_trap()

int remove_trap ( object op,
object skill 
)

This skill will disarm any previously discovered trap.

the algorithm is based (almost totally) on the old command_disarm() - b.t.

Parameters
opplayer disarming. Must be on a map.
skilldisarming skill.
Returns
experience gained to disarm.

Definition at line 1311 of file skills.cpp.

References calc_skill_exp(), FLAG_MONSTER, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), m, object::map, object_get_owner(), P_OUT_OF_MAP, PLAYER, QUERY_FLAG, RUNE, skill, TRAP, trap_disarm(), trap_show(), object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_unpaid_objects()

void remove_unpaid_objects ( object op,
object env,
int  free_items 
)

This goes throws the inventory and removes unpaid objects, and puts them back in the map (location and map determined by values of env) or frees them.

This function will descend into containers.

Parameters
opobject to start the search from.
envtop-level container, should be in a map if free_items is 0, unused if free_items is 1.
free_itemsif set, unpaid items are freed, else they are inserted in the same map as env.

Definition at line 3224 of file player.cpp.

References env, FLAG_UNPAID, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, object::inv, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), and QUERY_FLAG.

Referenced by check_login(), execute_word_of_recall(), and kill_player_not_permadeath().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rod_adjust()

void rod_adjust ( object rod)

Adjusts rod attributes.

This function must be called after a new rod has been created.

Parameters
rodthe rod to update

Definition at line 390 of file main.cpp.

References living::hp, object::inv, object::level, MAX, living::maxhp, SP_level_spellpoint_cost(), SPELL_HIGHEST, object::stats, and object::value.

Referenced by fix_generated_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_again()

void roll_again ( object op)

Ask the player what to do with the statistics.

Parameters
opplayer.

Definition at line 1149 of file player.cpp.

References object::contr, CS_QUERY_SINGLECHAR, esrv_new_player(), i18n(), send_query(), and player::socket.

Referenced by add_player(), and receive_player_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roll_stat()

int roll_stat ( void  )

This rolls four 1-6 rolls and sums the best 3 of the 4.

Returns
sum of rolls.

Definition at line 1046 of file player.cpp.

References RANDOM.

Referenced by roll_stats().

+ Here is the caller graph for this function:

◆ roll_stats()

void roll_stats ( object op)

Roll the initial player's statistics.

Parameters
opplayer to roll for.

Definition at line 1070 of file player.cpp.

References living::ac, living::Cha, living::Con, object::contr, living::Dex, living::exp, fix_object(), living::grace, living::hp, living::Int, object::level, player::levgrace, player::levhp, player::levsp, living::maxgrace, living::maxhp, living::maxsp, player::orig_stats, living::Pow, roll_stat(), Settings::roll_stat_points, settings, living::sp, object::stats, living::Str, and living::Wis.

Referenced by get_player(), and key_roll_stat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sack_can_hold()

int sack_can_hold ( const object pl,
const object sack,
const object op,
uint32_t  nrof 
)

Check if an item op can be put into a sack.

If pl exists then tell a player the reason of failure.

Parameters
plplayer.
sackcontainer to try to put into.
opwhat to put in the sack.
nrofnumber of objects (op) we want to put in. We specify it separately instead of using op->nrof because often times, a player may have specified a certain number of objects to drop, so we can pass that number, and not need to use split_ob() and stuff.
Returns
1 if it will fit, 0 if it will not.

Definition at line 317 of file c_object.cpp.

References object::carrying, CONTAINER, draw_ext_info_format(), FLAG_APPLIED, living::food, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, name, NDI_UNIQUE, QUERY_FLAG, query_name(), object::race, object::slaying, SPECIAL_KEY, object::stats, living::Str, object::type, object::weight, and object::weight_limit.

Referenced by esrv_move_object(), pick_up(), and put_object_in_sack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_player()

int save_player ( object op,
int  flag 
)

Saves a player to disk.

Parameters
opplayer to save.
flagif is set, it's only backup, ie dont remove objects from inventory. If BACKUP_SAVE_AT_HOME is set, and the flag is set, then the player will be saved at the emergency save location.
Returns
non zero if successful.

Definition at line 230 of file login.cpp.

References account_char_add(), account_char_save(), socket_struct::account_chars, account_get_account_for_char(), account_link(), socket_struct::account_name, player::bed_x, player::bed_y, player::bowtype, living::Cha, checksum(), CLEAR_FLAG, living::Con, object::contr, copy_file(), destroy_object(), living::Dex, player::digestion, draw_ext_info, draw_ext_info_format(), Settings::emergency_mapname, esrv_send_inventory(), living::exp, FLAG_NO_FIX_PLAYER, FLAG_WIZ, player::gen_grace, player::gen_hp, player::gen_sp, player::has_directory, i18n_get_language_code(), living::Int, object::inv, key_inventory, keyrings, knowledge_first_player_save(), player::language, player::last_skill_ob, object::level, player::levgrace, player::levhp, player::levsp, player::listening, llevDebug, llevError, Settings::localdir, LOG(), make_path_to_file(), object::map, MAX_BUF, MAX_SKILLS, MIN, player::mode, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_LOADSAVE, object::name, player::name_changed, NDI_ALL_DMS, NDI_RED, NDI_UNIQUE, player::no_shout, player::ob, of_close(), of_open(), player::orig_stats, player::partial_commands, player::party, party_get_password(), partylist::partyname, player::password, mapstruct::path, player::peaceful, player::petmode, pets_terminate_all(), PLAYER, player_get_own_title(), player_has_own_title(), Settings::playerdir, living::Pow, PROFILE_BEGIN, PROFILE_END, QUERY_FLAG, quest_first_player_save(), range_none, player::rejoin_party, SAVE_ERROR_OK, SAVE_FLAG_NO_REMOVE, SAVE_FLAG_SAVE_UNPAID, SAVE_MODE, save_object(), player::savebed_map, SET_FLAG, Settings::set_title, settings, player::shoottype, player::socket, ST_GET_PARTY_PASSWORD, ST_PLAYING, player::state, object::stats, living::Str, tempnam_secure(), player::ticks_played, Settings::tmpdir, TRUE, object::type, player::unapply, unapply_never, unapply_nochoice, player::unarmed_skill, player::usekeys, living::Wis, object::x, and object::y.

Referenced by account_play_cmd(), apply_savebed(), check_login(), command_save(), do_server(), drop_object(), emergency_save(), enter_exit(), kill_player_not_permadeath(), kill_player_permadeath(), player_changer_type_process(), process_players1(), and save_and_kick_all_players().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_throw_object()

void save_throw_object ( object op,
uint32_t  type,
object originator 
)

◆ scroll_failure()

void scroll_failure ( object op,
int  failure,
int  power 
)

op made some mistake with a scroll, this takes care of punishment.

scroll_failure()- hacked directly from spell_failure

If settings.spell_failure_effects is FALSE, the only nasty things that can happen are weird spell cast, or mana drain.

Parameters
opwho failed.
failurewhat kind of nasty things happen.
powerthe higher the value, the worse the thing that happens.

Definition at line 1601 of file apply.cpp.

References blind_living(), cast_magic_storm(), cast_wonder(), confuse_living(), create_archetype(), draw_ext_info, FREE_OBJ_NO_DESTROY_CALLBACK, LOOSE_MANA, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, NDI_UNIQUE, object_free(), paralyze_living(), PREFER_LOW, random_roll(), settings, living::sp, Settings::spell_failure_effects, SPELL_WONDER, object::stats, and TRUE.

Referenced by scroll_type_apply(), and spellbook_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_delayed_buffers()

void send_delayed_buffers ( player pl)

Send all delayed buffers for a player.

Parameters
plplayer to send buffers for.

Definition at line 4530 of file player.cpp.

References buf, player::delayed_buffers, player::delayed_buffers_used, Send_With_Handling(), and player::socket.

Referenced by process_players2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_news()

void send_news ( const object op)

Send the news to a player.

Parameters
opplayer to send to.

Definition at line 206 of file player.cpp.

References buf, Settings::confdir, draw_ext_info_format(), HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, NDI_GREEN, NDI_UNIQUE, news, Settings::news, safe_strcat(), safe_strncpy, settings, and strip_endline().

Referenced by add_player(), and command_news().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_rules()

void send_rules ( const object op)

Send the rules to a player.

Parameters
opplayer to send rules to.

Definition at line 170 of file player.cpp.

References buf, Settings::confdir, draw_ext_info, HUGE_BUF, llevDebug, LOG(), MAX_BUF, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_RULES, NDI_GREEN, NDI_UNIQUE, Settings::rules, safe_strcat(), and settings.

Referenced by add_player(), and command_rules().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ server_main()

void server_main ( int  argc,
char *  argv[] 
)

Server main function.

Parameters
argclength of argv.
argvcommand-line options.

Definition at line 1579 of file server.cpp.

References bRunning, cftimer_process_timers(), check_active_maps(), do_server(), do_specials(), EVENT_CLOCK, events_execute_global_event(), init, initPlugins(), llevInfo, LOG(), nroferrors, process_events(), PROFILE_BEGIN, PROFILE_END, tick_game_time(), TRUE, and update_players().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_darkness_map()

void set_darkness_map ( mapstruct m)

Set the darkness level for a map, based on the time of the day.

Parameters
mmap to alter.

Definition at line 371 of file main.cpp.

References change_map_light(), get_tod(), timeofday_t::hour, HOURS_PER_DAY, m, timeofday_t::season, and season_timechange.

Referenced by generate_random_map(), and ready_map_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_first_map()

void set_first_map ( object op)

This loads the first map an puts the player on it.

Parameters
opplayer to put on map.

Definition at line 402 of file player.cpp.

References object::contr, enter_player_maplevel(), first_map_path, player::maplevel, object::x, and object::y.

Referenced by add_player(), and receive_play_again().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_map_timeout()

void set_map_timeout ( mapstruct oldmap)

Enable swapping for the given map.

Called when all players leave a map, because maps with players are marked as ineligible for swap.

Parameters
oldmapmap to process.

Definition at line 304 of file main.cpp.

References MAP_MINTIMEOUT, and mapstruct::timeout.

Referenced by flush_old_maps(), place_exits(), and player_map_change_common().

+ Here is the caller graph for this function:

◆ set_object_face_main()

int set_object_face_main ( object op)

Makes an object's face the main face, which is supposed to be the "closed" one.

Sets an object's face to the 'face' in the archetype. Meant for showing containers opening and closing.

Parameters
opObject to set face on
Returns
TRUE if face changed

Definition at line 146 of file apply.cpp.

References object::arch, archetype::clone, object::face, FALSE, object::more, object_get_value(), sstring, TRUE, and try_find_face().

Referenced by apply_container(), and put_object_in_sack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_player_socket()

void set_player_socket ( player p,
socket_struct ns 
)

This copies the data from the socket into the player structure.

Originally written to separate this logic from add_player() so new character method could use it, but that did not work out, but still a good thing to have this separate.

Parameters
pThe target player object to copy the data into
nsthe socket structure to copy.

Definition at line 421 of file player.cpp.

References account_char_free(), socket_struct::account_chars, socket_struct::account_name, socket_struct::faces_sent, fatal(), socket_struct::host, socket_struct::inbuf, OUT_OF_MEMORY, player::socket, SockList_ResetRead(), and strdup_local.

Referenced by account_play_cmd(), and add_player().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_spell_skill()

void set_spell_skill ( object op,
object caster,
object spob,
object dest 
)

Utility function to assign the correct skill when casting.

Relatively simple function that gets used a lot. Basically, it sets up the skill pointer for the spell being cast. If op is really casting the spell, then the skill is whatever skill the spell requires. if instead caster (rod, horn, wand, etc) is casting the skill, then they get exp for the skill that you need to use for that object (use magic device).

Parameters
opobject casting the spell.
casterobject used to cast the spell (rod, wand, ...).
spobspell object.
destobject to set the skill for.

Definition at line 94 of file spell_util.cpp.

References add_refcount(), FREE_AND_CLEAR_STR, and object::skill.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_smite_spell(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_swarm(), magic_wall(), mood_change(), pets_summon_golem(), pets_summon_object(), and write_rune().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ should_director_abort()

int should_director_abort ( const object op,
const object victim 
)

Check if op should abort moving victim because of it's race or slaying.

Parameters
opdetector or equivalent we're testing. Note that its type is not checked.
victimobject trying to move on op.
Returns
1 if it should abort, 0 if it should continue.

Definition at line 68 of file apply.cpp.

References object::arch, DOOR, object::name, archetype::name, object::race, object::slaying, object::subtype, and object::type.

Referenced by director_type_move_on(), move_player_mover(), and player_mover_type_move_on().

+ Here is the caller graph for this function:

◆ show_skills()

void show_skills ( object op,
const char *  parms 
)

Displays a player's skill list, and some other non skill related info (god, max weapon improvements, item power).

This shows the amount of exp they have in the skills.

Note this function is a bit more complicated because we we want ot sort the skills before printing them. If we just dumped this as we found it, this would be a bit simpler.

Parameters
opplayer wanting to examine skills.
parmsoptional parameters, usually a string to restrict skills to show.

Definition at line 860 of file skill_util.cpp.

References clipped_percent(), object::contr, determine_god(), digits_in_long(), draw_ext_info, draw_ext_info_format(), living::exp, exp_level(), object::expmul, FMT64, FOR_INV_FINISH, FOR_INV_PREPARE, player::item_power, object::level, level_exp(), MAX_BUF, MAX_SKILLS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_LIST, NDI_RED, NDI_UNIQUE, PERM_EXP, Settings::permanent_exp_ratio, settings, SKILL, skills, and object::stats.

Referenced by command_skills().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shuffle_attack()

void shuffle_attack ( object op)

This routine shuffles the attack of op to one of the ones in the list.

It does this at random. It also chooses a face appropriate to the attack that is being committed by that square at the moment.

It's being used by color spray and create pool of chaos.

Note
This could really be a better implementation - the faces and attacktypes above are hardcoded, which is never good. The faces refer to faces in the animation sequence. Not sure how to do better - but not having it hardcoded would be nice.
Parameters
opobject to change.

Definition at line 1033 of file spell_util.cpp.

References AT_MAGIC, ATTACKS, Chaos_Attacks::attacktype, object::attacktype, face(), rndm(), and SET_ANIMATION.

Referenced by hit_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singing()

int singing ( object pl,
int  dir,
object skill 
)

Singing skill handling.

This skill allows the player to pacify nearby creatures. There are few limitations on who/what kind of non-player creatures that may be pacified. Right now, a player may pacify creatures which have Int == 0. In this routine, once successfully pacified the creature gets Int=1. Thus, a player may only pacify a creature once. BTW, I appologize for the naming of the skill, I couldnt think of anything better! -b.t.

Parameters
plplayer singing.
dirdirection to sing in.
skillsinging skill object.
Returns
experience gained for singing.

Definition at line 1149 of file skills.cpp.

References calc_skill_exp(), living::Cha, chance(), draw_ext_info_format(), FLAG_FRIENDLY, FLAG_HITBACK, FLAG_MONSTER, FLAG_NO_STEAL, FLAG_SPLITTING, FLAG_UNAGGRESSIVE, FLAG_UNDEAD, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), HEAD, living::Int, object::level, m, object::map, MAX_BUF, MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, name, NDI_UNIQUE, object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, unpaid_count::pl, PLAYER, PREFER_HIGH, QUERY_FLAG, query_name(), random_roll(), SET_FLAG, SIZEOFFREE, skill, object::stats, object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_attack()

void skill_attack ( object tmp,
object pl,
int  dir,
const char *  string,
object skill 
)

Core routine for use when we attack using a skills system.

In essence, this code handles all skill-based attacks, ie hth, missile and melee weapons should be treated here. If an opponent is already supplied by move_player(), we move right onto do_skill_attack(), otherwise we find if an appropriate opponent exists.

This is called by move_player() and attack_hth()

Initial implementation by -bt thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du

Parameters
tmpvictim. Can be NULL.
plwho is attacking.
dirdirection to attack.
stringdescribes the damage ("claw", "punch", ...).
skillattack skill.

Definition at line 1270 of file skill_util.cpp.

References object::contr, do_skill_attack(), draw_ext_info, object::facing, FLAG_ALIVE, FLAG_CAN_ROLL, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, LOCKED_DOOR, m, object::map, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, NDI_UNIQUE, OB_TYPE_MOVE_BLOCK, P_IS_ALIVE, P_OUT_OF_MAP, player::party, unpaid_count::pl, PLAYER, QUERY_FLAG, skill, object::type, object::x, and object::y.

Referenced by attack_hth(), attack_melee_weapon(), attempt_jump(), monster_move(), and move_player_attack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_ident()

int skill_ident ( object pl,
object skill 
)

Main identification skill handling.

Parameters
plplayer identifying.
skillidentification skill.
Returns
experience gained for identification.

Definition at line 927 of file skills.cpp.

References do_skill_detect_curse(), do_skill_detect_magic(), do_skill_ident(), draw_ext_info, draw_ext_info_format(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, llevError, LOG(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_SUCCESS, NDI_UNIQUE, OBJECT_TYPE_MAX, unpaid_count::pl, PLAYER, SK_DET_CURSE, SK_DET_MAGIC, skill, and object::type.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ skill_throw()

int skill_throw ( object op,
object part,
int  dir,
object skill 
)

Throwing skill handling.

Parameters
opobject throwing.
partactual part of op throwing.
dirdirection to throw into.
skillthrowing skill.
Return values
0skill use failed.
1skill was successfully used.

Definition at line 2277 of file skills.cpp.

References do_throw(), find_string(), find_throw_ob(), monster_find_throw_ob(), PLAYER, skill, and object::type.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slow_living_by()

int slow_living_by ( object op,
const int  speed_penalty 
)

Definition at line 2231 of file attack.cpp.

References arch_present_in_ob(), arch_to_object(), living::exp, find_archetype(), fix_object(), FLAG_APPLIED, living::food, object_insert_in_ob(), SET_FLAG, object::speed_left, and object::stats.

Referenced by eat_common(), and slow_living().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_dam_adjust()

int SP_level_dam_adjust ( const object caster,
const object spob 
)

Returns adjusted damage based on the caster.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted damage.

Definition at line 287 of file spell_util.cpp.

References caster_level(), object::dam_modifier, level, and min_casting_level().

Referenced by alchemy(), animate_weapon(), append_spell(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_missile(), cast_destruction(), cast_identify(), cast_light(), cast_smite_spell(), cast_transfer(), create_aura(), create_bomb(), esrv_update_spells(), fire_arch_from_position(), fire_bolt(), magic_wall(), pets_summon_golem(), pets_summon_object(), and recharge().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_duration_adjust()

int SP_level_duration_adjust ( const object caster,
const object spob 
)

Adjust the duration of the spell based on level.

This is basically the same as SP_level_dam_adjust() above, but instead looks at the duration_modifier value.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted duration.

Definition at line 312 of file spell_util.cpp.

References caster_level(), object::duration_modifier, level, and min_casting_level().

Referenced by alchemy(), animate_weapon(), cast_bless(), cast_cause_disease(), cast_change_ability(), cast_cone(), cast_create_food(), cast_create_missile(), cast_curse(), cast_destruction(), cast_invisible(), cast_light(), cast_word_of_recall(), create_aura(), create_bomb(), fire_arch_from_position(), fire_bolt(), fire_swarm(), magic_wall(), and pets_summon_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_range_adjust()

int SP_level_range_adjust ( const object caster,
const object spob 
)

Adjust the range of the spell based on level.

This is basically the same as SP_level_dam_adjust() above, but instead looks at the range_modifier value.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted range.

Definition at line 338 of file spell_util.cpp.

References caster_level(), level, min_casting_level(), and object::range_modifier.

Referenced by animate_weapon(), cast_cause_disease(), cast_cone(), cast_destruction(), cast_detection(), cast_earth_to_dust(), cast_light(), cast_polymorph(), cast_smite_spell(), create_aura(), create_bomb(), dimension_door(), fire_arch_from_position(), fire_bolt(), magic_wall(), mood_change(), pets_summon_golem(), and probe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_spellpoint_cost()

int16_t SP_level_spellpoint_cost ( object caster,
object spell,
int  flags 
)

Scales the spellpoint cost of a spell by it's increased effectiveness.

Some of the lower level spells become incredibly vicious at high levels. Very cheap mass destruction. This function is intended to keep the sp cost related to the effectiveness.

Note that it is now possible for a spell to cost both grace and mana. In that case, we return which ever value is higher.

Parameters
casterwhat is casting the spell.
spellspell object.
flagsone of Spell/grace points.
Returns
sp/mana points cost.

Definition at line 236 of file spell_util.cpp.

References caster_level(), flags, level, llevError, LOG(), MAX, PATH_SP_MULT, settings, spell, SPELL_GRACE, SPELL_HIGHEST, SPELL_MANA, Settings::spellpoint_level_depend, and TRUE.

Referenced by append_spell(), cast_spell(), drain_rod_charge(), esrv_update_spells(), examine_rod_charge_level(), fire_misc_object(), monster_cast_spell(), rod_adjust(), show_matching_spells(), write_rune(), and write_scroll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SP_level_wc_adjust()

int SP_level_wc_adjust ( const object caster,
const object spob 
)

Returns adjusted wc based on the caster and the spell.

Parameters
casterwho is casting.
spobspell we are adjusting.
Returns
adjusted wc (positive is best).

Definition at line 362 of file spell_util.cpp.

References caster_level(), level, min_casting_level(), object_get_value(), and sstring.

Referenced by pets_summon_golem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_effect()

void spell_effect ( object spob,
int  x,
int  y,
mapstruct map,
object originator 
)

Inserts into map a spell effect based on other_arch.

Parameters
spobspell object to insert object from.
x
y
mapcoordinates to put the effect at.
originatorwhat causes the effect to be inserted. Can be NULL.

Definition at line 144 of file spell_util.cpp.

References arch_to_object(), object_insert_in_map_at(), and object::other_arch.

Referenced by cast_identify(), and cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_failure()

void spell_failure ( object op,
int  failure,
int  power,
object skill 
)

Handles the various effects for differing degrees of failure badness.

Parameters
opplayer that failed.
failurerandom value of how badly you failed.
powerhow many spellpoints you'd normally need for the spell.
skillskill needed to cast the spell.

Definition at line 1103 of file spell_util.cpp.

References AT_INTERNAL, cast_cone(), confuse_living(), object::count, create_archetype(), living::dam, draw_ext_info, FALSE, get_map_flags(), hit_player(), isqrt(), object::level, LOOSE_MANA, object::map, living::maxhp, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, NDI_UNIQUE, object_free_drop_inventory(), object_insert_in_map_at(), P_NO_MAGIC, paralyze_living(), object::range, settings, skill, Settings::spell_failure_effects, SPELL_WONDER, object::stats, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spell_find_dir()

int spell_find_dir ( mapstruct m,
int  x,
int  y,
object exclude 
)

Search what direction a spell should go in, first the center square then some close squares in the given map at the given coordinates for live objects.

It will not consider the object given as exclude (= caster) among possible live objects. If the caster is a player, the spell will go after monsters/generators only. If not, the spell will hunt players only.

Exception is player on a battleground, who will be targeted unless excluded.

Parameters
m
x
ywhere to search from.
excludewhat object to avoid. Can be NULL, in which case all bets are off.
Returns
direction toward the first/closest live object if it finds any, otherwise -1.

Definition at line 887 of file spell_util.cpp.

References object::above, can_see_monsterP(), FLAG_GENERATOR, FLAG_MONSTER, freearr_x, freearr_y, freedir, get_map_flags(), GET_MAP_OB, get_search_arr(), HEAD, m, op_on_battleground(), P_BLOCKSVIEW, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, SIZEOFFREE, and object::type.

Referenced by move_ball_spell(), and move_missile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ spring_trap()

void spring_trap ( object trap,
object victim 
)

◆ stand_near_hostile()

int stand_near_hostile ( object who)

Determine if who is standing near a hostile creature.

Parameters
whoobject to check.
Returns
1 if near a monster, 0 else.

Definition at line 4095 of file player.cpp.

References FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, friendly, get_map_flags(), GET_MAP_MOVE_BLOCK, m, object::map, OB_TYPE_MOVE_BLOCK, P_OUT_OF_MAP, PLAYER, QUERY_FLAG, object::type, object::x, and object::y.

Referenced by attempt_hide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ steal()

int steal ( object op,
int  dir,
object skill 
)

Main stealing function.

Parameters
opthief.
dirdirection to steal from.
skillstealing skill.
Returns
experience gained for stealing, 0 if nothing was stolen.

Definition at line 279 of file skills.cpp.

References object::above, object::attack_movement, attempt_steal(), calc_skill_exp(), object::contr, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_WIZ, FOR_OB_AND_ABOVE_FINISH, FOR_OB_AND_ABOVE_PREPARE, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, GET_MAP_OB, HEAD, player::hidden, m, object::map, OB_TYPE_MOVE_BLOCK, object_get_owner(), P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, PLAYER, QUERY_FLAG, skill, object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop_item()

object* stop_item ( object op)

An item (ARROW or such) stops moving.

stop_item() returns a pointer to the stopped object. The stopped object may or may not have been removed from maps or inventories. It will not have been merged with other items.

This function assumes that only items on maps need special treatment.

If the object can't be stopped, or it was destroyed while trying to stop it, NULL is returned.

fix_stopped_item() should be used if the stopped item should be put on the map.

Parameters
opobject to check.
Returns
pointer to stopped object, NULL if destroyed or can't be stopped.

Definition at line 455 of file time.cpp.

References ARROW, fix_stopped_arrow(), free_no_drop(), object::inv, object::map, MIN_ACTIVE_SPEED, object_free_drop_inventory(), object_remove(), object::speed, THROWN_OBJ, and object::type.

Referenced by pick_up(), put_in_icecube(), and save_throw_object().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ store_spell_expiry()

void store_spell_expiry ( object spell)

Stores in the spell when to warn player of expiration.

Parameters
spellspell we're considering.

Definition at line 1981 of file spell_util.cpp.

References object_set_value(), and spell.

Referenced by cast_bless(), cast_change_ability(), create_aura(), and potion_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ summon_hostile_monsters()

int summon_hostile_monsters ( object op,
int  n,
const char *  monstername 
)

Summons hostile monsters and places them in nearby squares.

Note
this is not used by any spells (summon evil monsters use to call this, but best I can tell, that spell/ability was never used. This is however used by various failures on the players part (alchemy, reincarnation, etc)
Parameters
opthe summoner.
nnumber of monsters.
monsternamename of the monster to summon, should be a valid archetype.
Returns
number of monsters actually put on the map.

Definition at line 1005 of file spell_util.cpp.

References put_a_monster().

Referenced by alchemy_failure_effect(), and cast_raise_dead_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ swap_map()

◆ tailor_god_spell()

int tailor_god_spell ( object spellop,
object caster 
)

Changes the attributes of cone, smite, and ball spells as needed by the code.

Parameters
spellopspell object to change.
casterwhat is casting spellop (player, spell, ...).
Returns
0 if there was no race to assign to the slaying field of the spell, but the spell attacktype contains AT_HOLYWORD, 1 else.

Definition at line 1223 of file gods.cpp.

References add_string(), AT_GODPOWER, AT_HOLYWORD, object::attacktype, buf, determine_god(), draw_ext_info, find_god(), FREE_AND_COPY, free_string(), llevError, LOG(), MAX_BUF, MSG_TYPE_ATTRIBUTE, MSG_TYPE_ATTRIBUTE_GOD, object::name, object::name_pl, NDI_UNIQUE, object_free_drop_inventory(), object_get_owner(), object::race, object::slaying, SPELL, SPELL_EFFECT, object::title, and object::type.

Referenced by cast_cone(), cast_smite_spell(), explode_bullet(), fire_arch_from_position(), and fire_swarm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ teleport()

int teleport ( object teleporter,
uint8_t  tele_type,
object user 
)

Teleport an item around a nearby random teleporter of specified type.

It is basically used so that shop_mats and normal teleporters can be used close to each other and not have the player put to the one of another type.

Parameters
teleporterwhat is teleporting user.
tele_typewhat object type user can be put on. this is either set to SHOP_MAT or TELEPORTER.
userwhat object to teleport.
Return values
1user was destroyed.
0user is still valid, but may have moved or not.
Todo:
fix weird return values.

Definition at line 204 of file move.cpp.

References object::contr, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), GET_MAP_MOVE_BLOCK, HEAD, llevError, LOG(), m, object::map, map_newmap_cmd(), object::name, OB_TYPE_MOVE_BLOCK, object_find_free_spot(), object_insert_in_map_at(), object_remove(), OUT_OF_REAL_MAP, P_OUT_OF_MAP, pets_attempt_follow(), PLAYER, player_update_bg_music(), RANDOM, SHOP_MAT, player::socket, object::type, object::x, and object::y.

Referenced by initteleport(), move_teleporter(), runteleport(), and shop_mat_type_move_on().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tick_the_clock()

void tick_the_clock ( void  )

This performs the basic function of advancing the clock one tick forward.

Every 20 ticks, the clock is saved to disk. It is also saved on shutdown. Any time dependant functions should be called from this function, and probably be passed tod as an argument. Please don't modify tod in the dependant function.

Definition at line 94 of file weather.cpp.

References dawn_to_dusk(), get_tod(), todtick, and write_todclock().

Referenced by do_specials().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transfer_ob()

int transfer_ob ( object op,
int  x,
int  y,
int  randomly,
object originator 
)

Move an object (even linked objects) to another spot on the same map.

Does nothing if there is no free spot.

Parameters
opwhat to move.
x
ynew coordinates.
randomlyif true, use object_find_free_spot() to find the destination, otherwise use object_find_first_free_spot().
originatorwhat is causing op to move.
Return values
1op was destroyed.
0op was moved.

Definition at line 163 of file move.cpp.

References object::contr, freearr_x, freearr_y, HEAD, object::map, map_newmap_cmd(), object_find_first_free_spot(), object_find_free_spot(), object_insert_in_map_at(), object_remove(), pets_attempt_follow(), PLAYER, player_update_bg_music(), SIZEOFFREE, player::socket, and object::type.

Referenced by cfapi_object_transfer(), hole_type_move_on(), kill_player(), move_teleporter(), shop_mat_type_move_on(), and trapdoor_type_move_on().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_can_hold()

int transport_can_hold ( const object transport,
const object op,
int  nrof 
)

Can transport hold object op? This is a pretty trivial function, but in the future, possible transport may have more restrictions or weight reduction like containers.

Parameters
transporttransport to check.
opobject we're trying to insert.
nrofnumber of op.
Returns
1 if can hold, 0 else.

Definition at line 54 of file apply.cpp.

References object::carrying, object::weight, and object::weight_limit.

Referenced by esrv_move_object(), put_object_in_sack(), and transport_type_apply().

+ Here is the caller graph for this function:

◆ trap_disarm()

int trap_disarm ( object disarmer,
object trap,
int  risk,
object skill 
)

Try to disarm a trap/rune.

Parameters
disarmerobject disarming the trap/rune.
traptrap to disarm.
riskif 0, trap/rune won't spring if disarm failure. Else it will spring.
skillspell used to disarm.
Returns
experience to award, 0 for failure.

Definition at line 442 of file rune.cpp.

References living::dam, destroy_object(), living::Dex, mapstruct::difficulty, draw_ext_info, draw_ext_info_format(), object::inv, object::level, object::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_FAILURE, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, object_get_owner(), PLAYER, PREFER_LOW, random_roll(), skill, spring_trap(), sqr, object::stats, and object::type.

Referenced by dispel_rune(), and remove_trap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trap_see()

int trap_see ( object op,
object trap 
)

Should op see trap?

Parameters
opliving that could spot the trap.
traptrap that is invisible.
Return values
0trap wasn't spotted.
1trap was spotted.

Definition at line 385 of file rune.cpp.

References living::Cha, chance(), mapstruct::difficulty, draw_ext_info_format(), object::level, object::map, MAX, MIN, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, object::name, NDI_UNIQUE, PREFER_HIGH, random_roll(), and object::stats.

Referenced by find_traps().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trap_show()

int trap_show ( object trap,
object where 
)

Handles showing a trap/rune detonation.

Parameters
traptrap that detonates.
whereobject at the location to detonate.
Return values
0no animation inserted.
1animation inserted.

Definition at line 412 of file rune.cpp.

References object::animation, create_archetype(), object::face, GET_ANIMATION, object::map, object_insert_in_map_at(), object::temp_animation, object::x, and object::y.

Referenced by find_traps(), remove_trap(), and spring_trap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_alchemy()

int use_alchemy ( object op)

Handle use_skill for alchemy-like items.

Parameters
opplayer trying to do alchemy.
Returns
1 if any recipe was attempted, 0 else.
Note
Will inform player if attempting to use unpaid cauldron or ingredient.
Todo:
check if no superflous message when 2 cauldrons on same spot, one unpaid? (shouldn't happen, but well).

Definition at line 1057 of file alchemy.cpp.

References attempt_do_alchemy(), draw_ext_info, draw_ext_info_format(), esrv_send_inventory(), FLAG_APPLIED, FLAG_IS_CAULDRON, FLAG_UNPAID, FLAG_WIZ, FOR_MAP_FINISH, FOR_MAP_PREPARE, object::map, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DM, MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, name, NDI_UNIQUE, object_find_by_flag(), query_base_name(), QUERY_FLAG, object::x, and object::y.

Referenced by do_skill(), and knowledge_alchemy_attempt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_oratory()

int use_oratory ( object pl,
int  dir,
object skill 
)

Oratory skill handling.

Players using this skill can 'charm' a monster – into working for them. It can only be used on non-special (see below) 'neutral' creatures. -b.t. (thoma.nosp@m.s@as.nosp@m.tro.p.nosp@m.su.e.nosp@m.du)

Parameters
plplayer trying to convince a monster.
dirdirection to orate in.
skilloratory skill object.
Returns
experience gained for oratoring.
Todo:
check if can't be simplified, code looks duplicated.

Definition at line 996 of file skills.cpp.

References add_friendly_object(), object::attack_movement, calc_skill_exp(), living::Cha, chance(), CLEAR_FLAG, draw_ext_info, draw_ext_info_format(), living::exp, FLAG_FRIENDLY, FLAG_MONSTER, FLAG_UNAGGRESSIVE, FOR_MAP_FINISH, FOR_MAP_PREPARE, FREE_AND_COPY, freearr_x, freearr_y, get_map_flags(), HEAD, living::Int, object::level, m, object::map, MAX_BUF, MSG_TYPE_SKILL, MSG_TYPE_SKILL_FAILURE, MSG_TYPE_SKILL_SUCCESS, name, NDI_UNIQUE, object_get_owner(), object_set_owner(), object_value_set(), P_IS_ALIVE, P_OUT_OF_MAP, PETMOVE, unpaid_count::pl, PLAYER, PREFER_HIGH, PREFER_LOW, QUERY_FLAG, query_name(), random_roll(), remove_friendly_object(), SET_FLAG, object::skill, skill, object::stats, object::type, object::x, and object::y.

Referenced by do_skill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ use_skill()

int use_skill ( object op,
const char *  string 
)

Similar to invoke command, it executes the skill in the direction that the user is facing.

This is tricky because skills can have spaces. We basically roll our own find_skill_by_name so we can try to do better string matching.

Parameters
opplayer trying to use a skill.
stringparameter for the skill to use.
Return values
0unable to change to the requested skill, or unable to use the skill properly.
1skill correctly used.

Definition at line 964 of file skill_util.cpp.

References do_skill(), draw_ext_info_format(), object::facing, FLAG_CAN_USE_SKILL, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, llevDebug, LOG(), MIN, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, name, NDI_UNIQUE, QUERY_FLAG, SKILL, object::skill, SKILL_TOOL, and skills.

Referenced by command_uskill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_player()

int verify_player ( const char *  name,
char *  password 
)

This verify that a character of name exits, and that it matches password.

Parameters
nameplayer name.
passwordplayer's password, not encrypted.
Return values
0there is match.
1no such player.
2incorrect password.

Definition at line 111 of file login.cpp.

References buf, check_password(), first_player, llevDebug, llevError, Settings::localdir, LOG(), MAX_BUF, name, object::name, player::next, player::ob, Settings::playerdir, and settings.

Referenced by account_add_player_cmd(), and create_player_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_mark()

int write_mark ( object op,
object spell,
const char *  msg 
)

This writes a rune that contains the appropriate message.

There really aren't any adjustments we make.

Parameters
opwho is casting.
spellactual spell cast.
msgmessage to write.
Return values
0failure.
1success.

Definition at line 3413 of file spell_effect.cpp.

References add_string(), arch_to_object(), draw_ext_info, HUGE_BUF, INS_BELOW_ORIGINATOR, llevInfo, LOG(), object::map, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, NDI_UNIQUE, object_insert_in_map_at(), object_set_msg(), object::race, spell, strcasestr_local, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_on_item()

int write_on_item ( object pl,
const char *  params,
object skill 
)

Implement the 'inscription' skill, which checks for the required skills and marked items before running either write_note() or write_scroll().

Parameters
plPlayer attempting to write
paramsMessage to write, blank to write a spell
skillWriting skill
Returns
Experience gained from using the skill

Definition at line 1762 of file skills.cpp.

References BOOK, archetype::clone, draw_ext_info, draw_ext_info_format(), find_marked_object(), find_skill_by_name(), FLAG_BLIND, FLAG_UNPAID, FLAG_WIZ, get_archetype_by_type_subtype(), MSG_TYPE_SKILL, MSG_TYPE_SKILL_ERROR, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, unpaid_count::pl, PLAYER, QUERY_FLAG, SCROLL, SK_LITERACY, SKILL, object::skill, skill, object::type, write_note(), and write_scroll().

Referenced by do_skill(), and inscribe_scroll_cmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ write_rune()

int write_rune ( object op,
object caster,
object spell,
int  dir,
const char *  runename 
)

Player is attempting to write a magical rune.

This function does all checks for paths, sp/gr, ...

Parameters
oprune writer.
casterobject used for casting this rune.
spellwriting spell.
dirorientation of rune, direction rune's contained spell will be cast in, if applicable
runenamename of the rune or message displayed by the rune for a rune of marking.
Return values
0no rune was written.
1rune written.

Definition at line 50 of file rune.cpp.

References object::animation, arch_to_object(), buf, caster_level(), living::Cha, create_archetype(), object::direction, draw_ext_info, draw_ext_info_format(), object::face, FOR_INV_FINISH, FOR_INV_PREPARE, FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, GENERIC_RUNE, get_map_flags(), living::grace, object::level, m, object::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_ERROR, object::name, NDI_UNIQUE, object_copy(), object_insert_in_map_at(), object_insert_in_ob(), object_matches_string(), object_new(), object_set_msg(), object_set_owner(), object::path_denied, RUNE, set_spell_skill(), object::skill, living::sp, SP_level_spellpoint_cost(), spell, SPELL, SPELL_GRACE, SPELL_MANA, object::stats, try_find_animation(), try_find_face(), object::type, object::x, and object::y.

Referenced by cast_spell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: